我有以下代码:
\documentclass{article}
\usepackage{geometry}
\usepackage{amsfonts, setspace}
\usepackage[fleqn]{amsmath}
\usepackage{mathtools}
\usepackage{cancel}
\begin{document}
\begin{equation*}
\begin{rcases}
\begin{split}
\left.
\begin{alignedat}{4}
n^2 &> 0\\
n &> 0\\
1 &> 0\\
\end{alignedat}
\right\}
&\Rightarrow n^2 + n + 1 > 0
\\
\left.
\begin{alignedat}{4}
n &> 0\\
n + 2 &> 0\\
1 - n^2 &< 0\\
\end{alignedat}
\right\}
&\Rightarrow n(n + 2)(1 - n^2) < 0
\end{split}
\end{rcases}
\Rightarrow
\frac{n^2 + n + 1}{n(n + 2)(1 - n^2)} < 0
\end{equation*}
\end{document}
结果是:
但是,我希望右侧的括号仅延伸到实际的 2 条线,而不是整个等式。我该如何实现?此外,我混合了两种创建右括号的方法,因此如果您知道更简洁的方法,我将不胜感激
答案1
您可以缩小外部分隔符并恢复内部分隔符的设置,我只是在这里用眼睛选择了收缩量
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{equation*}
\xdef\restoredels{%
\delimitershortfall=\the\delimitershortfall
\delimiterfactor=\the\delimiterfactor
}
\delimitershortfall=30pt
\delimiterfactor=500
\left.
\restoredels
\begin{aligned}
\left.
\begin{alignedat}{4}
n^2 &> 0\\
n &> 0\\
1 &> 0\\
\end{alignedat}
\right\}
&\Rightarrow n^2 + n + 1 > 0
\\[\jot]
\left.
\begin{alignedat}{4}
n &> 0\\
n + 2 &> 0\\
1 - n^2 &< 0\\
\end{alignedat}
\right\}
&\Rightarrow n(n + 2)(1 - n^2) < 0
\end{aligned}
\right\}
\Rightarrow
\frac{n^2 + n + 1}{n(n + 2)(1 - n^2)} < 0
\end{equation*}
\end{document}
答案2
更复杂...使用tikzmark
库:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,calligraphy,
tikzmark}
\usepackage{mathtools}
\begin{document}
\begin{align*}
\begin{rcases}
\begin{split}
n^2 & > 0\\
n & > 0\\
1 & > 0\\
\end{split}
\end{rcases} & \Rightarrow n^2 + n + 1 > \tikzmarknode{A}{0} \\
\begin{rcases}
\begin{split}
n & > 0\\
n + 2 & > 0\\
1 - n^2 & < 0\\
\end{split}
\end{rcases} & \Rightarrow n(n + 2)(1 - n^2) < \tikzmarknode{B}{0}
%
\begin{tikzpicture}[overlay, remember picture,
BC/.style = {decorate, % Brace Calligraphic
decoration={calligraphic brace, amplitude=2mm,
raise=2mm},
very thick, pen colour={black}
},
]
\draw[BC] (A.north -| B.east) --
node[right=4mm] {$\Rightarrow \frac{n^2 + n + 1}{n(n + 2)(1 - n^2)} < 0$}
(B.south east);
\end{tikzpicture}
\end{align*}
\end{document}
经过两次编译结果是:
答案3
另一种解决方案,具有array
环境和\bigdelim
:
\documentclass{article}
\usepackage{mathtools}
\usepackage{array, bigdelim, multirow}
\usepackage{booktabs}
\begin{document}
\begin{equation*}
\setlength{\extrarowheight}{\jot}
\begin{array}{r@{}l@{}l@{}l@{}l}
n^2 > 0 & \rdelim\}{3}{*}\\
n > 0 & & \Rightarrow n^2 + n + 1 > 0 &\rdelim\}{4.5}{*} \\
1 > 0 & & & & \multirow{2.5}{*}{$ \Rightarrow\dfrac{n^2 + n + 1}{n(n + 2)(1 - n^2)} < 0 $}\\
\addlinespace
n > 0 & \rdelim\}{3}{*} \\
n + 2 > 0 & & \Rightarrow n(n + 2)(1 - n^2) < 0\\
1 - n^2 < 0 \\
\end{array}
\end{equation*}