7

My current approach uses phantom to place the first line where I want it, is there a better way to do this? I would still like the split environment or something similar so I can align multiple where clauses.

\newcommand{\graphG}{\mathcal{G}}                                                  
\newcommand{\modelM}{\mathcal{M}}
\newcommand{\card}[1]{\left|#1\right|}  
\newcommand{\vertices}[1]{V\!\left(#1\right)} 

\begin{equation}                                                                   
\begin{split}                                                                      
&\phantom{aaaaaaaa}\modelM \mapsto \graphG, x \le \card{\vertices{\graphG}} \\  
\textbf{where}\;x &= \text{number of maximal overlapping regions in $\modelM$}                    
\end{split}                                                                        
\end{equation} 

Desired result

9
  • Under any circumstances, you will have to know the width of the widest where clause.As for the centering, there is several useful tools in the mathtools package.
    – daleif
    Commented Dec 10, 2013 at 14:24
  • 1
    Use gathered environment from mathtools
    – Aditya
    Commented Dec 10, 2013 at 14:26
  • 1
    @Aditya, gathered is from amsmath and it will not let the OP align several where clauses (it was also my first thought)
    – daleif
    Commented Dec 10, 2013 at 14:28
  • Put the two expressions into an \array. You might need to use \displaymode since \array put one into the other mode. Commented Dec 10, 2013 at 14:46
  • 1
    @GarethA.Lloyd, that is sheer luck that that actually works.
    – daleif
    Commented Dec 10, 2013 at 15:08

5 Answers 5

4

I'm surprised the simplest solution has not been given, that is, using gathered. The additions with \DeclarePairedDelimiter are only stylistical.

\documentclass{article}
\usepackage{amsmath,mathtools}

\newcommand{\graphG}{\mathcal{G}}
\newcommand{\modelM}{\mathcal{M}}
\DeclarePairedDelimiter{\card}{\lvert}{\rvert}
\DeclarePairedDelimiter{\parens}{(}{)}
\newcommand{\vertices}{V\parens}

\begin{document}

\begin{equation}
\begin{gathered}
\modelM \mapsto \graphG, x \le \card{\vertices{\graphG}} \\
\text{\textbf{where} $x={}$number of maximal overlapping regions in $\modelM$}
\end{gathered}
\end{equation}

\end{document}

enter image description here

Multiple clauses can use alignedat that allows for specifying accurately the spacing:

\documentclass{article}
\usepackage{amsmath,mathtools}

\newcommand{\graphG}{\mathcal{G}}
\newcommand{\modelM}{\mathcal{M}}
\DeclarePairedDelimiter{\card}{\lvert}{\rvert}
\DeclarePairedDelimiter{\parens}{(}{)}
\newcommand{\vertices}{V\parens}

\begin{document}

\begin{equation}
\begin{gathered}
\modelM \mapsto \graphG, x \le \card{\vertices{\graphG}} \\
\text{\textbf{where} $x={}$number of maximal overlapping regions in $\modelM$}
\end{gathered}
\end{equation}
And another
\begin{equation}
\begin{gathered}
\modelM \mapsto \graphG, x \le \card{\vertices{\graphG}} \\
\begin{alignedat}{2}
&\textbf{where } & x&=\text{number of maximal overlapping regions in $\modelM$}\\
&                & y&=\text{something else}
\end{alignedat}
\end{gathered}
\end{equation}

\end{document}

enter image description here

2
  • did you read the requirement? Several have suggested it, but that would not keep alignment if there are more sets of where clauses
    – daleif
    Commented Dec 10, 2013 at 19:05
  • @daleif Then the clauses can be inserted in an aligned environment; but I don't see them in the OP's example and it's difficult to guess what's a use case.
    – egreg
    Commented Dec 10, 2013 at 21:16
10

Since the first line is actually the equation, I would go this way:

\documentclass{article}
\usepackage{amsmath,amssymb}

\begin{document}

\newcommand\+{\mkern2mu}
\newcommand{\graphG}{\mathcal{G}}
\newcommand{\graphH}{\mathcal{H}}
\newcommand{\setCA}{\mathbb{C}}
\newcommand{\setE}{\mathbb{E}}
\newcommand{\set}[1]{\left\{#1\right\}}
\newcommand{\vertices}[1]{V\!\left(#1\right)}
\newcommand{\edges}[1]{E\!\left(#1\right)}
\newcommand{\tuple}[1]{\left<\,#1\,\right>}
\newcommand{\card}[1]{\left|#1\right|}

\begin{gather}
\exists\+e \in \edges{\graphG},    \graphH = \tuple{\vertices{\graphG},\ \edges{\graphG} \setminus \set{e} },    \graphH \in \setCA \\
\begin{aligned}\notag
\textbf{where}\;\setCA &= \text{set of all circular-arc graphs} \\
\setE  &= \text{set of all empty graphs}
\end{aligned}
\end{gather} 

\end{document} 

enter image description here

7

Nasty trick of the day, split is really a two column array type of thing. So why not try \multicolumn. That actually works. Though It is not nice

\documentclass[a4paper]{memoir}
\usepackage{amsmath}
\begin{document}

\newcommand{\graphG}{\mathcal{G}}                                                  
\newcommand{\modelM}{\mathcal{M}}
\newcommand{\card}[1]{\left|#1\right|}  
\newcommand{\vertices}[1]{V\!\left(#1\right)} 
\newcommand\HideMe[1]{\multicolumn{2}{c}{$\displaystyle #1$}}

\begin{equation}                                                                   
\begin{split}                                                                      
\HideMe{\modelM \mapsto \graphG, x \le \card{\vertices{\graphG}} }  \\  
\textbf{where}\;x &= \text{number of maximal overlapping regions in $\modelM$}                    
\end{split}                                                                        
\end{equation} 

\end{document}

enter image description here

1
  • I do like the way this keeps the equation numbering over the whole equation. Commented Dec 10, 2013 at 15:24
2

This is the type of problem tailor made for the stackengine package.

\documentclass{article}
\usepackage{amsmath}
\newcommand{\graphG}{\mathcal{G}}                                                  
\newcommand{\modelM}{\mathcal{M}}
\newcommand{\card}[1]{\left|#1\right|}  
\newcommand{\vertices}[1]{V\!\left(#1\right)} 
\usepackage[usestackEOL]{stackengine}
\stackMath
\begin{document}
\begin{equation}                                                                   
\stackunder{%                                                                      
\modelM \mapsto \graphG, x \le \card{\vertices{\graphG}}%
}{%  
\textbf{where}\;x = \text{number of maximal overlapping regions in $\modelM$}%
}
\end{equation} 
\end{document}

enter image description here

1

Using aligned inside gathered inside equation

\newcommand{\graphG}{\mathcal{G}}
\newcommand{\modelM}{\mathcal{M}}
\newcommand{\vertices}[1]{V\!\left(#1\right)}
\newcommand{\card}[1]{\left|#1\right|} 

\begin{equation}                                                                
\begin{gathered}                                                                
\modelM \mapsto \graphG,\ x \le \card{\vertices{\graphG}} \\                    
\begin{aligned}                                                                 
\textbf{where}\;x &= \text{number of maximal overlapping regions in $\modelM$}       
\end{aligned}                                                                   
\end{gathered}                                                                  
\end{equation} 

enter image description here

1
  • Why the inner aligned?
    – egreg
    Commented Dec 10, 2013 at 17:20

You must log in to answer this question.

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