
내 문서의 일부에서 부록 섹션을 참조하는 방법을 변경하고 싶습니다. 본문에 "부록 A.1"을 추가하고 부록에 "섹션 A.1"을 추가하고 싶습니다.
나는 다음을 시도했다:
\documentclass{scrartcl}
\usepackage{cleveref}
\begin{document}
\cref{foo} and \cref{bar}
\appendix
\crefname{subappendix}{section}{sections}
\section{Foo}\label{foo}
\cref{foo} and \cref{bar}
\subsection{Bar}\label{bar}
\end{document}
나는 다음과 같은 결과를 예상했습니다.
부록 A 및 부록 A.1
푸
부록 A 및섹션 A.1
A.1 바
하지만 부록 안에 "부록 A.1"도 있습니다.
\crefname
서문에서만 사용할 수 있고 문서 전체에 영향을 미칠 수 있는 것 같습니다 . 부록에 대해서만 참조명을 변경하는 방법이 있나요?
답변1
패키지 apptools
는 관련 조건문 \IfAppendix
과 다음을 소개합니다 \ifappendix
.
\documentclass{scrartcl}
\usepackage{cleveref}
\usepackage{apptools}
\crefname{subappendix}{\IfAppendix{section}{appendix}}{\IfAppendix{sections}{appendices}s}
\begin{document}
\cref{foo} and \cref{bar}
\appendix
\section{Foo}\label{foo}
\cref{foo} and \cref{bar}
\subsection{Bar}\label{bar}
\end{document}