5

I am trying to simply combine a Euro sign with the plus-minus symbol \pm. However the Euro sign is always converted to a small e, instead of the actual €. Is there a simply workaround? Thanks!

\documentclass[12pt]{article}
\usepackage{eurosym} 

\begin{document}

\pm \EUR{1} 

\end{document}
8

\pm is a math mode symbol, thus TeX generates an error:

! Missing $ inserted.

and switches to math mode as error recovery:

? h
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.

but \EUR does not work well in math mode, because it sets the text font, but uses the current (math) font for the symbol (\officialeuro).

It works, if \pm is correctly set in math mode without covering \EUR:

\documentclass[12pt]{article}
\usepackage{eurosym}

\begin{document}

$\pm$\EUR{1}  

\end{document}

Result

Euro in math mode

\officialeuro can also be patched that it can be used in math mode:

\documentclass[12pt]{article}
\usepackage{eurosym}

\usepackage{etoolbox}
\makeatletter
\expandafter\pretocmd\csname officialeuro \endcsname{\nfss@text}{}{%
  \errmessage{Patching \@backslashchar officialeuro failed}%
}
\makeatother

\begin{document}

$\pm \EUR{1}$

\end{document}
5

Alternative to Heiko's answer:

\documentclass[12pt]{article}
\usepackage{eurosym} 

\begin{document}

$\pm \textrm{\EUR{1}}$

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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