To structure my sourcecode, I often use spaces for padding:
\newcommand{\st}[1]{%
\begin{tabular}{lr}
\emph{Student} & \emph{Score}\\
#1
\end{tabular}%
}
Can this ever cause problems? Like putting no % at the end some lines.
To structure my sourcecode, I often use spaces for padding:
\newcommand{\st}[1]{%
\begin{tabular}{lr}
\emph{Student} & \emph{Score}\\
#1
\end{tabular}%
}
Can this ever cause problems? Like putting no % at the end some lines.
Usually, spaces at the beginning of a line are ignored by TeX. However, this is not the case when writing in a verbatim like context. Tabulators at the beginning of a line are ignored as well.
Whitespace characters like NO-BREAK SPACE (U+00A0) behave in a different way. To use them properly, a modern engine like LuaLaTeX in conjunction with fontspec is needed.
Please be aware, that the end of a line is nothing more than a ␣ (space) for LaTeX, if in M-mode (middle of a line), so you have to be careful in the definition of your own commands.
\documentclass{article}
\newcommand\testa{h
ello}
\newcommand\testb{h%
ello}
\begin{document}
\testa \par \testb
\begin{verbatim}
h
a
ll
o
\end{verbatim}
\end{document}
U+00A0, which in the normal setting of LuaLaTeX and XeLaTeX has category code 12 when fontspec is loaded.
– egreg
Nov 27 '13 at 17:12
%on lines 1 and 5 which could produce anomalous white space in the result. – David Carlisle Nov 27 '13 at 13:37%:-). Someone add it as an answer so I can accept it. – u17 Nov 27 '13 at 13:41