Is it canonical bit space?remove additional space before `:`No space present after ensuremathExplicit space character?Extra vertical space before displayed math in enumeration with newtxmathBit Grouping in LaTeXExtra space in renewcommandHow to define variables with white spacelist of canonical math operatorsHow to make mtpro2 math font a litte bit more thick?Automatically convert math written in .tex into a canonical form that retains all the math information

How can the DM most effectively choose 1 out of an odd number of players to be targeted by an attack or effect?

How is it possible for user to changed after storage was encrypted? (on OS X, Android)

The use of multiple foreign keys on same column in SQL Server

Why is this code 6.5x slower with optimizations enabled?

Is there really no realistic way for a skeleton monster to move around without magic?

Why CLRS example on residual networks does not follows its formula?

How to add power-LED to my small amplifier?

Validation accuracy vs Testing accuracy

New order #4: World

whey we use polarized capacitor?

Why are 150k or 200k jobs considered good when there are 300k+ births a month?

Can a German sentence have two subjects?

What would happen to a modern skyscraper if it rains micro blackholes?

A function which translates a sentence to title-case

How old can references or sources in a thesis be?

What do you call a Matrix-like slowdown and camera movement effect?

How can I hide my bitcoin transactions to protect anonymity from others?

What do you call something that goes against the spirit of the law, but is legal when interpreting the law to the letter?

Shell script can be run only with sh command

I’m planning on buying a laser printer but concerned about the life cycle of toner in the machine

Why did the Germans forbid the possession of pet pigeons in Rostov-on-Don in 1941?

Japan - Plan around max visa duration

Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)

How is it possible to have an ability score that is less than 3?



Is it canonical bit space?


remove additional space before `:`No space present after ensuremathExplicit space character?Extra vertical space before displayed math in enumeration with newtxmathBit Grouping in LaTeXExtra space in renewcommandHow to define variables with white spacelist of canonical math operatorsHow to make mtpro2 math font a litte bit more thick?Automatically convert math written in .tex into a canonical form that retains all the math information













14















I have this simple code,



documentclass[12pt]book
usepackagemathtools
usepackagenewtxtext
usepackage[lite]mtpro2
begindocument
$dbarp$ and $dt$.
enddocument


with this output,



enter image description here



I think it's a canonical space is due to the presence of the bar... command? Sometimes to bring it back I insert a negative space ! to bring the p to the left near the d.



This little adjustment must always be done or I should create a particular macro. Which one could be always using the same command bar? It gets a bit complicated for me in my book to change the original command bar.... Thank you.




Using Steven Segletes' suggestion of ooalign$dbar#1$cr$d#1$, one can see if the problem is universal across bar. If the superposition produces a "thick" second letter, the kerning is not correct. (using newtxmath as Steven does not have mtpro2)



Unfortunately, that proves not to be the case, as some cases seem kerned correctly and others not:



documentclass[12pt]book
usepackagemathtools
usepackagenewtxtext
usepackagenewtxmath%instead of usepackage[lite]mtpro2
newcommandtestkern[1]%
ooalign$dbar#1$cr$d#1$
textwidth 1in
begindocument
noindenttestkerna
testkernb
testkernc
testkernd
testkerne
testkernf
testkerng
testkernh
testkerni
testkernj
testkernk
testkernl
testkernm
testkernn
testkerno
testkernp
testkernq
testkernr
testkerns
testkernt
testkernu
testkernv
testkernw
testkernx
testkerny
testkernz
enddocument


enter image description here



Applying a universal -1mu kern to bar



newcommandxbarmkern-1mubar
newcommandtestkern[1]%
ooalign$dxbar#1$cr$d#1$


therefore, may fix some letter combinations, but will inevitably break others:



enter image description here










share|improve this question



















  • 4





    Without mtpro2, the space does not manifest. However, it does show, when, instead of mtpro2, one uses newtxmath.

    – Steven B. Segletes
    Apr 4 at 10:18












  • @StevenB.Segletes You've given me some very bad news. :-( I have the whole book with mtpro2 because I like fonts.

    – Sebastiano
    Apr 4 at 10:20







  • 1





    If the problem is universal with bar in that font, you could always do letsvbarbarrenewcommandbarmkern-1musvbar

    – Steven B. Segletes
    Apr 4 at 10:24







  • 2





    Yes, if the two superimposed p's are "thick", that means the kerning is different between the two cases. If the superimposed p's look like one, then the kerning is correct.

    – Steven B. Segletes
    Apr 4 at 10:26







  • 1





    I removed some offtopic comments. (the conversation seemed to be finished anyway). Thanks.

    – Stefan Kottwitz
    9 hours ago















14















I have this simple code,



documentclass[12pt]book
usepackagemathtools
usepackagenewtxtext
usepackage[lite]mtpro2
begindocument
$dbarp$ and $dt$.
enddocument


with this output,



enter image description here



I think it's a canonical space is due to the presence of the bar... command? Sometimes to bring it back I insert a negative space ! to bring the p to the left near the d.



This little adjustment must always be done or I should create a particular macro. Which one could be always using the same command bar? It gets a bit complicated for me in my book to change the original command bar.... Thank you.




Using Steven Segletes' suggestion of ooalign$dbar#1$cr$d#1$, one can see if the problem is universal across bar. If the superposition produces a "thick" second letter, the kerning is not correct. (using newtxmath as Steven does not have mtpro2)



Unfortunately, that proves not to be the case, as some cases seem kerned correctly and others not:



documentclass[12pt]book
usepackagemathtools
usepackagenewtxtext
usepackagenewtxmath%instead of usepackage[lite]mtpro2
newcommandtestkern[1]%
ooalign$dbar#1$cr$d#1$
textwidth 1in
begindocument
noindenttestkerna
testkernb
testkernc
testkernd
testkerne
testkernf
testkerng
testkernh
testkerni
testkernj
testkernk
testkernl
testkernm
testkernn
testkerno
testkernp
testkernq
testkernr
testkerns
testkernt
testkernu
testkernv
testkernw
testkernx
testkerny
testkernz
enddocument


enter image description here



Applying a universal -1mu kern to bar



newcommandxbarmkern-1mubar
newcommandtestkern[1]%
ooalign$dxbar#1$cr$d#1$


therefore, may fix some letter combinations, but will inevitably break others:



enter image description here










share|improve this question



















  • 4





    Without mtpro2, the space does not manifest. However, it does show, when, instead of mtpro2, one uses newtxmath.

    – Steven B. Segletes
    Apr 4 at 10:18












  • @StevenB.Segletes You've given me some very bad news. :-( I have the whole book with mtpro2 because I like fonts.

    – Sebastiano
    Apr 4 at 10:20







  • 1





    If the problem is universal with bar in that font, you could always do letsvbarbarrenewcommandbarmkern-1musvbar

    – Steven B. Segletes
    Apr 4 at 10:24







  • 2





    Yes, if the two superimposed p's are "thick", that means the kerning is different between the two cases. If the superimposed p's look like one, then the kerning is correct.

    – Steven B. Segletes
    Apr 4 at 10:26







  • 1





    I removed some offtopic comments. (the conversation seemed to be finished anyway). Thanks.

    – Stefan Kottwitz
    9 hours ago













