Palatino font (newpxmath) misaligns text in fraction numeratorsConflict between color, graphicx and libertineTeXLive/PDFTeX fonts loading problemGenerating PDF/A-1b compliant documents using pdfx and pdfLaTeXHow to implement the Russian typographical traditions?Using a handwriting font from myscriptfont.comDante Monotype typeface and fractionsHow to remove i£ij at the bottom left corner under my abstractWho changed my Chinese character?

Is it possible to write Quake's fast InvSqrt() function in Rust?

For articles with more than 7 authors, is it compulsory to shorten it or just suggested?

How can baseline humanity survive on its own in the future?

Get rows only joined to certain types of row in another table

Can I say "guess what" to acknowledge new information?

Character Development - Robert Baratheon

Selecting Primes from list of list

Is Communism intrinsically Authoritarian?

How did the star tracker on the Corona (Key Hole) satellite work?

Is it possible to trap yourself in the Nether?

What is the point of teaching Coding and robotics to kids as young as 6 years old?

What is the purpose of the Dash 8’s “TOUCHED RUNWAY” warning light?

Find the length of a number's "base-jumping" path

Limitations for Colour Usage in NTSC

Sending non-work emails to colleagues. Is it rude?

Why LAE font encoding isn't needed to write arabic with babel (pdflatex)

How do you say "to play Devil's advocate" in German?

Are these pigtails inside the panel and outside a junction box allowed?

Should high school teachers say “real numbers” before teaching complex numbers?

Is it acceptable to say that a divergent series that tends to infinity is 'equal to' infinity?

Can Alice win the game?

Give a grammar for a language on Σ=a,b,c that accepts all strings containing exactly one a

How to negate forall?

Will practicing on an Ipad hurt my playing?



Palatino font (newpxmath) misaligns text in fraction numerators


Conflict between color, graphicx and libertineTeXLive/PDFTeX fonts loading problemGenerating PDF/A-1b compliant documents using pdfx and pdfLaTeXHow to implement the Russian typographical traditions?Using a handwriting font from myscriptfont.comDante Monotype typeface and fractionsHow to remove i£ij at the bottom left corner under my abstractWho changed my Chinese character?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









11


















I am using pdflatex in Texmaker (implements TeXLive). Using the default font, the numerator text of the following fractions are aligned to a common baseline:



$$fracpartial xpartial t fracpartial ypartial t fracpartial z_jpartial t$$


default font with aligned numerators



However, using the newpxmath package results in the numerators becoming misaligned:



documentclassarticle
usepackagenewpxmath
begindocument
$$fracpartial xpartial t fracpartial ypartial t fracpartial z_jpartial t$$
enddocument


newpx font with misaligned numerators



I would like to use New PX for math, but align the numerators as in the default font. I could use vphantom... to force the numerators to have the same height, but is there a more elegant way to do this?










share|improve this question






















  • 1





    The “aligned at baseline” for default Computer Modern fonts is by accident. If you try fracpartial z_j_jpartial t the numerator would be shifted upward too.

    – Ruixi Zhang
    Sep 20 at 15:02











  • Aha, that's interesting! So the behaviour in the example is because Palatino has longer "tails" under letters than Computer Modern, and this forces LaTeX to shift them upwards in more situations? Maybe the best solution would be to define a "blfrac" function, that inserts something like vphantomA^A j_j automatically. [EDIT: I would be happy to accept this as an answer btw, if it's the most LaTeX-onic way of doing it - would you like to post it, for the points? :-) ]

    – palatinouser1
    Sep 20 at 15:14












  • I am exploring other alternatives. You are correct that Palatino has longer descender since it is based on calligraphy. But the downside is that it can look uneven (the partial x and partial y are not on the same baseline either). I would say this is due to the (not-so-well) design of newpxmath, so I think we can play with font dimensions here…

    – Ruixi Zhang
    Sep 20 at 15:24

















11


















