8
\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}

I want to add a curly bracket to the right of the two first lines : Structure

I tried to use the mathtools package:

\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}

But the alignment is then messed up

How can I achieve that, maybe without the rcases environment ?

Crob
  • 91
  • 3

3 Answers3

6

You can position a large } while hiding it from the alignment:

enter image description here

\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}

David Carlisle
  • 757,742
6

You can use 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}

enter image description here

egreg
  • 1,121,712
5

with tikzmark and calligraphy

\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}

enter image description here

polyn
  • 5,614