14












14








14








I have this simple code,



documentclass[12pt]book
usepackagemathtools
usepackagenewtxtext
usepackage[lite]mtpro2
begindocument
$dbarp$ and $dt$.
enddocument


with this output,



enter image description here



I think it's a canonical space is due to the presence of the bar... command? Sometimes to bring it back I insert a negative space ! to bring the p to the left near the d.



This little adjustment must always be done or I should create a particular macro. Which one could be always using the same command bar? It gets a bit complicated for me in my book to change the original command bar.... Thank you.




Using Steven Segletes' suggestion of ooalign$dbar#1$cr$d#1$, one can see if the problem is universal across bar. If the superposition produces a "thick" second letter, the kerning is not correct. (using newtxmath as Steven does not have mtpro2)



Unfortunately, that proves not to be the case, as some cases seem kerned correctly and others not:



documentclass[12pt]book
usepackagemathtools
usepackagenewtxtext
usepackagenewtxmath%instead of usepackage[lite]mtpro2
newcommandtestkern[1]%
ooalign$dbar#1$cr$d#1$
textwidth 1in
begindocument
noindenttestkerna
testkernb
testkernc
testkernd
testkerne
testkernf
testkerng
testkernh
testkerni
testkernj
testkernk
testkernl
testkernm
testkernn
testkerno
testkernp
testkernq
testkernr
testkerns
testkernt
testkernu
testkernv
testkernw
testkernx
testkerny
testkernz
enddocument


enter image description here



Applying a universal -1mu kern to bar



newcommandxbarmkern-1mubar
newcommandtestkern[1]%
ooalign$dxbar#1$cr$d#1$


therefore, may fix some letter combinations, but will inevitably break others:



enter image description here










share|improve this question
















I have this simple code,



documentclass[12pt]book
usepackagemathtools
usepackagenewtxtext
usepackage[lite]mtpro2
begindocument
$dbarp$ and $dt$.
enddocument


with this output,



enter image description here



I think it's a canonical space is due to the presence of the bar... command? Sometimes to bring it back I insert a negative space ! to bring the p to the left near the d.



This little adjustment must always be done or I should create a particular macro. Which one could be always using the same command bar? It gets a bit complicated for me in my book to change the original command bar.... Thank you.




Using Steven Segletes' suggestion of ooalign$dbar#1$cr$d#1$, one can see if the problem is universal across bar. If the superposition produces a "thick" second letter, the kerning is not correct. (using newtxmath as Steven does not have mtpro2)



Unfortunately, that proves not to be the case, as some cases seem kerned correctly and others not:



documentclass[12pt]book
usepackagemathtools
usepackagenewtxtext
usepackagenewtxmath%instead of usepackage[lite]mtpro2
newcommandtestkern[1]%
ooalign$dbar#1$cr$d#1$
textwidth 1in
begindocument
noindenttestkerna
testkernb
testkernc
testkernd
testkerne
testkernf
testkerng
testkernh
testkerni
testkernj
testkernk
testkernl
testkernm
testkernn
testkerno
testkernp
testkernq
testkernr
testkerns
testkernt
testkernu
testkernv
testkernw
testkernx
testkerny
testkernz
enddocument


enter image description here



Applying a universal -1mu kern to bar



newcommandxbarmkern-1mubar
newcommandtestkern[1]%
ooalign$dxbar#1$cr$d#1$


therefore, may fix some letter combinations, but will inevitably break others:



enter image description here







math-mode macros symbols mtpro newtx






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 4 at 10:54









Steven B. Segletes

161k9205416




161k9205416










asked Apr 4 at 10:13









SebastianoSebastiano

11.2k42166




11.2k42166







  • 4





    Without mtpro2, the space does not manifest. However, it does show, when, instead of mtpro2, one uses newtxmath.

    – Steven B. Segletes
    Apr 4 at 10:18












  • @StevenB.Segletes You've given me some very bad news. :-( I have the whole book with mtpro2 because I like fonts.

    – Sebastiano
    Apr 4 at 10:20







  • 1





    If the problem is universal with bar in that font, you could always do letsvbarbarrenewcommandbarmkern-1musvbar

    – Steven B. Segletes
    Apr 4 at 10:24







  • 2





    Yes, if the two superimposed p's are "thick", that means the kerning is different between the two cases. If the superimposed p's look like one, then the kerning is correct.

    – Steven B. Segletes
    Apr 4 at 10:26







  • 1





    I removed some offtopic comments. (the conversation seemed to be finished anyway). Thanks.

    – Stefan Kottwitz
    9 hours ago












  • 4





    Without mtpro2, the space does not manifest. However, it does show, when, instead of mtpro2, one uses newtxmath.

    – Steven B. Segletes
    Apr 4 at 10:18












  • @StevenB.Segletes You've given me some very bad news. :-( I have the whole book with mtpro2 because I like fonts.

    – Sebastiano
    Apr 4 at 10:20







  • 1





    If the problem is universal with bar in that font, you could always do letsvbarbarrenewcommandbarmkern-1musvbar

    – Steven B. Segletes
    Apr 4 at 10:24







  • 2





    Yes, if the two superimposed p's are "thick", that means the kerning is different between the two cases. If the superimposed p's look like one, then the kerning is correct.

    – Steven B. Segletes
    Apr 4 at 10:26







  • 1





    I removed some offtopic comments. (the conversation seemed to be finished anyway). Thanks.

    – Stefan Kottwitz
    9 hours ago







4




4





Without mtpro2, the space does not manifest. However, it does show, when, instead of mtpro2, one uses newtxmath.

– Steven B. Segletes
Apr 4 at 10:18






Without mtpro2, the space does not manifest. However, it does show, when, instead of mtpro2, one uses newtxmath.

– Steven B. Segletes
Apr 4 at 10:18














@StevenB.Segletes You've given me some very bad news. :-( I have the whole book with mtpro2 because I like fonts.

– Sebastiano
Apr 4 at 10:20






@StevenB.Segletes You've given me some very bad news. :-( I have the whole book with mtpro2 because I like fonts.

– Sebastiano
Apr 4 at 10:20





1




1





If the problem is universal with bar in that font, you could always do letsvbarbarrenewcommandbarmkern-1musvbar

– Steven B. Segletes
Apr 4 at 10:24






If the problem is universal with bar in that font, you could always do letsvbarbarrenewcommandbarmkern-1musvbar

– Steven B. Segletes
Apr 4 at 10:24





2




2





Yes, if the two superimposed p's are "thick", that means the kerning is different between the two cases. If the superimposed p's look like one, then the kerning is correct.

– Steven B. Segletes
Apr 4 at 10:26






Yes, if the two superimposed p's are "thick", that means the kerning is different between the two cases. If the superimposed p's look like one, then the kerning is correct.

– Steven B. Segletes
Apr 4 at 10:26





1




1





I removed some offtopic comments. (the conversation seemed to be finished anyway). Thanks.

– Stefan Kottwitz
9 hours ago





