typst icon indicating copy to clipboard operation
typst copied to clipboard

Prime symbols can be attached as limits

Open MDLC01 opened this issue 2 years ago • 8 comments

Description

Prime symbols can be attached as limits instead of always being attached as exponents.

Not sure if this is a bug or the intended behavior.

$ lim' $
$ lim'' $
$ lim''' $
$ lim'''' $
$ lim''''' $

lim with prime symbols above instead of as exponents

Reproduction URL

No response

Operating system

No response

Typst version

  • [X] I am using the latest version of Typst

MDLC01 avatar Sep 05 '23 12:09 MDLC01

This is intentional, since lim has..well..limits.

scripts(lim)' should be what you want

Or use attach directly if you want to mix scripts and limits.

Enivex avatar Sep 05 '23 13:09 Enivex

Just to be clear, this issue is not about lim attaching its scripts as limits. It is about prime symbols being able to be attached as limits without the user explicitly using attach.

I think in most cases, the user does not want prime symbols to attach as limits even with a math.op(limits: true).

MDLC01 avatar Sep 05 '23 14:09 MDLC01

Just to be clear, this issue is not about lim attaching its scripts as limits. It is about prime symbols being able to be attached as limits without the user explicitly using attach.

I think in most cases, the user does not want prime symbols to attach as limits even with a math.op(limits: true).

It is the same thing, because prime is treated in a particular way. Essentially ' means the same thing as ^(big version of prime). This is the exact same way it's handled in LaTeX, so you'll also see the same thing if you write \lim' there

Enivex avatar Sep 05 '23 16:09 Enivex

While it may seem somewhat weird, it is consistent with how things generally work, so I would refrain from adding more special cases.

laurmaedje avatar Sep 06 '23 07:09 laurmaedje

On second thought, I sort of agree with @MDLC01. While a prime is as a normal attachment, that feels like an implementation detail to me and attaching it as a limit is probably almost never what the user wanted.

laurmaedje avatar Jan 30 '24 09:01 laurmaedje

On second thought, I sort of agree with @MDLC01. While a prime is as a normal attachment, that feels like an implementation detail to me and attaching it as a limit is probably almost never what the user wanted.

I apparently disagreed with myself here.

Enivex avatar Jan 30 '24 09:01 Enivex

To extend on this (and reference #3299), should the exponent and subscript after a comparator behave similarly to limits? I.e., should the 2 in >^2 and >_2 be rendered above and below the > or next to it?

jassler avatar Jan 30 '24 09:01 jassler

To extend on this (and reference #3299), should the exponent and subscript behave similarly for comparators? I.e., should the 2 in >^2 and >_2 be rendered above and below the > or next to it?

That's the difference between limits and scripts.

Both appear, so it's mostly about personal preference and/or context.

Enivex avatar Jan 30 '24 09:01 Enivex