[texhax] Smart periods?

Michael Barr barr at math.mcgill.ca
Sun Nov 4 18:59:08 CET 2012

Surely someone has solved this problem.  The online journal I do tex editing for uses \subsection and \subsubsection run in to the text.  The problem is that we want to add a period to the title unless there is already a punctuation mark.  But I have seen the following in authors' texts (even my own, I must admit).
\subsection{This is a subsection}
\subsection{This is a subsection.}
\subsection{Is this a subsection?}
\subsection{This is an amazing subsection!}
and I would want to automatically add a period to the first form and leave the remaining three unchanged.  This is also an issue for the starred version.  I have tried a couple of solutions, none of which quite worked.  Yet it seems like an obvious thing for someone to have dealt with.  


More information about the texhax mailing list