Unicode-math: Which fontdimen’s are used for overline?












0














Background



In actuarial notation, one often writes something like



A ___   __
x:y : n|


Luckily, the actuarialangle package provides the command angl{<duration>} to typeset the “angle” notation. This command is designed in such a way that the vertical space between the angle roof and the duration matches that of overline when used in first-level subscript.



% !TeX program = XeLaTeX
documentclass{article}
%usepackage{newpxtext}
%usepackage{newpxmath}
%usepackage{newtxtext}
%usepackage{newtxmath}
usepackage{actuarialangle}
newcommand*test{%
& $displaystyle overline{30},angl{30}$
& $textstyle overline{30},angl{30}$
& $scriptstyle overline{30},angl{30}$
& $scriptscriptstyleoverline{30},angl{30}$%
}
pagestyle{empty}
begin{document}
begin{tabular}{l l l l l}
$mathrm{Computer Modern}$ test \
$mathrm{newpxmath}$ test \
$mathrm{newtxmath}$ test \
end{tabular}
end{document}


background





Problem with unicode-math



With OpenType math fonts via unicode-math, I was aware of the fact that some legacy fontdimen’s, e.g., fontdimen8scriptfont3 (used by angl), were inappropriate. See Problem with substack and substack doesn’t work properly.



My attempt of re-implementing angl is thus to replace 3fontdimen8scriptfont3 with fontdimen53 (overbar_vgap) and to replace the fixed rule thickness of 0.4pt with fontdimen54 (overbar_rule). I was quite happy that my guess work turned out well for Latin Modern Math. But then I tried other fonts and my guess failed miserably:



