\section 标题的不同大小

\section 标题的不同大小

我想在报告中添加附录。为了做到这一点,我添加了附录包,将 \section “重命名”为附录 A、B 等...但我想将其缩小,同时保持文档其他 \section 的大小与以前相同。你知道怎么做吗?提前谢谢,Romain。

\documentclass[a4paper,12pt]{article}
\usepackage[a4paper, total={6in, 8in}]{geometry}
\usepackage[title]{appendix}
\begin{document}
\section{Title of the section}
\begin{appendices}
\section{Title of the appendix A}
\section{Title of the appendix B}
\end{appendices}
\end{document}

当我尝试以下命令时,内容表出现了问题。

\documentclass[a4paper,12pt]{article}
\usepackage[a4paper, total={6in, 8in}]{geometry}
%\usepackage[title]{appendix} % No longer needed
\makeatletter
\renewcommand\appendix{\par
  \setcounter{section}{0}%
  \setcounter{subsection}{0}%
  \gdef\thesection{Appendix \@Alph\c@section}
  \renewcommand\section{\@startsection {section}{1}{\z@}%
    {-3.5ex \@plus -1ex \@minus -.2ex}%
    {2.3ex \@plus.2ex}%
    {\normalfont\large\bfseries}}% from \Large
  \renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
    {-3.25ex\@plus -1ex \@minus -.2ex}%
    {1.5ex \@plus .2ex}%
    {\normalfont\normalsize\bfseries}}% from \large
}
\makeatother
\begin{document}
\newpage
\tableofcontents
\newpage
\section{Title of the section}
\appendix % Added
%\begin{appendices} % No longer needed
\section{Title of the appendix A}
\section{Title of the appendix B}
%\end{appendices} % No longer needed
\end{document} 

答案1

像这样吗?

\documentclass[a4paper,12pt]{article}
\usepackage[a4paper, total={6in, 8in}]{geometry}
%\usepackage[title]{appendix} % No longer needed
\makeatletter
\renewcommand\appendix{\par
  \setcounter{section}{0}%
  \setcounter{subsection}{0}%
  \gdef\thesection{Appendix \@Alph\c@section}
  \renewcommand\section{\@startsection {section}{1}{\z@}%
    {-3.5ex \@plus -1ex \@minus -.2ex}%
    {2.3ex \@plus.2ex}%
    {\normalfont\large\bfseries}}% from \Large
  \renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
    {-3.25ex\@plus -1ex \@minus -.2ex}%
    {1.5ex \@plus .2ex}%
    {\normalfont\normalsize\bfseries}}% from \large
}
\makeatother
\begin{document}
\section{Title of the section}
\appendix % Added
%\begin{appendices} % No longer needed
\section{Title of the appendix A}
\section{Title of the appendix B}
%\end{appendices} % No longer needed
\end{document}

请注意,我没有使用appendix包,但您的 MWE 中的结果相同。如果您除了Appendix [...]在每个部分和小节中都有其他原因,请告诉我。

相关内容