Why LaTex return error when I write _ in normal mode (not math mode). Why we have decided to return error, we couldn't just print _. I mean if we write _ in a normal mode it print _ and in normal mode it will have another definition.

What are the reasons for choosing that decision?

  • 2
    The same goes for other active characters as well, like $, or ^, or &, or ~, ... are you okay with these? – Werner Jul 2 '14 at 19:34
  • 4
    Then the answer is simple (like with all the others): _ has special meaning and should be used with care outside of these special contexts and should be escaped outside of these contexts (see Escape character in LaTeX). – Werner Jul 2 '14 at 19:39
  • 1
    If you're just interested in printing a _ see Underscores in words (text). – Werner Jul 2 '14 at 19:51
  • 2
    You could also use the underscore package. But read its documentation if you don't want to run into problem with underscores in file names and label etc. – Ulrike Fischer Jul 2 '14 at 20:41
  • 2
    It doesn't matter too much but I don't see why this has been closed as duplicate (and have voted to reopen) the other question is about how to get a text underscore which this question does not ask, it is a question about a design decision in the language (so admittedly not really answerable except by Knuth who could say what was in his mind at the time) – David Carlisle Jul 2 '14 at 22:10

It is a tex primitive behaviour not something defined in LaTeX. It is consistent with most other primitive math mode syntax, that it generates an error in text mode. \alpha for example.

  • Is Knuth the only who developed TeX? – Hunsu Jul 3 '14 at 6:18
  • @user230137 together with some help with specific parts from his students, yes. – David Carlisle Jul 3 '14 at 7:16

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.