6

I have an split equation.

\documentclass{article}

\usepackage{mathtools}

\begin{document}

\begin{equation*}
\label{eq:elig}
\begin{split}
\Omega_{v} := \{(a,\sigma)|a \in A &\wedge b \in B \wedge x(a,b)=v\\ &\wedge (\forall \sigma' \in B)[x(a,\sigma')! \neq v \rightarrow ( \sigma' \in \Sigma_{\text{hib}} \vee b \in \Sigma_{\text{for}})]\}
\end{split}
\end{equation*}

\end{document} 

I need to add an overbrace to the upper piece and ans underbrace to the lower one, but the following does not work.

\documentclass{article}

\usepackage{mathtools}

\begin{document}

\begin{equation*}
\label{eq:elig}
\begin{split}
\Omega_{v} := \{(a,\sigma)|\overbrace{a \in A &\wedge b \in B \wedge x(a,b)=v}^{\alpha}\\ &\wedge \underbrace{(\forall \sigma' \in B)[x(a,\sigma')! \neq v \rightarrow ( \sigma' \in \Sigma_{\text{hib}} \vee b \in \Sigma_{\text{for}})]}_{\beta}\}
\end{split}
\end{equation*}

\end{document}

I just checked some other questions like the one below, but they are about different situations like tables.

Overbrace in amsmath align environment

Here is what I really need:

enter image description here

2
  • What makes you think you can use & in the argument of \overbrace? Can you show an approximate representation of the desired output?
    – egreg
    Commented Dec 12, 2017 at 18:23
  • @egreg: please have a look at the added image.
    – user122160
    Commented Dec 12, 2017 at 18:33

3 Answers 3

5

I don't think you need to align the two \wedge symbols: a multline is better.

\documentclass{article}

\usepackage{mathtools}

\begin{document}

\begin{multline*}
\label{eq:elig}
\Omega_{v} := \{(a,\sigma)\mid
  \overbrace{a \in A \wedge b \in B \wedge x(a,b)=v}^{\alpha}\\
  \wedge \underbrace{(\forall \sigma' \in B)[x(a,\sigma')!
     \neq v \rightarrow ( \sigma' \in \Sigma_{\mathrm{hib}}
     \vee b \in \Sigma_{\mathrm{for}})]}_{\beta}
\,\}
\end{multline*}

\end{document}

enter image description here

3
  • @Thanks for the help! Just for the sake of curiosity, isn't it possible to handle the issue for the case of split without switching to multline?
    – user122160
    Commented Dec 12, 2017 at 18:52
  • 1
    What if the wedge alignment is a requirement? Of course, I know that one can shift the lower part by hspace{}, but I thought you may have a better idea for that.
    – user78499
    Commented Dec 12, 2017 at 18:57
  • 3
    @Roboticist: You can use \phantom.
    – Werner
    Commented Dec 12, 2017 at 19:06
7

You can insert \phantom content to align \wedge:

enter image description here

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{align*}
  & \Omega_v := \bigl\{ (a, \sigma) \mid
    \overbrace{a \in A \wedge b \in B \wedge x(a, b) = v}^{\alpha} \\
  & \phantom{\Omega_v := \bigl\{ (a, \sigma) \mid a \in A} % for alignment with \wedge
    \wedge \underbrace{(\forall \sigma' \in B) [x(a, \sigma')!
      \neq v \rightarrow ( \sigma' \in \Sigma_{\mathrm{hib}}
      \vee b \in \Sigma_{\mathrm{for}})]}_{\beta}
  \bigr\}
\end{align*}

\end{document}
1
  • Kinda hackish, but effective ! Commented Dec 12, 2017 at 22:42
2

In case you have reasons to keep the alignment symbols (like here), there is an alternative based on tikz:

\documentclass{article}
\usepackage{mathtools}
\usepackage{tikz}
\usetikzlibrary{matrix,decorations.pathreplacing,calc}
% from https://tex.stackexchange.com/questions/339526/confusion-over-use-of-tikzmark
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
\begin{document}

\begin{equation*}
\label{eq:elig}
\begin{split}
\Omega_{v} := \{(a,\sigma)|\tikzmark{a}a \in A &\wedge b \in B \wedge
x(a,b)=v\tikzmark{v}\\ 
&\wedge \tikzmark{lb}(\forall \sigma' \in B)[x(a,\sigma')! \neq v \rightarrow
( \sigma' \in \Sigma_{\text{hib}} \vee b \in \Sigma_{\text{for}})\tikzmark{rb}]\}
\end{split}
\end{equation*}
\tikz[remember picture, overlay,decoration={brace}]{%
\draw[decorate,transform canvas={xshift=0em,yshift=0.75em},thick] (a.north) -- (v.north) node[above=3pt,midway] {$\alpha$};
\draw[decorate,transform canvas={xshift=0em,yshift=-0.5em},thick] (rb.south) -- (lb.south) node[below=3pt,midway] {$\beta$};}
\end{document}

enter image description here

Here you can control the distance of the brace, its thickness etc. Whether this is an advantage or disadvantage is a matter of taste.

You must log in to answer this question.