Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to make vectors upright (non-italicized) #21

Open
notaduck448 opened this issue Jan 20, 2024 · 4 comments
Open

Add option to make vectors upright (non-italicized) #21

notaduck448 opened this issue Jan 20, 2024 · 4 comments

Comments

@notaduck448
Copy link

Currently, typing in vb(u) or vu(u) makes the vector u appear bold and italicized. However, in some style guides it is customary to make vectors only appear bold without being italics. It would be nice if an option was added to support this.

@YDX-2147483647
Copy link
Contributor

Before physica updates (or if this request is rejected), you can try the following:

#import "@preview/physica:0.9.2": vb as _vb

#let vb(x) = _vb(math.upright(x))

$vb(v) times vb(mu_1)$

图片

@Leedehai
Copy link
Owner

It appears to me vb(x, style:"upright") or vb(x, "upright") are too ad-hoc, and also given that Typst doesn't support set-rules for non-native functions, for now I think the workaround given in the above comment is good enough.

Discussions are welcome.

@Leedehai
Copy link
Owner

btw, Please give a bump to typst/typst#147 that proposes set-rules for non-native functions :)

@sjfhsjfh
Copy link

sjfhsjfh commented Jun 2, 2024

Currently I prefer

#import "@preview/physica:0.9.3": *

#let vb = vb.with(style:"upright")

$vb(v) crossproduct vb(mu_1)$

I doubt the usage of custom element here is necessary, since "vector" is semantic but "bold" is not.

I guess it would be better to set the style for v/vect (like set vect(style: "bold upright")) when Typst supports custom element and add support for std import to use vec or fix the single letter function support in math mode to use v

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants