枚举环境中的括号跨越两行或更多行

枚举环境中的括号跨越两行或更多行

我试图在枚举环境中让括号出现在第 2 行和第 3 行。给出的解决方案这里在第一个枚举环境中使用,但括号看起来不如第二个解决方案中的括号那么吸引人。

有没有办法让第二个枚举环境中给出的粗括号显示在第一个枚举环境中?

以下是代码:

\documentclass{article}
\pagestyle{empty}% for cropping
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,calc}
\usepackage{amsmath,amsfonts,amssymb,amsthm}

\begin{document}
\newcommand{\tikzmark}[2]{\tikz[remember picture,baseline=(#1.base)]{\node[inner sep=0pt] (#1) {#2};}}
\begin{enumerate}
    \item First item
    \item \tikzmark{L}{Second is a much longer item}
    \item \tikzmark{I}{Third item}
    \item Fourth item
    \item Fifth item
\end{enumerate}
\begin{tikzpicture}[remember picture,overlay]
    \draw[decorate,decoration={brace}] (L.north east) -- node[right] {Noise} (L.north east |- I.south east);
\end{tikzpicture}

$\left.\begin{minipage}{5.5cm}
\begin{enumerate}
\item First item
\item Second is a much longer item
\item Third item
\end{enumerate}
\end{minipage}\right\rbrace$ Some comment

\end{document}

答案1

由于第一个括号是使用绘制的,因此tikz您可以应用选项来\draw控制线宽。下面我使用了line width=1.25pt, draw=red

在此处输入图片描述

代码:

\documentclass{article}
\pagestyle{empty}% for cropping
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,calc}
\usepackage{amsmath,amsfonts,amssymb,amsthm}

\begin{document}
\newcommand{\tikzmark}[2]{\tikz[remember picture,baseline=(#1.base)]{\node[inner sep=0pt] (#1) {#2};}}
\begin{enumerate}
    \item First item
    \item \tikzmark{L}{Second is a much longer item}
    \item \tikzmark{I}{Third item}
    \item Fourth item
    \item Fifth item
\end{enumerate}
\begin{tikzpicture}[remember picture,overlay]
    \draw[decorate,decoration={brace}, line width=1.25pt, draw=red] (L.north east) -- node[right] {Noise} (L.north east |- I.south east);
\end{tikzpicture}

$\left.\begin{minipage}{5.5cm}
\begin{enumerate}
\item First item
\item Second is a much longer item
\item Third item
\end{enumerate}
\end{minipage}\right\rbrace$ Some comment

\end{document}

相关内容