3

I would like to ask how to reduce the width of the top horizontal line in the \sqrt command. I noticed that the top horizontal line of the square root symbol differs in width between the STIX font and the default CM font. When I replaced the square root symbol in the stix-mathex.pfb font with the one from cmex10.pfb, the result showed a noticeable discrepancy in line thickness.

I also tried modifying the default line thickness in the stix-mathex.tfm file to match that of cmex10.tfm, but this adjustment only improved the line thickness for the \overline and \frac commands, leaving the \sqrt command unaffected. How can I achieve the desired result?

The MWE:

\documentclass{article}

\usepackage{stix}
\usepackage{bm}
\usepackage{amsmath}

\thispagestyle{empty}
%\setbox0=\hbox{$$}
%\fontdimen8\textfont3=0.5pt 

\begin{document}

\[ \sqrt{\sum_{\sum_1^2}^{\gamma}}\]

\end{document}

enter image description here

New contributor
tsiayi is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
15
  • 2
    the width is set by the font (it is the height of the sqrtsign, all the rest of the symbol is in the depth) so you should not get the output you show, please show the input you used. Commented 10 hours ago
  • 1
    as you see you need to put code blocks in the question they do not work in comments. As I say you need to make the height of the character be the thickness of the top rule, but modifying a pfb font directly (and making the tfm still match) is not really on topic (and I wouldn't know how to do it) Commented 9 hours ago
  • 1
    why modify the pfb this seems a tricky thing to get right and makes your document completely non-portable, you could simply use the square root from cmex if that's what you want. Commented 9 hours ago
  • 1
    Today, we have Unicode fonts (for example STIXMath-Regular.otf) so we are using 8bit fonts only if we want to do an exploration of computers history. I recommend: use only Unicode fonts today, forget about the existence of 8bit fonts. On the other hand, if you want to explore the TeX and computer history, you can dive to ancient pfb and tfm formats of fonts. Your mistake is that you changed glyph in pfb but didn't change relevant metric in the tfm. The rule width is given by the height of the character saved in the tfm file. The ancient tftopl and pltotf programs enables you to edit tfm files.
    – wipet
    Commented 8 hours ago
  • 1
    the pdffonts output looks like just standard fonts, the BEJJDN.. prefix are just a prefix added while font subsetting, there is no need to modify any fonts Commented 8 hours ago

1 Answer 1

3

This is a consequence of the resource saving strategies used by Knuth.

There is no fontdimen that deal with the thickness of the vinculum, because the radical will need to be vertically adjusted anyway, so Knuth saved some memory space by making the radical character to mostly hang below the baseline; the character's height is what's used for the thickness of the vinculum.

Let's do some comparison. For Computer Modern, the radical is at slot 0x70 in either the symbol font (family 2) or the large symbols font (family 3).

We can easily ask TeX to show the heights:

\showthe\fontcharht\textfont2"70
\showthe\fontcharht\textfont3"70
\bye

(compile with pdftex) to get, in both cases, 0.39998pt (which is the same as 0.4pt).

For STIX Two it's a bit more complicated. In stix2.sty we find

\DeclareSymbolFont{largesymbols}  {LS2}{stix2ex}   {m} {n}
[...]
\stix@MathRadical{\sqrtsign}    {largesymbols}{"F9}{largesymbols}{"74}

Let's find what's in LS2stix2ex.fd:

\DeclareFontShape{LS2}{stix2ex}{m}{n} {<-> stix2-mathex}{}

so we can repeat the test above by selecting the TFM file

\font\test=stix2-mathex

\showthe\fontcharht\test"F9
\showthe\fontcharht\test"74

\bye

to get, in both cases, 0.68pt.

Replacing the characters in stix-mathex.pfb with the characters in cmsy10.pfb and cmex10.pfb (you need both and there are several radicals in cmex10) isn't enough: you also need to modify the TFM file to have a height of 0.4pt instead of 0.68pt (and to ensure that the position of the glyph is correct).

You can see that the character is from cmex10.pfb, but the vinculum has the thickness advertised in the TFM file that you haven't changed.


\font\test=stix2-mathex

CM

\vrule height 0.05pt depth0.05pt width 15pt \kern-15pt
{\tenex\char"70}

\bigskip

STIX Two

\vrule height 0.05pt depth0.05pt width 15pt \kern-15pt
{\test\char"74}

\bye

The hairlines show the baseline:

hanging below!

If we do tftopl cmex10, we see the series of the large radicals starting from octal 160 (hexadecimal 70)

(CHARACTER O 160
   (CHARWD R 1.000003)
   (CHARHT R 0.039999)
   (CHARDP R 1.160013)
   (NEXTLARGER O 161)
   )
(CHARACTER O 161
   (CHARWD R 1.000003)
   (CHARHT R 0.039999)
   (CHARDP R 1.760019)
   (NEXTLARGER O 162)
   )
(CHARACTER O 162
   (CHARWD R 1.000003)
   (CHARHT R 0.039999)
   (CHARDP R 2.360025)
   (NEXTLARGER O 163)
   )
(CHARACTER O 163
   (CHARWD R 1.000003)
   (CHARHT R 0.039999)
   (CHARDP R 2.9600315)
   (NEXTLARGER O 164)
   )
(CHARACTER O 164
   (CHARWD R 1.055559)
   (CHARDP R 1.800018)
   (VARCHAR
      (TOP O 166)
      (BOT O 164)
      (REP O 165)
      )
   )
(CHARACTER O 165
   (CHARWD R 1.055559)
   (CHARDP R 0.600006)
   )
(CHARACTER O 166
   (CHARWD R 1.055559)
   (CHARHT R 0.039999)
   (CHARDP R 0.560007)
   )

where you see that all of them are assigned a height of 0.4pt (conversion from scaled point may differ in the last digit for TeX or TFtoPL). With stix2-mathex we need to start from character t (ASCII hex "74)

(CHARACTER C t
   (CHARWD R 1.041)
   (CHARHT R 0.068)
   (CHARDP R 1.811)
   (NEXTLARGER C u)
   )
(CHARACTER C u
   (CHARWD R 1.177)
   (CHARHT R 0.068)
   (CHARDP R 2.302)
   (NEXTLARGER C v)
   )
(CHARACTER C v
   (CHARWD R 1.17)
   (CHARHT R 0.068)
   (CHARDP R 2.823)
   (NEXTLARGER C w)
   )
(CHARACTER C w
   (CHARWD R 1.212)
   (CHARHT R 0.068)
   (CHARDP R 1.811)
   (NEXTLARGER C y)
   )
(CHARACTER C x
   (CHARWD R 1.212)
   (CHARHT R 0.45)
   )
(CHARACTER C y
   (CHARWD R 1.212)
   (CHARHT R 0.068)
   (CHARDP R 0.473)
   (VARCHAR
      (TOP C y)
      (BOT C w)
      (REP C x)
      )
   )

where you see the 0.68pt height.

4
  • Well, but this brings up another issue. When I convert the stix-mathex.tfm file to a PL file, the result is as follows: https://paste.ubuntu.com/p/p4CZVMPfwz/. Which parameter should I adjust? It is worth noting that I replaced the last part of the FONTDIMEN section at the beginning of the file with the content from cmex10.tfm: ``` (DEFAULTRULETHICKNESS R 0.039999) (BIGOPSPACING1 R 0.111112) (BIGOPSPACING2 R 0.166667) (BIGOPSPACING3 R 0.2) (BIGOPSPACING4 R 0.6) (BIGOPSPACING5 R 0.1) ```
    – tsiayi
    Commented 8 hours ago
  • @tsiayi It's not among the font dimensions. You need to look at the characters.
    – egreg
    Commented 7 hours ago
  • Thank you for your guidance, this issue has been resolved!
    – tsiayi
    Commented 7 hours ago
  • @tsiayi I suggest making a virtual font instead of replacing characters in the pfb file and changing the TFM file. Do texdoc vptovf for information and peruse the TUGboat index.
    – egreg
    Commented 7 hours ago

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .