Text FormattingTheorem counter or similar with subscript number

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
letty
Posts: 9
Joined: Fri Jan 01, 2010 5:33 pm

Theorem counter or similar with subscript number

Post by letty »

Hi all,

I was wondering if you could help. I'm using a large number of different propositions in my document, that I need to keep a running number on, and cross reference.

I want something that would end up looking a bit like this:

Code: Select all

\begin{itemize}
    \item [C$_1$] blah blah blah
    \item [C$_2$] blah blah blah 
\end{itemize}
And now I do a long boring bit of text, but in it I refer to one of the things I talked about earlier, for example C$_2$. 
\begin{itemize}
   \item [C$_3$] blah blah blah
\end{itemize}
And now I need to refer to both C$_1$ and C$_3$

Only, the problem is, I can't work out how to make LaTeX do the counting for me. Right now, I'm having to change all the numbers myself each time I reorder something in the document (quite a major job with a phd thesis...). I'm sure there's a way to make this easier, but I can't figure it out. Can anyone help at all?

Many thanks!

-Letty

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Theorem counter or similar with subscript number

Post by cgnieder »

Hi Letty,

may I suggest to use enumitem for this?

Code: Select all

\documentclass{article}

\usepackage{enumitem}
\newlist{myenumerate}{enumerate}{1}
\setlist[myenumerate]{label=C$_{\arabic*}$}

\begin{document}

\begin{myenumerate}
  \item blah blah blah \label{one}
  \item blah blah blah \label{two}
\end{myenumerate}
And now I do a long boring bit of text, but in it I refer to one of the things I
talked about earlier, for example \ref{two}.
\begin{myenumerate}[resume]
 \item blah blah blah \label{three}
\end{myenumerate}
And now I need to refer to both \ref{one} and \ref{three}

\end{document}
Regards
site moderator & package author
Post Reply