Skip to content

In-line math exponent overlaps previous line #8045

Closed as duplicate
Closed as duplicate

Description

@jassler

A reddit user noted an issue in their document where the exponent of an in-line math expression would overlap the chevron braces in the the line above: https://www.reddit.com/r/typst/comments/1ryyw3c/

I was somewhat able to reproduce it like so:

abcdefghijklm $chevron.l dot, dot chevron.r_i$ \
$product_(i in ZZ) det(A_i)^((-1)^(i-1))$
Chevron symbol overlapping with exponent in the line below

Similarly, the bottom of the lower case p overlaps with the exponent in this example:

pppppp\
$2^n^n^n^n$
Exponent overlaps the vertical line of the small letter p

This might all be a somewhat contrived example, but since the LaTeX output avoids these collisions and overall looks more consistent, I think it's worth considering.

Here's my best attempt at recreating this scenario in latex:

\documentclass{article}
\usepackage{amssymb}
\begin{document}
  \noindent
  abcdefghijklm $\langle \cdot , \cdot \rangle_i$ \newline
  \hphantom{i}$\prod_{i \in \mathbb{Z}} \det(A_i)^{-1^{i-1}}$

  \vspace{1em}
  \noindent
  pppppp\newline
  \hphantom{i}$2^{n^{n^{n^n}}}$
\end{document}
Latex adding enough vertical space to tall in-line functions

EDIT:

In LaTeX, it seems that if a line contains no descenders (e.g., no p, y, g, j), the overall line height / distance to the next baseline is reduced.

Image

Typst does not seem to consider increasing (decreasing) the spacing between lines if descenders are present (not present).

Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions