답변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}\]