
내 문서에 텍스트 이름으로 참조하고 싶은 부록이 있습니다. \section*
목차에 부록이 표시되는 것을 원하지 않기 때문에 여기서는 별표 표시된 명령을 사용합니다 . 그러나 \nameref
단순히 "Appendix"라는 단어가 있어야 할 자리에 빈 공간을 두는 것뿐입니다.
댓글 덕분에 이제 문제가 실제로 titlesec
패키지에 있다는 것을 알 수 있습니다. 내 섹션이 목차에서 번호가 없는 항목으로 표시되기를 원 Appendix
하지만 동시에 \nameref
위에서 설명한 대로 참조를 수행하고 싶습니다. 그래서 이제 다음과 같이 예제를 편집했습니다.
\documentclass[11pt, oneside, a4paper]{article}
\usepackage{titlesec}
\titleformat{\section}{\normalfont\LARGE\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}{\normalfont\Large\bfseries}{\thesubsection}{1em}{}
\titleformat{\subsubsection}{\normalfont\large\bfseries}{\thesubsubsection}{1em}{}
\titleformat{\paragraph}[runin]{\normalfont\large\bfseries}{\theparagraph}{1em}{}
\usepackage[hidelinks]{hyperref}
\usepackage{nameref}
\newcommand{\sectionbreak}{\clearpage}
\begin{document}
\tableofcontents % added this line
\section{Section 1}
\label{sec:section_1}
All that can be seen in the \nameref{sec:appendix}.
\section*{Appendix}
\label{sec:appendix}
\addcontentsline{toc}{section}{Appendix} % added this line
Here comes the appendix.
\end{document}
답변1
이 질문은 을 사용하여 동일한 충돌에 대한 답변을 검색할 때 나타났기 때문에 titlesec
라벨링 이 필요 hyperref
했기 \section*{}
때문에 몇 년 후 Ulrike Fisher가 포럼에 게시한 해결 방법을 공유하고 싶습니다. 따라서 이 질문은 해당 답변과 교차 연결되어 모두에게 도움이 될 것입니다.
Ulrike는 레이블이 필요한 별표 섹션(및 기타)을 보강하는 데 사용할 수 있는 새로운 명령을 정의했습니다. 그녀의 대답은 여기에서 찾을 수 있습니다:titilesec 및 latexbangla로 인해 번호가 없는 섹션에서는 nameref가 작동하지 않습니다..
/ 'titlesec
와의 조합이 작동하지 않는 이유는 Heiko Oberdiek이 이 질문에서 설명합니다.hyperref
nameref
hyperref 및 titlesec과의 충돌.