5

In the following MWE, the problem is that the Condition: is not aligned with the formula:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

    \textbf{Condition}:$\begin{aligned}
    (\exists a \in A) (\exists b \in B)(\forall c \in C)[&F(a,b)=c~\wedge~F(c,d)=a~\wedge~ \\ 
    &a \in X~\wedge~(c \in Y ~\vee~d \in M)]
    \end{aligned}$

\end{document}

enter image description here

0
6

Just use the optional argument of aligned:

\textbf{Condition}:$\begin{aligned}[t]
    (\exists a \in A) (\exists b \in B)(\forall c \in C)[&F(a,b)=c~\wedge~F(c,d)=a~\wedge~ \\ 
    &a \in X~\wedge~(c \in Y ~\vee~d \in M)]
    \end{aligned}$
1

Edit (old answer was really complicated without such need)

Second way without \ontop command:

\documentclass{article}
\usepackage{adjustbox}
\usepackage{tabularx}
\usepackage{amsmath}

\begin{document}
\textbf{Condition}:
$\begin{aligned}[t]
    (\exists a \in A) (\exists b \in B)(\forall c \in C)[&F(a,b)=c~\wedge~F(c,d)=a~\wedge~ \\ 
    &a \in X~\wedge~(c \in Y ~\vee~d \in M)]
    \end{aligned}$
\end{document}

Same output as below with no extra space.

Old Answer:

The problem is that inline math are supposed to centered vertical with the text. What you want is a top aligned tabular.

So, you can try like this:

\documentclass{article}

\usepackage{amsmath}

\def\ontop#1{\vtop{\null\hbox{#1}}}

\begin{document}

    \begin{tabular}{cc}\ontop{\textbf{Condition}:}&\ontop{$\begin{aligned}
    (\exists a \in A) (\exists b \in B)(\forall c \in C)[&F(a,b)=c~\wedge~F(c,d)=a~\wedge~ \\ 
    &a \in X~\wedge~(c \in Y ~\vee~d \in M)]
    \end{aligned}$}\end{tabular}

\end{document}

Source of \ontop command from here:

https://tex.stackexchange.com/a/23522/120578

Output:

enter image description here

7
  • 1
    Wow. It's a fairly complicated approach!
    – A.Loc
    Oct 16 '17 at 0:28
  • @A.Loc you are right. I used realy complicated method but it works with any kind of math. The edited solution is for aligned environment only
    – koleygr
    Oct 16 '17 at 0:49
  • 1
    I believe that \aligned[t] does also work with any kind of math, don't you think?
    – A.Loc
    Oct 16 '17 at 0:57
  • 1
    Can downvoter explain why this answer deserves a -1?!
    – Roboticist
    Oct 16 '17 at 0:59
  • 1
    As I checked,aligned[t] even works in the case of \dfrac.
    – A.Loc
    Oct 16 '17 at 1:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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