vertical equality in

You can define a custom macro to do this for you:

enter image description here

The \mathclap was added to ensure that cases of wide text is handled properly:

enter image description here

References:

  • How to stack boxes like a vertical version of \mbox?

Code:

\documentclass{article}
\usepackage{graphicx}
\usepackage{mathtools}
\usepackage{adjustbox}

\newcommand{\veq}{\mathrel{\rotatebox{90}{$=$}}}
\newcommand{\vneq}{\mathrel{\rotatebox{90}{$\neq$}}}
\newcommand*{\VerticalRelations}[5]{%
    % #1 = center
    % #2 = above
    % #3 = symbol above
    % #4 = below
    % #5 = symbol below
    \adjustbox{stack=cc}{%
        \ensuremath{#2}\\%
        \ensuremath{\mathclap{#3}}\\%
        \ensuremath{#1}\\%
        \ensuremath{#5}\\%
        \ensuremath{\mathclap{#4}}%
    }%
}%
\begin{document}
\[
    A = \VerticalRelations{0}{C}{\veq}{D}{\vneq} \neq B
\]
and check appropriate spacing for longer ``above" and ``below" text:
\[
 A = \VerticalRelations{0}{C}{\veq}{D\neq B}{\vneq} \neq B
 \]
\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}

enter image description here

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 &.