Math & Sciencelualatex: too little space inside f\Bigl(

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
user49915
Posts: 81
Joined: Wed Apr 17, 2019 12:51 pm

lualatex: too little space inside f\Bigl(

Post by user49915 »

Consider the following example:

Code: Select all

Code, edit and compile here:
\documentclass{standalone}
\usepackage{unicode-math}
\setmathfont{TeX Gyre Termes Math}
\begin{document}
\(f\Bigl(\Bigr)\)
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
If you compile it with xelatex, you get
compiled_with_xelatex.png
compiled_with_xelatex.png (7.13 KiB) Viewed 2508 times
But if you compile it with lualatex, you get a narrower
compiled_with_lualatex.png
compiled_with_lualatex.png (6.9 KiB) Viewed 2508 times
Definitely, the results differ, so at least one of the engines or unicode-math is wrong about the spacing between f and the left parenthesis. Subjectively, the output of xelatex is more pleasant than that of lualatex, so, I presume, lualatex (or the code inside unicode-math run by lualatex only) is the culprit. But, I'm unaware of the "official" specification of how it should be, so, all bets are off.

- How large is the distance between f and ( supposed to be?

- Who is the culprit? (I.e., who deviates from the specification?)

- Is there any way to repair the culprit or at least to achieve independence of the engine used for compilation?

Weakly related: http://tex.stackexchange.com/questions/ ... -in-luatex .
However, there, Ulrike said in her answer that "you are at the end of the math and luatex doesn't insert the italic correction at the boundary between math and text." Here, on the contrary, we are still inside math. If you insert `\Uchar"200B` or the duck symbol U+01F986 right after `f`, you get more space for both engines, and the discrepancy remains. Moreover, it's far from automatic even if the discrepancy would have gone away.

Crosspost: http://tex.stackexchange.com/questions/ ... ide-f-bigl

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Post Reply