I am using pdflatex in Texmaker (implements TeXLive). Using the default font, the numerator text of the following fractions are aligned to a common baseline:



$$fracpartial xpartial t fracpartial ypartial t fracpartial z_jpartial t$$


default font with aligned numerators



However, using the newpxmath package results in the numerators becoming misaligned:



documentclassarticle
usepackagenewpxmath
begindocument
$$fracpartial xpartial t fracpartial ypartial t fracpartial z_jpartial t$$
enddocument


newpx font with misaligned numerators



I would like to use New PX for math, but align the numerators as in the default font. I could use vphantom... to force the numerators to have the same height, but is there a more elegant way to do this?










share|improve this question






















  • 1





    The “aligned at baseline” for default Computer Modern fonts is by accident. If you try fracpartial z_j_jpartial t the numerator would be shifted upward too.

    – Ruixi Zhang
    Sep 20 at 15:02











  • Aha, that's interesting! So the behaviour in the example is because Palatino has longer "tails" under letters than Computer Modern, and this forces LaTeX to shift them upwards in more situations? Maybe the best solution would be to define a "blfrac" function, that inserts something like vphantomA^A j_j automatically. [EDIT: I would be happy to accept this as an answer btw, if it's the most LaTeX-onic way of doing it - would you like to post it, for the points? :-) ]

    – palatinouser1
    Sep 20 at 15:14












  • I am exploring other alternatives. You are correct that Palatino has longer descender since it is based on calligraphy. But the downside is that it can look uneven (the partial x and partial y are not on the same baseline either). I would say this is due to the (not-so-well) design of newpxmath, so I think we can play with font dimensions here…

    – Ruixi Zhang
    Sep 20 at 15:24













11













11









11


2






I am using pdflatex in Texmaker (implements TeXLive). Using the default font, the numerator text of the following fractions are aligned to a common baseline:



$$fracpartial xpartial t fracpartial ypartial t fracpartial z_jpartial t$$


default font with aligned numerators



However, using the newpxmath package results in the numerators becoming misaligned:



documentclassarticle
usepackagenewpxmath
begindocument
$$fracpartial xpartial t fracpartial ypartial t fracpartial z_jpartial t$$
enddocument


newpx font with misaligned numerators



I would like to use New PX for math, but align the numerators as in the default font. I could use vphantom... to force the numerators to have the same height, but is there a more elegant way to do this?










share|improve this question
















I am using pdflatex in Texmaker (implements TeXLive). Using the default font, the numerator text of the following fractions are aligned to a common baseline:



$$fracpartial xpartial t fracpartial ypartial t fracpartial z_jpartial t$$


default font with aligned numerators



However, using the newpxmath package results in the numerators becoming misaligned:



documentclassarticle
usepackagenewpxmath
begindocument
$$fracpartial xpartial t fracpartial ypartial t fracpartial z_jpartial t$$
enddocument


newpx font with misaligned numerators



I would like to use New PX for math, but align the numerators as in the default font. I could use vphantom... to force the numerators to have the same height, but is there a more elegant way to do this?







fonts pdftex typography






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 20 at 18:05







palatinouser1

















asked Sep 20 at 13:54









palatinouser1palatinouser1

1135 bronze badges




