Numbering paragraphs in LaTeX
Recently, I was asked to write an essay and to number its paragraphs. I couldn’t
find anything premade, so I worked something up using the ledmac
package. It isn’t perfect (you need to restart it after using the
quote
environment, etc.) but it did the trick for a simple essay.
In case anybody else is looking to do something similar, here’s how I did
it:
\documentclass{article}
\usepackage{lipsum}
\usepackage{ledmac}
% \reversemarginpar % Uncomment for in the margin
% \setlength\marginparwidth{2em} % Uncomment for in the margin
\newcounter{para}\setcounter{para}{0}
\newcounter{thispara}\setcounter{thispara}{0}
\newcommand*{\newpara}{ %
\refstepcounter{para}
\setcounter{thispara}{\value{para}}
% \marginpar{{\textbf{\thepara. }}} % Uncomment for in the margin
\textbf{\thepara. } % Comment for in the margin
}
\begin{document}
\title{Lorem Ipsum}
\author{Ryan Kavanagh}
\maketitle
\everypar{\noindent\newpara}
\lipsum[1]
\lipsum[2]
\lipsum[3]
\end{document}
See the instructions in the comments for having numbers in the margin.
Comments: To comment on this post, send me an email following the template below. Your email address will not be posted, unless you choose to include it in the link: field. If your web browser is configured to handle mailto: links, click comment to load the template into your mail client.
To: Ryan Kavanagh <rak@rak.ac> Subject: [blog-comment] /blog/2010-12-05-numbering-paragraphs-in-latex/ post_id: /blog/2010-12-05-numbering-paragraphs-in-latex/ author: [How should you be identified? Usually your name or "Anonymous"] link: [optional link to your website] Your comments here. Markdown syntax accepted.
0 Comments