Skip to content

Wrong sub-/superscript alignment with accents #1672

Closed

Description

@EpicEricEE

Description

When using accents like hat, the positions of sub- and superscripts change, so that the spacing is off:

$f_a^a != hat(f)_a^a != hat(f_a^a)$

image

Reproduction URL

No response

Operating system

Web app

Typst version

  • I am using the latest version of Typst

Activity

  1. added
    bug
    on Jul 6, 2023
  2. Enivex commented on Jul 6, 2023

    @Enivex
    Collaborator

    Only the middle one is what I would consider a bug

  3. EpicEricEE commented on Jul 6, 2023

    @EpicEricEE
    ContributorAuthor

    Sure, the right one looks mostly as I would expect. I was only surprised that the superscript was moved down slightly, but I guess that's on purpose to make room for the hat.

  4. astrale-sharp commented on Jul 7, 2023

    @astrale-sharp
    Contributor

    image

    this might help #let y = 0.2em $f_a^a != hat(f)_a^a != hat(f_a^a)$ #place[#line(stroke: 0.2pt, start: (0pt,y), end: (90pt,y))]

  5. added
    math
    on Jul 11, 2023
  6. Enivex commented on Oct 14, 2023

    @Enivex
    Collaborator

    Here's an example of LaTeX doing this

    image

    The placement of scripts is a tricky balance between many things.

  7. ludwig-austermann commented on Oct 15, 2023

    @ludwig-austermann

    Here's an example of LaTeX doing this

    image

    The placement of scripts is a tricky balance between many things.

    I don't think that the LaTeX one here is intended nor perfect behaviour, it just is not implemented for the LaTeX package amsfonts. If you compare

    $e_1^1 \, \hat{\hat{e}}_1^1$

    I wouldn't say it is intended behaviour either, but obviously one can not handle every case the desired way, as users may write arbitrary complex expressions.

    I think that commonly used symbols which take accents should have commen sub-/ superscripts, as demonstrated here, but also for e.g. double stroke letters. It would be nice to have these common symbols look similar in this respect, when writing (mathematical) function definitions or in inline formulae.

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