LaTeX标题大小、位置控制
文章目录
插入宏包
宏包titlesec
\usepackage{titlesec}
section标题左对齐
可直接使用CTEXsetup控制标题左对齐
\CTEXsetup[format={\Large\bfseries}]{section}
使用titleformat可同时控制大小及位置
section左对齐及大小
section默认位置为居中,大小为Large
\titleformat{\section}
{\normalfont\normalsize\bfseries}{\thesection}{1em}{}
normalsize控制section的大小,同时加入这段代码后section会左对齐。
section恢复默认
\titleformat{\section}
{\centering\normalfont\Large\bfseries}{\thesection}{1em}{}
这样就恢复居中及大小了。
代码均可在文章中间插入,随时调整,不必一定在\begin{document}之前。
subsection居中及大小
subsection默认大小为large,位置为左对齐。
\titleformat{\subsection}
{\centering\normalfont\Large\bfseries}{\thesubsection}{1em}{}
更改大小为Large,位置为居中
subsection恢复默认
\titleformat{\subsection}{\normalfont\large\bfseries}{\thesubsection}{1em}{}
恢复左对齐及大小了。
与section类似,可随时调整。
subsubsection
与subsection类似
字号
从小到大
\tiny
\scriptsize
\footnotesize
\small
\normalsize
\large
\Large
\LARGE
\huge
\Huge