번호가 없는 부록

번호가 없는 부록

LaTeX에서 번호가 지정되지 않은 단일 부록을 가질 수 있는 방법이 있습니까? 부록이 하나만 있는 문서가 있습니다. 그러므로 부록 번호 매기기를 갖는 것은 실제로 의미가 없습니다.

현재 다음 코드가 있습니다.

\appendix
\appendixpage
\section{}

부록 시작 부분에 다음 텍스트가 표시됩니다.

여기에 이미지 설명을 입력하세요

이상적으로는 내 부록이부록명령 과 동일한 크기/형식입니다 \section{}. 이 일을 쉽게 할 수 있는 방법이 있나요?

답변1

사실 특별한 것은 필요하지 않습니다. 간단한 것만 \section*{Appendix}으로도 충분하지만 아래 코드는 필요한 경우 다른 개선 사항을 제안합니다.

\documentclass{article}

\usepackage{lipsum} % for mock text

\newcommand{\addappendix}{%
  \section*{\appendixname}% start the appendix
  \addcontentsline{toc}{section}{\appendixname}% add it to the toc
  \counterwithin*{figure}{section}% optional, if you want to reset the figure counter
  \stepcounter{section}% reset counters related to section
  \renewcommand{\thesection}{A}% we want A
  \renewcommand{\thefigure}{\thesection.\arabic{figure}}% optional
}

\begin{document}

\title{A document with a single appendix}
\author{Me}

\maketitle

\tableofcontents

\section{Introduction}

\lipsum[1-3]

\section{Another}

\lipsum[4-6]

\addappendix

\lipsum[1]

\begin{figure}[htp]
\centering

\fbox{A figure here}

\caption{This is a figure}

\end{figure}

\lipsum[3-4]

\end{document}

여기에 이미지 설명을 입력하세요

답변2

제가 하는 방법은 다음과 같습니다. 스타일의 요소를 조정할 수 있습니다. \appendix*단독 부록을 원할 경우 사용 하거나 \appendix문자로 된 부록을 얻으려면 사용하십시오. 단독 부록의 경우에는 그림, 표, 방정식에 표기법으로 번호를 붙인다 A-x.

부록은 로 섹션화되어 있으므로 부록 내 섹션화에는 및 를 \section사용합니다 . 번호는 및 등 으로 표시됩니다 . 또한 부록 내의 섹션은 목차에서 생략됩니다.\subsection\subsubsectionA.1A.1.1

\documentclass{article}
\makeatletter
\let\svaddcontentsline\addcontentsline
\newcounter{appndx}

%% Create commands to create an unnumbered (lone) appendix or a series of
%% appendices, as needed
\renewcommand\appendix{%
  \renewcommand\addcontentsline[3]{%
    \def\qtest{##2}%
    \def\qmatch{subsection}%
    \ifx\qmatch\qtest\else%
      \def\qmatch{subsubsection}%
      \ifx\qmatch\qtest\else%
        \svaddcontentsline{##1}{##2}{##3}%
    \fi\fi%
  }%
  \@ifstar{\loneappendix}{\anappendix}%
}

\newcommand\loneappendix[2][p]{
  \def\appendixtitle{\appendixname. #2}
  \appendixformat[#1]{#2}%
}

\newcommand\anappendix[2][p]{
  \def\appendixtitle{\appendixname~\Alph{appndx}. #2}
  \appendixformat[#1]{#2}%
}

\newcommand\appendixformat[2][p]{
  \clearpage
  \refstepcounter{appndx}
  \setcounter{section}{\arabic{appndx}}
  \renewcommand\thesection {\appendixname~\Alph{appndx}.}
  \setcounter{subsection}{0}
  \renewcommand\thesubsection {\Alph{appndx}.\@arabic\c@subsection}
  \setcounter{paragraph}{0}
  \setcounter{subparagraph}{0}
  \setcounter{equation}{0}
  \setcounter{figure}{0}
  \renewcommand\thefigure{\Alph{appndx}-\@arabic\c@figure}
  \setcounter{table}{0}
  \renewcommand\thetable{\Alph{appndx}-\arabic{table}}
  \renewcommand\theequation {\Alph{appndx}-\arabic{equation}}
  \setcounter{footnote}{0}
  \addcontentsline{toc}{section}\appendixtitle
  \if p#1\vspace*{\fill}\fi
  \theappendix\appendixtitle
  \if p#1\vspace*{\fill}\clearpage\fi
}

\newcommand\theappendix[1]{
  \section*{\centering#1}
}
\makeatother

\begin{document}
\tableofcontents
\clearpage

\def\blahblah{
blah

\begin{equation}
y = mx + b
\end{equation}

\begin{figure}[ht]
\centering
\rule{10ex}{5ex}
\caption{Appendix figure}
\end{figure}

\begin{table}[ht]
\centering
\caption{Appendix table}
\begin{tabular}{|c|c|}
\hline
a & bbb \\
\hline
ccc & d\\
\hline
\end{tabular}
\end{table}}

\section{Normal Section}

\blahblah

\appendix*{A Lone Appendix}

\blahblah

\appendix{One Appendix of a Multi-Appendix}

\blahblah
\end{document}

여기에 이미지 설명을 입력하세요

여기에 이미지 설명을 입력하세요

여기에 이미지 설명을 입력하세요

여기에 이미지 설명을 입력하세요

여기에 이미지 설명을 입력하세요

관련 정보