I have a document at hand that was written by using an old template and now I want to copy it to a new one. However, when I do this and execute the code I am facing the error

Missing $ inserted.

for all inline math modes. That's because in my initial template I used the symbol \( \) to write all the inline math equations and somehow my new template does not accept this notation but forces me to use $ instead. So, my question is: What should I do to define the equality $...$ = \(...\) or how can I interchange these two?

  • 2
    For me \( and \) are working, no matter what I try. Please provide MWE, so we can figure out, where the problem is.
    – Wamseln
    Oct 18 '15 at 18:55
  • 1
    Sorry for being silent so long, I was trying to put my template into ShareLaTeX which I finally managed. Here it is: sharelatex.com/project/5623f19368d179c93909d251
    – sahin
    Oct 18 '15 at 19:26
  • 2
    Ok, so the problem is certainly caused by \def\({\left(} and \def\){\right)}. I think you should change those in order to get back the usual \( and \) behaviour.
    – Wamseln
    Oct 18 '15 at 19:32
  • 3
    It is definitely not a good template. It is using obsolete and deprecated packages. It is loading things in the wrong order. It is loading things multiple times. It is setting manually what would be better managed by a package designed for the purpose. And it redefines the standard markup for inline maths mode!! At the very least, delete lines 59 and 60. Better, don't use it at all.
    – cfr
    Oct 18 '15 at 19:32
  • 2
    Also, eqnarray shouldn't be used. Use align from amsmath instead.
    – Bernard
    Oct 18 '15 at 19:39

Here's an attempt to clean things up a bit. More could be done, but I think this modifies the worst features of the original template.

% \usepackage{subfigure}% obsolete! use subfig or, better, subcaption
\usepackage[textwidth = 6.5in, textheight = 8.5in, marginparwidth=0pt, marginparsep=0pt, headheight=0pt, headsep=0pt, left=1in, top=1.2in]{geometry}

  pdfauthor={John Smith},

% use align rather than eqnarray

\newcommand{\intx}{\int d^d \mathbf{x}\ }

\newcommand{\intkd}{\int \frac{d^Dk}{(2\pi)^D}\ }
\newcommand{\intpd}{\int \frac{d^Dp}{(2\pi)^D}\ }
\newcommand{\intpdo}{\int \frac{d^{D-1}k}{(2\pi)^{D-1}}\ }
\newcommand{\intl}{\int \frac{d^4l}{(2\pi)^4}\ }
\newcommand{\intld}{\int \frac{d^dl}{(2\pi)^d}\ }
\newcommand{\intle}{\int \frac{d^4l_E}{(2\pi)^4}\ }
\newcommand{\intp}{\int d^d \mathbf{p}\ }
\newcommand{\intpp}{\int \frac{d^d \mathbf{p}}{\sqrt{\pd 2\wsp}}\ }

\title{SUBJECT\thanks{This is a title.}}
\author{John Smith\textsuperscript{\itshape a,}\thanks{E-mail address: \Comment{\href{mail@mail.edu}}{\url{mail@mail.edu}}}}
\pretitle{\begin{center}\LARGE\bfseries}% Note that your original settings do not get bold small-caps and would not do so even if this shape existed in bold for this font. If you want small-caps, change \bfseries to \scshape
\posttitle{\par\end{center}\vskip 10mm}
\postauthor{\par\end{center}\vskip 10mm}
\renewcommand\maketitlehookc{\begin{center}\itshape\textsuperscript{a}Department,\par Address\par\end{center}\vskip 10mm}


\setlength\parindent\normalparindent% Not at all clear this is wise with skip between paragraphs as well, but if you must, you must...

Abstract goes in here.






\section{Appendix 1}



Modified template

  • \be,\ee etc. with align wont work, see What is wrong with defining \bal as \begin{align}? Oct 18 '15 at 20:57
  • @TorbjørnT. Thanks! I forgot about Bernard's comment until I'd pasted the code and didn't check it out properly. Thanks for pointing that out, and for the link. (I'm sure I've read that before but had forgotten.)
    – cfr
    Oct 18 '15 at 21:13

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.