如何在定理中交联属性?

如何在定理中交联属性?

我正在写这样的东西

\documentclass[15pt]{book}
\newtheorem{theorem}{Theorem}[section]
\usepackage{hyperref}

\begin{document}

\begin{theorem}\label{vectorspacethrm} A vector space's elements have
these properties

(i) axiom 1 \label{vectorspacethrm1}
(ii) axiom 2

...etc you get the idea.

\end{theorem}

By theorem property 1 \ref{vectorspacethrm1}
\end{document}

我希望能够像 \label{vectorspacethrm1} 一样引用它们

\begin{enumerate}
\item \label{a1} prop 1
\item prop2 
\end{enumerate}

稍后的

\begin{enumerate}
\item \label{b1} prop 1
\item prop2 
\end{enumerate}

但是 \ref{a1} 和 \ref{b1} 具有相同的标签名称。

答案1

您可以使用enumitem及其labelref格式来更改的输出\ref。在下面的例子中,我们定义了一个thmprop环境,它基本上是一个enumerate用罗马数字标记的环境,并在前面引用了完整的定理名称。

文档enumitem似乎更喜欢最后一种方法。

\documentclass{book}
\newtheorem{theorem}{Theorem}[section]
\usepackage{enumitem}
\usepackage{hyperref}
\usepackage{cleveref}

\newlist{thmprop}{enumerate}{2}
\setlist[thmprop]{label={\normalfont(\roman*)},ref=\thetheorem(\roman*)}

\crefname{thmpropi}{property}{properties}

\begin{document}
\chapter{Spaces}\section{V and H}

\begin{theorem}\label{thm:vspace} A vector space's elements have
these properties
\begin{thmprop}
\item \label{thm:vspace:prop1} prop 1
\item prop2 
\end{thmprop}
...etc you get the idea.
\end{theorem}

\begin{theorem}\label{thm:hspace} A hector space's elements have
these properties
\begin{thmprop}
\item \label{thm:hspace:prop1} prop 1
\item prop2 
\end{thmprop}
...etc you get the idea.
\end{theorem}

We have \ref{thm:vspace:prop1} and \ref{thm:hspace:prop1}

We have \cref{thm:vspace:prop1} and \cref{thm:hspace:prop1}

\begin{theorem}\label{thm:space} A space's elements have
these properties
\begin{enumerate}[label={\normalfont(\roman*)}]
\item \label{thm:space:prop1} prop 1
\item prop2 
\end{enumerate}
...etc you get the idea.
\end{theorem}
We have property~\ref{thm:space:prop1} of Theorem~\ref{thm:space}.
\end{document}

在此处输入图片描述

相关内容