![如何在对齐环境中将花括号放置在几行的右侧?](https://linux22.com/image/470444/%E5%A6%82%E4%BD%95%E5%9C%A8%E5%AF%B9%E9%BD%90%E7%8E%AF%E5%A2%83%E4%B8%AD%E5%B0%86%E8%8A%B1%E6%8B%AC%E5%8F%B7%E6%94%BE%E7%BD%AE%E5%9C%A8%E5%87%A0%E8%A1%8C%E7%9A%84%E5%8F%B3%E4%BE%A7%EF%BC%9F.png)
\documentclass[a4paper]{article}
\usepackage{derivative}
\begin{document}
\begin{align*}
\{q_a,q_b\} &= 0 = \{p_a,p_b\} \\
\{q_a,p_b\} &= \delta_{ab} \\
\{q_a,F\} &= \pdv{F}{q_a}\\
\{p_a,F\} &= -\pdv{F}{p_a}
\end{align*}
\end{document}
我尝试使用该mathtools
包:
\documentclass[a4paper]{article}
\usepackage{derivative}
\usepackage{mathtools}
\begin{document}
\begin{align*}
\negthickspace
\begin{rcases}
\{q_a,q_b\} &= 0 = \{p_a,p_b\} \\
\{q_a,p_b\} &= \delta_{ab}
\end{rcases} \\
\{q_a,F\} &= \pdv{F}{q_a}\\
\{p_a,F\} &= -\pdv{F}{p_a}
\end{align*}
\end{document}
但对齐就被搞乱了
我怎样才能实现这一点,也许没有环境rcases
?
答案1
您可以定位一个大}同时隐藏对齐:
\documentclass[a4paper]{article}
\usepackage{mathtools,derivative}
\begin{document}
\begin{align*}
\{q_a,q_b\} &= 0 = \{p_a,p_b\}
\quad\smash{\raisebox{-10pt}{$\mathrlap{\Biggr\}}$}}\\
\{q_a,p_b\} &= \delta_{ab} \\[2pt]
\{q_a,F\} &= \pdv{F}{q_a}\\
\{p_a,F\} &= -\pdv{F}{p_a}
\end{align*}
\end{document}
答案2
您可以使用nicematrix
:
\documentclass[a4paper]{article}
\usepackage{derivative}
\usepackage{nicematrix}
\begin{document}
\begin{equation*}
\setlength{\arraycolsep}{0pt}
\renewcommand{\arraystretch}{1.5}
\begin{NiceArray}{r >{{}}c<{{}} >{\displaystyle}l}
\{q_a,q_b\} &=& 0 = \{p_a,p_b\} \\
\{q_a,p_b\} &=& \delta_{ab} \\[1ex]
\{q_a,F\} &=& \pdv{F}{q_a}\\[2ex]
\{p_a,F\} &=& -\pdv{F}{p_a}
\CodeAfter\SubMatrix.{1-3}{2-3}\}
\end{NiceArray}
\end{equation*}
\end{document}
答案3
带有 tikzmark 和书法
\documentclass[a4paper]{article}
\usepackage{amsmath}
\usepackage{derivative}
\usepackage{tikz}
\usetikzlibrary{decorations,calligraphy,tikzmark}
\begin{document}
\begin{align*}
\{q_a,q_b\} &= 0 = \tikzmarknode{ne}{\{p_a,p_b\}} \\
\{q_a,p_b\} &= \tikzmarknode{se}{\delta_{ab}} \\
\{q_a,F\} &= \pdv{F}{q_a}\\
\{p_a,F\} &= -\pdv{F}{p_a}
\end{align*}
\begin{tikzpicture}[remember picture,overlay]
\draw[decorate, decoration={calligraphic brace, amplitude=4pt, raise=4pt}, thick]
([yshift=2pt]ne.north east) -- ([yshift=-2pt]ne.north east |- se.south east);
\end{tikzpicture}
\end{document}