I want my references to nested items in an enumerate
d list to include all the punctuation that was in the list. Here is a simple example:
\documentclass{article}
\begin{document}
\begin{enumerate}
\item whatever
\item 1st level \label{first}
\begin{enumerate}
\item whatever
\item 2nd level \label{second}
\begin{enumerate}
\item whatever
\item 3rd \label{third}
\begin{enumerate}
\item whatever
\item 4th \label{fourth}
\end{enumerate}
\end{enumerate}
\end{enumerate}
\end{enumerate}
1st: \ref{first}
2nd: \ref{second}
3rd: \ref{third}
4th: \ref{fourth}
\end{document}
This is the output I get (I'm showing it as code because the quotes don't preserve spaces at the start of the line)
1. whatever
2. 1st level
(a) whatever
(b) 2nd level
i. whatever
ii. 3rd
A. whatever
B. 4th
1st: 2
2nd: 2b
3rd: 2(b)ii
4th: 2(b)iiB
The problem is the missing punctuation in the four references at the end. I want the references at the end to look like this:
1st: 2.
2nd: 2.(b)
3rd: 2.(b).ii.
4th: 2.(b).ii.B.
Although admittedly ugly, someone is demanding the references look exactly like they do in the list.
I would prefer to do this without any \usepackage
stuff that's not standard in most latex installations. So, I want to redefine the way the \ref
works and have it leave all the punctuation in place, or redefine whatever will make it do what I want, without including any outside package.