텍스트 사이에 두 줄을 그리는 방법

텍스트 사이에 두 줄을 그리는 방법

이 그림과 같이 텍스트 사이에 두 개의 선을 그리는 방법입니다. 이것은 내 코드입니다

\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여기에서 자세한 정보를 찾을 수 있는 패키지를 사용하세요 .알고리즘. 두 개의 이미지가 생성됩니다. 하나는 코드에서, 다른 하나는 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}

여기에 이미지 설명을 입력하세요

관련 정보