1135 bronze badges










  • 1





    The “aligned at baseline” for default Computer Modern fonts is by accident. If you try fracpartial z_j_jpartial t the numerator would be shifted upward too.

    – Ruixi Zhang
    Sep 20 at 15:02











  • Aha, that's interesting! So the behaviour in the example is because Palatino has longer "tails" under letters than Computer Modern, and this forces LaTeX to shift them upwards in more situations? Maybe the best solution would be to define a "blfrac" function, that inserts something like vphantomA^A j_j automatically. [EDIT: I would be happy to accept this as an answer btw, if it's the most LaTeX-onic way of doing it - would you like to post it, for the points? :-) ]

    – palatinouser1
    Sep 20 at 15:14












  • I am exploring other alternatives. You are correct that Palatino has longer descender since it is based on calligraphy. But the downside is that it can look uneven (the partial x and partial y are not on the same baseline either). I would say this is due to the (not-so-well) design of newpxmath, so I think we can play with font dimensions here…

    – Ruixi Zhang
    Sep 20 at 15:24












  • 1





    The “aligned at baseline” for default Computer Modern fonts is by accident. If you try fracpartial z_j_jpartial t the numerator would be shifted upward too.

    – Ruixi Zhang
    Sep 20 at 15:02











  • Aha, that's interesting! So the behaviour in the example is because Palatino has longer "tails" under letters than Computer Modern, and this forces LaTeX to shift them upwards in more situations? Maybe the best solution would be to define a "blfrac" function, that inserts something like vphantomA^A j_j automatically. [EDIT: I would be happy to accept this as an answer btw, if it's the most LaTeX-onic way of doing it - would you like to post it, for the points? :-) ]

    – palatinouser1
    Sep 20 at 15:14












  • I am exploring other alternatives. You are correct that Palatino has longer descender since it is based on calligraphy. But the downside is that it can look uneven (the partial x and partial y are not on the same baseline either). I would say this is due to the (not-so-well) design of newpxmath, so I think we can play with font dimensions here…

    – Ruixi Zhang
    Sep 20 at 15:24







1




1





The “aligned at baseline” for default Computer Modern fonts is by accident. If you try fracpartial z_j_jpartial t the numerator would be shifted upward too.

– Ruixi Zhang
Sep 20 at 15:02





The “aligned at baseline” for default Computer Modern fonts is by accident. If you try fracpartial z_j_jpartial t the numerator would be shifted upward too.

– Ruixi Zhang
Sep 20 at 15:02













Aha, that's interesting! So the behaviour in the example is because Palatino has longer "tails" under letters than Computer Modern, and this forces LaTeX to shift them upwards in more situations? Maybe the best solution would be to define a "blfrac" function, that inserts something like vphantomA^A j_j automatically. [EDIT: I would be happy to accept this as an answer btw, if it's the most LaTeX-onic way of doing it - would you like to post it, for the points? :-) ]

– palatinouser1
Sep 20 at 15:14






Aha, that's interesting! So the behaviour in the example is because Palatino has longer "tails" under letters than Computer Modern, and this forces LaTeX to shift them upwards in more situations? Maybe the best solution would be to define a "blfrac" function, that inserts something like vphantomA^A j_j automatically. [EDIT: I would be happy to accept this as an answer btw, if it's the most LaTeX-onic way of doing it - would you like to post it, for the points? :-) ]

– palatinouser1
Sep 20 at 15:14














I am exploring other alternatives. You are correct that Palatino has longer descender since it is based on calligraphy. But the downside is that it can look uneven (the partial x and partial y are not on the same baseline either). I would say this is due to the (not-so-well) design of newpxmath, so I think we can play with font dimensions here…

– Ruixi Zhang
Sep 20 at 15:24





I am exploring other alternatives. You are correct that Palatino has longer descender since it is based on calligraphy. But the downside is that it can look uneven (the partial x and partial y are not on the same baseline either). I would say this is due to the (not-so-well) design of newpxmath, so I think we can play with font dimensions here…

– Ruixi Zhang
Sep 20 at 15:24










1 Answer
1






active

oldest

votes


















13



















Newer and simpler solution



Since v1.401 of newpxmath (released on October 2, 2019, now available in both MiKTeX and TeX Live), the package offers a new option fracspacing that “modifies fontdimens 8 and 11 of the symbol font to values more appropriate to the newpx fonts”.



documentclassarticle

% New package option since 2019/10/02 update
usepackage[fracspacing]newpxmath[2019/10/02]

usepackagemathtools% for clap
newcommand*drawbaseline%
claprule80pt0.4pt%


