# itemize under sf produce a font warning

It seems that textbullet has no sf version. When itemize is in a \sf environment, I receive the following warning:

LaTeX Font Warning: Font shape OMS/cmss/m/n' undefined
(Font)              for symbol textbullet' on input line 14.


Here is a minimalist example:

\documentclass{article}
\begin{document}
{\sf
\begin{itemize}
\item Test
\end{itemize}
}
\end{document}


In particular, I was interested on doing this when the package txfonts is loaded, but I receive a similar warning:

LaTeX Font Warning: Font shape OMS/txss/m/n' undefined
(Font)              using OMS/txsy/m/n' instead
(Font)              for symbol textbullet' on input line 14.


I have noticed that by uploading the textcomp package (before txfonts in the second example), I get rid of the warning.

Can somebody identify what lines in that package avoid the warning? In that case, I could just put the needed lines in my file, without uploading the full package. I guess that this package defines the missing font, but I do not know how to find the specific line that I need.

-

The warnings are telling you the bullet is coming from the math fonts, but since you know that but don't want to be warned, perhaps the easiest thing to do is

\renewcommand\textbullet{\ensuremath{\bullet}}


Then it will explicitly use math and not feel the need to warn you. Even simpler of course would be to ignore the warnings.

\documentclass{article}
\renewcommand\textbullet{\ensuremath{\bullet}}
\begin{document}
{\sf
\begin{itemize}
\item Test
\end{itemize}
}
\end{document}

-
Thanks, but it does not work. I still receive the warning. –  Alejandro DC Jan 23 '14 at 15:35
@AlejandroDíaz-Caro you must not have added it to the correct place, it is impossible for that definition to generate that warning, see the MWE I just added to my answer. –  David Carlisle Jan 23 '14 at 16:21
You are right! It seems that if I load hyperref, then your renewcommand has to be placed after it. –  Alejandro DC Jan 23 '14 at 16:36
@AlejandroDíaz-Caro: \textbullet is a command that is defined via NFSS2. hyperref uses NFSS2 to redefine the symbol for the bookmark encodings. Using \renewcommand puts the symbol out of the NFSS2 system and hyperref does not expect that a standard symbol is changed that way. Thus a better way is the redefinition via NFSS2: \DeclareTextCommandDefault{\textbullet}{\ensuremath{\bullet}} –  Heiko Oberdiek Jan 23 '14 at 18:09
Great! Thank you. –  Alejandro DC Jan 24 '14 at 6:55

The text fonts don't have a bullet character, so \textbullet is obtained with a font substitution: instead of OT1/<family>/m/n/, TeX looks for OMS/<family>/m/n and, if it doesn't find it, it changes <family> into the standard math symbol font family. Since it appears you're using Latin Modern, the process is

OT1/lmss/m/n
OMS/lmss/m/n
OMS/lmsy/m/n


because there's no OMS/lmss font defined and <family> refers to the current font family, which in your case is the one corresponding to sans serif. The same will happen with all font families that haven't a math symbol font for the sans serif family.

Note that the font substitution is performed also with the Roman font family; in the case of Computer Modern, the substitution is silent; other font families may not have defined this font substitution as silent.

There's no way to get rid of the warning, except loading textcomp. In that case \textbullet is redefined to point to a character in the TS1 encoded font

TS1/lmss/m/n


which exists and so no warning is produced.

A couple of notes. First, using txfonts is not recommended; better doing

\usepackage{newtxtext,newtxmath}


Second, \sf is an obsolete command; use \sffamily, instead.

-
Thanks for the explanation. I use txfonts and \sf only because this is a form that I am filling up, so I cannot modify it. I was looking at the minimum modification just to get rid of this annoying warning, but I see now that it is not possible. –  Alejandro DC Jan 23 '14 at 15:31