![枚举项的交叉引用中没有点](https://linux22.com/image/326521/%E6%9E%9A%E4%B8%BE%E9%A1%B9%E7%9A%84%E4%BA%A4%E5%8F%89%E5%BC%95%E7%94%A8%E4%B8%AD%E6%B2%A1%E6%9C%89%E7%82%B9.png)
我将枚举中的项目标签定义如下:
1.\usepackage{enumerate}
2.\renewcommand{\theenumi}{\arabic{enumi}}
3.\renewcommand{\labelenumi}{\theenumi}
4.\renewcommand{\theenumii}{\arabic{enumii}}
5.\renewcommand{\labelenumii}{\theenumi.~\theenumii}
6.\renewcommand{\theenumiii}{\arabic{enumiii}}
7.\renewcommand{\labelenumiii}{\theenumi.~\theenumii.~\theenumiii}
我可以用点来创建三个级别的项目枚举:
1
1.1
1.1.1
我使用命令引用该项目\ref{item_label}
\item \label{item_label} item_text
In \ref{item_label} you can find ...
枚举中的数字有点,但在引用中缺少点,尽管我在第 5 行和第 7 行定义了它们。
1.1.1 item_text
In 111 you can find ...
我怎样才能在交叉引用中使用点?我只想使用枚举,而不使用其他包。
答案1
\documentclass{article}
\usepackage{enumerate}
\renewcommand{\theenumi}{\arabic{enumi}}
\renewcommand{\labelenumi}{\theenumi}
\renewcommand{\theenumii}{\arabic{enumii}}
\renewcommand{\labelenumii}{\theenumi.~\theenumii}
\renewcommand{\theenumiii}{\arabic{enumiii}}
\renewcommand{\labelenumiii}{\theenumi.~\theenumii.~\theenumiii}
\makeatletter
\renewcommand\p@enumii{\theenumi.}
\renewcommand\p@enumiii{\theenumi.\theenumi.}
\makeatother
\begin{document}
\begin{enumerate}
\item xxx
\begin{enumerate}
\item xxx
\begin{enumerate}
\item xx \label{x}
\end{enumerate}
\end{enumerate}
\end{enumerate}
see [\ref{x}]
\end{document}