所以我目前正在为学期考试写一份大学报告,附录中的词汇表/缩写部分出现了问题。我希望缩写与章节标题在同一页开始,但最后却跳过了一页,有办法解决这个问题吗?
我附上了撰写本文时的照片以及代码。
以下为主要内容:
\input{Preamble/Preamble.tex}
\input{Preamble/AAUSynopsis.tex}
\makeatletter
\providecommand\add@text{}
\newcommand\tagaddtext[1]{%
\gdef\add@text{#1\gdef\add@text{}}}%
\renewcommand\tagform@[1]{%
\maketag@@@{\llap{\add@text\quad}(\ignorespaces#1\unskip\@@italiccorr)}%
}
\makeatother
\makeglossaries
\input{Bib/Glossary.tex}
\renewcommand{\glsclearpage}{}
\newglossarystyle{custom_acronyms}
{
\setglossarystyle{long3colheader}%
\renewcommand*{\glossaryheader}{}%
\renewcommand{\glossentry}[1]{%
\textbf{\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}}}
& \glossentrydesc{##1}
& ##2
\tabularnewline}%
}
\begin{document}
\input{Formalia/Forside.tex}
\input{Formalia/Titelblad.tex}
\input{Formalia/Underskrifter.tex}
\setcounter{tocdepth}{1}
\setcounter{secnumdepth}{2}
\tableofcontents
%Text
\input{Text/01 - Introduction/Introduction.tex}
\input{Text/02 - Problem Analysis/2.0 - Problem Analysis Main.tex}
\input{Text/03 - Requirements/Requirements Main.tex}
\input{Text/04 - Design/Design Main.tex}
\input{Text/05 - Implementation/Implementation}
\input{Text/06 - Accept Test/TestMain}
\input{Text/07 - Discussion/DiscussionMain}
\input{Text/08 - Conclusion/ConclusionMain}
\BiblatexSplitbibDefernumbersWarningOff
%Sektions indelt kildeliste (indsæt keywords i kildelisten)
\printbibliography[heading=bibintoc,keyword={general},title={Bibliography}] %USE
\phantomsection
\printbibliography[heading=subbibintoc,keyword={image},title={Images}]
\phantomsection
\printbibliography[heading=subbibintoc,keyword={datasheet},title={Datasheet}]
\phantomsection
%\input{Text/09 - Appendix/Glossary}
\input{Text/09 - Appendix/Appendix.tex}
\end{document}
以下是序言:
%%%Layout%%%
\documentclass[11pt,a4paper,table,xcdraw]{report}
\usepackage{etoolbox}
\usepackage[a4paper,hmargin=3cm,vmargin=3cm]{geometry}
\usepackage{parskip}
\usepackage{multirow}
\usepackage{enumitem}
\usepackage{booktabs}
\usepackage[T1]{fontenc}
\usepackage{listings}
%\usepackage{doi}
\usepackage{array}
\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
%requirements setup
\setlist[description]{style=nextline}
%Macros for SI units
\usepackage[siunitx]{circuitikz}
\AtBeginDocument{\RenewCommandCopy\qty\SI}
\usepackage{amsmath}
\makeatletter
\def\ifGm@preamble#1{\@firstofone}
\appto\restoregeometry{%
\pdfpagewidth=\paperwidth
\pdfpageheight=\paperheight}
\apptocmd\newgeometry{%
\pdfpagewidth=\paperwidth
\pdfpageheight=\paperheight}{}{}
\makeatother
\usepackage{matlab-prettifier}
\usepackage{listings}
\lstset{literate=
{á}{{\'a}}1 {é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {ú}{{\'u}}1
{Á}{{\'A}}1 {É}{{\'E}}1 {Í}{{\'I}}1 {Ó}{{\'O}}1 {Ú}{{\'U}}1
{à}{{\`a}}1 {è}{{\`e}}1 {ì}{{\`i}}1 {ò}{{\`o}}1 {ù}{{\`u}}1
{À}{{\`A}}1 {È}{{\'E}}1 {Ì}{{\`I}}1 {Ò}{{\`O}}1 {Ù}{{\`U}}1
{ä}{{\"a}}1 {ë}{{\"e}}1 {ï}{{\"i}}1 {ö}{{\"o}}1 {ü}{{\"u}}1
{Ä}{{\"A}}1 {Ë}{{\"E}}1 {Ï}{{\"I}}1 {Ö}{{\"O}}1 {Ü}{{\"U}}1
{â}{{\^a}}1 {ê}{{\^e}}1 {î}{{\^i}}1 {ô}{{\^o}}1 {û}{{\^u}}1
{Â}{{\^A}}1 {Ê}{{\^E}}1 {Î}{{\^I}}1 {Ô}{{\^O}}1 {Û}{{\^U}}1
{ã}{{\~a}}1 {ẽ}{{\~e}}1 {ĩ}{{\~i}}1 {õ}{{\~o}}1 {ũ}{{\~u}}1
{Ã}{{\~A}}1 {Ẽ}{{\~E}}1 {Ĩ}{{\~I}}1 {Õ}{{\~O}}1 {Ũ}{{\~U}}1
{œ}{{\oe}}1 {Œ}{{\OE}}1 {æ}{{\ae}}1 {Æ}{{\AE}}1 {ß}{{\ss}}1
{ű}{{\H{u}}}1 {Ű}{{\H{U}}}1 {ő}{{\H{o}}}1 {Ő}{{\H{O}}}1
{ç}{{\c c}}1 {Ç}{{\c C}}1 {ø}{{\o}}1 {å}{{\r a}}1 {Å}{{\r A}}1
{€}{{\euro}}1 {£}{{\pounds}}1 {«}{{\guillemotleft}}1
{»}{{\guillemotright}}1 {ñ}{{\~n}}1 {Ñ}{{\~N}}1 {¿}{{?`}}1 {¡}{{!`}}1
}
\lstdefinestyle{MatLab}{ %Formatting for code in appendix
language=Matlab,
numbers=left,
frame=L,
stepnumber=1,
showstringspaces=false,
tabsize=1,
breaklines=true,
breakatwhitespace=false,
commentstyle=\itshape\color{green!40!black},
keywordstyle=\bfseries\color{blue},
}
\lstdefinestyle{C}{
backgroundcolor=\color{backgroundColour},
commentstyle=\color{mGreen},
keywordstyle=\color{magenta},
numberstyle=\tiny\color{mGray},
stringstyle=\color{mPurple},
basicstyle=\footnotesize,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2,
language=C
}
\usepackage[final]{pdfpages}
\usepackage{lscape}
\usepackage{pdflscape}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{fancyhdr}
\fancypagestyle{fancy}{
\renewcommand{\footrulewidth}{0.4pt}% Line at the footer visible
}
\pagestyle{fancy}
\fancyhf{}
\lhead{\small\nouppercase\leftmark}
\rhead{\small\nouppercase\rightmark}
\rfoot{Page \thepage \hspace{1pt} of \pageref{LastPage}}
\fancypagestyle{plain}{%
\fancyhf{}%
\rfoot{Page \thepage \hspace{1pt} of \pageref{LastPage}}%
\renewcommand{\headrulewidth}{0pt}% Line at the header invisible
\renewcommand{\footrulewidth}{0.4pt}% Line at the footer visible
}
\usepackage{calc}
\setlength{\parindent}{0pt}
\usepackage{lastpage}
%%%Sprog og font%%%
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[sc]{mathpazo}
\linespread{1.05}
\usepackage[T1]{fontenc}
\usepackage{physics}
\AtBeginDocument{\RenewCommandCopy\qty\SI}
%%%Grafik%%%
\usepackage{float}
%\usepackage{xcolor}
%\definecolor{aaublue}{RGB}{33,26,82}% dark blue
\usepackage{graphicx}
\usepackage{caption}
\captionsetup{%
font=footnotesize,% set font size to footnotesize
labelfont=bf % bold label (e.g., Figure 3.2) font
}
\usepackage{adjustbox}
\usepackage{array,booktabs}
\usepackage{framed}
\usepackage{lscape}
%%%Matematik%%%
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{siunitx}
\usepackage[framed,amsmath,thmmarks]{ntheorem}
\newenvironment{conditions}
{\par\vspace{\abovedisplayskip}\noindent\begin{tabular}{>{$}l<{$} @{${}={}$} l}}
{\end{tabular}\par\vspace{\belowdisplayskip}}
\usepackage{textcomp}
%%%Overskrifter%%%
\usepackage{titlesec}
\titleformat{\chapter}[display]{\normalfont\bfseries}{}{0pt}{\Huge}
\titleformat{\chapter}{\normalfont\bfseries\huge}{\thechapter}{20pt}{\huge}
\titlespacing*{\chapter}{0pt}{-50pt}{10pt}
\titleformat*{\section}{\normalfont\Large\bfseries}
\titleformat*{\subsection}{\normalfont\large\bfseries}
\titleformat*{\subsubsection}{\normalfont\normalsize\bfseries}
%%%Kommentarer%%%
\usepackage{verbatim}
%%%Kildehenvisninger%%%
\usepackage{csquotes}
\usepackage[nottoc]{tocbibind}
\usepackage[backend=biber,style=numeric,sortcites,natbib=true,sorting=none,date=iso,seconds=true]{biblatex}
\setcounter{biburllcpenalty}{9000}
\addbibresource{Bib/Kilder.bib}
%%%Appendix og indholdsfortegnelse%%%
\usepackage[toc,page]{appendix}
%\appto\appendix{\addtocontents{toc}{\protect\setcounter{tocdepth}{0}}}
%Ændrer * til cdot notation
\mathcode`\*="8000
{\catcode`\*\active\gdef*{\cdot}}
%Pakke til SI enheder
\usepackage{siunitx}
%Pakke til glossary
\usepackage[acronym]{glossaries}
%Pakke til .svg figurer
\usepackage{svg}
%Pakke til wrapfigure
\usepackage{wrapfig}
% Enable hyperlinks and insert info into the pdf file
\usepackage[hidelinks]{hyperref}
\hypersetup{%
%pdfpagelabels=true,%
plainpages=false,%
pdfauthor={Author(s)},%
pdftitle={Title},%
pdfsubject={Subject},%
bookmarksnumbered=true,%
colorlinks=false,%
citecolor=black,%
filecolor=black,%
linkcolor=black,% you should probably change this to black before printing
urlcolor=black,%
pdfstartview=FitH%
}
%\usepackage{hyperref}
\usepackage{lipsum}
% Enables file trees, which can be generated using
%https://github.com/d-koppenhagen/latex-dirtree-generator
\usepackage{dirtree}
\usepackage{xcolor}
\definecolor{aaublue}{RGB}{33,26,82}% dark blue
\definecolor{mGreen}{rgb}{0,0.6,0}
\definecolor{mGray}{rgb}{0.5,0.5,0.5}
\definecolor{mPurple}{rgb}{0.58,0,0.82}
\definecolor{backgroundColour}{rgb}{0.95,0.95,0.92}
\lstdefinestyle{CStyle}{
backgroundcolor=\color{backgroundColour},
commentstyle=\color{mGreen},
keywordstyle=\color{magenta},
numberstyle=\tiny\color{mGray},
stringstyle=\color{mPurple},
basicstyle=\footnotesize,
breaklines=true,
breakatwhitespace=false,
captionpos=b,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2,
language=C,
tabsize=4,
tabsize=2,
}
以下是附录主要内容:
\chapter{Appendix}
\setcounter{section}{0}% Reset numbering for sections
\renewcommand{\thesection}{\Alph{section}}
\include{Text/09 - Appendix/Glossary}
\include{Text/09 - Appendix/CAN_Bitfields.tex}
%\include{Text/09 - Appendix/Figures.tex}
\include{Text/09 - Appendix/Source Code.tex}
\include{Text/09 - Appendix/Compression Rate Test}
\include{Text/09 - Appendix/Delete Files Test}
\include{Text/09 - Appendix/OV7670_output_format_test}
\include{Text/09 - Appendix/Prototype Design.tex}
这是词汇表文件:
\section{Abbreviation}\label{app:abbreviation}
\setglossarystyle{list}
\setlist[description]{style = standard}
\printglossary[type=\acronymtype,title={}]