[Tex/LaTex] Capitalizing only the first word of the sentence in Section,Subsection


I am using the book class and I wrote all the parts, sections, subsections as
\section{My Section Is Like This}
that I produce something like this

My Section Is Like This

My editor asked to write something like this:

My section is like this

I believe that I have to introduce a command like the one in capitalising-first-letter-of-each-word-in-section-headings-using-book-class:


that does not solve my problem


something like that


that produces

my section is like this

The problem is how to capitalize only the first letter of the sentence for all sections, subsections, subsubsections, but I have not been able to find it.

Best Answer

Rather than complicate your macros forever I'd just edit the file.

if your sec.tex file is

\section{My Title}

\section{With Title Case}


Then after a command such as

sed -ie "s/\\\\section{\(.\)\([^{}]*\)}/\\\\section{\\1\\L\\2}/"  sec.tex 

then it will be

\section{My title}

\section{With title case}


I used sed on the commandline there but any editor should be able to do similar replacements.