附录编号及附录间缺失的空白页

附录编号及附录间缺失的空白页

我正在尝试为我的硕士论文制作附录。模板由几个部分组成,这些部分排列在名为“final.tex”的文件中。附录有两个问题:

  1. 我可以按自己想要的方式保留索引,但附录 A、B 和 C 不以 A.1、B.1 和 C.1 开头,而是始终以 A.1、A.1 和 A.1 开头,无论附录的字母是什么。我希望附录的标题:“Anexos A”、“Anexos B”和“Anexos C”前面没有字母,但副标题有字母、点和数字。
  2. 附录中添加的空白页不予接受。当页数为奇数时,模板不会像文档的其余部分那样在附录中添加空白页。

我该如何解决这两个问题?我尝试查看其他 Stack Exchange 问题并尝试查看它是否有效,但我仍然无法使模板正常工作。

“final.tex”文件的代码:

\documentclass[11pt]{book}
%oneside ou openany serve para tirar paginas em branco depois das secções
% Omitting Page Numbers
\pagenumbering{gobble} 

% Packages
\usepackage[a4paper,left=2.5cm,right=2.5cm,top=4cm,bottom=4.9cm]{geometry}
\renewcommand{\baselinestretch}{1.15}
\usepackage{graphicx,kantlipsum,setspace}
\usepackage{caption}
\captionsetup[table]{font={stretch=1,footnotesize}, labelfont=bf}
\captionsetup[figure]{font={stretch=1,footnotesize}, labelfont=bf}
\usepackage[font=bf]{caption}
\usepackage{indentfirst}
\usepackage{textcomp}
\usepackage{makecell}
\usepackage{mathtools,float,geometry}
\usepackage{booktabs,array,tabularx,threeparttablex}
\usepackage[portuguese]{babel}
\usepackage{subfig}
\usepackage[version=4]{mhchem}
\usepackage{comment}
\usepackage{float}
\usepackage{catoptions}
\usepackage{graphicx}
\usepackage{bm}
\usepackage{adjustbox}
\usepackage{cite}
\usepackage{caption}
\usepackage{fontspec}
%\usepackage{natbib}
\usepackage{cite}
%\setcitestyle{square}
\usepackage{afterpage}  % blank pages
\usepackage{multirow}  % table
%\usepackage[table, dvipsnames]{xcolor}  % table
\usepackage{xpatch}  % table
\usepackage{tabu}  % table
\usepackage{hhline}  % cell color does not overlap cell line
\usepackage{fancyhdr}  % headers
\usepackage{breakcites}  % references do not go though margins
\usepackage{sectsty}  % change chapter title size
\setcounter{tocdepth}{3}  % four level contents
\setcounter{secnumdepth}{3}  % numbered four level contents
\usepackage{amsfonts}  % math
\usepackage{amsmath}  % math
\usepackage[nottoc,notlof,notlot]{tocbibind}
\usepackage{hyperref}  % references
\usepackage{lmodern}
\usepackage{lipsum}
\usepackage{fixmath}
\usepackage{scalerel}
\newlength\bshft
\bshft=.18pt\relax
\def\fakebold#1{\ThisStyle{\ooalign{$\SavedStyle#1$\cr%
  \kern-\bshft$\SavedStyle#1$\cr%
  \kern\bshft$\SavedStyle#1$}}}