I removed some offtopic comments. (the conversation seemed to be finished anyway). Thanks.

– Stefan Kottwitz
9 hours ago










2 Answers
2






active

oldest

votes


















15














A proposal to renew the command of bar as follows:



letsvbarbar
renewcommandbar[1]%
#1ThisStylesetbox0=hbox$SavedStyle#1$kern-wd0svbar,phantom#1!


This will guarantee proper kerning of the letter, as it is set first thing without the bar. Then, I kern backward across the letter, and apply the bar to a variant of the letter's phantom. In this case, the variant is a shifted phantom, which is then unshifted following the bar, so as not to introduce any stray space.



Therefore, if there are residual kerning issues, they will be with the placement of the superimposed bar, relative to the underlying properly kerned letter.



The MWE uses the ooalign test given in the question to judge the quality of the bar macro, using letter boldness as an indicator for bad kerning. As you can see, there are no thick/boldened letters signifying a kern mismatch. Therefore, with this approach, one must merely judge if the placement of the bar relative to the letter is suitable or not.



While all examples are shown relative to the letter "d", the method, in fact, will perform similarly, regardless of the preceding letter.



EDITED to work across math styles.



documentclass[12pt]book
usepackagemathtools
usepackagenewtxtext
usepackagenewtxmath%instead of usepackage[lite]mtpro2
usepackagescalerel
letsvbarbar
renewcommandbar[1]%
#1ThisStylesetbox0=hbox$SavedStyle#1$kern-wd0svbar,phantom#1!
newcommandtestkern[2][]%
ooalign$#1 dbar#2$cr$#1 d#2$
textwidth 1in
begindocument
noindenttestkerna testkernb testkernc testkernd
testkerne testkernf testkerng testkernh testkerni
testkernj testkernk testkernl testkernm testkernn
testkerno testkernp testkernq testkernr testkerns
testkernt testkernu testkernv testkernw testkernx
testkerny testkernz

noindenttestkern[scriptstyle]a testkern[scriptstyle]b
testkern[scriptstyle]c testkern[scriptstyle]d
testkern[scriptstyle]e testkern[scriptstyle]f
testkern[scriptstyle]g testkern[scriptstyle]h
testkern[scriptstyle]i testkern[scriptstyle]j
testkern[scriptstyle]k testkern[scriptstyle]l
testkern[scriptstyle]m testkern[scriptstyle]n
testkern[scriptstyle]o testkern[scriptstyle]p
testkern[scriptstyle]q testkern[scriptstyle]r
testkern[scriptstyle]s testkern[scriptstyle]t
testkern[scriptstyle]u testkern[scriptstyle]v
testkern[scriptstyle]w testkern[scriptstyle]x
testkern[scriptstyle]y testkern[scriptstyle]z

noindent$2 dbarp^2ne2d p^2$
enddocument


enter image description here






share|improve this answer




















  • 1





    My always thanks from my first question I asked two and a half years ago :-)

    – Sebastiano
    Apr 4 at 11:21






  • 2





    @Sebastiano It has been my pleasure to assist you.

    – Steven B. Segletes
    Apr 4 at 11:26











  • Steven I can't get a green check mark. I'm sorry. The two answers are both beautiful.

    – Sebastiano
    Apr 4 at 19:53











  • @Sebastiano No problem. Sometimes, a question without a checkmark brings more eyes, from those thinking it is still unanswered.

    – Steven B. Segletes
    Apr 4 at 19:54











  • I really appreciate the answers. When I can't choose, they are rare for me, it's because I can't penalize one user over another.

    – Sebastiano
    Apr 4 at 19:55


















13














If I compile



documentclass[12pt]book
usepackagemathtools
usepackagenewtxtext
usepackage[lite]mtpro2
begindocument

$dbarp$

$dp$

showoutput

enddocument


I get, for the two formulas



....mathon
....LMP1/mtt/m/it/12 d
....kern1.43999
....vbox(7.88399+2.568)x7.98
.....hbox(7.88399+0.0)x0.0, shifted 3.312
......LMP2/mtt/m/n/12 N
.....kern-5.484
.....hbox(5.484+2.568)x7.98
......LMP1/mtt/m/it/12 p
....mathoff


....mathon
....LMP1/mtt/m/it/12 d
....kern1.43999
....kern-2.40001
....LMP1/mtt/m/it/12 p
....kern0.48
....mathoff


After removing the call to mtpro2, I get



....mathon
....OML/cmm/m/it/12 d
....vbox(6.77774+2.33331)x5.89717
.....hbox(6.77774+0.0)x0.0, shifted 0.99028
......OT1/cmr/m/n/12 ^^V
.....kern-5.16667
.....hbox(5.16667+2.33331)x5.89717
......OML/cmm/m/it/12 p
....mathoff


....mathon
....OML/cmm/m/it/12 d
....OML/cmm/m/it/12 p
....mathoff


The obvious difference is that d in the font LMP1/mtt/m/it/12 (pointing to mt2mit at 12pt) has an italic correction, which isn't present in the OML/cmm/m/it/12 font (pointing to cmsy10 at 12pt).



Indeed, if I do tftopl mt2mit, I get



(CHARACTER C d
(CHARWD R 0.551)
(CHARHT R 0.717)
(CHARIC R 0.12)
(COMMENT
(KRN O 0 R -0.06)
[...]
(KRN C p R -0.2)
[...]
(KRN C t R -0.04)
[...]
(KRN O 263 R -0.02)
)
)


and with tftopl cmsy10 I get



(CHARACTER O 100
(CHARWD R 0.611113)
(CHARHT R 0.694445)
)


As you can see, there is also a kerning pair with p or t, which moves in the character when there is no accent, but this is not possible when the next item is an Acc atom.



You can manually compute the appropriate kerning.



documentclass[12pt]book
usepackagemathtools
usepackagenewtxtext
usepackage[lite]mtpro2

newcommanddwithbar[1]%
dcomputedaccentkern#1bar#1%

makeatletter
newcommandcomputedaccentkern[1]%
mathpalettecomputedaccentkern@#1%

newcommandcomputedaccentkern@[2]%
begingroup
sboxz@$m@th#1d#2$
sboxtw@$m@th#1dkern0pt#2$%
kerndimexprwdz@-wdtw@relax
endgroup

makeatother


begindocument

$dbarp$ $scriptstyle dbarp$

$dwithbarp$ $scriptstyle dwithbarp$

$dp$ $scriptstyle dp$

$dbart$ $scriptstyle dbart$

$dwithbart$ $scriptstyle dwithbart$

$dt$ $scriptstyle dt$

enddocument


You can define similarly for other accents, say dot:



newcommanddwithdot[1]%
dcomputedaccentkern#1dot#1%



or a generic



newcommanddwithacc[2]%
dcomputedaccentkern#2#1#2%



to be called like dwithaccbarp or dwithaccdotp.



enter image description here






