
"Appendix A: [some title]" , "Appendix B: [some other title]" ... 접두사를 사용하여 부록 제목을 인쇄하고 싶습니다.
다음과 같이 정의된 명령을 사용했습니다(마지막에 실행 가능한 tex-document).
\newcounter{rsss}
\DeclareRobustCommand{\appendixString}{
\setcounter{rsss}{\value{chapter}}
\addtocounter{rsss}{- \value{chapterCounter}}
Appendix\Alph{rsss} :
}
\DeclareRobustCommand{\appendixStringHeadline}{
\setcounter{rsss}{\value{chapter}}
\addtocounter{rsss}{- \value{chapterCounter}}
\addtocounter{rsss}{1}
Appendix \Alph{rsss} :
}
\DeclareRobustCommand{\appendix}[2]{
\addchap[\appendixStringHeadline #1]{\appendixStringHeadline #1}\label{#2}
\ihead{
\appendixString #1
}
\stepcounter{chapter}
}
이는 제목과 헤드라인에는 적용되지만 목차에는 항상 "Appendix A"가 있습니다. 이 문제를 어떻게 해결할 수 있나요? 를 사용하여 목차 이름을 수동으로 설정하려고 시도했지만 []
작동하지 않았습니다./. 도와 주셔서 감사합니다 :)
실행 가능한 tex 파일
\documentclass{scrreprt}
\usepackage{scrpage2}\pagestyle{scrheadings}
\newcounter{chapterCounter}
\newcounter{rsss}
\DeclareRobustCommand{\appendixString}{
\setcounter{rsss}{\value{chapter}}
\addtocounter{rsss}{- \value{chapterCounter}}
Appendix \Alph{rsss} :
}
\DeclareRobustCommand{\appendixStringHeadline}{
\setcounter{rsss}{\value{chapter}}
\addtocounter{rsss}{- \value{chapterCounter}}
\addtocounter{rsss}{1}
Appendix \Alph{rsss} :
}
\DeclareRobustCommand{\appendix}[2]{
\addchap[\appendixStringHeadline #1]{\appendixStringHeadline #1}\label{#2}
\ihead{
\appendixString #1
}
\stepcounter{chapter}
}
\begin{document}
\tableofcontents
\chapter{ Bla}
\chapter{ Bla Bla}
\appendix{test 1}{bla bla}
\appendix{test 2}{bla}
\end{document}
답변1
왜 이렇게 복잡한 접근 방식을 사용하는지 모르겠습니다.
\documentclass{scrreprt}
\usepackage{scrpage2}
\pagestyle{scrheadings}
\newcommand{\appendixString}{Appendix \thechapter: }
\newcommand{\addappendix}[1]{%
\refstepcounter{chapter}
\addchap{\appendixString #1}%
\ihead{\appendixString #1}%
}
\begin{document}
\tableofcontents
\chapter{Bla}
\chapter{Bla Bla}
\appendix
\addappendix{test 1}\label{bla bla}
\addappendix{test 2}\label{bla}
\end{document}
재정의는 \appendix
어떤 경우에도 최선의 선택이 아닙니다.
답변2
\addchap 인수 안에 카운터를 설정하지 마세요.
\documentclass{scrreprt}
\usepackage{scrpage2}\pagestyle{scrheadings}
\newcounter{chapterCounter}
\newcounter{rsss}
\DeclareRobustCommand{\appendix}[2]{%
\clearpage
\setcounter{rsss}{\value{chapter}}%
\addtocounter{rsss}{- \value{chapterCounter}}%
\addtocounter{rsss}{1}%
\addchap[Anhang \Alph{rsss} : #1]{Anhang \Alph{rsss} : #1}\label{#2}
\ihead{%
Appendix \Alph{rsss} : #1
}%
\stepcounter{chapter}
}
\begin{document}
\tableofcontents
\chapter{ Bla}
\chapter{ Bla Bla}
\appendix{test 1}{bla bla}
\appendix{test 2}{bla}
\end{document}
(이 추가 카운터를 왜 다 사용하는지, 왜 KOMA 스크립트에서 제공하는 장 접두어를 사용하지 않는지, 텍스트에는 "Anhang"을 사용하고 헤더에는 "Appendix"를 사용했지만 왜 사용하지 않았는지 이해가 되지 않습니다. 코드의 이 부분을 변경하지 마십시오.)