Sometimes, I do have long section headings that take more than one line. I would like to make second and each subsequent line of \section
heading indented (so called 'hanging indent'). I know I can produce hanging indent for paragraphs with hanging
package:
\documentclass[final]{book}
\usepackage{lipsum}
\usepackage{hanging}
\begin{document}
\hangpara{3em}{1} \lipsum[11]
\end{document}
However, I have no idea how to do the same for \section
heading as hanging
package works only for paragraphs and not headings. My code for section heading so far:
\documentclass[final]{book}
\usepackage{lipsum}
\begin{document}
\section*{\large{Very long section heading that takes two or more lines when it is typeset on page}}
\end{document}
Best Answer
Here is a solution using the
titlesec
package inspired by @egreg's comment.The title text is indented by extra 1em. For the first line, this extra indentation is cancelled by
\hspace{-1em}
. With section number:Without section number:
Code: