我想删除编译此 MWE 时收到的警告:
\documentclass{article}
\renewcommand*\familydefault{\sfdefault}
\begin{document}
ab\textcopyright{}de % issues warning
ab\textcircled{c}de % same warning
ab\textrm{\textcopyright}de % looks ugly
%ab\textsym{\textcopyright}de % does not compile
\end{document}
警告是
LaTeX Font Warning: Font shape `OMS/cmss/m/n' undefined
(Font) using `OMS/cmsy/m/n' instead on input line 4.
我同意 latex 进行这种替换,但如果可能的话,我想通过主动更改符号的字体来消除警告\textcopyright
。我知道诸如 之类的命令\textrm
,但我还没有找到从“ss”更改为“sy”的命令。我也知道这个silence
包,但我想“正确地”做。
附加问题:我想使用 lmodern 包,然后警告是:
LaTeX Font Warning: Font shape `OMS/lmss/m/n' undefined
(Font) using `OMS/cmsy/m/n' instead on input line 5.
答案1
使用
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{textcomp}
\begin{document}
\sffamily\Huge
ab\textcopyright{}de\par
ab\textcircled{c}de \par
ab\textrm{\textcopyright}de\par
\fontfamily{qhv}\selectfont%% Helvetica
ab\textcopyright{}de\par
ab\textcircled{c}de \par
ab\textrm{\textcopyright}de
\end{document}