# Automatically adding space before punctuation in old-style English texts

I'm typesetting an English text in an 18th century style (based on a 1725 edition of Alexander Pope's "Dunciad"). Is there a LaTeX package I can use to automatically add the correct space before (and after) punctuation? I need something similar to the spacing given for "french" in babel, but there doesn't seem to be an option to do this for "english", and the closest I can find in another package is ecclesiastic.sty, which does a similar thing for Latin.

-
You probably need to explain what this entails more clearly. Surprisingly, not everyone is familiar with the 1725 edition of the Dunciad. Is it identical to what French typography requires, or only similar in certain respects? –  jon Jul 25 '12 at 1:25
LaTeX provides the \frenchspacing declaration, which turns off the (ugly) default habit of adding extra spacing after fullstops. I'm not aware of other options. Is this what you're looking for? –  Marc van Dongen Jul 25 '12 at 2:12
Just from looking at a facsimile, I'm not sure what the rules are. I was hoping for guidance on that as well as technical suggestion. –  Reuben Thomas Jul 25 '12 at 10:52

If you use a recent pdflatex you can also enable the french extrakerning of microtype:

\documentclass{scrbook}
\usepackage[T1]{fontenc}
\usepackage[kerning=true]{microtype}

\begin{document}
What is the result of these settings?
Some space!

\microtypecontext{kerning=french}
What is the result of these settings?
Some space!
\end{document}

-
This is great! Merely adding \usepackage{microtype} gets me basic optical alignment, and the manual explains how to customize the spacing of punctuation. I will start with the settings for French and try to find out what old-style English actually requires (and if I get a good answer, add it here). –  Reuben Thomas Jul 25 '12 at 12:56
@ReubenThomas - Be aware that (current) French typographic usage calls for (and microtype's kerning=french setting thus implements) a slightly larger amount of whitespace before a colon (:) than before the other three symbols of interest. This may, or may not, be what your typesetting needs require. –  Mico Jul 25 '12 at 13:15
Thanks @Mico, I have adapted the default French settings to make the spacing before each of ; : ! and ? the same, as that is what seems to be the case in the facsimile I'm working from (though there the extra space varies quite a bit). –  Reuben Thomas Aug 6 '12 at 19:19

You could make the !, ?, ;, and : characters "active" in TeX jargon, i.e., turn them into control sequences which, in this case, automatically insert a "thinspace" before the corresponding characters.

\documentclass{article}
\catcode\!=\active \edef!{\unskip\noexpand\,\string!}
\catcode\:=\active \edef:{\unskip\noexpand\,\string:}
\catcode\;=\active \edef;{\unskip\noexpand\,\string;}
\catcode\?=\active \edef?{\unskip\noexpand\,\string?}

\begin{document}
Hello? World! I'm; here: now.
\end{document}


-
Spaces are not ignored after active characters, so \xspace is not needed. I'd add instead \unskip before the thin space: copying from a source where the punctuation signs are spaced can lead to inserting spaces in the input. I'd write \edef!{\unskip\noexpand\,\string!}, so defining \ExclaSign is redundant, but it's a matter of taste. In any case a space before the closing brace in the definition of \ExclaSign is important. –  egreg Jul 25 '12 at 6:45
Is there a functional solution that would also work for commas (i.e. without messing up all lists and multiple arguments)? I know there was some discussion of this a while ago… In some ancient texts, there is also a space before commas. –  ienissei Jul 25 '12 at 7:10