![两种算法之间的垂直线](https://linux22.com/image/378912/%E4%B8%A4%E7%A7%8D%E7%AE%97%E6%B3%95%E4%B9%8B%E9%97%B4%E7%9A%84%E5%9E%82%E7%9B%B4%E7%BA%BF.png)
我试图将两种算法并排放置,并在它们之间画一条垂直线。我有以下 MWE:
\documentclass{article}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\begin{document}
\begin{table}
\begin{tabular}{c|c}
\begin{minipage}{5cm}
\begin{algorithm}[H]
\caption{My algorithm}\label{euclid0}
\begin{algorithmic}[1]
\Procedure{Euclid}{$a,b$}
\State $r\gets a\bmod b$
\While{$r\not=0$}
\State $a\gets b$
\State $b\gets r$
\State $r\gets a\bmod b$
\EndWhile
\State \textbf{return} $b$\Comment{The gcd is b}
\EndProcedure
\end{algorithmic}
\end{algorithm}
\end{minipage}
&
\begin{minipage}{5cm}
\begin{algorithm}[H]
\caption{My algorithm}\label{euclid1}
\begin{algorithmic}[1]
\Procedure{Euclid}{$a,b$}
\State $r\gets a\bmod b$
\While{$r\not=0$}
\State $a\gets b$
\State $b\gets r$
\State $r\gets a\bmod b$
\EndWhile
\State \textbf{return} $b$\Comment{The gcd is b}
\EndProcedure
\end{algorithmic}
\end{algorithm}
\end{minipage}
\end{tabular}
\end{table}
\end{document}
问题是,绘制的垂直线比算法占用的垂直空间更长:
如何解决这个问题(擦除算法标题顶部的垂直线的顶部?)
笔记:我尝试过minipage
和\vline
,但也有同样的问题。