
私は
\newtheorem{definition}{Definition}[section]
\newtheorem{proposition}[definition]{Proposition}
命題と定義が「同じオブジェクト」であるかのように番号付けが行われます。しかし、問題は、\cref{...何らかの命題名...} を使用すると、出力が「命題 2.7」ではなく「定義 2.7」になることです。
この問題を解決するにはどうすればいいでしょうか?
答え1
以下は、パッケージのユーザー ガイドの 25 ページからの抜粋ですcleveref
(黄色の強調表示を追加)。
パッケージを使用すると仮定するとamsthm
、次のコードで相互参照の目的を達成できます。
\documentclass{article} % or some other suitable document class
\usepackage{amsthm}
\usepackage{cleveref}
% Place all \newtheorem declarations _after_ cleveref is loaded:
\newtheorem{definition}{Definition}[section]
\newtheorem{proposition}[definition]{Proposition}
\begin{document}
\setcounter{section}{2} % just for this example
\begin{definition}\label{def:1} Hello. \end{definition}
\begin{proposition}\label{prop:1} World. \end{proposition}
\noindent % Create some cross-references:
As \cref{def:1,prop:1} argue, \dots
\end{document}