begindocument
[
begingathered
x,ydrawbaseline,z\
fracpartial xpartial t fracpartial ydrawbaselinepartial t fracpartial z_jpartial t fracpartial z_j_jpartial t\
fracpartial xpartial t fracpartial ypartial t fracpartial z_jpartial t fracpartial z_j_jpartial t\
endgathered
]
enddocument


The output looks very similar to the one in the old answer below. The parameters are refined from the very crude 0.8.




Old and depreciated answer



The design of Palatino contains long descenders. When a math font is based Palatino, the various math font dimensions should be chosen to avoid unevenness, as much as possible.



There are many font dimensions governing the positions of numerator and denominator in a fraction. We can change two of them in newpxmath which are the most relevant.



newpxmath-modified



documentclassarticle
usepackagenewpxmath

% Code modified from lmsnpxsy.fd
makeatletter
expandafterifxcsname npxmath@scaledendcsnamerelax
letnpxmath@@scaled@empty%
else
edefnpxmath@@scaleds*[csname npxmath@scaledendcsname]%
fi
DeclareFontFamilyLMSnpxsyprovidecommand setSYdimenssetSYdimensskewchar font =120
DeclareFontShapeLMSnpxsymn%
<-> npxmath@@scaled zplsy
%
fontdimen 8font=0.8fontdimen6font % was 0.677 of a quad
fontdimen11font=0.8fontdimen6font % was 0.686 of a quad

makeatother

usepackagemathtools% for clap
newcommand*drawbaseline%
claprule80pt0.4pt%


begindocument
[
begingathered
x,ydrawbaseline,z\
fracpartial xpartial t fracpartial ydrawbaselinepartial t fracpartial z_jpartial t fracpartial z_j_jpartial t\
fracpartial xpartial t fracpartial ypartial t fracpartial z_jpartial t fracpartial z_j_jpartial t\
endgathered
]
enddocument


Modifying font dimensions gives the most consistent look for all your fractions, but this requires your own aesthetic judgement.



Here, I changed the numerator raising dimension from 0.677 to 0.8 to give more room for long descender. I also changed the denominator dropping dimension from 0.686 to 0.8 for more even spacing both above and below the fraction bar.






share|improve this answer



























  • Thank you for this great answer. This is very useful to know - your description of the raising and dropping parameters is very helpful. I didn't know that these font parameters could be tweaked, so knowing about this approach will help if I run into similar problems with newpxmath too. Thanks again!

    – palatinouser1
    Sep 20 at 16:27






  • 1





    @palatinouser1 The above code could be simplified to defsetSYdimens... but this turns out revealing a hidden bug in newpxmath. If weren’t for your question I would not notice this bug: Changing dimensions in the symbol font also changes dimensions in the extensible font. I will send an email to the maintainer to report this bug.

    – Ruixi Zhang
    Sep 20 at 16:40












  • Very nice answer!

    – Oleg Lobachev
    Sep 20 at 19:43












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/4.0/"u003ecc by-sa 4.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%2f509072%2fpalatino-font-newpxmath-misaligns-text-in-fraction-numerators%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown


























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









13



















Newer and simpler solution



Since v1.401 of newpxmath (released on October 2, 2019, now available in both MiKTeX and TeX Live), the package offers a new option fracspacing that “modifies fontdimens 8 and 11 of the symbol font to values more appropriate to the newpx fonts”.



documentclassarticle

% New package option since 2019/10/02 update
usepackage[fracspacing]newpxmath[2019/10/02]

usepackagemathtools% for clap
newcommand*drawbaseline%
claprule80pt0.4pt%


begindocument
[
begingathered
x,ydrawbaseline,z\
fracpartial xpartial t fracpartial ydrawbaselinepartial t fracpartial z_jpartial t fracpartial z_j_jpartial t\
fracpartial xpartial t fracpartial ypartial t fracpartial z_jpartial t fracpartial z_j_jpartial t\
endgathered
]
enddocument


