# Combining lmodern and tipa

When I use tipa and lmodern in the same document, I always get a couple of font substitution warnings. The document looks fine, though. Is there any way around this?

Minimal example:

\documentclass{article}
\usepackage{lmodern}
\usepackage[]{tipa}
\begin{document}
\textesh
\end{document}

pdflatex output:

test.tex|| LaTeX Font Warning: Font shape T3/lmr/m/n' undefined

test.tex|| LaTeX Font Warning: Some font shapes were not available, defaults substituted.

EDIT: See Filtering font substitution warnings caused by the combination of lmodern and tipa if latex crashes when you try Seamus' solution.

-

## migrated from stackoverflow.comDec 4 '11 at 15:05

This question came from our site for professional and enthusiast programmers.

on a recent full MikTeX installation, which I presume is what you have from your other post I don't get any warnings or errors. –  Yiannis Lazarides Dec 4 '11 at 18:38

Leo Liu's answer says that you can safely ignore them. This answer is a complement to that answer. It tells you how to safely ignore them. (And it borrows heavily from Stefan Kottwitz's answer to an earlier question of mine)

You can use the silence package to turn off warnings from the appropriate package. So

\WarningFilter{latexfont}{Some font}
\WarningFilter{latexfont}{Font shape}

should turn off those warnings.

-
Unfortunately, I just tried this and it doesn't work. Very strange. I don't have time to work out why not just now… –  Seamus Dec 4 '11 at 16:00
Quoting from the silence manual: "In case of a LaTeX Font' message, the Name of the package is latexfont by convention." –  Erik Dec 4 '11 at 16:14
Didn't spot that. But the error is more fundamental: just the combination of the three packages fails to compile. –  Seamus Dec 4 '11 at 17:06
Yeah, I amended my question with the crash. (Should I ask a separate question for this?) –  Erik Dec 4 '11 at 17:49
@user1080125 Your first question was very clear and straightforward, and the kind of question that others might have. I think you should ask a new question about the interaction. That way my and Leo's answers to the original question will still be useful to others. –  Alan Munn Dec 4 '11 at 17:57

The warnings are harmless, and the substitutions will happen automatically. If you want to get rid of the warning you could redefine the \textipa command and the IPA environments to always use Computer Modern as shown in the example below. If you decide later to change to using e.g. mathptmx then you would need to change the definition of \tiparmdefault to use ptm instead of cmr.

\documentclass[12pt]{article}

\usepackage{lmodern}
\usepackage[T1]{tipa}
\newcommand\tiparmdefault{cmr} % needs to be ptm if using mathptmx
\renewcommand{\textipa}[1]{{\fontencoding{T3}\fontfamily{\tiparmdefault}\selectfont#1}}
\renewenvironment{IPA}{\fontencoding{T3}\fontfamily{\tiparmdefault}\selectfont}{}

\begin{document}

\textipa{\textesh HGTR}
\begin{IPA}
\textesh
\end{IPA}

Note that in your example, you used an IPA defined character without enclosing it in \textipa or an IPA environment. Even with this solution, doing that will still give rise to the warning.

-

You can ignore it safely.

Latin Modern fonts have no T3 encoding support. Since Latin Modern families come from Computer Modern fonts, it will works fine combining LM fonts with CM IPA fonts in T3 encoding.

-
Are there no cases where font substitution warnings are not harmless? –  Erik Dec 4 '11 at 18:20
@erik: Indeed there are some. You are supposed to read the warnings and understand it. For fonts warnings, you should know what the fonts are. When you change the font encodings which are not supported, you probably get some warnings and wrong result. For example, use XeLaTeX with fontspec and txfonts together, the font EU1/txr/m/n (Times) is missing, then changed to EU1/lmr/m/n (Latin Modern): it is wrong result, and you should use a OpenType/TrueType Times font with help of fontspec, or change the text font encoding to T1 sometimes. –  Leo Liu Dec 5 '11 at 2:15