formatting - 如何在 LaTeX 中给章节标题加下划线?

编辑:正如我在第一个答案中看到的,下划线是错误的词。我想在章节标题下有一行,将标题与以下文本分开。

我想用一条水平线将部分标题与以下文本分开。目前我使用以下内容:

\newcommand{\tmpsection}[1]{}
\let\tmpsection=\section
\renewcommand{\section}[1]{\tmpsection{#1}\hrule\nobreak}

但这会产生一条线,离节标题太远,离后面的文本太近。有人有更好的主意吗?

最佳答案

听说titlesecsectsty 包更强大,所以就用了。您可以使用以下方法将水平线放在节标题之前:

\usepackage{titlesec}
\titleformat{\section}{\large\bfseries}{\thesection}{1em}{\hrule}

或者你可以在 newcommand 的帮助下把它放在后面。

参见 titlesec manual 的第 4.4 节.

https://stackoverflow.com/questions/1392614/

相关文章:

r - 更改 R DataTables (DT) 中的字体大小

android - 在 EditText 中自动格式化电话号码

ide - 为什么 IDE 不支持动态格式化?

javascript - Vue js 文本高亮过滤器

android - 如何正确显示 MediaPlayer 的位置/持续时间?

c# - Visual Studio 在 if 语句后添加空格

perl - 如何在 Perl 中输出文本表?

eclipse - 如何使 Eclipse Formatter 不破坏注释掉的代码?

python - python 3中的字符串拆分格式

postgresql - 我可以在 PostgreSQL 中获得 CSV header 但没有行数吗