share|improve this answer

























  • Shocking :-) I dare say amazed. I don't understand almost anything (mathon...mathoff :-) where they come from, CHARACTER etc...) but I can imagine that it's a problem with encoding the different incompatible fonts that I'm using.

    – Sebastiano
    Apr 4 at 11:20






  • 2





    @Sebastiano The first part is the analysis of what TeX internally does with the input, in terms of boxes and glue. Then I looked at the metrics for the fonts, finding the correspondence with what we saw in the boxes and glue representation.

    – egreg
    Apr 4 at 11:21











  • Do i understand your solution correctly that it specifically addresses kerns following the letter "d", or is it universal for any letter combinations?

    – Steven B. Segletes
    Apr 4 at 11:57






  • 1





    @StevenB.Segletes It's specifically for d, but could be modified quite easily for other pairs.

    – egreg
    Apr 4 at 12:02











  • @egreg Doesn't know who to vote for the two questions to. If I don't, it's because they're both beautiful.

    – Sebastiano
    Apr 4 at 19:52











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
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483128%2fis-it-canonical-bit-space%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









15














A proposal to renew the command of bar as follows:



letsvbarbar
renewcommandbar[1]%
#1ThisStylesetbox0=hbox$SavedStyle#1$kern-wd0svbar,phantom#1!


This will guarantee proper kerning of the letter, as it is set first thing without the bar. Then, I kern backward across the letter, and apply the bar to a variant of the letter's phantom. In this case, the variant is a shifted phantom, which is then unshifted following the bar, so as not to introduce any stray space.



Therefore, if there are residual kerning issues, they will be with the placement of the superimposed bar, relative to the underlying properly kerned letter.



The MWE uses the ooalign test given in the question to judge the quality of the bar macro, using letter boldness as an indicator for bad kerning. As you can see, there are no thick/boldened letters signifying a kern mismatch. Therefore, with this approach, one must merely judge if the placement of the bar relative to the letter is suitable or not.



While all examples are shown relative to the letter "d", the method, in fact, will perform similarly, regardless of the preceding letter.



EDITED to work across math styles.



documentclass[12pt]book
usepackagemathtools
usepackagenewtxtext
usepackagenewtxmath%instead of usepackage[lite]mtpro2
usepackagescalerel
letsvbarbar
renewcommandbar[1]%
#1ThisStylesetbox0=hbox$SavedStyle#1$kern-wd0svbar,phantom#1!
newcommandtestkern[2][]%
ooalign$#1 dbar#2$cr$#1 d#2$
textwidth 1in
begindocument
noindenttestkerna testkernb testkernc testkernd
testkerne testkernf testkerng testkernh testkerni
testkernj testkernk testkernl testkernm testkernn
testkerno testkernp testkernq testkernr testkerns
testkernt testkernu testkernv testkernw testkernx
testkerny testkernz

noindenttestkern[scriptstyle]a testkern[scriptstyle]b
testkern[scriptstyle]c testkern[scriptstyle]d
testkern[scriptstyle]e testkern[scriptstyle]f
testkern[scriptstyle]g testkern[scriptstyle]h
testkern[scriptstyle]i testkern[scriptstyle]j
testkern[scriptstyle]k testkern[scriptstyle]l
testkern[scriptstyle]m testkern[scriptstyle]n
testkern[scriptstyle]o testkern[scriptstyle]p
testkern[scriptstyle]q testkern[scriptstyle]r
testkern[scriptstyle]s testkern[scriptstyle]t
testkern[scriptstyle]u testkern[scriptstyle]v
testkern[scriptstyle]w testkern[scriptstyle]x
testkern[scriptstyle]y testkern[scriptstyle]z

noindent$2 dbarp^2ne2d p^2$
enddocument


enter image description here






share|improve this answer




















  • 1





    My always thanks from my first question I asked two and a half years ago :-)

    – Sebastiano
    Apr 4 at 11:21






  • 2





    @Sebastiano It has been my pleasure to assist you.

    – Steven B. Segletes
    Apr 4 at 11:26











  • Steven I can't get a green check mark. I'm sorry. The two answers are both beautiful.

    – Sebastiano
    Apr 4 at 19:53











  • @Sebastiano No problem. Sometimes, a question without a checkmark brings more eyes, from those thinking it is still unanswered.

    – Steven B. Segletes
    Apr 4 at 19:54











  • I really appreciate the answers. When I can't choose, they are rare for me, it's because I can't penalize one user over another.

    – Sebastiano
    Apr 4 at 19:55















15














A proposal to renew the command of bar as follows:



letsvbarbar
renewcommandbar[1]%
#1ThisStylesetbox0=hbox$SavedStyle#1$kern-wd0svbar,phantom#1!


This will guarantee proper kerning of the letter, as it is set first thing without the bar. Then, I kern backward across the letter, and apply the bar to a variant of the letter's phantom. In this case, the variant is a shifted phantom, which is then unshifted following the bar, so as not to introduce any stray space.



Therefore, if there are residual kerning issues, they will be with the placement of the superimposed bar, relative to the underlying properly kerned letter.



The MWE uses the ooalign test given in the question to judge the quality of the bar macro, using letter boldness as an indicator for bad kerning. As you can see, there are no thick/boldened letters signifying a kern mismatch. Therefore, with this approach, one must merely judge if the placement of the bar relative to the letter is suitable or not.



While all examples are shown relative to the letter "d", the method, in fact, will perform similarly, regardless of the preceding letter.



EDITED to work across math styles.



documentclass[12pt]book
usepackagemathtools
usepackagenewtxtext
usepackagenewtxmath%instead of usepackage[lite]mtpro2
usepackagescalerel
letsvbarbar
renewcommandbar[1]%
#1ThisStylesetbox0=hbox$SavedStyle#1$kern-wd0svbar,phantom#1!
newcommandtestkern[2][]%
ooalign$#1 dbar#2$cr$#1 d#2$
textwidth 1in
begindocument
noindenttestkerna testkernb testkernc testkernd
testkerne testkernf testkerng testkernh testkerni
testkernj testkernk testkernl testkernm testkernn
testkerno testkernp testkernq testkernr testkerns
testkernt testkernu testkernv testkernw testkernx
testkerny testkernz

noindenttestkern[scriptstyle]a testkern[scriptstyle]b
testkern[scriptstyle]c testkern[scriptstyle]d
testkern[scriptstyle]e testkern[scriptstyle]f
testkern[scriptstyle]g testkern[scriptstyle]h
testkern[scriptstyle]i testkern[scriptstyle]j
testkern[scriptstyle]k testkern[scriptstyle]l
testkern[scriptstyle]m testkern[scriptstyle]n
testkern[scriptstyle]o testkern[scriptstyle]p
testkern[scriptstyle]q testkern[scriptstyle]r
testkern[scriptstyle]s testkern[scriptstyle]t
testkern[scriptstyle]u testkern[scriptstyle]v
testkern[scriptstyle]w testkern[scriptstyle]x
testkern[scriptstyle]y testkern[scriptstyle]z

noindent$2 dbarp^2ne2d p^2$
enddocument


enter image description here






