Text Formattingref in enumerate

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
spiegboy
Posts: 120
Joined: Thu Dec 06, 2007 9:58 am

ref in enumerate

Post by spiegboy »

I use the enumerate package
when I cite the label, i can just got the number 1,2,3 ,rather than the whole label, C1,C2,C3, any idea ?

Code: Select all

\documentclass{article}
\usepackage{enumerate}
\begin{document}

\begin{enumerate}[{C}1]
\item\label{AAA} Text.
\item More text.
\end{enumerate}

Here we write a reference \ref{AAA}.
\end{document}

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

ref in enumerate

Post by gmedina »

Hi,

use the enumitem package instead:

Code: Select all

\documentclass{article}
\usepackage{enumitem}
\begin{document}

\begin{enumerate}[label=C\arabic*,ref=C\arabic*]
\item\label{AAA} Text.
\item More text.
\end{enumerate}

Here we write a reference \ref{AAA}.
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
spiegboy
Posts: 120
Joined: Thu Dec 06, 2007 9:58 am

Re: ref in enumerate

Post by spiegboy »

It works very well, many thanks.
Post Reply