% !TeX program = XeLaTeX
documentclass{article}
usepackage{unicode-math}
setmathfont{Latin Modern Math}[version=LM]
setmathfont{TeX Gyre Bonum Math}[version=Bonum]
setmathfont{TeX Gyre Pagella Math}[version=Pagella]
setmathfont{TeX Gyre Schola Math}[version=Schola]
setmathfont{TeX Gyre Termes Math}[version=Termes]
setmathfont{Fira Math}[version=Fira]
usepackage{actuarialangle}
makeatletter
ExplSyntaxOn
% The following fix is included but yet to be released, as of 2019/01/03
cs_set:Nn __um_fontdimen_to_percent:nN
{
fp_eval:n { dim_to_decimal:n { 65536 fontdimen #1 #2 } / 100 }
}
% Re-implementing the ``correct'' font dimensions
defacta@angle#1#2{%
mathord{%
mkern1mu%
vbox{hrule height __um_overbar_rule:N #1 hbox{ % <- seems right
vbox{%
kern dim_eval:n { __um_overbar_vgap:N #1 } % <- something missing?
hbox{$m@th#1#2$}}%
setboxz@hbox{$#1mathstrut$}%
vrule width __um_overbar_rule:N #1 depthdpz@}}% <- seems right
mkern1mu}}
ExplSyntaxOff
makeatother
newcommand*test[2]{% #1: font name, #2 mathversion
mathversion{#2}$mathup{#1}$
& mathversion{#2}$displaystyle overline{30},angl{30}$
& mathversion{#2}$textstyle overline{30},angl{30}$
& mathversion{#2}$scriptstyle overline{30},angl{30}$
& mathversion{#2}$scriptscriptstyleoverline{30},angl{30}$%
}
pagestyle{empty}
begin{document}
begin{tabular}{l l l l l}
test{Latin Modern Math}{LM} \
test{TG Bonum Math}{Bonum} \
test{TG Pagella Math}{Pagella} \
test{TG Schola Math}{Schola} \
test{TG Termes Math}{Termes} \
test{Fira Math}{Fira} \
end{tabular}
end{document}


attempt



Disclaimer: I have used private macros __um_..., which is considered as bad practice. Please try not to copy and paste the above “fix” unless you know what you are doing.





Questions



Which are the correct fontdimen’s, and how can I use them?










share|improve this question



























    0














    Background



    In actuarial notation, one often writes something like



    A ___   __
    x:y : n|


    Luckily, the actuarialangle package provides the command angl{<duration>} to typeset the “angle” notation. This command is designed in such a way that the vertical space between the angle roof and the duration matches that of overline when used in first-level subscript.



    % !TeX program = XeLaTeX
    documentclass{article}
    %usepackage{newpxtext}
    %usepackage{newpxmath}
    %usepackage{newtxtext}
    %usepackage{newtxmath}
    usepackage{actuarialangle}
    newcommand*test{%
    & $displaystyle overline{30},angl{30}$
    & $textstyle overline{30},angl{30}$
    & $scriptstyle overline{30},angl{30}$
    & $scriptscriptstyleoverline{30},angl{30}$%
    }
    pagestyle{empty}
    begin{document}
    begin{tabular}{l l l l l}
    $mathrm{Computer Modern}$ test \
    $mathrm{newpxmath}$ test \
    $mathrm{newtxmath}$ test \
    end{tabular}
    end{document}


    background





    Problem with unicode-math



    With OpenType math fonts via unicode-math, I was aware of the fact that some legacy fontdimen’s, e.g., fontdimen8scriptfont3 (used by angl), were inappropriate. See Problem with substack and substack doesn’t work properly.



    My attempt of re-implementing angl is thus to replace 3fontdimen8scriptfont3 with fontdimen53 (overbar_vgap) and to replace the fixed rule thickness of 0.4pt with fontdimen54 (overbar_rule). I was quite happy that my guess work turned out well for Latin Modern Math. But then I tried other fonts and my guess failed miserably:



    % !TeX program = XeLaTeX
    documentclass{article}
    usepackage{unicode-math}
    setmathfont{Latin Modern Math}[version=LM]
    setmathfont{TeX Gyre Bonum Math}[version=Bonum]
    setmathfont{TeX Gyre Pagella Math}[version=Pagella]
    setmathfont{TeX Gyre Schola Math}[version=Schola]
    setmathfont{TeX Gyre Termes Math}[version=Termes]
    setmathfont{Fira Math}[version=Fira]
    usepackage{actuarialangle}
    makeatletter
    ExplSyntaxOn
    % The following fix is included but yet to be released, as of 2019/01/03
    cs_set:Nn __um_fontdimen_to_percent:nN
    {
    fp_eval:n { dim_to_decimal:n { 65536 fontdimen #1 #2 } / 100 }
    }
    % Re-implementing the ``correct'' font dimensions
    defacta@angle#1#2{%
    mathord{%
    mkern1mu%
    vbox{hrule height __um_overbar_rule:N #1 hbox{ % <- seems right
    vbox{%
    kern dim_eval:n { __um_overbar_vgap:N #1 } % <- something missing?
    hbox{$m@th#1#2$}}%
    setboxz@hbox{$#1mathstrut$}%
    vrule width __um_overbar_rule:N #1 depthdpz@}}% <- seems right
    mkern1mu}}
    ExplSyntaxOff
    makeatother
    newcommand*test[2]{% #1: font name, #2 mathversion
    mathversion{#2}$mathup{#1}$
    & mathversion{#2}$displaystyle overline{30},angl{30}$
    & mathversion{#2}$textstyle overline{30},angl{30}$
    & mathversion{#2}$scriptstyle overline{30},angl{30}$
    & mathversion{#2}$scriptscriptstyleoverline{30},angl{30}$%
    }
    pagestyle{empty}
    begin{document}
    begin{tabular}{l l l l l}
    test{Latin Modern Math}{LM} \
    test{TG Bonum Math}{Bonum} \
    test{TG Pagella Math}{Pagella} \
    test{TG Schola Math}{Schola} \
    test{TG Termes Math}{Termes} \
    test{Fira Math}{Fira} \
    end{tabular}
    end{document}


    attempt



    Disclaimer: I have used private macros __um_..., which is considered as bad practice. Please try not to copy and paste the above “fix” unless you know what you are doing.





    Questions



    Which are the correct fontdimen’s, and how can I use them?










    share|improve this question

























      0












      0








      0


      1





      Background



      In actuarial notation, one often writes something like



      A ___   __
      x:y : n|


      Luckily, the actuarialangle package provides the command angl{<duration>} to typeset the “angle” notation. This command is designed in such a way that the vertical space between the angle roof and the duration matches that of overline when used in first-level subscript.



      % !TeX program = XeLaTeX
      documentclass{article}
      %usepackage{newpxtext}
      %usepackage{newpxmath}
      %usepackage{newtxtext}
      %usepackage{newtxmath}
      usepackage{actuarialangle}
      newcommand*test{%
      & $displaystyle overline{30},angl{30}$
      & $textstyle overline{30},angl{30}$
      & $scriptstyle overline{30},angl{30}$
      & $scriptscriptstyleoverline{30},angl{30}$%
      }
      pagestyle{empty}
      begin{document}
      begin{tabular}{l l l l l}
      $mathrm{Computer Modern}$ test \
      $mathrm{newpxmath}$ test \
      $mathrm{newtxmath}$ test \
      end{tabular}
      end{document}


      background





      Problem with unicode-math



      With OpenType math fonts via unicode-math, I was aware of the fact that some legacy fontdimen’s, e.g., fontdimen8scriptfont3 (used by angl), were inappropriate. See Problem with substack and substack doesn’t work properly.



      My attempt of re-implementing angl is thus to replace 3fontdimen8scriptfont3 with fontdimen53 (overbar_vgap) and to replace the fixed rule thickness of 0.4pt with fontdimen54 (overbar_rule). I was quite happy that my guess work turned out well for Latin Modern Math. But then I tried other fonts and my guess failed miserably:



      % !TeX program = XeLaTeX
      documentclass{article}
      usepackage{unicode-math}
      setmathfont{Latin Modern Math}[version=LM]
      setmathfont{TeX Gyre Bonum Math}[version=Bonum]
      setmathfont{TeX Gyre Pagella Math}[version=Pagella]
      setmathfont{TeX Gyre Schola Math}[version=Schola]
      setmathfont{TeX Gyre Termes Math}[version=Termes]
      setmathfont{Fira Math}[version=Fira]
      usepackage{actuarialangle}
      makeatletter
      ExplSyntaxOn
      % The following fix is included but yet to be released, as of 2019/01/03
      cs_set:Nn __um_fontdimen_to_percent:nN
      {
      fp_eval:n { dim_to_decimal:n { 65536 fontdimen #1 #2 } / 100 }
      }
      % Re-implementing the ``correct'' font dimensions
      defacta@angle#1#2{%
      mathord{%
      mkern1mu%
      vbox{hrule height __um_overbar_rule:N #1 hbox{ % <- seems right
      vbox{%
      kern dim_eval:n { __um_overbar_vgap:N #1 } % <- something missing?
      hbox{$m@th#1#2$}}%
      setboxz@hbox{$#1mathstrut$}%
      vrule width __um_overbar_rule:N #1 depthdpz@}}% <- seems right
      mkern1mu}}
      ExplSyntaxOff
      makeatother
      newcommand*test[2]{% #1: font name, #2 mathversion
      mathversion{#2}$mathup{#1}$
      & mathversion{#2}$displaystyle overline{30},angl{30}$
      & mathversion{#2}$textstyle overline{30},angl{30}$
      & mathversion{#2}$scriptstyle overline{30},angl{30}$
      & mathversion{#2}$scriptscriptstyleoverline{30},angl{30}$%
      }
      pagestyle{empty}
      begin{document}
      begin{tabular}{l l l l l}
      test{Latin Modern Math}{LM} \
      test{TG Bonum Math}{Bonum} \
      test{TG Pagella Math}{Pagella} \
      test{TG Schola Math}{Schola} \
      test{TG Termes Math}{Termes} \
      test{Fira Math}{Fira} \
      end{tabular}
      end{document}


      attempt



      Disclaimer: I have used private macros __um_..., which is considered as bad practice. Please try not to copy and paste the above “fix” unless you know what you are doing.





      Questions



      Which are the correct fontdimen’s, and how can I use them?










      share|improve this question













      Background



      In actuarial notation, one often writes something like



      A ___   __
      x:y : n|


      Luckily, the actuarialangle package provides the command angl{<duration>} to typeset the “angle” notation. This command is designed in such a way that the vertical space between the angle roof and the duration matches that of overline when used in first-level subscript.



      % !TeX program = XeLaTeX
      documentclass{article}
      %usepackage{newpxtext}
      %usepackage{newpxmath}
      %usepackage{newtxtext}
      %usepackage{newtxmath}
      usepackage{actuarialangle}
      newcommand*test{%
      & $displaystyle overline{30},angl{30}$
      & $textstyle overline{30},angl{30}$
      & $scriptstyle overline{30},angl{30}$
      & $scriptscriptstyleoverline{30},angl{30}$%
      }
      pagestyle{empty}
      begin{document}
      begin{tabular}{l l l l l}
      $mathrm{Computer Modern}$ test \
      $mathrm{newpxmath}$ test \
      $mathrm{newtxmath}$ test \
      end{tabular}
      end{document}


      background





      Problem with unicode-math



      With OpenType math fonts via unicode-math, I was aware of the fact that some legacy fontdimen’s, e.g., fontdimen8scriptfont3 (used by angl), were inappropriate. See Problem with substack and substack doesn’t work properly.



      My attempt of re-implementing angl is thus to replace 3fontdimen8scriptfont3 with fontdimen53 (overbar_vgap) and to replace the fixed rule thickness of 0.4pt with fontdimen54 (overbar_rule). I was quite happy that my guess work turned out well for Latin Modern Math. But then I tried other fonts and my guess failed miserably:



      % !TeX program = XeLaTeX
      documentclass{article}
      usepackage{unicode-math}
      setmathfont{Latin Modern Math}[version=LM]
      setmathfont{TeX Gyre Bonum Math}[version=Bonum]
      setmathfont{TeX Gyre Pagella Math}[version=Pagella]
      setmathfont{TeX Gyre Schola Math}[version=Schola]
      setmathfont{TeX Gyre Termes Math}[version=Termes]
      setmathfont{Fira Math}[version=Fira]
      usepackage{actuarialangle}
      makeatletter
      ExplSyntaxOn
      % The following fix is included but yet to be released, as of 2019/01/03
      cs_set:Nn __um_fontdimen_to_percent:nN
      {
      fp_eval:n { dim_to_decimal:n { 65536 fontdimen #1 #2 } / 100 }
      }
      % Re-implementing the ``correct'' font dimensions
      defacta@angle#1#2{%
      mathord{%
      mkern1mu%
      vbox{hrule height __um_overbar_rule:N #1 hbox{ % <- seems right
      vbox{%
      kern dim_eval:n { __um_overbar_vgap:N #1 } % <- something missing?
      hbox{$m@th#1#2$}}%
      setboxz@hbox{$#1mathstrut$}%
      vrule width __um_overbar_rule:N #1 depthdpz@}}% <- seems right
      mkern1mu}}
      ExplSyntaxOff
      makeatother
      newcommand*test[2]{% #1: font name, #2 mathversion
      mathversion{#2}$mathup{#1}$
      & mathversion{#2}$displaystyle overline{30},angl{30}$
      & mathversion{#2}$textstyle overline{30},angl{30}$
      & mathversion{#2}$scriptstyle overline{30},angl{30}$
      & mathversion{#2}$scriptscriptstyleoverline{30},angl{30}$%
      }
      pagestyle{empty}
      begin{document}
      begin{tabular}{l l l l l}
      test{Latin Modern Math}{LM} \
      test{TG Bonum Math}{Bonum} \
      test{TG Pagella Math}{Pagella} \
      test{TG Schola Math}{Schola} \
      test{TG Termes Math}{Termes} \
      test{Fira Math}{Fira} \
      end{tabular}
      end{document}


      attempt



      Disclaimer: I have used private macros __um_..., which is considered as bad practice. Please try not to copy and paste the above “fix” unless you know what you are doing.





      Questions



      Which are the correct fontdimen’s, and how can I use them?







      fonts unicode-math opentype






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 10 mins ago









      Ruixi Zhang

      5,113320




      5,113320






















          0






          active

          oldest

          votes











          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%2f468496%2funicode-math-which-fontdimen-s-are-used-for-overline%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          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.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • 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%2f468496%2funicode-math-which-fontdimen-s-are-used-for-overline%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

          Entries order in /etc/network/interfaces

          新発田市

          Grub takes very long (several minutes) to open Menu (in Multi-Boot-System)