share|improve this answer




















  • 1





    My always thanks from my first question I asked two and a half years ago :-)

    – Sebastiano
    Apr 4 at 11:21






  • 2





    @Sebastiano It has been my pleasure to assist you.

    – Steven B. Segletes
    Apr 4 at 11:26











  • Steven I can't get a green check mark. I'm sorry. The two answers are both beautiful.

    – Sebastiano
    Apr 4 at 19:53











  • @Sebastiano No problem. Sometimes, a question without a checkmark brings more eyes, from those thinking it is still unanswered.

    – Steven B. Segletes
    Apr 4 at 19:54











  • I really appreciate the answers. When I can't choose, they are rare for me, it's because I can't penalize one user over another.

    – Sebastiano
    Apr 4 at 19:55













15












15








15







A proposal to renew the command of bar as follows:



letsvbarbar
renewcommandbar[1]%
#1ThisStylesetbox0=hbox$SavedStyle#1$kern-wd0svbar,phantom#1!


This will guarantee proper kerning of the letter, as it is set first thing without the bar. Then, I kern backward across the letter, and apply the bar to a variant of the letter's phantom. In this case, the variant is a shifted phantom, which is then unshifted following the bar, so as not to introduce any stray space.



Therefore, if there are residual kerning issues, they will be with the placement of the superimposed bar, relative to the underlying properly kerned letter.



The MWE uses the ooalign test given in the question to judge the quality of the bar macro, using letter boldness as an indicator for bad kerning. As you can see, there are no thick/boldened letters signifying a kern mismatch. Therefore, with this approach, one must merely judge if the placement of the bar relative to the letter is suitable or not.



While all examples are shown relative to the letter "d", the method, in fact, will perform similarly, regardless of the preceding letter.



EDITED to work across math styles.



documentclass[12pt]book
usepackagemathtools
usepackagenewtxtext
usepackagenewtxmath%instead of usepackage[lite]mtpro2
usepackagescalerel
letsvbarbar
renewcommandbar[1]%
#1ThisStylesetbox0=hbox$SavedStyle#1$kern-wd0svbar,phantom#1!
newcommandtestkern[2][]%
ooalign$#1 dbar#2$cr$#1 d#2$
textwidth 1in
begindocument
noindenttestkerna testkernb testkernc testkernd
testkerne testkernf testkerng testkernh testkerni
testkernj testkernk testkernl testkernm testkernn
testkerno testkernp testkernq testkernr testkerns
testkernt testkernu testkernv testkernw testkernx
testkerny testkernz

noindenttestkern[scriptstyle]a testkern[scriptstyle]b
testkern[scriptstyle]c testkern[scriptstyle]d
testkern[scriptstyle]e testkern[scriptstyle]f
testkern[scriptstyle]g testkern[scriptstyle]h
testkern[scriptstyle]i testkern[scriptstyle]j
testkern[scriptstyle]k testkern[scriptstyle]l
testkern[scriptstyle]m testkern[scriptstyle]n
testkern[scriptstyle]o testkern[scriptstyle]p
testkern[scriptstyle]q testkern[scriptstyle]r
testkern[scriptstyle]s testkern[scriptstyle]t
testkern[scriptstyle]u testkern[scriptstyle]v
testkern[scriptstyle]w testkern[scriptstyle]x
testkern[scriptstyle]y testkern[scriptstyle]z

noindent$2 dbarp^2ne2d p^2$
enddocument


enter image description here






share|improve this answer















A proposal to renew the command of bar as follows:



letsvbarbar
renewcommandbar[1]%
#1ThisStylesetbox0=hbox$SavedStyle#1$kern-wd0svbar,phantom#1!


This will guarantee proper kerning of the letter, as it is set first thing without the bar. Then, I kern backward across the letter, and apply the bar to a variant of the letter's phantom. In this case, the variant is a shifted phantom, which is then unshifted following the bar, so as not to introduce any stray space.



Therefore, if there are residual kerning issues, they will be with the placement of the superimposed bar, relative to the underlying properly kerned letter.



The MWE uses the ooalign test given in the question to judge the quality of the bar macro, using letter boldness as an indicator for bad kerning. As you can see, there are no thick/boldened letters signifying a kern mismatch. Therefore, with this approach, one must merely judge if the placement of the bar relative to the letter is suitable or not.



While all examples are shown relative to the letter "d", the method, in fact, will perform similarly, regardless of the preceding letter.



EDITED to work across math styles.



documentclass[12pt]book
usepackagemathtools
usepackagenewtxtext
usepackagenewtxmath%instead of usepackage[lite]mtpro2
usepackagescalerel
letsvbarbar
renewcommandbar[1]%
#1ThisStylesetbox0=hbox$SavedStyle#1$kern-wd0svbar,phantom#1!
newcommandtestkern[2][]%
ooalign$#1 dbar#2$cr$#1 d#2$
textwidth 1in
begindocument
noindenttestkerna testkernb testkernc testkernd
testkerne testkernf testkerng testkernh testkerni
testkernj testkernk testkernl testkernm testkernn
testkerno testkernp testkernq testkernr testkerns
testkernt testkernu testkernv testkernw testkernx
testkerny testkernz

noindenttestkern[scriptstyle]a testkern[scriptstyle]b
testkern[scriptstyle]c testkern[scriptstyle]d
testkern[scriptstyle]e testkern[scriptstyle]f
testkern[scriptstyle]g testkern[scriptstyle]h
testkern[scriptstyle]i testkern[scriptstyle]j
testkern[scriptstyle]k testkern[scriptstyle]l
testkern[scriptstyle]m testkern[scriptstyle]n
testkern[scriptstyle]o testkern[scriptstyle]p
testkern[scriptstyle]q testkern[scriptstyle]r
testkern[scriptstyle]s testkern[scriptstyle]t
testkern[scriptstyle]u testkern[scriptstyle]v
testkern[scriptstyle]w testkern[scriptstyle]x
testkern[scriptstyle]y testkern[scriptstyle]z

noindent$2 dbarp^2ne2d p^2$
enddocument


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited Apr 4 at 14:02

























answered Apr 4 at 11:12









Steven B. SegletesSteven B. Segletes

161k9205416




161k9205416







  • 1





    My always thanks from my first question I asked two and a half years ago :-)

    – Sebastiano
    Apr 4 at 11:21






  • 2





    @Sebastiano It has been my pleasure to assist you.

    – Steven B. Segletes
    Apr 4 at 11:26











  • Steven I can't get a green check mark. I'm sorry. The two answers are both beautiful.

    – Sebastiano
    Apr 4 at 19:53











  • @Sebastiano No problem. Sometimes, a question without a checkmark brings more eyes, from those thinking it is still unanswered.

    – Steven B. Segletes
    Apr 4 at 19:54











  • I really appreciate the answers. When I can't choose, they are rare for me, it's because I can't penalize one user over another.

    – Sebastiano
    Apr 4 at 19:55












  • 1





    My always thanks from my first question I asked two and a half years ago :-)

    – Sebastiano
    Apr 4 at 11:21






  • 2





    @Sebastiano It has been my pleasure to assist you.

    – Steven B. Segletes
    Apr 4 at 11:26











  • Steven I can't get a green check mark. I'm sorry. The two answers are both beautiful.

    – Sebastiano
    Apr 4 at 19:53











  • @Sebastiano No problem. Sometimes, a question without a checkmark brings more eyes, from those thinking it is still unanswered.

    – Steven B. Segletes
    Apr 4 at 19:54











  • I really appreciate the answers. When I can't choose, they are rare for me, it's because I can't penalize one user over another.

    – Sebastiano
    Apr 4 at 19:55







