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 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}
share|improve this question
add comment

2 Answers 2

up vote 9 down vote accepted

\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}
share|improve this answer
add comment

Alternative to Heiko's answer:

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

\begin{document}

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

\end{document}
share|improve this answer
    
Thanks a lot!!! Both ways work perfectly! –  meierun Mar 10 at 9:12
add comment

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.