Como desenhar duas linhas entre o texto

Como desenhar duas linhas entre o texto

Como desenhar duas linhas entre o texto conforme mostrado nesta imagem. Este é o meu código

\documentclass{article}
\thispagestyle{empty}
\usepackage{lipsum}

\begin{document}



\noindent\rule[0.5ex]{\linewidth}{1pt}
Algorithm Use iteration to find general solution
\noindent\rule[0.5ex]{\linewidth}{1pt}
fator $a$,$b$
$y=a+bx$
\noindent\rule[0.5ex]{\linewidth}{1pt}
\end{document}

insira a descrição da imagem aqui

Responder1

Posso sugerir uma alternativa. Use algorithmico pacote onde você pode encontrar mais informações aquiAlgoritmos. Duas imagens são geradas: uma a partir do seu código e a outra é um exemplo baseado na imagem OP.

\documentclass[10pt,a4paper]{article}
\usepackage{algorithmic}
\usepackage{algorithm}
\begin{document}

% Your code

\noindent\rule[0.5ex]{\linewidth}{1pt}
Algorithm Use iteration to find general solution

\noindent\rule[0.5ex]{\linewidth}{1pt}

factor $a$,$b$

$y=a+bx$

\noindent\rule[0.5ex]{\linewidth}{1pt}

% alternative

\begin{algorithm}
\caption{Use iteration to find the general solution of the ODE in Example 1.4}\label{abc}
\begin{algorithmic}[1]
\STATE factor \textbf{a,b};
\STATE {\textbf {y:=a+b*x}};
\FOR {\textbf{n:=1:4 do write}}
\STATE {\textbf{y:=a+b*x-int(int(y,x),x)}}
\ENDFOR
\end{algorithmic}
\end{algorithm}
\end{document}

insira a descrição da imagem aqui

informação relacionada