答案1
您可以在标题(部分、小节等)之前放置一个 tikz 行,然后使用带有负值的 \vspace{} 将其移动到标题上。
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[line width=3pt]
\draw[rounded corners=8pt, pink] (0,0) -- (0.5,0.5) -- (0.7,0.0) -- (1.1,0.6) -- (1.5,-0.1) -- (1.8,0.4) -- (2.4,-0.1) -- (3.0,0.3) -- (3.5,0.0);
\end{tikzpicture}
\vspace{-1.3cm} % to move the line over the section header
\section{First section}
Your text goes here.
\begin{tikzpicture}[line width=3pt]
\draw[rounded corners=8pt, pink] (0,0) -- (0.5,0.5) -- (0.7,0.0) -- (1.1,0.6) -- (1.5,-0.1) -- (1.8,0.4) -- (2.4,-0.1) -- (3.0,0.3) -- (3.5,0.0);
\end{tikzpicture}
\vspace{-1.2cm} % to move the line over the section header
\subsection{A subsection}
More text.
\end{document}
您可能需要编辑该行,并且根据您的字体,您可能必须调整 vspace 以使该行出现在您想要的位置,但这对我来说,使用非常简单的文章格式就足够了。