我正在写一篇带有附录的论文(硕士论文),对于这篇论文,我希望标题左对齐。但对于附录,标题应该居中。对于这篇论文,我在序言中使用了以下设置:
\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}