4

This question already has an answer here:

I am writing my own class file and when I am browsing through code developed by others I see % sign popping up at the end of command lines while other authors do not use it. Consider the following example from biblatex:

\DeclareCiteCommand{\citeauthor}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \printnames{labelname}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

Here the % sign is used after the second and third line. Other others only use it in constructs like

\newcommand*{\bla}{%
  \a
  \b}

where % is only present at the first line. Finally there are authors that use it almost everywhere (after every line). As a class/package writer what should I do?

marked as duplicate by David Carlisle, karlkoeller, zeroth, Henri Menke, Claudio Fiandrino Feb 10 '14 at 15:14

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • This is a duplicate of the above question, but to rephrase the answer, just use a % if, if writing the code on one line, you do not want a space at that point. – David Carlisle Feb 10 '14 at 15:05
  • 2
    In your two examples I would use % as shown in the second, and in the first I would add % on line 6 – David Carlisle Feb 10 '14 at 15:09
0

This is probably not a complete answer, but whitespace after a command such as \a does not count. So, in your second example, there is no need to add % after \a.

Not the answer you're looking for? Browse other questions tagged or ask your own question.