# [Tex/LaTex] vertical equality in

diagramsmath-modetypography

How does one get inline or at least formula space typography of the following sort in an easy to parse (for the editor) way when writing formulas, for instance:

Yes, I know, the equalities … can be done within TikZ for commuting diagrams, like with arrows. But is there an easy way to just to use vertical equalities (and most importantly, inequalities) in this way in simple formulas, without invoking a TikZ frame, in ordinary latex math $…$.

EDIT:

I should just clarify, I meant the above image as an example. Some great solutions were posted, but how can they be generalized to allow for more or fewer levels or nested together, so that they can be robustly used without changing the basic grid above below to left to right relative framework (and thus avoiding driving the editor of a paper or coauthor mad)? For instance, also:

Most clearly: how can stacks or macros be used to create in line or in formula "above" "below" arbitrary equalities/inequalities that ignore other levels above and below?

My own attempt, which doesn't quite work, since columns cannot overlap sideways in matrices, and yet they have to look good, and the same problem with the macro approach, and of course a matrix cannot be subscript size:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsmath}

\newcommand{\veq}{\mathrel{\rotatebox{90}{$=$}}}
\newcommand{\vneq}{\mathrel{\rotatebox{90}{$\neq$}}}

\begin{document}

This is a test. Yes it is. Of course. Look here. Yes, Here. That's right. Mhmm. Words. Filler. Indeed. Look. A paragraph. With words. Here. Yes. And where's that? Where is here? It's right here:

$\left. \frac{\partial f(A,B,C,D)}{\partial A} \right| \raisebox{.9\baselineskip}{_{\begin{array}{ccccc} A & = & B & = & Z \\ {} & {} & \vneq & {} & {} \\ C & \neq & I & \neq & W \\ \veq & {} & {} & {} & {} \\ D & = & G & \neq & Q^2+3 \end{array} }}$

\end{document}


Relatively straightforward with stacks. In essence, the vertical equality is the \tabbedCenterstack, using rotated equality signs \req and \rne.

For the first example, I just used a conventional stack, though for the more complex examples, a full tabular stack makes it easiest.

\documentclass{article}
\usepackage{tabstackengine}
\stackMath
\makeatletter
\renewcommand\TAB@delim[1]{\scriptstyle#1}
\def\req{\protect\rotatebox{90}{$\scriptstyle=$}}
\def\rne{\protect\rotatebox{90}{$\scriptstyle\ne$}}
\makeatother
\usepackage{graphicx}
\begin{document}
$\setstackgap{L}{.6\baselineskip} \left.\frac{\partial f(A,B,C,D)}{\partial A}\right| \raisebox{.9\baselineskip}{_{A = \tabbedCenterstack{C\\ \req\\0\\ \rne\\ D} \ne B}}$

$\setstackgap{L}{.6\baselineskip}\setstacktabulargap{0pt}\TABbinary \left.\frac{\partial f(A,B,C,D)}{\partial A}\right| \raisebox{-.2\baselineskip}% {_{\tabularCenterstack{rcl}{A = & 0&\\ &\req&\\&D& \ne B = C}}}$

$\setstackgap{L}{.6\baselineskip}\setstacktabulargap{0pt}\TABbinary \left.\frac{\partial f(A,B,C,D)}{\partial A}\right| \raisebox{.9\baselineskip}% {_{\tabularCenterstack{rcl}{L = & 0&\\ &\req&\\A = &0& \ne B = F\\ &\rne&\\ &D&\ne B\\&\rne&\\&E&}}}$
\end{document}


Note: the \TABbinary is not needed in \scriptstyle, but would be needed in \displaystyle, to place the proper spacing around the relational operators that appear immediately after a &.