lualatex: too little space inside fBigl(Change bounding box of math glyphs in LuaTeXReplacing greek glyphs in math modeToo much space after integral sign with unicode-math and lualatexWhy does it take LuaLaTeX so long to load fonts and can I speed it up?Is direct utf8 input of combining diacritics in math mode possible with lualatex?LuaLaTex: Where do we stand as of 2014?LuaLaTeX: Replace character “ß” in CMU fontsGeneral guide on how to set up Minion Pro for math in lualatexWhy is the fraction off the math axis in XeTeX?How are non-unicode glyphs referenced in LuaTeX .dvi files?xelatex + unicode-math + big = ↯
How should I ask for a "pint" in countries that use metric?
This LM317 diagram doesn't make any sense to me
What are some bad ways to subvert tropes?
Possibility to correct pitch from digital versions of records with the hole not centered
Intern not wearing safety equipment; how could I have handled this differently?
What do you call a situation where you have choices but no good choice?
How many Jimmys can fit?
What purpose does mercury dichloride have in fireworks?
How to deal with account scam and fraud?
Tesco's Burger Relish Best Before End date number
QR codes, do people use them?
Sorting a list according to some pre-specified rules
Is this car delivery via Ebay Motors on Craigslist a scam?
Those who speak do not know, those who know do not speak
Uniform initialization by tuple
Shipped package arrived - didn't order, possible scam?
Does anyone have a method of differentiating informative comments from commented out code?
What is this burst transmission sequence across the entire band?
How did the IEC decide to create kibibytes?
Why am I getting unevenly-spread results when using $RANDOM?
Why do airports remove/realign runways?
What is the meaning of "prairie-dog" in this sentence?
Can we share mixing jug/beaker for developer, fixer and stop bath?
How to have a filled pattern
lualatex: too little space inside fBigl(
Change bounding box of math glyphs in LuaTeXReplacing greek glyphs in math modeToo much space after integral sign with unicode-math and lualatexWhy does it take LuaLaTeX so long to load fonts and can I speed it up?Is direct utf8 input of combining diacritics in math mode possible with lualatex?LuaLaTex: Where do we stand as of 2014?LuaLaTeX: Replace character “ß” in CMU fontsGeneral guide on how to set up Minion Pro for math in lualatexWhy is the fraction off the math axis in XeTeX?How are non-unicode glyphs referenced in LuaTeX .dvi files?xelatex + unicode-math + big = ↯
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Consider the following example:
documentclassstandalone
usepackageunicode-math
setmathfontTeX Gyre Termes Math
begindocument
(fBigl(Bigr))
enddocument
If you compile it with xelatex
, you get
But if you compile it with lualatex
, you get a narrower
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 for the most pleasant reading?Who is the culprit? (I.e., who deviates from the way it is supposed to be?)
Is there any way to repair the culprit or at least to achieve independency of the engine used for compilation more or less automatically?
Weakly related: Change bounding box of math glyphs 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 🦆
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.
EDIT: Concerning
This question already has an answer here:
Change bounding box of math glyphs in LuaTeX
It doesn't. The answer from there doesn't fit here. Feel free to test it.
Crosspost: http://latex.org/forum/viewtopic.php?f=46&t=32655&p=109799
math-mode spacing xetex luatex unicode-math
New contributor
|
show 9 more comments
Consider the following example:
documentclassstandalone
usepackageunicode-math
setmathfontTeX Gyre Termes Math
begindocument
(fBigl(Bigr))
enddocument
If you compile it with xelatex
, you get
But if you compile it with lualatex
, you get a narrower
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 for the most pleasant reading?Who is the culprit? (I.e., who deviates from the way it is supposed to be?)
Is there any way to repair the culprit or at least to achieve independency of the engine used for compilation more or less automatically?
Weakly related: Change bounding box of math glyphs 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 🦆
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.
EDIT: Concerning
This question already has an answer here:
Change bounding box of math glyphs in LuaTeX
It doesn't. The answer from there doesn't fit here. Feel free to test it.
Crosspost: http://latex.org/forum/viewtopic.php?f=46&t=32655&p=109799
math-mode spacing xetex luatex unicode-math
New contributor
Yes, because of LuaTeX's lack of the italic correction, although, as you say, here we're in the middle of the formula. As stated in the answer, you can try(fUchar"200BBigl(Bigr))
or(f🦆Bigl(Bigr))
to have the spacing fixed. However I must say that it's a pain to do that eveywhere... I'll retract my close vote.
– Phelype Oleinik
9 hours ago
@PhelypeOleinik In both suggestions of yours, the space after f increases both for xelatex and for lualatex. The discepancy between the two outputs remains.
– MdAyq5
9 hours ago
Your question "Who is the culprit? (I.e., who deviates from the specification?)" presupposes that there is a specification. the OpenType Math table specification is somewhat vague and font authors have to interpret it to know what values to put into the dimensions in the table, and rendering engine authors need to interpret the values in the table to lay out the math and then tex macros like unicode-math need to interpret the differences between the engines to give a consistent cross engine interface. It's amazing anything comes out looking similar, less surprising that they sometimes differ.
– David Carlisle
7 hours ago
@DavidCarlisle If so, then we should conclude that the culprit is fact of life that the specification is absent or ambiguous. The spec writers would be then the folks responsible. (I'm not saying that they did a bad job with respect to the payment they got for it; perhaps they did an excellent job, but, as usual, one can still do better. I'm not saying that they are guilty or anything. I don't know; I have not read the specs you talk about. If these are Microsoft folks; one should ping Microsoft, I guess.)
– MdAyq5
7 hours ago
1
why ping Murray, he doesn't have write access to luatex or xetex sources and they are the systems that you want to act the same. there is always room for interpretation mapping tex concepts like the mathord and mathopen classses of f and ( and the layout rules in OpenType.
– David Carlisle
7 hours ago
|
show 9 more comments
Consider the following example:
documentclassstandalone
usepackageunicode-math
setmathfontTeX Gyre Termes Math
begindocument
(fBigl(Bigr))
enddocument
If you compile it with xelatex
, you get
But if you compile it with lualatex
, you get a narrower
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 for the most pleasant reading?Who is the culprit? (I.e., who deviates from the way it is supposed to be?)
Is there any way to repair the culprit or at least to achieve independency of the engine used for compilation more or less automatically?
Weakly related: Change bounding box of math glyphs 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 🦆
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.
EDIT: Concerning
This question already has an answer here:
Change bounding box of math glyphs in LuaTeX
It doesn't. The answer from there doesn't fit here. Feel free to test it.
Crosspost: http://latex.org/forum/viewtopic.php?f=46&t=32655&p=109799
math-mode spacing xetex luatex unicode-math
New contributor
Consider the following example:
documentclassstandalone
usepackageunicode-math
setmathfontTeX Gyre Termes Math
begindocument
(fBigl(Bigr))
enddocument
If you compile it with xelatex
, you get
But if you compile it with lualatex
, you get a narrower
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 for the most pleasant reading?Who is the culprit? (I.e., who deviates from the way it is supposed to be?)
Is there any way to repair the culprit or at least to achieve independency of the engine used for compilation more or less automatically?
Weakly related: Change bounding box of math glyphs 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 🦆
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.
EDIT: Concerning
This question already has an answer here:
Change bounding box of math glyphs in LuaTeX
It doesn't. The answer from there doesn't fit here. Feel free to test it.
Crosspost: http://latex.org/forum/viewtopic.php?f=46&t=32655&p=109799
math-mode spacing xetex luatex unicode-math
math-mode spacing xetex luatex unicode-math
New contributor
New contributor
edited 4 hours ago
MdAyq5
New contributor
asked 9 hours ago
MdAyq5MdAyq5
213 bronze badges
213 bronze badges
New contributor
New contributor
Yes, because of LuaTeX's lack of the italic correction, although, as you say, here we're in the middle of the formula. As stated in the answer, you can try(fUchar"200BBigl(Bigr))
or(f🦆Bigl(Bigr))
to have the spacing fixed. However I must say that it's a pain to do that eveywhere... I'll retract my close vote.
– Phelype Oleinik
9 hours ago
@PhelypeOleinik In both suggestions of yours, the space after f increases both for xelatex and for lualatex. The discepancy between the two outputs remains.
– MdAyq5
9 hours ago
Your question "Who is the culprit? (I.e., who deviates from the specification?)" presupposes that there is a specification. the OpenType Math table specification is somewhat vague and font authors have to interpret it to know what values to put into the dimensions in the table, and rendering engine authors need to interpret the values in the table to lay out the math and then tex macros like unicode-math need to interpret the differences between the engines to give a consistent cross engine interface. It's amazing anything comes out looking similar, less surprising that they sometimes differ.
– David Carlisle
7 hours ago
@DavidCarlisle If so, then we should conclude that the culprit is fact of life that the specification is absent or ambiguous. The spec writers would be then the folks responsible. (I'm not saying that they did a bad job with respect to the payment they got for it; perhaps they did an excellent job, but, as usual, one can still do better. I'm not saying that they are guilty or anything. I don't know; I have not read the specs you talk about. If these are Microsoft folks; one should ping Microsoft, I guess.)
– MdAyq5
7 hours ago
1
why ping Murray, he doesn't have write access to luatex or xetex sources and they are the systems that you want to act the same. there is always room for interpretation mapping tex concepts like the mathord and mathopen classses of f and ( and the layout rules in OpenType.
– David Carlisle
7 hours ago
|
show 9 more comments
Yes, because of LuaTeX's lack of the italic correction, although, as you say, here we're in the middle of the formula. As stated in the answer, you can try(fUchar"200BBigl(Bigr))
or(f🦆Bigl(Bigr))
to have the spacing fixed. However I must say that it's a pain to do that eveywhere... I'll retract my close vote.
– Phelype Oleinik
9 hours ago
@PhelypeOleinik In both suggestions of yours, the space after f increases both for xelatex and for lualatex. The discepancy between the two outputs remains.
– MdAyq5
9 hours ago
Your question "Who is the culprit? (I.e., who deviates from the specification?)" presupposes that there is a specification. the OpenType Math table specification is somewhat vague and font authors have to interpret it to know what values to put into the dimensions in the table, and rendering engine authors need to interpret the values in the table to lay out the math and then tex macros like unicode-math need to interpret the differences between the engines to give a consistent cross engine interface. It's amazing anything comes out looking similar, less surprising that they sometimes differ.
– David Carlisle
7 hours ago
@DavidCarlisle If so, then we should conclude that the culprit is fact of life that the specification is absent or ambiguous. The spec writers would be then the folks responsible. (I'm not saying that they did a bad job with respect to the payment they got for it; perhaps they did an excellent job, but, as usual, one can still do better. I'm not saying that they are guilty or anything. I don't know; I have not read the specs you talk about. If these are Microsoft folks; one should ping Microsoft, I guess.)
– MdAyq5
7 hours ago
1
why ping Murray, he doesn't have write access to luatex or xetex sources and they are the systems that you want to act the same. there is always room for interpretation mapping tex concepts like the mathord and mathopen classses of f and ( and the layout rules in OpenType.
– David Carlisle
7 hours ago
Yes, because of LuaTeX's lack of the italic correction, although, as you say, here we're in the middle of the formula. As stated in the answer, you can try
(fUchar"200BBigl(Bigr))
or (f🦆Bigl(Bigr))
to have the spacing fixed. However I must say that it's a pain to do that eveywhere... I'll retract my close vote.– Phelype Oleinik
9 hours ago
Yes, because of LuaTeX's lack of the italic correction, although, as you say, here we're in the middle of the formula. As stated in the answer, you can try
(fUchar"200BBigl(Bigr))
or (f🦆Bigl(Bigr))
to have the spacing fixed. However I must say that it's a pain to do that eveywhere... I'll retract my close vote.– Phelype Oleinik
9 hours ago
@PhelypeOleinik In both suggestions of yours, the space after f increases both for xelatex and for lualatex. The discepancy between the two outputs remains.
– MdAyq5
9 hours ago
@PhelypeOleinik In both suggestions of yours, the space after f increases both for xelatex and for lualatex. The discepancy between the two outputs remains.
– MdAyq5
9 hours ago
Your question "Who is the culprit? (I.e., who deviates from the specification?)" presupposes that there is a specification. the OpenType Math table specification is somewhat vague and font authors have to interpret it to know what values to put into the dimensions in the table, and rendering engine authors need to interpret the values in the table to lay out the math and then tex macros like unicode-math need to interpret the differences between the engines to give a consistent cross engine interface. It's amazing anything comes out looking similar, less surprising that they sometimes differ.
– David Carlisle
7 hours ago
Your question "Who is the culprit? (I.e., who deviates from the specification?)" presupposes that there is a specification. the OpenType Math table specification is somewhat vague and font authors have to interpret it to know what values to put into the dimensions in the table, and rendering engine authors need to interpret the values in the table to lay out the math and then tex macros like unicode-math need to interpret the differences between the engines to give a consistent cross engine interface. It's amazing anything comes out looking similar, less surprising that they sometimes differ.
– David Carlisle
7 hours ago
@DavidCarlisle If so, then we should conclude that the culprit is fact of life that the specification is absent or ambiguous. The spec writers would be then the folks responsible. (I'm not saying that they did a bad job with respect to the payment they got for it; perhaps they did an excellent job, but, as usual, one can still do better. I'm not saying that they are guilty or anything. I don't know; I have not read the specs you talk about. If these are Microsoft folks; one should ping Microsoft, I guess.)
– MdAyq5
7 hours ago
@DavidCarlisle If so, then we should conclude that the culprit is fact of life that the specification is absent or ambiguous. The spec writers would be then the folks responsible. (I'm not saying that they did a bad job with respect to the payment they got for it; perhaps they did an excellent job, but, as usual, one can still do better. I'm not saying that they are guilty or anything. I don't know; I have not read the specs you talk about. If these are Microsoft folks; one should ping Microsoft, I guess.)
– MdAyq5
7 hours ago
1
1
why ping Murray, he doesn't have write access to luatex or xetex sources and they are the systems that you want to act the same. there is always room for interpretation mapping tex concepts like the mathord and mathopen classses of f and ( and the layout rules in OpenType.
– David Carlisle
7 hours ago
why ping Murray, he doesn't have write access to luatex or xetex sources and they are the systems that you want to act the same. there is always room for interpretation mapping tex concepts like the mathord and mathopen classses of f and ( and the layout rules in OpenType.
– David Carlisle
7 hours ago
|
show 9 more comments
1 Answer
1
active
oldest
votes
What does the relevant specification actually say?
Italics correction can be used in the following situations:
- When a run of slanted characters is followed by a straight character (such as an operator or a delimiter), the italics correction of the last glyph is added to its advance width.
(The OpenType MATH table specification, emphasis mine)
Now the TeX engine has to decide how to translate this to TeX concepts. XeTeX generally classifies mathopen
atoms as "delimiters" and therefore "straight characters", but LuaTeX only classifies TeX delimiters, (left
, right
, etc.) as "delimiters".
I tend to agree with XeTeX here.
To get consistant behaviour, you can add explicitly add the italic correction through /
, so in your example:
documentclassstandalone
usepackageunicode-math,ifluatex
setmathfontTeX Gyre Termes Math
ifluatex
mathitalicsmode=1
fi
begindocument
(f/Bigl(Bigr))
enddocument
This can also be automated using the mlist_to_hlist
callback.
Now, it works like a charm. Thank you. Any idea on whymathitalicsmode=1
is not the default in lualatex?
– MdAyq5
6 hours ago
@MdAyq5 AFAICT mostly historical reasons. Earlier versions of the OpenType MATH specs did not include the part quoted above, so it was unclear when italic correction should be added. Later the default probably never changed to stay compatible.
– Marcel Krüger
6 hours ago
Settingmathitalicsmode=1
incurs some tiny changes in the remainder of a huge document (from which my example above has been taken). Do you know, perhaps, whether settingmathitalicsmode=1
a good thing in general for LuaLaTeX for new documents or does it have some downsides overwieghing the problem described?
– MdAyq5
5 hours ago
@MdAyq5 As documented,mathitalicsmode=1
forces italic correction before "noads that represent some more complex structure". So basically it answers the question: What if a slanted character is not followed by a character at all. This isn't specified (the quote above only talks about slanted characters followed by straight characters). So the entire point behindmathitalicsmode
is that it is not clear what setting is "good". You have to decide for yourself, probably depending on the math font.
– Marcel Krüger
5 hours ago
1
@MdAyq5 Yes, but you can't change it inside a math formula. (To be precise, as usual the setting active at the end of the formula will apply to the entire formula.)
– Marcel Krüger
5 hours ago
|
show 2 more comments
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
MdAyq5 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f498776%2flualatex-too-little-space-inside-f-bigl%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
What does the relevant specification actually say?
Italics correction can be used in the following situations:
- When a run of slanted characters is followed by a straight character (such as an operator or a delimiter), the italics correction of the last glyph is added to its advance width.
(The OpenType MATH table specification, emphasis mine)
Now the TeX engine has to decide how to translate this to TeX concepts. XeTeX generally classifies mathopen
atoms as "delimiters" and therefore "straight characters", but LuaTeX only classifies TeX delimiters, (left
, right
, etc.) as "delimiters".
I tend to agree with XeTeX here.
To get consistant behaviour, you can add explicitly add the italic correction through /
, so in your example:
documentclassstandalone
usepackageunicode-math,ifluatex
setmathfontTeX Gyre Termes Math
ifluatex
mathitalicsmode=1
fi
begindocument
(f/Bigl(Bigr))
enddocument
This can also be automated using the mlist_to_hlist
callback.
Now, it works like a charm. Thank you. Any idea on whymathitalicsmode=1
is not the default in lualatex?
– MdAyq5
6 hours ago
@MdAyq5 AFAICT mostly historical reasons. Earlier versions of the OpenType MATH specs did not include the part quoted above, so it was unclear when italic correction should be added. Later the default probably never changed to stay compatible.
– Marcel Krüger
6 hours ago
Settingmathitalicsmode=1
incurs some tiny changes in the remainder of a huge document (from which my example above has been taken). Do you know, perhaps, whether settingmathitalicsmode=1
a good thing in general for LuaLaTeX for new documents or does it have some downsides overwieghing the problem described?
– MdAyq5
5 hours ago
@MdAyq5 As documented,mathitalicsmode=1
forces italic correction before "noads that represent some more complex structure". So basically it answers the question: What if a slanted character is not followed by a character at all. This isn't specified (the quote above only talks about slanted characters followed by straight characters). So the entire point behindmathitalicsmode
is that it is not clear what setting is "good". You have to decide for yourself, probably depending on the math font.
– Marcel Krüger
5 hours ago
1
@MdAyq5 Yes, but you can't change it inside a math formula. (To be precise, as usual the setting active at the end of the formula will apply to the entire formula.)
– Marcel Krüger
5 hours ago
|
show 2 more comments
What does the relevant specification actually say?
Italics correction can be used in the following situations:
- When a run of slanted characters is followed by a straight character (such as an operator or a delimiter), the italics correction of the last glyph is added to its advance width.
(The OpenType MATH table specification, emphasis mine)
Now the TeX engine has to decide how to translate this to TeX concepts. XeTeX generally classifies mathopen
atoms as "delimiters" and therefore "straight characters", but LuaTeX only classifies TeX delimiters, (left
, right
, etc.) as "delimiters".
I tend to agree with XeTeX here.
To get consistant behaviour, you can add explicitly add the italic correction through /
, so in your example:
documentclassstandalone
usepackageunicode-math,ifluatex
setmathfontTeX Gyre Termes Math
ifluatex
mathitalicsmode=1
fi
begindocument
(f/Bigl(Bigr))
enddocument
This can also be automated using the mlist_to_hlist
callback.
Now, it works like a charm. Thank you. Any idea on whymathitalicsmode=1
is not the default in lualatex?
– MdAyq5
6 hours ago
@MdAyq5 AFAICT mostly historical reasons. Earlier versions of the OpenType MATH specs did not include the part quoted above, so it was unclear when italic correction should be added. Later the default probably never changed to stay compatible.
– Marcel Krüger
6 hours ago
Settingmathitalicsmode=1
incurs some tiny changes in the remainder of a huge document (from which my example above has been taken). Do you know, perhaps, whether settingmathitalicsmode=1
a good thing in general for LuaLaTeX for new documents or does it have some downsides overwieghing the problem described?
– MdAyq5
5 hours ago
@MdAyq5 As documented,mathitalicsmode=1
forces italic correction before "noads that represent some more complex structure". So basically it answers the question: What if a slanted character is not followed by a character at all. This isn't specified (the quote above only talks about slanted characters followed by straight characters). So the entire point behindmathitalicsmode
is that it is not clear what setting is "good". You have to decide for yourself, probably depending on the math font.
– Marcel Krüger
5 hours ago
1
@MdAyq5 Yes, but you can't change it inside a math formula. (To be precise, as usual the setting active at the end of the formula will apply to the entire formula.)
– Marcel Krüger
5 hours ago
|
show 2 more comments
What does the relevant specification actually say?
Italics correction can be used in the following situations:
- When a run of slanted characters is followed by a straight character (such as an operator or a delimiter), the italics correction of the last glyph is added to its advance width.
(The OpenType MATH table specification, emphasis mine)
Now the TeX engine has to decide how to translate this to TeX concepts. XeTeX generally classifies mathopen
atoms as "delimiters" and therefore "straight characters", but LuaTeX only classifies TeX delimiters, (left
, right
, etc.) as "delimiters".
I tend to agree with XeTeX here.
To get consistant behaviour, you can add explicitly add the italic correction through /
, so in your example:
documentclassstandalone
usepackageunicode-math,ifluatex
setmathfontTeX Gyre Termes Math
ifluatex
mathitalicsmode=1
fi
begindocument
(f/Bigl(Bigr))
enddocument
This can also be automated using the mlist_to_hlist
callback.
What does the relevant specification actually say?
Italics correction can be used in the following situations:
- When a run of slanted characters is followed by a straight character (such as an operator or a delimiter), the italics correction of the last glyph is added to its advance width.
(The OpenType MATH table specification, emphasis mine)
Now the TeX engine has to decide how to translate this to TeX concepts. XeTeX generally classifies mathopen
atoms as "delimiters" and therefore "straight characters", but LuaTeX only classifies TeX delimiters, (left
, right
, etc.) as "delimiters".
I tend to agree with XeTeX here.
To get consistant behaviour, you can add explicitly add the italic correction through /
, so in your example:
documentclassstandalone
usepackageunicode-math,ifluatex
setmathfontTeX Gyre Termes Math
ifluatex
mathitalicsmode=1
fi
begindocument
(f/Bigl(Bigr))
enddocument
This can also be automated using the mlist_to_hlist
callback.
edited 6 hours ago
answered 7 hours ago
Marcel KrügerMarcel Krüger
14.4k1 gold badge17 silver badges37 bronze badges
14.4k1 gold badge17 silver badges37 bronze badges
Now, it works like a charm. Thank you. Any idea on whymathitalicsmode=1
is not the default in lualatex?
– MdAyq5
6 hours ago
@MdAyq5 AFAICT mostly historical reasons. Earlier versions of the OpenType MATH specs did not include the part quoted above, so it was unclear when italic correction should be added. Later the default probably never changed to stay compatible.
– Marcel Krüger
6 hours ago
Settingmathitalicsmode=1
incurs some tiny changes in the remainder of a huge document (from which my example above has been taken). Do you know, perhaps, whether settingmathitalicsmode=1
a good thing in general for LuaLaTeX for new documents or does it have some downsides overwieghing the problem described?
– MdAyq5
5 hours ago
@MdAyq5 As documented,mathitalicsmode=1
forces italic correction before "noads that represent some more complex structure". So basically it answers the question: What if a slanted character is not followed by a character at all. This isn't specified (the quote above only talks about slanted characters followed by straight characters). So the entire point behindmathitalicsmode
is that it is not clear what setting is "good". You have to decide for yourself, probably depending on the math font.
– Marcel Krüger
5 hours ago
1
@MdAyq5 Yes, but you can't change it inside a math formula. (To be precise, as usual the setting active at the end of the formula will apply to the entire formula.)
– Marcel Krüger
5 hours ago
|
show 2 more comments
Now, it works like a charm. Thank you. Any idea on whymathitalicsmode=1
is not the default in lualatex?
– MdAyq5
6 hours ago
@MdAyq5 AFAICT mostly historical reasons. Earlier versions of the OpenType MATH specs did not include the part quoted above, so it was unclear when italic correction should be added. Later the default probably never changed to stay compatible.
– Marcel Krüger
6 hours ago
Settingmathitalicsmode=1
incurs some tiny changes in the remainder of a huge document (from which my example above has been taken). Do you know, perhaps, whether settingmathitalicsmode=1
a good thing in general for LuaLaTeX for new documents or does it have some downsides overwieghing the problem described?
– MdAyq5
5 hours ago
@MdAyq5 As documented,mathitalicsmode=1
forces italic correction before "noads that represent some more complex structure". So basically it answers the question: What if a slanted character is not followed by a character at all. This isn't specified (the quote above only talks about slanted characters followed by straight characters). So the entire point behindmathitalicsmode
is that it is not clear what setting is "good". You have to decide for yourself, probably depending on the math font.
– Marcel Krüger
5 hours ago
1
@MdAyq5 Yes, but you can't change it inside a math formula. (To be precise, as usual the setting active at the end of the formula will apply to the entire formula.)
– Marcel Krüger
5 hours ago
Now, it works like a charm. Thank you. Any idea on why
mathitalicsmode=1
is not the default in lualatex?– MdAyq5
6 hours ago
Now, it works like a charm. Thank you. Any idea on why
mathitalicsmode=1
is not the default in lualatex?– MdAyq5
6 hours ago
@MdAyq5 AFAICT mostly historical reasons. Earlier versions of the OpenType MATH specs did not include the part quoted above, so it was unclear when italic correction should be added. Later the default probably never changed to stay compatible.
– Marcel Krüger
6 hours ago
@MdAyq5 AFAICT mostly historical reasons. Earlier versions of the OpenType MATH specs did not include the part quoted above, so it was unclear when italic correction should be added. Later the default probably never changed to stay compatible.
– Marcel Krüger
6 hours ago
Setting
mathitalicsmode=1
incurs some tiny changes in the remainder of a huge document (from which my example above has been taken). Do you know, perhaps, whether setting mathitalicsmode=1
a good thing in general for LuaLaTeX for new documents or does it have some downsides overwieghing the problem described?– MdAyq5
5 hours ago
Setting
mathitalicsmode=1
incurs some tiny changes in the remainder of a huge document (from which my example above has been taken). Do you know, perhaps, whether setting mathitalicsmode=1
a good thing in general for LuaLaTeX for new documents or does it have some downsides overwieghing the problem described?– MdAyq5
5 hours ago
@MdAyq5 As documented,
mathitalicsmode=1
forces italic correction before "noads that represent some more complex structure". So basically it answers the question: What if a slanted character is not followed by a character at all. This isn't specified (the quote above only talks about slanted characters followed by straight characters). So the entire point behind mathitalicsmode
is that it is not clear what setting is "good". You have to decide for yourself, probably depending on the math font.– Marcel Krüger
5 hours ago
@MdAyq5 As documented,
mathitalicsmode=1
forces italic correction before "noads that represent some more complex structure". So basically it answers the question: What if a slanted character is not followed by a character at all. This isn't specified (the quote above only talks about slanted characters followed by straight characters). So the entire point behind mathitalicsmode
is that it is not clear what setting is "good". You have to decide for yourself, probably depending on the math font.– Marcel Krüger
5 hours ago
1
1
@MdAyq5 Yes, but you can't change it inside a math formula. (To be precise, as usual the setting active at the end of the formula will apply to the entire formula.)
– Marcel Krüger
5 hours ago
@MdAyq5 Yes, but you can't change it inside a math formula. (To be precise, as usual the setting active at the end of the formula will apply to the entire formula.)
– Marcel Krüger
5 hours ago
|
show 2 more comments
MdAyq5 is a new contributor. Be nice, and check out our Code of Conduct.
MdAyq5 is a new contributor. Be nice, and check out our Code of Conduct.
MdAyq5 is a new contributor. Be nice, and check out our Code of Conduct.
MdAyq5 is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f498776%2flualatex-too-little-space-inside-f-bigl%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Yes, because of LuaTeX's lack of the italic correction, although, as you say, here we're in the middle of the formula. As stated in the answer, you can try
(fUchar"200BBigl(Bigr))
or(f🦆Bigl(Bigr))
to have the spacing fixed. However I must say that it's a pain to do that eveywhere... I'll retract my close vote.– Phelype Oleinik
9 hours ago
@PhelypeOleinik In both suggestions of yours, the space after f increases both for xelatex and for lualatex. The discepancy between the two outputs remains.
– MdAyq5
9 hours ago
Your question "Who is the culprit? (I.e., who deviates from the specification?)" presupposes that there is a specification. the OpenType Math table specification is somewhat vague and font authors have to interpret it to know what values to put into the dimensions in the table, and rendering engine authors need to interpret the values in the table to lay out the math and then tex macros like unicode-math need to interpret the differences between the engines to give a consistent cross engine interface. It's amazing anything comes out looking similar, less surprising that they sometimes differ.
– David Carlisle
7 hours ago
@DavidCarlisle If so, then we should conclude that the culprit is fact of life that the specification is absent or ambiguous. The spec writers would be then the folks responsible. (I'm not saying that they did a bad job with respect to the payment they got for it; perhaps they did an excellent job, but, as usual, one can still do better. I'm not saying that they are guilty or anything. I don't know; I have not read the specs you talk about. If these are Microsoft folks; one should ping Microsoft, I guess.)
– MdAyq5
7 hours ago
1
why ping Murray, he doesn't have write access to luatex or xetex sources and they are the systems that you want to act the same. there is always room for interpretation mapping tex concepts like the mathord and mathopen classses of f and ( and the layout rules in OpenType.
– David Carlisle
7 hours ago