Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compare different methods of entering primes in LaTeX Math #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

michal-h21
Copy link
Contributor

As we discussed on Mastodon, here is a change that uses the Siunitx package to typeset the geographic dimensions.

@michal-h21
Copy link
Contributor Author

I've also compared different methods of handling of primes in math, because I think it is better to use ' instead of \prime (which should be in fact ^{\prime}). You can see that using of just \prime, \dprime and \trprime leads to big differences in the end result.

@alerque
Copy link
Owner

alerque commented Jan 5, 2024

Thanks.

The Use of siunitx here is certainly more idiomatic here. In fact I already cherry picked that commit, so the only thing left here is about math mode primes.

I'm not so sure what to do here. I am not convinced you are correct about this:

which should be in fact ^{\prime}

This seems like something subjective you are doing because you prefer the output, not because it is the correct math typesetting expectation. In fact I suspect from what other people have said about this and elsewhere that this is objectively wrong and just a work around for a different visial preference than the math font designer intended. In particular the use of STIX TWO and Libertinus Math here were specifically to highlight different ways of encoding the prime, and the latter might actually be wrong. As such hacking around it is hiding the difference between typesetting engines I was trying to highlight.

c.f. typst/typst#2860

It might be good to add a comparison between ' and \prime though, I might rework this a little bit to accomplish that. I'm not sure what is supposed to be the "right" or "more idiomatic of LaTeX way" for that, do you have docs to point to on that topic?

@alerque
Copy link
Owner

alerque commented Jan 5, 2024

Also on the coordinates topic: the difference between XeLaTeX Unicode handling and the \ang{} command is interesting!

@alerque alerque changed the title Use siunitx to typeset the geographic dimensions Compare different methods of entering primes in LaTeX Math Jan 5, 2024
@alerque
Copy link
Owner

alerque commented Jan 5, 2024

On deeper review a detail I missed:

  • For STIX-MATH, all inputs create the same output.
  • Using the unicode-math package and Libertinus Math, the f' creates the same output as f^{\prime}, which I didn't expect. That suggests I might be wrong about LaTeX's expectations on how a prime should be encoded.

@khaledhosny
Copy link

In TeX math, ' is essentially a short-hand for ^{\prime}, so both should result in the same output. This is because in Computer Modern, \prime is a full size glyph that sets on the baseline that is designed with the expectation that it will be scaled down and positioned by math layout engine.

This is contrary to how the prime ′ (U+2032) symbol is expected, as its glyph supposed to be in the appropriate and raised above baseline. To work around this, OpenType math fonts usually will have a U+2032 glyph like any other font, and provide alternate glyphs for ssty that are scaled up and set on the baseline. This way when it is used as super script, the layout engine will apply the ssty feature and then scaled it down and raise it like any other math superscript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants