The command \S is defined with \DeclareRobustCommand, so redefining it with \renewcommand is not the best strategy, see When to use \LetLtxMacro?
If you really want a space after \S (which is not usual, I should say), it's better to act at a lower level.
The kernel definition of \S is
% latex.ltx, line 1798:
\DeclareRobustCommand{\S}{\ifmmode\mathsection\else\textsection\fi}
so a better strategy would be
\usepackage{xspace}
\let\S\relax % to avoid spurious warnings
\DeclareRobustCommand{\S}{%
\ifmmode
\mathsection
\else
\textsection~%
\fi
}
You surely don't want a line break after §, do you? So ~ is necessary. Using \xspace doesn't guarantee that a line break is not taken at the space.
Note. With
\let\OldS\S
\renewcommand{\S}{\OldS\ }
an \S command that ends up in a caption or other moving argument will result in two spaces. Why?
When LaTeX writes in the .aux file a command \S 1 appearing in a figure caption, it will write
\protect \S \ 1
because the expansion of \OldS is still \protect\S. The same would be written out in the .lof file. When the .lof file is read in, \protect will be ignored, and \S will be interpreted normally as \OldS\; this means two spaces, because the following \ would still be there.
For having “double §”, you can do
\documentclass{article}
\makeatletter
\DeclareRobustCommand{\NS}{%
\textsection\@ifnextchar\NS{}{~}%
}
\makeatother
\begin{document}
\NS 1 and \NS\NS 2--3
\end{document}
reserving \S for the cases where you don't want a space (I can't see when, though).
However, I believe that the simplest way is to type
\S~1 and \S\S~2--3
\renewcommand{\S}{\OldS\ }? – Gonzalo Medina Feb 19 '14 at 19:31xspace, but also read Drawbacks ofxspace. – Werner Feb 19 '14 at 19:31xspace. Is it something that a relative novice shouldn't tinker with? – Dennis Feb 19 '14 at 19:41\Swith a space, you can use it as such and add\unskipwherever you want to remove the space (as in\S\unskip). If you mostly use\Swithout a space, then you can add the space manually. As a novice, I would suggest usingxspaceand see if it suits your needs. – Werner Feb 19 '14 at 19:43\citepparenthetical citations. Writing(Author, §1.1 -- 1.3)doesn't look as nice to me as writing(Author, § 1.1 -- 1.3). – Dennis Feb 19 '14 at 22:22