我也想引用一个命题及其子部分。
\documentclass[12pt, a4paper]{book}
\usepackage{amsthm}
\theoremstyle{definition}
\newtheorem{prop}{Proposition}
\usepackage{unicode-math}
\setmainfont{Latin Modern Roman}
\setmathfont{Latin Modern Math}
\usepackage{cleveref}
\begin{document}
\begin{prop}\label{p1}
Let \(f \colon A \rightarrow B\).
{ \renewcommand\labelenumi{(\theenumi)}
\begin{enumerate}
\item A statement about \(f\). \label{p1.1}
\item Another statement about \(f\). \label{p1.2}
\end{enumerate}}
\end{prop}
\begin{proof}
We will first prove \cref{p1.1}, then we will prove \cref{p1.2}. We have proved \cref{p1}.
\end{proof}
\end{document}
现在,我想要的是 prop. 1(1) 和 prop. (2),而不是 item 1 和 item 2。我想要的是 prop. 1,而不是 ?? 1。我该如何实现?此外,是否可以在参考资料上创建超链接,这样当我单击它们时,我就会重定向?我正在使用 XeLaTeX。
答案1
以下内容有帮助吗?
\documentclass[12pt, a4paper]{book}
\usepackage{amsthm}
\theoremstyle{definition}
\newtheorem{prop}{Proposition}
\usepackage{unicode-math}
\setmainfont{Latin Modern Roman}
\setmathfont{Latin Modern Math}
\usepackage{enumitem}
\newlist{propenum}{enumerate}{1}
\setlist[propenum,1]{%
label= \sffamily\upshape(\arabic*), % modfiy as desired!
ref={\arabic*}, % strips formatting!
}
\usepackage{cleveref}
\crefname{prop}{prop.}{prop.}
\crefname{propenumi}{prop.}{props.}
\crefformat{propenumi}{prop.~(#2#1#3)}
\newcommand\crefproppart[2]{\namecref{#1}~\labelcref{#1}~(\ref{#2})}
\begin{document}
\begin{prop}\label{p1}
Let \(f \colon A \rightarrow B\). Then:
%{ \renewcommand\labelenumi{(\theenumi)}
\begin{propenum}
\item A statement about \(f\). \label{p1.1}
\item Another statement about \(f\). \label{p1.2}
\end{propenum}
\end{prop}
\begin{proof}
We will first prove \crefproppart{p1}{p1.1}, then we will prove \crefproppart{p1}{p1.2}. We have proved \cref{p1}.
\end{proof}
\end{document}
在定义中根据需要调整间距,并根据需要crefproppart
更改格式。\setlist