1

I don't know how to explain my problem.

I have this code

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
%\usepackage{envmath}

\newcommand\irrev{\(\rightarrow \ \)}
\begin{document}

            \irrev

\end{document}

(a test code) which works but when I add the package envmath I have the following error :

! Missing $ inserted.
<inserted text> 
            $
l.8 \irrev

What's wrong ? Is the package ? How can I use it ?

2

As the documentation of the package makes clear, it provides non standard definitions of \( and related commands.

You can use $

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{envmath}

\newcommand\irrev{$\rightarrow \ $}
\begin{document}

            \irrev

\end{document}

Or not use the package, depending on requirements.

  • Ok, so there are packages which redefine (. Have I right understand ? (Sorry, i'm not fluent in english, I may have some misunderstandings) – Ccile Dec 18 '16 at 20:16
  • 1
    @Ccile yes I had never used envmath so to answer your question I looked at its documentation (texdoc envmath) and it states in the very first section on page 1 that it redefines \( and you have to use $ or \begin{math} to start math mode. – David Carlisle Dec 18 '16 at 20:20
  • (I looked at mathenv instead of envmath documentation....) Do you think it could be a good practice to always use \\begin{math} (or displaymath) to avoid this kinf of problem ? – Ccile Dec 18 '16 at 20:27
  • @Ccile there are very few packages that would redefine a standard latex command in such an incompatible way. I do not know what that package does or why you need it, but it's not really a general problem but just a problem with this package, not a bug, but rather a well documented and intentional incompatibility. – David Carlisle Dec 18 '16 at 20:31

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.