如何在 Latex 中为标题段落部分加下划线

如何在 Latex 中为标题段落部分加下划线

我读过很多与我的问题非常相似的问题,但我无法让它们正常工作。我想要的是将段落放在“小节”下方(不编号也不包含在索引中)。

我希望段落标题带有下划线、粗体,其余文本以新行开始。我试过乌莱姆教派,但它们都没有按预期工作。目前我正在使用以下代码:

\titleformat{\paragraph}
{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
\titlespacing*{\paragraph}
{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}

有什么建议吗?提前感谢您的回复!

答案1

对于我来说这很好(尽管不建议使用下划线瓷砖:它是在打字机时代使用的,因为没有更好的方法了):

\documentclass{article}
\usepackage{ulem}
\usepackage{titlesec}

 \titleformat{\paragraph}[hang]{\bfseries}{}{0pt}{\uline}
\titlespacing*{\paragraph}
{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}

\begin{document}

\paragraph{test}
Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.

\end{document} 

在此处输入图片描述

相关内容