The output looks very similar to the one in the old answer below. The parameters are refined from the very crude 0.8.




Old and depreciated answer



The design of Palatino contains long descenders. When a math font is based Palatino, the various math font dimensions should be chosen to avoid unevenness, as much as possible.



There are many font dimensions governing the positions of numerator and denominator in a fraction. We can change two of them in newpxmath which are the most relevant.



newpxmath-modified



documentclassarticle
usepackagenewpxmath

% Code modified from lmsnpxsy.fd
makeatletter
expandafterifxcsname npxmath@scaledendcsnamerelax
letnpxmath@@scaled@empty%
else
edefnpxmath@@scaleds*[csname npxmath@scaledendcsname]%
fi
DeclareFontFamilyLMSnpxsyprovidecommand setSYdimenssetSYdimensskewchar font =120
DeclareFontShapeLMSnpxsymn%
<-> npxmath@@scaled zplsy
%
fontdimen 8font=0.8fontdimen6font % was 0.677 of a quad
fontdimen11font=0.8fontdimen6font % was 0.686 of a quad

makeatother

usepackagemathtools% for clap
newcommand*drawbaseline%
claprule80pt0.4pt%


begindocument
[
begingathered
x,ydrawbaseline,z\
fracpartial xpartial t fracpartial ydrawbaselinepartial t fracpartial z_jpartial t fracpartial z_j_jpartial t\
fracpartial xpartial t fracpartial ypartial t fracpartial z_jpartial t fracpartial z_j_jpartial t\
endgathered
]
enddocument


Modifying font dimensions gives the most consistent look for all your fractions, but this requires your own aesthetic judgement.



Here, I changed the numerator raising dimension from 0.677 to 0.8 to give more room for long descender. I also changed the denominator dropping dimension from 0.686 to 0.8 for more even spacing both above and below the fraction bar.






share|improve this answer



























  • Thank you for this great answer. This is very useful to know - your description of the raising and dropping parameters is very helpful. I didn't know that these font parameters could be tweaked, so knowing about this approach will help if I run into similar problems with newpxmath too. Thanks again!

    – palatinouser1
    Sep 20 at 16:27






  • 1





    @palatinouser1 The above code could be simplified to defsetSYdimens... but this turns out revealing a hidden bug in newpxmath. If weren’t for your question I would not notice this bug: Changing dimensions in the symbol font also changes dimensions in the extensible font. I will send an email to the maintainer to report this bug.

    – Ruixi Zhang
    Sep 20 at 16:40












  • Very nice answer!

    – Oleg Lobachev
    Sep 20 at 19:43















13



















Newer and simpler solution



Since v1.401 of newpxmath (released on October 2, 2019, now available in both MiKTeX and TeX Live), the package offers a new option fracspacing that “modifies fontdimens 8 and 11 of the symbol font to values more appropriate to the newpx fonts”.



documentclassarticle

% New package option since 2019/10/02 update
usepackage[fracspacing]newpxmath[2019/10/02]

usepackagemathtools% for clap
newcommand*drawbaseline%
claprule80pt0.4pt%


begindocument
[
begingathered
x,ydrawbaseline,z\
fracpartial xpartial t fracpartial ydrawbaselinepartial t fracpartial z_jpartial t fracpartial z_j_jpartial t\
fracpartial xpartial t fracpartial ypartial t fracpartial z_jpartial t fracpartial z_j_jpartial t\
endgathered
]
enddocument


The output looks very similar to the one in the old answer below. The parameters are refined from the very crude 0.8.




Old and depreciated answer



The design of Palatino contains long descenders. When a math font is based Palatino, the various math font dimensions should be chosen to avoid unevenness, as much as possible.



There are many font dimensions governing the positions of numerator and denominator in a fraction. We can change two of them in newpxmath which are the most relevant.



newpxmath-modified



documentclassarticle
usepackagenewpxmath

