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

Subscript is too low for the fraction #1582

Closed
1 task done
awav opened this issue Jun 26, 2023 · 5 comments
Closed
1 task done

Subscript is too low for the fraction #1582

awav opened this issue Jun 26, 2023 · 5 comments
Labels
feature request New feature or request math Related to math syntax, layout, etc.

Comments

@awav
Copy link

awav commented Jun 26, 2023

Description

The subscript adheres to a lower position adjacent to the parentheses surrounding fraction equations, compared to its placement in the LaTeX version. This causes it to hang too low.

Overleaf version:
overleaf-eq

Typst version:
typst-eq

Reproduction URL

https://typst.app/project/rH4r93CN7_U_Lw6KbgFHGv

Operating system

macOS

Typst version

  • I am using the latest version of Typst
@awav awav added the bug Something isn't working label Jun 26, 2023
@Enivex
Copy link
Collaborator

Enivex commented Jun 26, 2023

I do not believe the same font is being used in both pictures

@awav
Copy link
Author

awav commented Jun 26, 2023

Both fonts are "Times".

@Enivex
Copy link
Collaborator

Enivex commented Jun 26, 2023

Both fonts are "Times".

The parentheses are different.

Are you using LuaTeX/XeTeX and the unicode -math package?

@awav
Copy link
Author

awav commented Jun 26, 2023

I used pdfLaTeX, here is a link to the overleaf https://www.overleaf.com/read/sskgsdhqvsbb. Here is how it looks with unicode-math and LuaLaTeX:

overleaf-eq-unicode

@reknih reknih added the math Related to math syntax, layout, etc. label Jul 3, 2023
@laurmaedje laurmaedje added feature request New feature or request and removed bug Something isn't working labels Jul 16, 2024
@mkorje
Copy link
Contributor

mkorje commented Aug 25, 2024

This is really asking for #360, IMO. There's nothing wrong with how it is being laid out in Typst, it's the size of the parentheses that is not the same as in LuaTeX. For example, if I scale the parens in Typst down and in LuaTeX up, the subscript positioning is the same.

Normal Debug
latex latex-debug
typst typst-debug
LuaTeX code (first row)
\documentclass[11pt]{article}
\usepackage[paperheight=2cm,paperwidth=4cm,margin=0cm]{geometry}
\usepackage{fontspec}
\usepackage{unicode-math}
\usepackage{lua-visual-debug}
\setmathfont{New Computer Modern Math}
\begin{document}

\[ \left(\frac{d \mu}{d t}\right)_p
 \biggl(\frac{d \mu}{d t}\biggr)_p \]

\end{document}
Typst code (second row)
#set page(width: 4cm, height: 2cm)
#set align(bottom)

$
  lr(((d mu)/(d t)), size: #90%)_p
  ((d mu)/(d t))_p
$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request math Related to math syntax, layout, etc.
Projects
None yet
Development

No branches or pull requests

5 participants