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

Wrong upright style and spacing for vecrow() and Greek letters #19

Closed
CarrotDLaw opened this issue Dec 17, 2023 · 3 comments
Closed

Wrong upright style and spacing for vecrow() and Greek letters #19

CarrotDLaw opened this issue Dec 17, 2023 · 3 comments

Comments

@CarrotDLaw
Copy link

CarrotDLaw commented Dec 17, 2023

When the first element in vecrow() is a Greek letter, there are unexpected spacing and upright style issues, like the first three lines in the following. The last three lines are how the output is supposed to be.

I found a temporary solution that is to use italic(alpha) instead of just alpha in the first element, though.

$
& vecrow(alpha, beta) \
& vecrow(alpha, italic(beta)) \
& vecrow(alpha, b) \
& vecrow(a, beta) \
& vecrow(italic(alpha), beta) \
& (alpha, beta) \
$
image
@YDX-2147483647
Copy link
Contributor

YDX-2147483647 commented Dec 21, 2023

Some investigation:

#let vecrow(..content) = $lr(( #content.pos().join(",") ))$

test

#grid(columns: (1fr, 1fr), [
  ```typst $lr((alpha, beta/gamma))$```

  $lr((alpha, beta/gamma))$

  #repr($lr((alpha, beta/gamma))$)
], [
  ```typst $vecrow(alpha, beta/gamma)$```

  $vecrow(alpha, beta/gamma)$

  #repr($vecrow(alpha, beta/gamma)$)
])

Possible fix

  • Change "," to [,]

    #let vecrow(..content) = $lr(( #content.pos().join([,]) ))$

  • Directly use math.lr

    #let vecrow(..content) = math.lr([(] + content.pos().join([,]) + [)])

    It imitates $lr(…)$ better, but longer…

@Leedehai
Copy link
Owner

Wow, thanks! Let me see..

@Leedehai
Copy link
Owner

Leedehai commented Dec 21, 2023

@YDX-2147483647 It works 👍 I committed 8df2cc4 and added you as the author.

Leedehai pushed a commit that referenced this issue Dec 21, 2023
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

3 participants