algorithm2e 环境中的文本宽度

algorithm2e 环境中的文本宽度

我使用该功能包含了一个简单的 .tex 文件的内容algorithm2e。使用旧版(2015)LaTeX 进行编译时,我得到了所需的输出。但是,使用最新版本的 LaTeX 进行编译时(在我自己的笔记本电脑上或在 Overleaf.com 上),环境内的文本宽度algorithm2e会减小(如环境的正确范围所示snugshade*)。

供您参考,我已分享了我的 Dropbox 文件夹链接,其中包含 LaTeX 文件和两个输出(从 .pdf 格式转换为 .png)。我似乎找不到解决这个问题的方法。我将不胜感激任何有关此事的帮助。

以下是我的 LaTeX 文件的内容:

\documentclass[10pt]{article}
\usepackage{parskip} 
\parindent0pt 
\setlength{\parskip}{10pt}
\usepackage[paperwidth=8.5in,paperheight=11.0in, left=1.25in,right=1.25in,top=1.25in,bottom=1.25in, includefoot]{geometry}               
\usepackage[ruled,noend,noline,slide]{algorithm2e}
\usepackage{algpseudocode}
\usepackage{framed}
\usepackage{xcolor}

\definecolor{shadecolor}{RGB}{230,230,230}

\title{Textwidth Inside Algorithm2e Environment}
\author{\large\textsc{Sid}\\[2mm] 
\normalsize\textit{Some Institute} \\
\vspace{-5mm}}
\date{}

\begin{document}
\maketitle 

\begin{algorithm}[H]
\SetAlgoLined
\caption{\emph{MatVecMult}: A Matrix-Vector Multiplication Procedure }
\begin{snugshade*}
\textbf{Procedure} MatVecMult \\
\textbf{Input}:  $\left\{A_{i,j}\right\}_{i,j=0}^{M,N}$, $\left\{B_j\right\}_{j=0}^N$ \\
\For{$i = 0$ \upshape \textbf{to} $M$}{
$t \gets 0$ \\
\For{$j = 0$ \upshape \textbf{to} $N$}{
$t \gets t + A_{i,j}*B_j$
}
\textbf{end} \\
$C_i \gets t$
}
\textbf{end} \\
\Return $\left\{C_j\right\}_{j=0}^M$ \\
\textbf{End Procedure} MatVecMult
\end{snugshade*}
\end{algorithm}

\end{document}

链接到我的 Dropbox 文件夹,其中包含带有两个输出的 Latex 文件

相关内容