1




1





My always thanks from my first question I asked two and a half years ago :-)

– Sebastiano
Apr 4 at 11:21





My always thanks from my first question I asked two and a half years ago :-)

– Sebastiano
Apr 4 at 11:21




2




2





@Sebastiano It has been my pleasure to assist you.

– Steven B. Segletes
Apr 4 at 11:26





@Sebastiano It has been my pleasure to assist you.

– Steven B. Segletes
Apr 4 at 11:26













Steven I can't get a green check mark. I'm sorry. The two answers are both beautiful.

– Sebastiano
Apr 4 at 19:53





Steven I can't get a green check mark. I'm sorry. The two answers are both beautiful.

– Sebastiano
Apr 4 at 19:53













@Sebastiano No problem. Sometimes, a question without a checkmark brings more eyes, from those thinking it is still unanswered.

– Steven B. Segletes
Apr 4 at 19:54





@Sebastiano No problem. Sometimes, a question without a checkmark brings more eyes, from those thinking it is still unanswered.

– Steven B. Segletes
Apr 4 at 19:54













I really appreciate the answers. When I can't choose, they are rare for me, it's because I can't penalize one user over another.

– Sebastiano
Apr 4 at 19:55





I really appreciate the answers. When I can't choose, they are rare for me, it's because I can't penalize one user over another.

– Sebastiano
Apr 4 at 19:55











13














If I compile



documentclass[12pt]book
usepackagemathtools
usepackagenewtxtext
usepackage[lite]mtpro2
begindocument

$dbarp$

$dp$

showoutput

enddocument


I get, for the two formulas



....mathon
....LMP1/mtt/m/it/12 d
....kern1.43999
....vbox(7.88399+2.568)x7.98
.....hbox(7.88399+0.0)x0.0, shifted 3.312
......LMP2/mtt/m/n/12 N
.....kern-5.484
.....hbox(5.484+2.568)x7.98
......LMP1/mtt/m/it/12 p
....mathoff


....mathon
....LMP1/mtt/m/it/12 d
....kern1.43999
....kern-2.40001
....LMP1/mtt/m/it/12 p
....kern0.48
....mathoff


After removing the call to mtpro2, I get



....mathon
....OML/cmm/m/it/12 d
....vbox(6.77774+2.33331)x5.89717
.....hbox(6.77774+0.0)x0.0, shifted 0.99028
......OT1/cmr/m/n/12 ^^V
.....kern-5.16667
.....hbox(5.16667+2.33331)x5.89717
......OML/cmm/m/it/12 p
....mathoff


....mathon
....OML/cmm/m/it/12 d
....OML/cmm/m/it/12 p
....mathoff


The obvious difference is that d in the font LMP1/mtt/m/it/12 (pointing to mt2mit at 12pt) has an italic correction, which isn't present in the OML/cmm/m/it/12 font (pointing to cmsy10 at 12pt).



Indeed, if I do tftopl mt2mit, I get



(CHARACTER C d
(CHARWD R 0.551)
(CHARHT R 0.717)
(CHARIC R 0.12)
(COMMENT
(KRN O 0 R -0.06)
[...]
(KRN C p R -0.2)
[...]
(KRN C t R -0.04)
[...]
(KRN O 263 R -0.02)
)
)


and with tftopl cmsy10 I get



(CHARACTER O 100
(CHARWD R 0.611113)
(CHARHT R 0.694445)
)


As you can see, there is also a kerning pair with p or t, which moves in the character when there is no accent, but this is not possible when the next item is an Acc atom.



You can manually compute the appropriate kerning.



documentclass[12pt]book
usepackagemathtools
usepackagenewtxtext
usepackage[lite]mtpro2

newcommanddwithbar[1]%
dcomputedaccentkern#1bar#1%

makeatletter
newcommandcomputedaccentkern[1]%
mathpalettecomputedaccentkern@#1%

newcommandcomputedaccentkern@[2]%
begingroup
sboxz@$m@th#1d#2$
sboxtw@$m@th#1dkern0pt#2$%
kerndimexprwdz@-wdtw@relax
endgroup

makeatother


begindocument

$dbarp$ $scriptstyle dbarp$

$dwithbarp$ $scriptstyle dwithbarp$

$dp$ $scriptstyle dp$

$dbart$ $scriptstyle dbart$

$dwithbart$ $scriptstyle dwithbart$

$dt$ $scriptstyle dt$

enddocument


You can define similarly for other accents, say dot:



newcommanddwithdot[1]%
dcomputedaccentkern#1dot#1%



or a generic



newcommanddwithacc[2]%
dcomputedaccentkern#2#1#2%



to be called like dwithaccbarp or dwithaccdotp.



enter image description here






share|improve this answer

























  • Shocking :-) I dare say amazed. I don't understand almost anything (mathon...mathoff :-) where they come from, CHARACTER etc...) but I can imagine that it's a problem with encoding the different incompatible fonts that I'm using.

    – Sebastiano
    Apr 4 at 11:20






  • 2





    @Sebastiano The first part is the analysis of what TeX internally does with the input, in terms of boxes and glue. Then I looked at the metrics for the fonts, finding the correspondence with what we saw in the boxes and glue representation.

    – egreg
    Apr 4 at 11:21











  • Do i understand your solution correctly that it specifically addresses kerns following the letter "d", or is it universal for any letter combinations?

    – Steven B. Segletes
    Apr 4 at 11:57






  • 1





    @StevenB.Segletes It's specifically for d, but could be modified quite easily for other pairs.

    – egreg
    Apr 4 at 12:02











  • @egreg Doesn't know who to vote for the two questions to. If I don't, it's because they're both beautiful.

    – Sebastiano
    Apr 4 at 19:52















13














If I compile



documentclass[12pt]book
usepackagemathtools
usepackagenewtxtext
usepackage[lite]mtpro2
begindocument

$dbarp$

$dp$

showoutput

enddocument


I get, for the two formulas



....mathon
....LMP1/mtt/m/it/12 d
....kern1.43999
....vbox(7.88399+2.568)x7.98
.....hbox(7.88399+0.0)x0.0, shifted 3.312
......LMP2/mtt/m/n/12 N
.....kern-5.484
.....hbox(5.484+2.568)x7.98
......LMP1/mtt/m/it/12 p
....mathoff


....mathon
....LMP1/mtt/m/it/12 d
....kern1.43999
....kern-2.40001
....LMP1/mtt/m/it/12 p
....kern0.48
....mathoff


After removing the call to mtpro2, I get



....mathon
....OML/cmm/m/it/12 d
....vbox(6.77774+2.33331)x5.89717
.....hbox(6.77774+0.0)x0.0, shifted 0.99028
......OT1/cmr/m/n/12 ^^V
.....kern-5.16667
.....hbox(5.16667+2.33331)x5.89717
......OML/cmm/m/it/12 p
....mathoff


