11

I created the following minimal LaTeX document:

\documentclass{article}
\usepackage[ansinew]{inputenc}

\begin{document}
$–A + B$
\end{document}

It throws a warning 'LaTeX Warning: Command \textendash invalid in math mode on input line 6'. Without the minus symbol before the A everything works fine.

Question: Why does the minus symbol throw such a warning? I am confused.

System: Windows 8 64 Bit Pro, latext Miktex release with Texniccenter.

1 Answers1

12

It is not a minus symbol but that is taken as \textendash. Use - to get correct math minus.

\documentclass{article}
\usepackage[ansinew]{inputenc}

\begin{document}
$-A + B$
\end{document}

enter image description here

  • Thank you. So I somehow managed to type in the wrong symbol? I use ansinew because I always thought Windows uses this one, too. Should I better use utf8 on Windows? – John Threepwood Nov 28 '13 at 07:28
  • 2
    @HarishKumar I'd say that the options argument for inputenc depends on the editor being used, not the language. It should always match the character encoding the .tex file has been saved as. – daleif Nov 28 '13 at 08:37
  • @daleif You are correct. Thanks for correcting me. I have no idea of how John saved his file. :-) –  Nov 28 '13 at 09:04