I am using book
class and have made the section numbers appear in the right margin with the titlesec
package. Whenever there's a \noindent
command, the marginal section number seems to shift to the left. This causes the section numbers look uneven. The MWE
is as follows:
\documentclass[draft]{book}
\usepackage{lipsum}
\renewcommand{\thesection}{\arabic{section}}
\usepackage{titlesec}
\titleformat{\section}[rightmargin]
{}
{\it\thesection}
{0em}
{}
\titlespacing{\section}
{1em}{1em}{0em}
\begin{document}
\chapter{chapter-name}
\section{}
\lipsum[1][1]\par
\section{}
\noindent\lipsum[1][2]\par
\section{}
\lipsum[1][3]\par
\section{}
\lipsum[1][4-6]\par
\section{}
\lipsum[2-4][12-18]
\end{document}
The resulting output is as follows:
Note that the 5th section number overlaps with the section content.
How can I make the section numbers appear in a uniform way in the right margin irrespective of the text contained in the respective section?
Regards.
\noindent
.verse
package by default doesn't satisfy my requirements. 2. And yes, I maybe misusing the\section
command, but right now I have to get the work done and cannot spare time to explore other ways, such as using a newcounter
OR tinkering withverse
package etc.. 3. But I want to learn LaTeX in depth in the near future. You are most welcome to share your thoughts/suggestions w.r.t the three points.\hspace*{-\parindent}\lipsum[1][3]
. This will nullify the indent too but not move the number.