为部分和章节定义较小的字体大小

为部分和章节定义较小的字体大小

例子

\documentclass{article}
\begin{document}

\part{1. At the next lecture we will be talking about binary mixtures and their phase behaviour.}
\section{The system consists of two types of particles (say, A and B)}

\section{The particles fill a simple 3D lattice}

\end{document}

我在中间写下了我的答案。然而,实际上第一句话更长。它看起来很长:

在此处输入图片描述

如何让部分或章节的字体变小?

我可以申请这个

{\fontsize{0.3cm}{0.4em}\selectfont \textbf{This is small but bold!}}

但挑战在于将其应用于定义部分和章节字体大小的某些声明。

答案1

有了这个包就很方便了sectsty

只需定义

\parttitlefont{\Large}
\sectionfont{\large}

平均能量损失

\documentclass{article}

\usepackage{sectsty}

\parttitlefont{\Large}
\sectionfont{\large}

\begin{document}

\part{1. At the next lecture we will be talking about binary mixtures and their phase behaviour.}

\section{The system consists of two types of particles (say, A and B)}

\section{The particles fill a simple 3D lattice}

\end{document} 

输出

在此处输入图片描述

答案2

您可以使用 titlesec 包。它允许进行许多此类修改。您可能需要查看其文档以了解详细信息,但对于仅比章节标题稍大的部分标题,您可以使用

\documentclass{article}
\usepackage{titlesec}
\titleformat{\part}[display]{\LARGE\bfseries}{Part~\thepart}{8pt}{}

\begin{document}

\part{1. At the next lecture we will be talking about binary mixtures and their phase behaviour.}
\section{The system consists of two types of particles (say, A and B)}

\section{The particles fill a simple 3D lattice}

\end{document}

答案3

这是一种可能性。将命令partsection定义复制到article.cls序言中,并根据您的喜好更改字体大小命令。请注意,如果您只更改part,则section所有其他标题(小节、段落)都不会改变。

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{lmodern}
\usepackage{lipsum}

\makeatletter
\renewcommand\section{\@startsection {section}{1}{\z@}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\normalfont\large\bfseries}}
\def\@part[#1]#2{%
    \ifnum \c@secnumdepth >\m@ne
      \refstepcounter{part}%
      \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
    \else
      \addcontentsline{toc}{part}{#1}%
    \fi
    {\parindent \z@ \raggedright
     \interlinepenalty \@M
     \normalfont
     \ifnum \c@secnumdepth >\m@ne
       \large\bfseries \partname\nobreakspace\thepart
       \par\nobreak
     \fi
     \Large \bfseries #2%
     \markboth{}{}\par}%
    \nobreak
    \vskip 3ex
    \@afterheading}
\makeatother

\begin{document}

\part{1. At the next lecture we will be talking about binary mixtures and their phase behaviour.}
\section{The system consists of two types of particles (say, A and B)}
\lipsum[1]
\section{The particles fill a simple 3D lattice}
\lipsum[2]
\end{document}

在此处输入图片描述

相关内容