答案1
也许是这样的,有tikz
?
\documentclass{article}
\usepackage{lipsum}
\usepackage{tikz}
\newcommand{\parline}[1][orange]{%
\par\noindent%
\tikz{
\draw[-,dashed,#1] (0.01*\linewidth,0) -- (0.99*\linewidth,0);
\draw[-,thick,#1] (0,-0.5ex) -- (0,0.5ex) (\linewidth,-0.5ex) -- (\linewidth,0.5ex);
}%
\par
}
\begin{document}
\lipsum[1]
\parline
\lipsum[2]
\end{document}
答案2
另一种选择是dashrule
\documentclass{article}
\usepackage{lipsum}
\usepackage{dashrule}
\usepackage{xcolor}
\newcommand{\mydashrule}{\par~\par\noindent\textcolor{orange}{\rule[-2pt]{1pt}{5pt}\rule[0pt]{3pt}{1pt}\hdashrule{\linewidth}{1pt}{3pt}\hspace*{-4pt}\rule[-2pt]{1pt}{5pt}}\par~\par}
\begin{document}
\lipsum[1]
\mydashrule
\lipsum[2]
\end{document}
答案3
以下是使用版本\leaders
:
\documentclass{article}
\usepackage{lipsum}
\usepackage{xcolor}
\newcommand{\parline}[1][orange]{\bgroup\color{#1}\par\noindent
\rule[\dimexpr 0.5\ht\strutbox-0.5\dp\strutbox-3pt]{1pt}{6pt}% verticaL 6pt
\leaders\hbox to 6pt{\hss-\hss}\hfill% dashed horizontal with 6pt spacing
\rule[\dimexpr 0.5\ht\strutbox-0.5\dp\strutbox-3pt]{1pt}{6pt}% verticaL 6pt
\par\egroup}
\begin{document}
\lipsum[1]
\parline
\lipsum[2]
\end{document}