% Code modified from lmsnpxsy.fd
makeatletter
expandafterifxcsname npxmath@scaledendcsnamerelax
letnpxmath@@scaled@empty%
else
edefnpxmath@@scaleds*[csname npxmath@scaledendcsname]%
fi
DeclareFontFamilyLMSnpxsyprovidecommand setSYdimenssetSYdimensskewchar font =120
DeclareFontShapeLMSnpxsymn%
<-> npxmath@@scaled zplsy
%
fontdimen 8font=0.8fontdimen6font % was 0.677 of a quad
fontdimen11font=0.8fontdimen6font % was 0.686 of a quad

makeatother

usepackagemathtools% for clap
newcommand*drawbaseline%
claprule80pt0.4pt%


begindocument
[
begingathered
x,ydrawbaseline,z\
fracpartial xpartial t fracpartial ydrawbaselinepartial t fracpartial z_jpartial t fracpartial z_j_jpartial t\
fracpartial xpartial t fracpartial ypartial t fracpartial z_jpartial t fracpartial z_j_jpartial t\
endgathered
]
enddocument


Modifying font dimensions gives the most consistent look for all your fractions, but this requires your own aesthetic judgement.



Here, I changed the numerator raising dimension from 0.677 to 0.8 to give more room for long descender. I also changed the denominator dropping dimension from 0.686 to 0.8 for more even spacing both above and below the fraction bar.






share|improve this answer



























  • Thank you for this great answer. This is very useful to know - your description of the raising and dropping parameters is very helpful. I didn't know that these font parameters could be tweaked, so knowing about this approach will help if I run into similar problems with newpxmath too. Thanks again!

    – palatinouser1
    Sep 20 at 16:27






  • 1





    @palatinouser1 The above code could be simplified to defsetSYdimens... but this turns out revealing a hidden bug in newpxmath. If weren’t for your question I would not notice this bug: Changing dimensions in the symbol font also changes dimensions in the extensible font. I will send an email to the maintainer to report this bug.

    – Ruixi Zhang
    Sep 20 at 16:40












  • Very nice answer!

    – Oleg Lobachev
    Sep 20 at 19:43













13















13











13









Newer and simpler solution



Since v1.401 of newpxmath (released on October 2, 2019, now available in both MiKTeX and TeX Live), the package offers a new option fracspacing that “modifies fontdimens 8 and 11 of the symbol font to values more appropriate to the newpx fonts”.



documentclassarticle

% New package option since 2019/10/02 update
usepackage[fracspacing]newpxmath[2019/10/02]

usepackagemathtools% for clap
newcommand*drawbaseline%
claprule80pt0.4pt%


begindocument
[
begingathered
x,ydrawbaseline,z\
fracpartial xpartial t fracpartial ydrawbaselinepartial t fracpartial z_jpartial t fracpartial z_j_jpartial t\
fracpartial xpartial t fracpartial ypartial t fracpartial z_jpartial t fracpartial z_j_jpartial t\
endgathered
]
enddocument


The output looks very similar to the one in the old answer below. The parameters are refined from the very crude 0.8.




Old and depreciated answer



The design of Palatino contains long descenders. When a math font is based Palatino, the various math font dimensions should be chosen to avoid unevenness, as much as possible.



There are many font dimensions governing the positions of numerator and denominator in a fraction. We can change two of them in newpxmath which are the most relevant.



newpxmath-modified



documentclassarticle
usepackagenewpxmath

% Code modified from lmsnpxsy.fd
makeatletter
expandafterifxcsname npxmath@scaledendcsnamerelax
letnpxmath@@scaled@empty%
else
edefnpxmath@@scaleds*[csname npxmath@scaledendcsname]%
fi
DeclareFontFamilyLMSnpxsyprovidecommand setSYdimenssetSYdimensskewchar font =120
DeclareFontShapeLMSnpxsymn%
<-> npxmath@@scaled zplsy
%
fontdimen 8font=0.8fontdimen6font % was 0.677 of a quad
fontdimen11font=0.8fontdimen6font % was 0.686 of a quad

