4

I'm not sure if I've happened on a bug or am merely misunderstanding how some font commands in latex ought to behave. The following is a heavily minimized example that produces a bolded "tt" while I would expect it to be a teletyped "tt":

\documentclass{beamer}
\usepackage{newpxmath}

\begin{document}
$\mathit{}\mathsf{}\mathtt{tt}\text{}\mathbf{}$
\end{document}

No errors or warnings are reported during compilation. One can commute mathit and mathsf (but removing either or removing text or mathbf causes the bolding to vanish). I cannot reproduce this after switching the document class to article nor after removing newpxmath.

Is there a comprehensible explanation for this behavior? Is it a bug (and if so, where should it be reported)?

(Experiments conducted with pdfTeX 3.141592653-2.6-1.40.24 (TeX Live 2022) and kpathsea version 6.3.4 on an Ubuntu machine.)

2
  • Looking in the log file, one can see a lot of warnings for LaTeX Font Info: Font shape OT1/cmss/b/n in size <6.1> not available (Font) Font shape OT1/cmss/bx/n tried instead on input line 7.. The font combinations you want to use are not available so some other shapes are used. At the end of chain, the result happens to be bold. Commented Jan 6 at 14:41
  • 1
    @samcarter_is_at_topanswers.xyz I see, I can understand how the font shapes aren't available, but it still surprises me that removing commands that I would expect to be irrelevant (such as the \text{} after the \mathtt{tt}) impacts the results. Commented Jan 6 at 14:43

1 Answer 1

5

You can reproduce this without beamer

\documentclass{article}
\DeclareSymbolFont{symbolsa}     {OMS}{cmsy}{m}{n}
\DeclareSymbolFont{symbolsb}     {OMS}{cmsy}{m}{n}
\DeclareSymbolFont{symbolsc}     {OMS}{cmsy}{m}{n}
\DeclareSymbolFont{symbolsd}     {OMS}{cmsy}{m}{n}

\usepackage{newpxmath}

%\setcounter{localmathalphabets}{0}
\begin{document}
$\mathit{}\mathsf{}\mathtt{tt}\text{}\mathbf{}$
\end{document}

disabling the local math alphabets feature by uncommenting the \setcounter avoids the issue.

This indicates the problem is in the base latex format code, related to but not identical to

https://github.com/latex3/latex2e/issues/1101

You must log in to answer this question.

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