I would like to convert the fist letter of each word in all my section headings to capitals automatically. Is it possible?
ie
\section{This is my first section}
Section 1. This Is My First Section
capitalization
I would like to convert the fist letter of each word in all my section headings to capitals automatically. Is it possible?
ie
\section{This is my first section}
Section 1. This Is My First Section
Best Answer
I'm not sure if there are any problems with this approach to making the titlecaps automatic for all sections, but it works for the example given. Check the
titlecaps
documentation for quirks on how to handle different kinds of non-standard text in its argument.Note how it is able to handle an "exluded words" list, font styles, fontsize changes, as well as diacritics and national symbols like
\ae
.UPDATE: I did find that the section redefinition above will break
\tableofcontents
unless care is taken. If that is a necessary ingredient of your work, then this approach below will work. Renewing the\def
of\section
must occur after the\tableofcontents
. Also, the\Addlcwords
must occur before the\tableofcontents
. Furthermore, fontsize changes in a section heading will also break the\tableofcontents
, so I have removed them from this example.EDITED to handle optional arguments in
\section
, as shown in section 3 below.