
패키지에서 두 가지 옵션(전체 참조 이름과 참조 이름 약어)을 모두 사용할 수 있는지 궁금합니다 cleveref
.
현재 사례는 텍스트 모드 내의 참조와 =
수학 모드의 기호 위 참조를 모두 포함하는 문서입니다(예: 아래 예). 이상적으로는 텍스트 모드에서는 전체 참조 이름(정리 0.1)을 사용하고, $\stackrel{\text{\Cref{th:theorem1}}}{=}$
기호 위에 참조를 인쇄하는 데 필요한 공간 문제와 같은 경우에는 축약 버전(Thm. 0.1 또는 이와 유사한 것)을 사용하고 싶습니다 =
.
누구든지 이것을 달성하는 방법을 알고 있습니까?
다음은 최소한의 작업 예입니다.
\documentclass[a4paper,english]{scrbook}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage[nameinlink, noabbrev]{cleveref}
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem*{theorem*}{Theorem}
\begin{document}
\begin{theorem}\label{th:theorem1}
If $A$ is closed, then $A$ is closed.
\end{theorem}
\begin{proof}
Left to the reader.
\end{proof}
In \Cref{th:theorem1} we have seen that ...
\begin{equation}
a + b \stackrel{\text{\Cref{th:theorem1}}}{=} 0\,.
\end{equation}
\end{document}
답변1
힌트를 주신 Leandriis에게 감사드립니다.Cleveref - 축약형 및 전체 형식 참조를 모두 사용합니까?
이 수정된 솔루션은 축약된 형식과 축약되지 않은 형식 \Cref
모두 에서 작동합니다.\cref
\usepackage[nameinlink, noabbrev]{cleveref}
\DeclareRobustCommand{\abbrevcrefs}{%
\Crefname{theorem}{Thm.}{Thms.}%
\Crefname{example}{Ex.}{Exs.}%
\crefname{equation}{eqn.}{eqns.}%
}
\DeclareRobustCommand{\Cshref}[1]{{\abbrevcrefs\Cref{#1}}}
\DeclareRobustCommand{\cshref}[1]{{\abbrevcrefs\cref{#1}}}
도움이 되길 바랍니다.