....mathon
....OML/cmm/m/it/12 d
....OML/cmm/m/it/12 p
....mathoff


The obvious difference is that d in the font LMP1/mtt/m/it/12 (pointing to mt2mit at 12pt) has an italic correction, which isn't present in the OML/cmm/m/it/12 font (pointing to cmsy10 at 12pt).



Indeed, if I do tftopl mt2mit, I get



(CHARACTER C d
(CHARWD R 0.551)
(CHARHT R 0.717)
(CHARIC R 0.12)
(COMMENT
(KRN O 0 R -0.06)
[...]
(KRN C p R -0.2)
[...]
(KRN C t R -0.04)
[...]
(KRN O 263 R -0.02)
)
)


and with tftopl cmsy10 I get



(CHARACTER O 100
(CHARWD R 0.611113)
(CHARHT R 0.694445)
)


As you can see, there is also a kerning pair with p or t, which moves in the character when there is no accent, but this is not possible when the next item is an Acc atom.



You can manually compute the appropriate kerning.



documentclass[12pt]book
usepackagemathtools
usepackagenewtxtext
usepackage[lite]mtpro2

newcommanddwithbar[1]%
dcomputedaccentkern#1bar#1%

makeatletter
newcommandcomputedaccentkern[1]%
mathpalettecomputedaccentkern@#1%

newcommandcomputedaccentkern@[2]%
begingroup
sboxz@$m@th#1d#2$
sboxtw@$m@th#1dkern0pt#2$%
kerndimexprwdz@-wdtw@relax
endgroup

makeatother


begindocument

$dbarp$ $scriptstyle dbarp$

$dwithbarp$ $scriptstyle dwithbarp$

$dp$ $scriptstyle dp$

$dbart$ $scriptstyle dbart$

$dwithbart$ $scriptstyle dwithbart$

$dt$ $scriptstyle dt$

enddocument


You can define similarly for other accents, say dot:



newcommanddwithdot[1]%
dcomputedaccentkern#1dot#1%



or a generic



newcommanddwithacc[2]%
dcomputedaccentkern#2#1#2%



to be called like dwithaccbarp or dwithaccdotp.



enter image description here






share|improve this answer

























  • Shocking :-) I dare say amazed. I don't understand almost anything (mathon...mathoff :-) where they come from, CHARACTER etc...) but I can imagine that it's a problem with encoding the different incompatible fonts that I'm using.

    – Sebastiano
    Apr 4 at 11:20






  • 2





    @Sebastiano The first part is the analysis of what TeX internally does with the input, in terms of boxes and glue. Then I looked at the metrics for the fonts, finding the correspondence with what we saw in the boxes and glue representation.

    – egreg
    Apr 4 at 11:21











  • Do i understand your solution correctly that it specifically addresses kerns following the letter "d", or is it universal for any letter combinations?

    – Steven B. Segletes
    Apr 4 at 11:57






  • 1





    @StevenB.Segletes It's specifically for d, but could be modified quite easily for other pairs.

    – egreg
    Apr 4 at 12:02











  • @egreg Doesn't know who to vote for the two questions to. If I don't, it's because they're both beautiful.

    – Sebastiano
    Apr 4 at 19:52













13












13








13







If I compile



documentclass[12pt]book
usepackagemathtools
usepackagenewtxtext
usepackage[lite]mtpro2
begindocument

$dbarp$

$dp$

showoutput

enddocument


I get, for the two formulas



....mathon
....LMP1/mtt/m/it/12 d
....kern1.43999
....vbox(7.88399+2.568)x7.98
.....hbox(7.88399+0.0)x0.0, shifted 3.312
......LMP2/mtt/m/n/12 N
.....kern-5.484
.....hbox(5.484+2.568)x7.98
......LMP1/mtt/m/it/12 p
....mathoff


....mathon
....LMP1/mtt/m/it/12 d
....kern1.43999
....kern-2.40001
....LMP1/mtt/m/it/12 p
....kern0.48
....mathoff


After removing the call to mtpro2, I get



....mathon
....OML/cmm/m/it/12 d
....vbox(6.77774+2.33331)x5.89717
.....hbox(6.77774+0.0)x0.0, shifted 0.99028
......OT1/cmr/m/n/12 ^^V
.....kern-5.16667
.....hbox(5.16667+2.33331)x5.89717
......OML/cmm/m/it/12 p
....mathoff


....mathon
....OML/cmm/m/it/12 d
....OML/cmm/m/it/12 p
....mathoff


The obvious difference is that d in the font LMP1/mtt/m/it/12 (pointing to mt2mit at 12pt) has an italic correction, which isn't present in the OML/cmm/m/it/12 font (pointing to cmsy10 at 12pt).



Indeed, if I do tftopl mt2mit, I get



(CHARACTER C d
(CHARWD R 0.551)
(CHARHT R 0.717)
(CHARIC R 0.12)
(COMMENT
(KRN O 0 R -0.06)
[...]
(KRN C p R -0.2)
[...]
(KRN C t R -0.04)
[...]
(KRN O 263 R -0.02)
)
)


and with tftopl cmsy10 I get



(CHARACTER O 100
(CHARWD R 0.611113)
(CHARHT R 0.694445)
)


As you can see, there is also a kerning pair with p or t, which moves in the character when there is no accent, but this is not possible when the next item is an Acc atom.



You can manually compute the appropriate kerning.



documentclass[12pt]book
usepackagemathtools
usepackagenewtxtext
usepackage[lite]mtpro2

newcommanddwithbar[1]%
dcomputedaccentkern#1bar#1%

makeatletter
newcommandcomputedaccentkern[1]%
mathpalettecomputedaccentkern@#1%

newcommandcomputedaccentkern@[2]%
begingroup
sboxz@$m@th#1d#2$
sboxtw@$m@th#1dkern0pt#2$%
kerndimexprwdz@-wdtw@relax
endgroup

makeatother


begindocument

$dbarp$ $scriptstyle dbarp$

$dwithbarp$ $scriptstyle dwithbarp$

$dp$ $scriptstyle dp$

$dbart$ $scriptstyle dbart$

$dwithbart$ $scriptstyle dwithbart$

$dt$ $scriptstyle dt$

enddocument


You can define similarly for other accents, say dot:



newcommanddwithdot[1]%
dcomputedaccentkern#1dot#1%



or a generic



newcommanddwithacc[2]%
dcomputedaccentkern#2#1#2%



to be called like dwithaccbarp or dwithaccdotp.



enter image description here






share|improve this answer















If I compile



documentclass[12pt]book
usepackagemathtools
usepackagenewtxtext
usepackage[lite]mtpro2
begindocument

$dbarp$

$dp$

showoutput

enddocument


I get, for the two formulas



....mathon
....LMP1/mtt/m/it/12 d
....kern1.43999
....vbox(7.88399+2.568)x7.98
.....hbox(7.88399+0.0)x0.0, shifted 3.312
......LMP2/mtt/m/n/12 N
.....kern-5.484
.....hbox(5.484+2.568)x7.98
......LMP1/mtt/m/it/12 p
....mathoff


