Q:

how to draw special line in latex

I want to draw a line between two text paragraphs, I try many ways but no one is ok, anyone know how to draw line like this?

A:

Maybe something like this, with 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}

A:

An alternative with 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}

A:

Here is a version using \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}

