I created a command that prints material in an aux file and that's all. I can reasonably expect it to (also) be used in the following ways:
\precis{Some text}
The section goes on.
\precis{Some text}
The section goes on.
That is, with or without the %
signs at the end of lines that would automatically take care of any spurious spaces.
In order to remove the trailing spaces the command is defined as:
\newcommand{\precis}[1]{%
% Whatever the command does
\ignorespaces%
}
However, as shown in my second example, there is still the case of a "spurious \par
" which I don't know how to deal with.
I have tried using \@gobble
instead, but indeed this only works if the next character is a space or blank line, and it breaks if %
-signs were used (i.e. it swallows the first letter of the sentence).
So, I would like to be able to gobble only whitespace and the implicit par
. Is that possible?
(I am working on a package, hence the attempt to be foolproof… I can go with the %
signs for myself.)
Best Answer
You can do it with a font sectioning command:
Alternatively, use
\@ifnextchar
to gobble white space and check whether\par
follows; in that case gobble it and restart the machinery.