1

How to change the font of math operators led to me wanting to find the slot numbers needed to redefine all possible math operator symbols. MWE:

\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}

\usepackage{fonttable}

\begin{document}
x$=+-\pm$ +\textminus\textpm

%\fonttable{LinuxLibertineT-TLF}
%\xfonttable{TS1}{\rmdefaultB}{m}{n}
%\xfonttable{TS1}{LinuxLibertineT-TLF}{m}{n}
\end{document}

In the comments, T1enc.def and ts1enc.def files were proposed for this, but looking in the files wasn't helpful for me.

The other often found suggestion is using fonttable package. Activating any of the three fonttable commands in my MWE gives a slew of erros, even though I just used the settings from above or the working font specifiers for my microtype settings ({TS1}{LinuxLibertineT-TLF}{m}{n}).

Also suggested reading material was the fntguide, but I couldn't find the tables I need nor individual slot numbers (= for example ...).

So, how to find all possible math slot numbers of Linux Libertine (or any other font of a package) to work with them?

lblb
  • 3,454

2 Answers2

2

The main problem is with standalone, use article.

\documentclass{article}

\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}

\usepackage{fonttable}

\begin{document}

x$=+-\pm$ +\textminus\textpm

\xfonttable{TS1}{\familydefault}{m}{n}

\end{document}

enter image description here

egreg
  • 1,121,712
  • Could you please expand your answer with the font tables that show plus, minus, equals sign and others? Looking at the slot numbers in my MWE I can't find them in that one font table and \pm is at the "wrong" place (261 instead of 177). My question is mainly about how to find "all" slot numbers of a given font, as this is a problem I face often. – lblb Apr 03 '17 at 17:22
  • 2
    It is at 177, 261 is the octal representation. The decimal representation is in the cell itself and is 177. – egreg Apr 03 '17 at 17:25
  • I can handle converting the numbers, but where are the other symbols? This was the core of my question, I want to get all slot numbers of the common mathematical operator symbols. – lblb Apr 03 '17 at 17:30
  • 1
    @lblb There aren't. That's why most are substituted with newtxmath symbols. – egreg Apr 03 '17 at 17:30
  • Thanks for all the help. Last question: LinLibertine still has the equals sign = that is not found in the table, what slot number / command is needed to use it? – lblb Apr 03 '17 at 17:36
  • 1
    @lblb That's in the normal text font, encoding T1 or OT1. I think you can use the operators symbol font. – egreg Apr 03 '17 at 17:36
  • 1
    @lblb \DeclareMathSymbol{=}{\mathrel}{operators}{`=} – egreg Apr 03 '17 at 17:41
1

I think the reason you get error messages is that you're not correctly specifying the font file you want to peak into.

\documentclass{article}
\usepackage{fonttable}

\begin{document}
\fonttable{LinLibertineT-lf-ts1}
\end{document}

enter image description here

Sverre
  • 20,729