引用枚举环境

引用枚举环境

我在 amsart 文档中创建了以下环境:

 \documentclass{amsart}
\usepackage[a4paper, total={6 in, 9 in}]{geometry}
\usepackage{amssymb,amsfonts}
\usepackage{mathrsfs}
\usepackage{hyperref}

    \newtheorem{thm}{Theorem}[section]
    \newtheorem{cor}[thm]{Corollary}
    \newtheorem{prop}[thm]{Proposition}
    \newtheorem{lem}[thm]{Lemma}
    \newtheorem{quest}[thm]{Question}
    
    \theoremstyle{definition}
    \newtheorem{defn}[thm]{Definition}
    \newtheorem{exmp}[thm]{Example}
    \theoremstyle{remark}
    \newtheorem{rem}[thm]{Remark}
    
    \makeatletter
    \let\c@equation\c@thm
    \makeatother
    \numberwithin{equation}{section}

我可以用来\label{label}标记这样的环境,然后将其引用为\hyperref[label]{shown label}

不过,我想标记与下面类似的枚举环境:

\begin{enumerate}
\item[\textup{(C1)}] ...
\item[\textup{(C2)}] ...
\item[\textup{(C3)}] ...
\end{enumerate}

这样我就可以引用属性 (C1)、(C2) 和 (C3)。

我该如何处理这个问题?

答案1

如果你加载枚举项,您可以创建自定义标签,\ref{}可以识别

在此处输入图片描述

\documentclass{article}
\usepackage{enumitem}

\begin{document}
List
\begin{enumerate}[label=(C\theenumi)]
\item X \label{x}
\item Y
\item Z. \label{z}
\end{enumerate}

Reference to \ref{x} and \ref{z}.
\end{document}

答案2

您想使用enumitem和 来简化代码。无需定义计数器thm然后指向equation它。只需使用 即可equation

\documentclass{amsart}
\usepackage[a4paper, total={6 in, 9 in}]{geometry}
\usepackage{amssymb,amsfonts}
\usepackage{mathrsfs}
\usepackage{enumitem}
\usepackage{hyperref}

\numberwithin{equation}{section}

\newtheorem{thm}[equation]{Theorem}
\newtheorem{cor}[equation]{Corollary}
\newtheorem{prop}[equation]{Proposition}
\newtheorem{lem}[equation]{Lemma}
\newtheorem{quest}[equation]{Question}

\theoremstyle{definition}
\newtheorem{defn}[equation]{Definition}
\newtheorem{exmp}[equation]{Example}
\theoremstyle{remark}
\newtheorem{rem}[equation]{Remark}

\newenvironment{conditions}[1]
 {\enumerate[label=\upshape(#1\arabic*)]}
 {\endenumerate}

\begin{document}

\section{Introduction}
Let's make a reference to condition~\ref{condition3}.

\begin{conditions}{A}
\item This is a condition.
\item This is another one.
\end{conditions}

\section{Text}

\begin{thm}
The following conditions are equivalent:
\begin{conditions}{C}
\item ...
\item ...
\item\label{condition3} ...
\end{conditions}
We have also an equation
\begin{equation}
0=0
\end{equation}
\end{thm}

Another equation
\begin{equation}
1=1
\end{equation}

\begin{rem}
This is interesting, isn't it?
\end{rem}

\end{document}

在此处输入图片描述

相关内容