# How to change the font of math operators, e.g. plus and minus

I use the Linux Libertine font together with the newtxmath package to get matching math. I discovered though that math operators, e.g. minus and plus and others, are not taken from Linux Libertine. How could this be achieved, meaning that all relevant glyphs of Linux Libertine (e.g. minus and plus signs, plusminus, etc.) would be used in math?

I have a partly working example taken from How to redefine the “plus” symbol?, but I can't place the relevant code block multiple times with a different symbol each time, this would lead to errors (many Missing $inserted$+ and finally TeX capacity exceeded, sorry [grouping levels=255] $+). The MWE has the second code block commented out so it compiles. How to expand the given solution for more symbols or how to do this with a different approach, with pdftex? \documentclass{standalone} \usepackage{libertine} \usepackage[libertine]{newtxmath} \usepackage{textcomp} \begingroup \catcode-=\active \gdef-{\mathbin{\text{\textminus}}} \endgroup \AtBeginDocument{\mathcode-="8000 } %\begingroup %\catcode+=\active %\gdef+{\mathbin{\text{+}}} %\endgroup %\AtBeginDocument{\mathcode+="8000 } \begin{document}$+-\pm$+\textminus\textpm \end{document}  ## 1 Answer I don't see why it should be needed to make the chars math active. \documentclass{standalone} \usepackage{libertine} \usepackage[libertine]{newtxmath} \usepackage{textcomp} \DeclareSymbolFont{operatorsB}{TS1}{\rmdefaultB}{m}{n} \DeclareMathSymbol{+}{\mathbin}{operators}{43} \DeclareMathSymbol{-}{\mathbin}{operatorsB}{61} \DeclareMathSymbol{\pm}{\mathbin}{operatorsB}{177} \begin{document}$+-\pm\$ +\textminus\textpm
\end{document}


• How to find the slot numbers for other operator symbols? Ideally I want to remap all possible symbols to show up in Linux Libertine. – lblb Apr 2 '17 at 21:22
• You will have to look at the various font tables, or T1enc,def and ts1enc.def. But if you want everything in libertine, consider the liberinus font: ctan.org/pkg/libertinus. – Ulrike Fischer Apr 2 '17 at 21:33
• there's no context to make this more obvious, but it looks like the \pm is set on the baseline rather than aligned around the math axis. that means the p[lus probably is too. if so, that isn't really good style for heavy math. – barbara beeton Apr 2 '17 at 23:21
• @barbara beeton: Your concern is valid, but the Linux Libertine glyphs seem to be aligned with the equals sign and fraction bar, so it looks right. – lblb Apr 3 '17 at 7:15
• Why does the - and pmrequire the new font operatorsB whereas the + uses just operators? – lblb Apr 3 '17 at 17:14