Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I wanted to use some symbols from marvosym but they don't seem to work in my distribution.


\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} 

I get a PDF output like:

enter image description here

Log highlights:

  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!

I'm using TeXstudio 2.6.6. My MiKTeX package manager has a load-on-demand setup so maybe I'm missing packages with other fonts? At the moment I'm pretty clueless how to solve these missing character errors (I presumed they would be installed with the package).

Any ideas how can I solve this?

(I hope the question is not too localised but I do have a pretty standard setup.)

share|improve this question

2 Answers 2

up vote 6 down vote accepted

The symbols can't be used in pure math mode. Remove the $...$ around it or wrap \text{} around the symbol macro name (\usepackage{amsmath}) then.

\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} 

enter image description here

share|improve this answer
    
This is similar to LaTeX command for unfilled star. The same solution if the symbol has to be used in math mode applies. –  egreg Sep 4 at 22:05
    
@egreg: Thanks, I have not seen that question before –  Christian Hupfer Sep 4 at 22:08
1  
    
@badroit: Nice cat! –  Christian Hupfer Sep 5 at 19:26

The symbol commands of marvosym are text mode commands, as explained in Christian Hupfer's answer.

Since marvosym's symbol macros are defined based on the more lower level macro \mvchr, these macros can be easily patched to get them work in math mode, e.g.:

\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}

Result

share|improve this answer
    
Thanks for the added info! I didn't need them in math mode, it was just a reflex to do that for a symbol. :) –  badroit Sep 5 at 0:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.