我想使用一些符号,marvosym
但它们似乎在我的发行版中不起作用。
\documentclass{article}
\usepackage[english]{babel}
\usepackage{marvosym}
\begin{document}
$\Bat$
$\Bicycle$
$\Coffeecup$
$\Frowny$
$\Heart$
$\Industry$
$\Football$
$\Mobilefone$
$\Smiley$
$\Womanface$
$\Gentsroom$
$\Ladiesroom$
$\Taurus$
$\Sagittarius$
$\WomanFace$
$\ManFace$
$\Yingyang$
\end{document}
我得到如下 PDF 输出:
日志重点:
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9 64-bit) (preloaded format=pdflatex 2013.12.5)
...
("C:\Program Files\MiKTeX 2.9\tex\latex\base\fontenc.sty"
Package: fontenc 2005/09/27 v1.99g Standard LaTeX package
("C:\Program Files\MiKTeX 2.9\tex\latex\base\t1enc.def"
File: t1enc.def 2005/09/27 v1.99g Standard LaTeX file
LaTeX Font Info: Redeclaring font encoding T1 on input line 43.
))
...
("C:\Program Files\MiKTeX 2.9\tex\latex\marvosym\marvosym.sty"
Package: marvosym 2011/07/20 v2.2 Martin Vogel's Symbols font definitions
)
...
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 6.
LaTeX Font Info: ... okay on input line 6.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 6.
LaTeX Font Info: ... okay on input line 6.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 6.
LaTeX Font Info: ... okay on input line 6.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 6.
LaTeX Font Info: ... okay on input line 6.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 6.
LaTeX Font Info: ... okay on input line 6.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 6.
LaTeX Font Info: ... okay on input line 6.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <7> on input line 8.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <5> on input line 8.
LaTeX Font Info: Try loading font information for U+mvs on input line 8.
("C:\Program Files\MiKTeX 2.9\tex\latex\marvosym\umvs.fd")
Missing character: There is no ý in font cmr10!
Missing character: There is no ® in font cmr10!
Missing character: There is no § in font cmr10!
Missing character: There is no Œ in font cmr10!
Missing character: There is no © in font cmr10!
Missing character: There is no þ in font cmr10!
Missing character: There is no á in font cmr10!
Missing character: There is no è in font cmr10!
Missing character: There is no þ in font cmr10!
Missing character: There is no ÿ in font cmr10!
我正在使用 TeXstudio 2.6.6。我的 MiKTeX 包管理器有一个按需加载设置,所以也许我缺少其他字体的包?目前,我对如何解决这些缺失字符错误一无所知(我假设它们会随包一起安装)。
有什么想法可以解决这个问题吗?
(我希望问题不要太过局部化,但我确实有一个非常标准的设置。)
答案1
符号不能在纯数学模式下使用。删除符号$...$
周围的 或将\text{}
符号宏名称 ( \usepackage{amsmath}
) 括起来即可。
\documentclass{article}
\usepackage[english]{babel}
\usepackage{marvosym}
\begin{document}
\Bat
\Bicycle
\Coffeecup
\Frowny
\Heart
\Industry
\Football
\Mobilefone
\Smiley
\Womanface
\Gentsroom
\Ladiesroom
\Taurus
\Sagittarius
\WomanFace
\ManFace
\Yingyang
\end{document}
答案2
的符号命令marvosym
是文本模式命令,如 Christian Hupfer 的回答。
由于marvosym
的符号宏是基于较低级别的宏定义的\mvchr
,因此可以轻松修补这些宏以使其在数学模式下工作,例如:
\documentclass{article}
\usepackage[english]{babel}
\usepackage{marvosym}
\usepackage{amstext}
\usepackage{etoolbox}
\pretocmd\mvchr{\text}{}{\errmessage{Patching \noexpand\mvchr failed}}
\pretocmd\textmvs{\text}{}{\errmessage{Patching \noexpand\textmvs failed}}
\begin{document}
$\Bat$
$\Bicycle$
$\Coffeecup$
$\Frowny$
$\Heart$
$\Industry$
$\Football$
$\Mobilefone$
$\Smiley$
$\Womanface$
$\Gentsroom$
$\Ladiesroom$
$\Taurus$
$\Sagittarius$
$\WomanFace$
$\ManFace$
$\Yingyang$
\end{document}