makeatother

usepackagemathtools% for clap
newcommand*drawbaseline%
claprule80pt0.4pt%


begindocument
[
begingathered
x,ydrawbaseline,z\
fracpartial xpartial t fracpartial ydrawbaselinepartial t fracpartial z_jpartial t fracpartial z_j_jpartial t\
fracpartial xpartial t fracpartial ypartial t fracpartial z_jpartial t fracpartial z_j_jpartial t\
endgathered
]
enddocument


Modifying font dimensions gives the most consistent look for all your fractions, but this requires your own aesthetic judgement.



Here, I changed the numerator raising dimension from 0.677 to 0.8 to give more room for long descender. I also changed the denominator dropping dimension from 0.686 to 0.8 for more even spacing both above and below the fraction bar.






share|improve this answer
















Newer and simpler solution



Since v1.401 of newpxmath (released on October 2, 2019, now available in both MiKTeX and TeX Live), the package offers a new option fracspacing that “modifies fontdimens 8 and 11 of the symbol font to values more appropriate to the newpx fonts”.



documentclassarticle

% New package option since 2019/10/02 update
usepackage[fracspacing]newpxmath[2019/10/02]

usepackagemathtools% for clap
newcommand*drawbaseline%
claprule80pt0.4pt%


begindocument
[
begingathered
x,ydrawbaseline,z\
fracpartial xpartial t fracpartial ydrawbaselinepartial t fracpartial z_jpartial t fracpartial z_j_jpartial t\
fracpartial xpartial t fracpartial ypartial t fracpartial z_jpartial t fracpartial z_j_jpartial t\
endgathered
]
enddocument


The output looks very similar to the one in the old answer below. The parameters are refined from the very crude 0.8.




Old and depreciated answer



The design of Palatino contains long descenders. When a math font is based Palatino, the various math font dimensions should be chosen to avoid unevenness, as much as possible.



There are many font dimensions governing the positions of numerator and denominator in a fraction. We can change two of them in newpxmath which are the most relevant.



newpxmath-modified



documentclassarticle
usepackagenewpxmath

% Code modified from lmsnpxsy.fd
makeatletter
expandafterifxcsname npxmath@scaledendcsnamerelax
letnpxmath@@scaled@empty%
else
edefnpxmath@@scaleds*[csname npxmath@scaledendcsname]%
fi
DeclareFontFamilyLMSnpxsyprovidecommand setSYdimenssetSYdimensskewchar font =120
DeclareFontShapeLMSnpxsymn%
<-> npxmath@@scaled zplsy
%
fontdimen 8font=0.8fontdimen6font % was 0.677 of a quad
fontdimen11font=0.8fontdimen6font % was 0.686 of a quad

makeatother

usepackagemathtools% for clap
newcommand*drawbaseline%
claprule80pt0.4pt%


begindocument
[
begingathered
x,ydrawbaseline,z\
fracpartial xpartial t fracpartial ydrawbaselinepartial t fracpartial z_jpartial t fracpartial z_j_jpartial t\
fracpartial xpartial t fracpartial ypartial t fracpartial z_jpartial t fracpartial z_j_jpartial t\
endgathered
]
enddocument


Modifying font dimensions gives the most consistent look for all your fractions, but this requires your own aesthetic judgement.



Here, I changed the numerator raising dimension from 0.677 to 0.8 to give more room for long descender. I also changed the denominator dropping dimension from 0.686 to 0.8 for more even spacing both above and below the fraction bar.







share|improve this answer















share|improve this answer




share|improve this answer








edited Oct 6 at 5:33

























answered Sep 20 at 16:07









Ruixi ZhangRuixi Zhang

7,1257 silver badges27 bronze badges