\newlength\longest
\makeatletter
\newcommand{\unchapter}[1]{%
  \begingroup
  \let\@makechapterhead\@gobble % make \@makechapterhead do nothing
  \chapter{#1}
  \endgroup
}
\makeatother
\usepackage{tcolorbox}
\usepackage{amssymb}
\tcbuselibrary{theorems}
\newtcbtheorem
  []% init options
  {definição}% name
  {Definição}% title
  {%
    colback=gray!5,
    colframe=gray!20!gray,
    fonttitle=\bfseries,
  }% options
  {def}% prefix
%\newcommand{\rectangle}{{  % rectangle
%  \ooalign{$\sqsubset\mkern3mu$\cr$\mkern3mu\sqsupset$\cr}
%}}

%\newcommand\BibTeX{B{\sc ib}\TeX}

% References
\hypersetup{
   colorlinks=true,
   linkcolor=black,
   filecolor=black,
   citecolor=black,
   urlcolor=black,
   bookmarksopen=true,
   linktocpage=true,
   pdfpagemode=UseOutlines,
   pdfstartpage=1
}

% Blank Page
\newcommand\blankpage{
    \null
    \thispagestyle{empty}
    \addtocounter{page}{-1}
    \newpage}

% Hide Blank Pages Numbers + Headers
\let\origdoublepage\cleardoublepage
\newcommand{\clearemptydoublepage}{%
  \clearpage
  {\pagestyle{empty}\origdoublepage}%
}

% Space between numbers and text
\geometry{footskip=1.2cm}

\begin{document}
\begingroup

\newgeometry{left=3cm, right=3cm, top=1cm, bottom=1.2cm}
\renewcommand{\baselinestretch}{1.9}

%\include{parts/capa_provisoria}
\include{parts/capa_definitiva}

\afterpage{\blankpage} %comentar para tirar paginas em branco

\endgroup

% Preamble for Thesis
\setmainfont{Times New Roman}
\newgeometry{left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm}
\renewcommand{\baselinestretch}{1.15}
\pagenumbering{Roman}
\pagestyle{plain}
\let\cleardoublepage\clearemptydoublepage  % hide blank pages numbers + headers

\include{parts/agradecimentos}
%tenho um problema com a numeração das paginas
%%\afterpage{\blankpage}
\include{parts/dedicacao}
%%\afterpage{\blankpage}
\include{parts/abstract}

\include{parts/resumo}

%\include{parts/resumo_alargado}

\include{parts/contents}

\include{parts/list_of_figures}

\include{parts/list_of_tables}

\afterpage{\blankpage} %comentar para tirar paginas em branco

% After Introductory Pages
\pagenumbering{arabic}
\pagestyle{fancy}
\newgeometry{left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm,headsep=1cm}
\setlength{\headheight}{14pt} 

\chaptertitlefont{\Huge} % to fit chapter title to one line
\chapternumberfont{\Huge} 

\include{parts/introducao}

\include{parts/propriedadesTMDs}

\include{parts/aplicacoes}

\include{parts/metodosexperimentais}

\include{parts/resultadosediscussao}

\include{parts/conclusao}

\pagestyle{plain}  % no more header 

\include{parts/bibliografia}
\appendix
\renewcommand{\thesection}{\Alph{section}.\arabic{section}}
\include{parts/AnexosA}

\include{parts/AnexosB}

\include{parts/AnexosC}
\end{document}

附录A零件代号:

%\newpage
\appendix
\section*{\Huge Anexos A}
\addcontentsline{toc}{chapter}{Anexos A}
%\chapter*{Anexos A}
%\addcontentsline{toc}{chapter}{Anexos A}
\renewcommand{\theequation}{A.\arabic{equation}}
\setcounter{equation}{0}
\vspace{1cm}
\section{Diferença de caminho óptico}

附录B部分代码:

\newpage
\appendix
\section*{\Huge Anexos B}
\addcontentsline{toc}{chapter}{Anexos B}
%\chapter*{Anexos A}
%\addcontentsline{toc}{chapter}{Anexos A}
\appendix
\renewcommand{\theequation}{B.\arabic{equation}}
\setcounter{equation}{0}
\vspace{1cm}
\section{Distribuição log-normal}

目录: 在此处输入图片描述

“Anexos A” 和 “Anexos B” 部件的错误:

在此处输入图片描述 在此处输入图片描述 在此处输入图片描述

答案1

\appendix您正在通过使用多次来重置编号。请尝试仅在整个附录部分之前使用它,如下所示:

\documentclass{book}

\usepackage{blindtext}

\begin{document}
    \tableofcontents
    \Blinddocument

    \appendix

    \refstepcounter{chapter}
    \chapter*{\appendixname\enskip\thechapter}
    \addcontentsline{toc}{chapter}{\appendixname\enskip\thechapter}
    
    \section{Section in Appendix A}

    \refstepcounter{chapter}
    \chapter*{\appendixname\enskip\thechapter}
    \addcontentsline{toc}{chapter}{\appendixname\enskip\thechapter}

    \section{Section in Appendix B}

\end{document}

相关内容