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 ?

1
  • Welcome to the TeX.SE. community.
    – Sebastiano
    Commented Oct 28, 2023 at 20:09

3 Answers 3

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .