如何更改附錄的標題設定?

如何更改附錄的標題設定?

我正在寫一篇帶有附錄的論文(用於碩士論文),並且對於該論文,我希望標題向左對齊。但對於附錄,標題應該要居中。對於本文,我在序言中使用了此設定:

\captionsetup{format=plain, labelfont={bf,it},textfont=it,skip=6pt,font=small, singlelinecheck=off}

但對於附錄,我希望標題居中。我嘗試更新標題設定的命令,如下所示:

\renewcommand\captionsetup{format=plain, labelfont={bf,it},textfont=it,skip=6pt,font=small, singlelinecheck=on}

因此將 singlelinecheck 設為“on”。但這不起作用。

這是如何運作的?我對 LaTeX 很陌生,所以也許我只是不明白 renew 命令?

先感謝您!

我將報告分成一個主文件,並在該文件中添加所有章節,這些章節是單獨的文件。當我這樣做時,也許這是不可能的?這是主文件(的摘要):

\documentclass[10pt, mathptmx,a4paper,twoside]{article}
\usepackage{Packages}
\setlength\columnsep{20pt}
\author{Anne Derks\,}
\title{Master Thesis Sandwich Panels}
\input{Input_titlepage}
\captionsetup{format=plain, labelfont={bf,it},textfont=it,skip=6pt,font=small, singlelinecheck=off}

\begin{document}
\include{Titlepage}
\setcounter{page}{0}
\pagenumbering{roman}
\newpage
\begin{flushleft}
\large\textbf{PREFACE}\\
\addcontentsline{toc}{section}{PREFACE}
\normalsize
\lipsum[1]
\end{flushleft}

\newpage
\renewcommand{\contentsname}{CONTENTS}
\tableofcontents

\newpage
\setcounter{page}{0}
\pagenumbering{arabic}  
\end{flushleft}
 
\vspace{60pt}

\begin{flushleft}
\textbf{ABSTRACT:} 
\hfill 
\\
\vspace{12pt}

\textbf{KEYWORDS:} \hspace{1mm} Sandwich Panels, Geometric Non-Linear Buckling, Connection Failure.
\end{flushleft}
 \vspace{24pt}

\begin{multicols}{2}
\section{INTRODUCTION}\label{section:Introduction}
\input{Chapters/Chapter1_Introduction}  

\section{THEORETICAL BACKGROUND}\label{section:Literature}
\input{Chapters/Chapter2_Literature}            

\section{ANALYTICAL MODEL}\label{section:Analytical_model}
\input{Chapters/Chapter3_AnalyticalModel}   

\renewcommand\refname{REFERENCES}
\bibliographystyle{unsrt}
\bibliography{references}
\addcontentsline{toc}{section}{REFERENCES}
\end{multicols}

\newpage
\appendix
\addcontentsline{toc}{section}{APPENDIX}
\counterwithin{figure}{section}
\counterwithin{table}{section}

\captionsetup{format=plain, labelfont={bf,it},textfont=it,skip=6pt,font=small, singlelinecheck=on}

\newpage
\section{Drawings Cembrit Cetris Basis tests}
\label{Appendix:Cembrit}
\input{Appendices/AppendixH_Cembrit_drawings}

\captionsetup{format=plain, labelfont={bf,it},textfont=it,skip=6pt,font=small, singlelinecheck=off}

\newpage
\section{Results sandwich panel test}
\input{Appendices/AppendixL_Panel_results}

\end{document}

答案1

\renewcommand用於更新命令。在您的情況下,您不想更新命令,而是套用它。因此刪除\renewcommand應該沒問題。

可以\captionsetup在文件中多次使用,如以下 MWE 中所示:

\documentclass{article}
\usepackage{graphicx,subcaption}
\captionsetup{format=plain, labelfont={bf,it},textfont=it,skip=6pt,font=small,singlelinecheck=off}% Setup for main part
\begin{document}
\begin{figure}% figure in main part
    \centering \includegraphics[width=2cm]{example-image-duck} \caption{First caption.}
\end{figure}
% adapt setup for appendix:
\captionsetup{format=plain, labelfont={bf,it},textfont=it,skip=6pt,font=small,singlelinecheck=on}
\begin{figure}% figure in appendix
    \centering \includegraphics[width=2cm]{example-image-duck} \caption{Second caption.}
\end{figure}
% adapt setup for second part of appendix:
\captionsetup{format=plain, labelfont={bf,it},textfont=it,skip=6pt,font=small,singlelinecheck=off}
\begin{figure}% figure in second part of appendix
    \centering \includegraphics[width=2cm]{example-image-duck} \caption{Third caption.}
\end{figure}
\end{document}

結果

評論後編輯

抱歉,很難從您的程式碼中獲得有意義的內容,因為我沒有您的所有文件。即使當我嘗試將您的程式碼簡化為 MWE 時,它仍然有效。

\documentclass[10pt, mathptmx,a4paper,twoside]{article}
\usepackage{subcaption,lipsum,multicol,graphicx}

\captionsetup{format=plain, labelfont={bf,it},textfont=it,skip=6pt,font=small, singlelinecheck=off}

\begin{document}
 
\begin{figure} %%%%%%%%%%%%%%%%%%%%% HERE %%%%%%%%%%%%%%%%%%%%%
    \centering
    \includegraphics[height=2cm]{example-image-a}
    \caption{First image}
\end{figure}
\begin{multicols}{2}
\section{INTRODUCTION}\label{section:Introduction}
\lipsum[1]

\section{THEORETICAL BACKGROUND}\label{section:Literature}
\lipsum[1]         

\section{ANALYTICAL MODEL}\label{section:Analytical_model}
\lipsum[1]

\end{multicols}

\newpage
\appendix
\addcontentsline{toc}{section}{APPENDIX}
\counterwithin{figure}{section}
\counterwithin{table}{section}

\captionsetup{format=plain, labelfont={bf,it},textfont=it,skip=6pt,font=small, singlelinecheck=on}


\newpage
\section{Drawings Cembrit Cetris Basis tests}
\label{Appendix:Cembrit}
\lipsum[1]
\begin{figure} %%%%%%%%%%%%%%%%%%%%% HERE %%%%%%%%%%%%%%%%%%%%%
    \centering
    \includegraphics{example-image-a}
    \caption{First image}
\end{figure}

\captionsetup{format=plain, labelfont={bf,it},textfont=it,skip=6pt,font=small, singlelinecheck=off}
\begin{figure} %%%%%%%%%%%%%%%%%%%%% HERE %%%%%%%%%%%%%%%%%%%%%
    \centering
    \includegraphics{example-image-a}
    \caption{First image}
\end{figure}
\newpage
\section{Results sandwich panel test}
\lipsum[1]

\end{document}

結果

相關內容