テキスト間に2本の線を引く方法

テキスト間に2本の線を引く方法

この図のようにテキスト間に2本の線を引く方法。これが私のコードです

\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}

ここに画像の説明を入力してください

答え1

代替案を提案させてください。algorithmic詳細については、こちらにあるパッケージを使用してください。アルゴリズム2 つの画像が生成されます。1 つはコードから生成され、もう 1 つは 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}

ここに画像の説明を入力してください

関連情報