3

I'm currently preparing a thesis which must be paragraph numbered. The below is working fine for my purposes, kind of:

\documentclass[12pt, twoside]{book} 

\newcounter{chapcount}[chapter]
\newcounter{parnum}
\newlength{\parnumwidth}
\setlength{\parnumwidth}{4em}
\newcommand{\N}{%
\noindent\refstepcounter{chapcount}%
\makebox[0pt][r]{\makebox[\parnumwidth][l]{\textbf{\arabic{chapter}-
\arabic{chapcount}}}}%
\hspace*{\parindent}\ignorespaces}
\setlength{\parindent}{0em}

\begin{document}
\chapter{Introduction}
\N This is a numbered paragraph. 
\N This is another paragraph.
\end{document}

I wonder, though, whether it is possible to have the numbering in the left margin of a left-hand page, and the right margin of the right page -- a fairly common layout for textbooks and the like:

left numbered right numbered

1 Answer 1

3

You can use \marginpar which has this feature built in.

enter image description here

\documentclass[12pt, twoside]{book} 

\newcounter{chapcount}[chapter]
\renewcommand\thechapcount{\thechapter.\arabic{chapcount}}

\newcommand{\N}{%
\par
\noindent\refstepcounter{chapcount}%
\marginpar[\raggedleft \textbf{\thechapcount}]{\raggedright \textbf{\thechapcount}}}

\setlength{\parindent}{0em}

\begin{document}
\chapter{Introduction}
\N This is a numbered paragraph. 
\N This is another paragraph.


\clearpage

\N This is a numbered paragraph. 
\N This is another paragraph.


\end{document}
2
  • Perfect, thank you! Do you know if it's possible to include leading zeros in the paragraph element? (e.g., 1-001)
    – mactreb
    Commented Apr 30, 2017 at 14:13
  • 1
    yes of course, just define thechapcount to use something like \ifnum\valuechapcount}<100 0\fi\ifnum\valuechapcount}<10 0\fi\arabic{chapcount} @mactreb Commented Apr 30, 2017 at 14:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .