
當我在同一個文件中使用tipa
和時lmodern
,我總是會收到幾個字體替換警告。不過,該文件看起來不錯。有沒有辦法解決?
最小的例子:
\documentclass{article}
\usepackage{lmodern}
\usepackage[]{tipa}
\begin{document}
\textesh
\end{document}
pdflatex 輸出:
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.
編輯: 看過濾lmodern和tipa組合引起的字體替換警告如果當您嘗試 Seamus 的解決方案時乳膠崩潰。
答案1
答案2
這些警告是無害的,並且替換會自動發生。如果您想擺脫警告,您可以重新定義命令\textipa
和IPA
環境以始終使用 Computer Modern,如下例所示。如果您稍後決定將其更改為使用 eg,mathptmx
那麼您將需要更改 的定義以\tiparmdefault
使用ptm
而不是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}
請注意,在您的範例中,您使用了 IPA 定義的字符,但沒有將其包含在\textipa
環境中IPA
。即使使用此解決方案,這樣做仍然會引起警告。
答案3
您可以安全地忽略它。
拉丁現代字體沒有T3
編碼支援。由於 Latin Modern 系列來自 Computer Modern 字體,因此在T3
編碼中將 LM 字體與 CM IPA 字體結合可以很好地工作。