In order to make the problem and the solution understandable, I have to elaborate a bit and explain the background. TeX's parser and scanner are closely connected. If we assume that all characters have their usual catcodes, then the following applies:
\par
).\setcounter
, \addtocounter
, \value
, \roman
, \Roman
, \arabic
, \Alph
, and \the<counter name>
.\normalsize \normalfont
” is interpreted as \normalsize
and \normalfont
).\normalsize9
” is interpreted as \normalsize
and 9
; “\textbf9
” is interpreted as \textbf
with argument 9
and “\textbf98
” is interpreted as \textbf
with argument 9
and as 8
).\makeatletter
and \makeatother
, the at sign (@
) is a non-letter.\index{foo}
). However, this does not always work.tabular
and minipage
, which set vertical material within horizontal mode).This means, for example, that for a macro defined as follows:
\newcommand*{\Beispiel}[1]{ { \sffamily{ \bfseries #1} } }
three significant spaces are inserted before the argument and two after it. For better clarification, here is the definition again, where I have marked the significant spaces as ␣
and the line ends that become significant spaces by ¶
:
\newcommand*{\Beispiel}[1]{¶ {␣\sffamily{␣\bfseries #1}¶ }¶ }
If these spaces are to be eliminated, simply omit some and comment out the others
\newcommand*{\Beispiel}[1]{% {\sffamily{\bfseries #1}% }% }
That's almost it. The last thing to mention is that sometimes a shift of a whole block such as a tabular
, \parbox
or a minipage
is simply caused by the normal paragraph indentation. This is always the case when this block is placed at the beginning of the paragraph or even all by itself in the paragraph. In this case it helps either not to make a paragraph, for example to remove existing blank lines, or if necessary to insert a \noindent
at the beginning of the paragraph.