Skip to content

Scripts are sometimes in the wrong position with lr() #2342

Closed

Description

@Enivex

Description

The following

$
lr(|,size: #3em)_a^b
$

produces
image

The scripts are in the wrong place.

If I put anything else in there, even a zws, they appear in the right place

$
lr(zws|,size: #3em)_a^b
$

image

Reproduction URL

No response

Operating system

No response

Typst version

  • I am using the latest version of Typst

Activity

  1. added
    bug
    math
    on Oct 9, 2023
  2. changed the title [-]Scripts are sometimes in the wrong position with lr()[/-] [+]Scripts are sometimes in the wrong position with `lr()`[/+] on Jul 16, 2024
  3. mkorje commented on Sep 27, 2024

    @mkorje
    Collaborator

    On main, adding a zws or anything else no longer makes the scripts appear in the right place. If I'm remembering correctly, I believe #4545 caused this.

    Regardless, I think we need to change/remove the text-like field on the fragment structs (to something better), which would then resolve this. I'll try to think of a better way to pass around "text-like"-ness.

  4. Enivex commented on Sep 29, 2024

    @Enivex
    CollaboratorAuthor

    On main, adding a zws or anything else no longer makes the scripts appear in the right place. If I'm remembering correctly, I believe #4545 caused this.

    Regardless, I think we need to change/remove the text-like field on the fragment structs (to something better), which would then resolve this. I'll try to think of a better way to pass around "text-like"-ness.

    Does this qualify as "urgent" considering there's no workaround anymore?

    Edit: I guess I can think of some more convoluted workarounds

  5. laurmaedje commented on Sep 29, 2024

    @laurmaedje
    Member

    I would not classify the breaking of a workaround as a regression/urgent. If someone comes up with a solution until the release candidate I'd be happy, but otherwise I'd say it's a bug just like any other.

  6. mkorje commented on Sep 30, 2024

    @mkorje
    Collaborator

    math.stretch, which was recently added, also suffers from this same bug when it has script attachments.

  7. Enivex commented on Nov 11, 2024

    @Enivex
    CollaboratorAuthor

    I would not classify the breaking of a workaround as a regression/urgent. If someone comes up with a solution until the release candidate I'd be happy, but otherwise I'd say it's a bug just like any other.

    There's definitely been a regression, since it's broken even in situations without a workaround.

    $ lr(size: #2em, [x])_0^1 $
    

    renders as
    image

    in 0.12 and

    image

    in 0.11.1.

    Attachments do not seem to care about manual scaling at all.

  8. added
    urgent
    on Nov 11, 2024
  9. Enivex commented on Nov 11, 2024

    @Enivex
    CollaboratorAuthor

    This does work as a workaround for now

    lr([x #block(width:0pt,height:2em) #h(-1/3*1em) ])_0^1
    
  10. added
    regression
    on Nov 11, 2024
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

    bugmathregressionurgent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions