Skip to content

Primes on symbols lead to misaligned superscripts: they are pushed upward #3043

Closed

Description

@Leedehai

Description

Update (2024-07-02): a more obvious example in #3043 (comment).


Typst:

$ A A^2 A'^2 A''^2 $

LaTeX:

$$ A A^2 A'^2 A''^2 $$
Screenshot 2023-12-21 at 16 29 35

The LaTeX version looks better, because math expressions often mix symbols with and without primes, and having the misaligned superscripts up and down along the line looks a bit unpleasant.

Related (at the time of writing):
#539 (fixed): misaligned superscripts with "naked" symbols.
#1672/#2324 (open): accents on symbols lead to misaligned superscripts.

Reproduction URL

No response

Operating system

Web app

Typst version

  • I am using the latest version of Typst

Activity

  1. added
    bug
    on Dec 21, 2023
  2. emilyyyylime commented on Dec 22, 2023

    @emilyyyylime
    Contributor

    Honestly I prefer the Typst output here. It's misaligned but the spacing is much more pleasing

  3. max397574 commented on Dec 22, 2023

    @max397574
    Contributor

    I'd prefer the LaTeX way but with a little bit more spacing between the ' and the 2

  4. added
    math
    on Jan 8, 2024
  5. jassler commented on Jan 29, 2024

    @jassler
    Contributor

    I'm having a similar annoyance where the prime symbol is displayed above a mathematical symbol. Specifically, when I use $R^{\succsim'}$ in LaTeX I get the following.

    Correctly rendered prime symbol in LaTeX

    Apart from the obvious $R^(succ.tilde')$, I've tried some variations to get it to render the way I want. Alas, I've not been successful yet.

    Examples of small mathematical expressions using the prime symbol in the superscript

    UPDATE: I just realized that this has nothing to do with superscript. $succ'$ renders just as strangely. This might be more related to #2860.

    UPDATE': Turns out this is intended behavior. The way to get around this is using scripts(>) (the opposite would be limits(>).

    UPDATE'': According to Enivex on Discord, this isn't intended behavior.

  6. Leedehai commented on Jul 2, 2024

    @Leedehai
    ContributorAuthor

    This issue leads to more unpleasant rendering when there's a square root or a fraction bar that makes the misalignment more obvious:

    $ sqrt(f^2) sqrt(f'^2) sqrt(f''^2)  sqrt(f'''''^2) $
    $ 1/f^2 1/f'^2 1/f''^2  1/f'''''^2 $
    Screenshot 2024-07-02 at 00 50 22
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

    bugmath

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions