
我還想引用一個命題和命題的子部分。
\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 項和第 2 項。 1(1) 和支柱。 (2)。代替 ? 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