如何摆脱算法中的命令(for、do、if...)?

如何摆脱算法中的命令(for、do、if...)?

我正在用 LATEX 写一篇论文,如图所示。我试了很多次,但还没有展示出如何做。 在此处输入图片描述

我尝试使用算法输入此示例,但无法输入。您能为我的问题提供一些提示吗?谢谢大家!

答案1

您可以使用常规tabular

在此处输入图片描述

\documentclass{article}

\usepackage{lipsum}
\newcommand{\algvrule}{@{\hspace{.5em}}|@{\hspace{1em}}}

\begin{document}

\lipsum[1]

\noindent
\begin{tabular}{@{} l @{}}
  As before,~$k$ here is a commutative ring. \\
  \begin{tabular}{\algvrule l @{}}
    Hence could be a field of integers~$Z$; these are the usual choices. \\
    \begin{tabular}{\algvrule l @{}}
      Given an infinite variable set $x = (x_1; x_2; \ldots)$, a monomial \\
      $x^p = x_1^a x_2^b \cdots$, is indexed by an element $t = (a; b; \ldots)$ in~$N^\infty$ \\
      having finite support, such~$t$ are called weak compositions.
    \end{tabular} \\
    The nonzero ones among the integers $a; b; \ldots$ are called the parts of the
  \end{tabular} \\
  weak composition~$t$.
\end{tabular}

\lipsum[2]

\end{document}

相关内容