7,1257 silver badges27 bronze badges















  • Thank you for this great answer. This is very useful to know - your description of the raising and dropping parameters is very helpful. I didn't know that these font parameters could be tweaked, so knowing about this approach will help if I run into similar problems with newpxmath too. Thanks again!

    – palatinouser1
    Sep 20 at 16:27






  • 1





    @palatinouser1 The above code could be simplified to defsetSYdimens... but this turns out revealing a hidden bug in newpxmath. If weren’t for your question I would not notice this bug: Changing dimensions in the symbol font also changes dimensions in the extensible font. I will send an email to the maintainer to report this bug.

    – Ruixi Zhang
    Sep 20 at 16:40












  • Very nice answer!

    – Oleg Lobachev
    Sep 20 at 19:43

















  • Thank you for this great answer. This is very useful to know - your description of the raising and dropping parameters is very helpful. I didn't know that these font parameters could be tweaked, so knowing about this approach will help if I run into similar problems with newpxmath too. Thanks again!

    – palatinouser1
    Sep 20 at 16:27






  • 1





    @palatinouser1 The above code could be simplified to defsetSYdimens... but this turns out revealing a hidden bug in newpxmath. If weren’t for your question I would not notice this bug: Changing dimensions in the symbol font also changes dimensions in the extensible font. I will send an email to the maintainer to report this bug.

    – Ruixi Zhang
    Sep 20 at 16:40












  • Very nice answer!

    – Oleg Lobachev
    Sep 20 at 19:43
















Thank you for this great answer. This is very useful to know - your description of the raising and dropping parameters is very helpful. I didn't know that these font parameters could be tweaked, so knowing about this approach will help if I run into similar problems with newpxmath too. Thanks again!

– palatinouser1
Sep 20 at 16:27





Thank you for this great answer. This is very useful to know - your description of the raising and dropping parameters is very helpful. I didn't know that these font parameters could be tweaked, so knowing about this approach will help if I run into similar problems with newpxmath too. Thanks again!

– palatinouser1
Sep 20 at 16:27




1




1





@palatinouser1 The above code could be simplified to defsetSYdimens... but this turns out revealing a hidden bug in newpxmath. If weren’t for your question I would not notice this bug: Changing dimensions in the symbol font also changes dimensions in the extensible font. I will send an email to the maintainer to report this bug.

– Ruixi Zhang
Sep 20 at 16:40






@palatinouser1 The above code could be simplified to defsetSYdimens... but this turns out revealing a hidden bug in newpxmath. If weren’t for your question I would not notice this bug: Changing dimensions in the symbol font also changes dimensions in the extensible font. I will send an email to the maintainer to report this bug.

– Ruixi Zhang
Sep 20 at 16:40














Very nice answer!

– Oleg Lobachev
Sep 20 at 19:43





Very nice answer!

– Oleg Lobachev
Sep 20 at 19:43


















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%2f509072%2fpalatino-font-newpxmath-misaligns-text-in-fraction-numerators%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

Distance measures on a map of a game The 2019 Stack Overflow Developer Survey Results Are Inmin distance in a graphShortest distance path on contour plotHow to plot a tilted map?Finding points outside of a diskDelaunay link distanceAnnulus from GeoDisks: drawing a ring on a mapNegative Correlation DistanceFind distance along a path (GPS coordinates)Finding position at given distance in a GeoPathMathematics behind distance estimation using camera

How to get a smooth, uniform ParametricPlot of a 2D Region?How to plot a complicated Region?How to exclude a region from ParametricPlotHow discretize a region placing vertices on a specific non-uniform gridHow to transform a Plot or a ParametricPlot into a RegionHow can I get a smooth plot of a bounded region?Smooth ParametricPlot3D with RegionFunction?Smooth border of a region ParametricPlotSmooth region boundarySmooth region plot from list of pointsGet minimum y of a certain x in a region

Genealogie vun de Merowenger Vum Merowech bis zum Chilperich I. | Navigatiounsmenü