0

I need to include an email address with an underline between words in this form: [email protected], but latex was considering the underline being for a subscript in math mode.

I used \author{Name\corresp{\email{[email protected]}}}.

The console reports the error:

Missing $ inserted. ...

What is this error and what's causing it, moreover what should be changed in my file to fix this?

3
  • 1
    Use \_ instead of _
    – egreg
    Nov 12, 2021 at 15:28
  • _ is expected to be seen in math mode; that's why it complains about missing $
    – Diaa
    Nov 12, 2021 at 15:41
  • @egreg thank you! I am ashamed for not having thought of this!
    – Nobody
    Nov 12, 2021 at 17:58

2 Answers 2

1

Your command should be:

\author{Name\corresp{\email{foo\[email protected]}}}

1

Pah! The problem is whatever documentclass/style file you are using has a bad definition of \email. Strictly speaking it is not your problem, and instead you should contact whatever journal/publisher provides the class/style to get them to fix the problem.

What they (and you when necessary) should really use is \usepackage{url} and then instead of their bad \email, just code \protect\url{[email protected]}.

So, in standard LaTeX the author definition is \author{Name\thanks{\protect\url{[email protected]}}}

(Although best practice email is \url{mailto:[email protected]} )

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .