LaTeX之附录设置

作者:金良([email protected]) csdn博客:http://blog.csdn.net/u012176591

LaTeX之附录设置_第1张图片
  • Example1
\documentclass[10pt,conference,twocolumn]{ctexrep}
\usepackage{appendix}
\begin{document}
   main body %正文内容
    \begin{appendices}
      \section{aa  }
      some text in Appendix A
      \section{bb  }
      some text in Appendix B
  \end{appendices}
\end{document}

效果:附录标题前之所以序号为空,是因为它不在任何已知chapter下,因为report最高层次是chapter。
LaTeX之附录设置_第2张图片

  • Example2
\documentclass[a4paper,12pt]{ctexart}
\begin{document}
   main body %正文内容
 \appendix
 % \renewcommand{\appendixname}{Appendix~\Alph{section}}
 \section{附录 1}
  some text...
 \section{Some Examples 2}
  some text...
\end{document}

效果:最高层次是section,故附录标题序号是A。
LaTeX之附录设置_第3张图片
  • Example3

<span style="font-size:18px;">\documentclass[a4paper]{report}
 \usepackage{titlesec}
 \usepackage{titletoc}
 \titleformat{\chapter}[display]
 {\normalfont\Large\bfseries}{\thechapter}{11pt}{\Large}\titleformat{\section}{\normalfont\large\bfseries}{\thesection}{11pt}{\large}
\titlespacing*{\chapter}{0pt}{0pt}{15pt} %left, beforesep, aftersep, right
\titlespacing*{\section}{0pt}{3.5explus1exminus.2ex}{2.3explus.2ex}
\usepackage{nameref}
\usepackage[titletoc]{appendix}
\usepackage[colorlinks,linkcolor=red,anchorcolor=blue,citecolor=green]{hyperref}

\begin{document}
\tableofcontents
\chapter{Introduction}
chapter contents.
\section{Project}
section here.
\bibliographystyle{unsrtnat}
\nocite{FAN03,ZHU04}
\renewcommand{\bibname}{\bf AA}
\addcontentsline{toc}{chapter}{\bibname}
\bibliography{myBibfile}


\titleformat{\chapter}[display]
{\normalfont\Large\bfseries}{Appendix~\Alph{chapter}}{11pt}{\Large}

\begin{appendices}
    \renewcommand{\thechapter}{\Alph{chapter}.}
    \chapter{Firstappendix}
    sometext...
    \chapter{Secondappendix}
    somemoretext
\end{appendices}

\end{document}</span>

效果:

LaTeX之附录设置_第4张图片

  • Example4
首先设置目录深度,这里设置深度为2,所以目录中只显示section和subsection级别。设置深度语句如下:
\setcounter{tocdepth}{2}
要设置的效果:既要在目录中显示“附录”二字,又要在正文出现“附录”二字,而且是section级别;其下还有subsection级别标题。设置语句如下:
<span style="font-size:18px; background-color: rgb(240, 240, 240);">\appendix</span>
\section{附录}
\subsection{程序代码}
\subsubsection{冒泡排序代码}
\subsubsection{Python代码}
显示效果:
LaTeX之附录设置_第5张图片


你可能感兴趣的:(latex,附录)