如何使用 enumitem 在引用项上添加下标?

如何使用 enumitem 在引用项上添加下标?

我有一个枚举列表,标签在括号中。我想使用 \ref 重复使用标签,但使用撇号或下标。我该怎么做?

\documentclass{article}
\usepackage{enumitem}

\setlist[enumerate,1]{label={(\arabic*)}}  

\begin{document}

\begin{enumerate}
\item This is the first sentence.
\item\label{toprime} I will give a variant of this sentence soon.
\end{enumerate}

Now here's some intervening material.

\begin{enumerate}[resume]
\item Let's stick another sentence in.
\item[\ref{toprime}$'$] I am now giving a variant of the original
  sentence.
\item[\ref{toprime}$_2$] I would also like to tack on subscripts.
\end{enumerate}
\end{document}

得出:

在此处输入图片描述

我想要将撇号和下标放在括号内。该怎么做?

答案1

您可以使用ref设置不同于的参考格式label

\documentclass{article}
\usepackage{enumitem}

\setlist[enumerate,1]{label={(\arabic*)},ref=\arabic*}

\begin{document}

\begin{enumerate}
\item This is the first sentence.
\item\label{toprime} I will give a variant of this sentence soon.
\end{enumerate}

Now here's some intervening material.

\begin{enumerate}[resume]
\item Let's stick another sentence in.
\item[(\ref{toprime}$'$)] I am now giving a variant of the original
  sentence.
\item[(\ref{toprime}$_2$)] I would also like to tack on subscripts.
\end{enumerate}
\end{document}

花式变化

相关内容