I am trying to learn how to define commands (\newcommand) and variables (\def) in LaTeX.

When I try:

\def \new {$new$}



and substitute it in the text:


%\def \new {$new$}           

lala \new lala

The substituted text sticks to the following text as shown here:

enter image description here

no matter how many spaces I put after the command.

What causes this behavior and how can I change it?

  • 1
    That's the normal behaviour. Any amount of space after a control sequence (such as \new) gets gobbled. To effect a space after \new, you can, for instance, use an empty group {}: try lala \new{} lala. – jub0bs Nov 22 '13 at 14:30
  • 1
    Or use xspace package and put \newcommand{\new}{$new$\xspace}. David is here any way to help ;-) – user11232 Nov 22 '13 at 14:52

Browse other questions tagged or ask your own question.