....mathon
....LMP1/mtt/m/it/12 d
....kern1.43999
....kern-2.40001
....LMP1/mtt/m/it/12 p
....kern0.48
....mathoff


After removing the call to mtpro2, I get



....mathon
....OML/cmm/m/it/12 d
....vbox(6.77774+2.33331)x5.89717
.....hbox(6.77774+0.0)x0.0, shifted 0.99028
......OT1/cmr/m/n/12 ^^V
.....kern-5.16667
.....hbox(5.16667+2.33331)x5.89717
......OML/cmm/m/it/12 p
....mathoff


....mathon
....OML/cmm/m/it/12 d
....OML/cmm/m/it/12 p
....mathoff


The obvious difference is that d in the font LMP1/mtt/m/it/12 (pointing to mt2mit at 12pt) has an italic correction, which isn't present in the OML/cmm/m/it/12 font (pointing to cmsy10 at 12pt).



Indeed, if I do tftopl mt2mit, I get



(CHARACTER C d
(CHARWD R 0.551)
(CHARHT R 0.717)
(CHARIC R 0.12)
(COMMENT
(KRN O 0 R -0.06)
[...]
(KRN C p R -0.2)
[...]
(KRN C t R -0.04)
[...]
(KRN O 263 R -0.02)
)
)


and with tftopl cmsy10 I get



(CHARACTER O 100
(CHARWD R 0.611113)
(CHARHT R 0.694445)
)


As you can see, there is also a kerning pair with p or t, which moves in the character when there is no accent, but this is not possible when the next item is an Acc atom.



You can manually compute the appropriate kerning.



documentclass[12pt]book
usepackagemathtools
usepackagenewtxtext
usepackage[lite]mtpro2

newcommanddwithbar[1]%
dcomputedaccentkern#1bar#1%

makeatletter
newcommandcomputedaccentkern[1]%
mathpalettecomputedaccentkern@#1%

newcommandcomputedaccentkern@[2]%
begingroup
sboxz@$m@th#1d#2$
sboxtw@$m@th#1dkern0pt#2$%
kerndimexprwdz@-wdtw@relax
endgroup

makeatother


begindocument

$dbarp$ $scriptstyle dbarp$

$dwithbarp$ $scriptstyle dwithbarp$

$dp$ $scriptstyle dp$

$dbart$ $scriptstyle dbart$

$dwithbart$ $scriptstyle dwithbart$

$dt$ $scriptstyle dt$

enddocument


You can define similarly for other accents, say dot:



newcommanddwithdot[1]%
dcomputedaccentkern#1dot#1%



or a generic



newcommanddwithacc[2]%
dcomputedaccentkern#2#1#2%



to be called like dwithaccbarp or dwithaccdotp.



enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited Apr 4 at 12:45









wipet

35.4k4983




35.4k4983










answered Apr 4 at 11:05









egregegreg

732k8919303253




732k8919303253












  • Shocking :-) I dare say amazed. I don't understand almost anything (mathon...mathoff :-) where they come from, CHARACTER etc...) but I can imagine that it's a problem with encoding the different incompatible fonts that I'm using.

    – Sebastiano
    Apr 4 at 11:20






  • 2





    @Sebastiano The first part is the analysis of what TeX internally does with the input, in terms of boxes and glue. Then I looked at the metrics for the fonts, finding the correspondence with what we saw in the boxes and glue representation.

    – egreg
    Apr 4 at 11:21











  • Do i understand your solution correctly that it specifically addresses kerns following the letter "d", or is it universal for any letter combinations?

    – Steven B. Segletes
    Apr 4 at 11:57






  • 1





    @StevenB.Segletes It's specifically for d, but could be modified quite easily for other pairs.

    – egreg
    Apr 4 at 12:02











  • @egreg Doesn't know who to vote for the two questions to. If I don't, it's because they're both beautiful.

    – Sebastiano
    Apr 4 at 19:52

















  • Shocking :-) I dare say amazed. I don't understand almost anything (mathon...mathoff :-) where they come from, CHARACTER etc...) but I can imagine that it's a problem with encoding the different incompatible fonts that I'm using.

    – Sebastiano
    Apr 4 at 11:20






  • 2





    @Sebastiano The first part is the analysis of what TeX internally does with the input, in terms of boxes and glue. Then I looked at the metrics for the fonts, finding the correspondence with what we saw in the boxes and glue representation.

    – egreg
    Apr 4 at 11:21











  • Do i understand your solution correctly that it specifically addresses kerns following the letter "d", or is it universal for any letter combinations?

    – Steven B. Segletes
    Apr 4 at 11:57






  • 1





    @StevenB.Segletes It's specifically for d, but could be modified quite easily for other pairs.

    – egreg
    Apr 4 at 12:02











  • @egreg Doesn't know who to vote for the two questions to. If I don't, it's because they're both beautiful.

    – Sebastiano
    Apr 4 at 19:52
















Shocking :-) I dare say amazed. I don't understand almost anything (mathon...mathoff :-) where they come from, CHARACTER etc...) but I can imagine that it's a problem with encoding the different incompatible fonts that I'm using.

– Sebastiano
Apr 4 at 11:20





Shocking :-) I dare say amazed. I don't understand almost anything (mathon...mathoff :-) where they come from, CHARACTER etc...) but I can imagine that it's a problem with encoding the different incompatible fonts that I'm using.

– Sebastiano
Apr 4 at 11:20




2




2





@Sebastiano The first part is the analysis of what TeX internally does with the input, in terms of boxes and glue. Then I looked at the metrics for the fonts, finding the correspondence with what we saw in the boxes and glue representation.

– egreg
Apr 4 at 11:21





@Sebastiano The first part is the analysis of what TeX internally does with the input, in terms of boxes and glue. Then I looked at the metrics for the fonts, finding the correspondence with what we saw in the boxes and glue representation.

– egreg
Apr 4 at 11:21













Do i understand your solution correctly that it specifically addresses kerns following the letter "d", or is it universal for any letter combinations?

– Steven B. Segletes
Apr 4 at 11:57





Do i understand your solution correctly that it specifically addresses kerns following the letter "d", or is it universal for any letter combinations?

– Steven B. Segletes
Apr 4 at 11:57




1




1





@StevenB.Segletes It's specifically for d, but could be modified quite easily for other pairs.

– egreg
Apr 4 at 12:02





@StevenB.Segletes It's specifically for d, but could be modified quite easily for other pairs.

– egreg
Apr 4 at 12:02













@egreg Doesn't know who to vote for the two questions to. If I don't, it's because they're both beautiful.

– Sebastiano
Apr 4 at 19:52





@egreg Doesn't know who to vote for the two questions to. If I don't, it's because they're both beautiful.

– Sebastiano
Apr 4 at 19:52

















draft saved

draft discarded
















































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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483128%2fis-it-canonical-bit-space%23new-answer', 'question_page');

);

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







Popular posts from this blog

Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company