5

This stems out of How can one number paragraphs in LaTeX?, which I asked earlier today:

Running with Brent.Longborough's suggestion for how to number paragraphs in a document:

\setcounter{secnumdepth}{5}
...
\paragraph{If we want to}
\paragraph{do something}

This results in LaTeX producing something likeso:

0.0.0.1 If we want to 
0.0.0.2 do something

How can one change the numbering scheme of \paragraph{} to produce something like:

1. If we want to
2. do something

or alternatively

A. If we want to
B. do something

Thank you.

Community
  • 1
  • 1
Brian M. Hunt
  • 81,008
  • 74
  • 230
  • 343
  • I don't know if a mass migration of *tex related questions is in order. Perhaps ask on meta? Or do you WANT these on meta for a particular reason? –  Jan 20 '11 at 22:14
  • Will: You ask a good question. Since http://tex.stackexchange.com/questions/9363 was migrated, I thought it valuable to point out the other questions that seem indistinguishable (to me) in terms of criteria for migration -- I figured they just "flew under the radar" (it since occurred to me that the TeX/LaTeX tag is probably a better way to point them out). If there is a criteria for moving *TeX questions over, I don't know what it is, but I assumed that moderators would. Perhaps Gumbo (who migrated the above question) could offer some guidance? I'll ask on Meta. – Brian M. Hunt Jan 21 '11 at 00:01
  • It seems this has already been discussed ad nauseum: http://meta.stackexchange.com/questions/70466 http://meta.stackexchange.com/questions/12918 I don't feel there's much I can contribute, policy wise. I had hoped my submissions highlighted the "under the radar" *TeX questions that would be moved as part of a novel policy that hit the question in my previous comment, but alas my "flagging for migration" may have been both unnecessary and jumping the gun. – Brian M. Hunt Jan 21 '11 at 00:12

1 Answers1

11

To change the number referenced when referring to paragraphs, you want to change \theparagraph. Here's an example:

\documentclass[12pt]{article}
\setcounter{secnumdepth}{5}
\renewcommand\theparagraph{\roman{paragraph}}
\usepackage{lipsum}
\begin{document}
\paragraph{foo} \lipsum[1]
\paragraph{bar} \lipsum[2]
\end{document}

Instead of \roman you can also use \Roman, \arabic, \alph, \Alph. Although if you have lots of paragraphs you'll want to use the alphalph package and use \alphalph to get more than 26 paragraphs.

Note that \paragraph takes an argument for the "paragraph title". If you never want that, you'll probably want to define your own command to simplify things:

\newcommand\PARA{\paragraph{}}

You'll also probably want to remove the way that paragraphs are numbered "within" sections; i.e., they reset from "1" for every new section. You can get around this with something like

\usepackage{remreset}
\makeatletter
\@removefromreset{paragraph}{section}
\makeatother
Will Robertson
  • 62,540
  • 32
  • 99
  • 117