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

Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020