Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
    
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 Dec 10 '13 at 14:24
1  
Use gathered environment from mathtools –  Aditya Dec 10 '13 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 Dec 10 '13 at 14:28
    
Put the two expressions into an \array. You might need to use \displaymode since \array put one into the other mode. –  John Kormylo Dec 10 '13 at 14:46
1  
@GarethA.Lloyd, that is sheer luck that that actually works. –  daleif Dec 10 '13 at 15:08
show 4 more comments

5 Answers

up vote 4 down vote accepted

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

share|improve this answer
    
did you read the requirement? Several have suggested it, but that would not keep alignment if there are more sets of where clauses –  daleif Dec 10 '13 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 Dec 10 '13 at 21:16
add comment

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

share|improve this answer
add comment

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

share|improve this answer
    
I do like the way this keeps the equation numbering over the whole equation. –  Gareth A. Lloyd Dec 10 '13 at 15:24
add comment

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

share|improve this answer
add comment

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

share|improve this answer
    
Why the inner aligned? –  egreg Dec 10 '13 at 17:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.