答え1
このtcolorbox
パッケージを使用すると、垂直線を作成する環境を作成できます。
\documentclass[a4paper]{article}
\usepackage[most]{tcolorbox}
% \usepackage{pgfplots}
\newtcolorbox{env}{
enhanced,
breakable, % This make the box breakable
boxrule=0pt,
frame hidden,
borderline west={2pt}{0pt}{black}, % this create the line
colback=white, % The background color,
math upper,
hbox,
center
}
\begin{document}
Text text text
\begin{env}
\int_{-\infty}^{\infty}f(x)\delta(x-a)dx = f(a)
\end{env}
\end{document}
答え2
配列のような環境を使用して、または最初ではないすべての要素の前。あまりきれいではありませんが、機能します。
\documentclass[a4paper]{article}
\usepackage{ifthen}
\newcounter{orcounter}
\newenvironment{orlist}{%
\noindent\begin{tabular*}{\textwidth}{|l}
\setcounter{orcounter}{0}
}{%
\end{tabular*}
}
\newcommand{\oritem}[1]{%
\ifthenelse{\equal{\theorcounter}{0}}{\hspace{-1em}}{\\ \textbf{or}\\}
#1\stepcounter{orcounter}
}
% -- Usage Example
\begin{document}
\begin{orlist}
\oritem{example 1}
\oritem{example 2}
\end{orlist}
\end{document}
答え3
答え4
クラスメートの助けを借りて、私が当初望んでいたものにさらに近い新しいソリューションを作成することができました。環境の代わりにコマンドを使用しますが、はるかに優れています。
コードは次のとおりです:
\newcounter{orcounter}
\newenvironment{orlist}
{
\begin{array}{|l}
\setcounter{orcounter}{0}
}
{
\end{array}
}
\newcommand{\oritem}[1]{%
\ifthenelse{\theorcounter<1}{}{\\ \text{ou} \\}#1\stepcounter{orcounter}
}
\NewDocumentCommand{\orenv}{>{\SplitList{\\}}m}{%
\begin{orlist}\ProcessList{#1}{\oritem}\end{orlist}}
次のように非常に簡単に使用できます。
\[\orenv{G\text{ abélien} \\ I=\ensvide}\]