1

I'm using the method given by the first answer in this post, with a slight modifcation, to produce the following:

enter image description here

This is pretty good, but there are two issues I'd like to fix if possible:

  1. The font of the "underneath" expressions is smaller and typed in "in-line" style; I'd like it to appear the same size & style as in the top line, and
  2. The vertical positions of the "underneath" equal signs and expressions are not the same.

I realize these might sound very nit-picky, but my actual expression is more complicated than the toy example I'm showing here, and it looks a lot worse than this example would suggest.

I think the method I'm borrowing from the above-cited post probably can't accommodate the proper vertical alignment, and I may need to use something in the "align" environments, but I'm still having trouble with that. Any help would be appreciated.

Here's the code I'm using for the above, just for reference:

\newcommand{\verteq}{\rotatebox{90}{$\;\;=\;\;$}}
\newcommand{\vertequiv}{\rotatebox{90}{$\;\;\equiv\;\;$}}
\newcommand{\equalto}[2]{\underset{\scriptstyle\overset{\mkern4mu\verteq}{#2}}{#1}}
\newcommand{\equivto}[2]{\underset{\scriptstyle\overset{\mkern4mu\vertequiv}{#2}}{#1}}

\begin{equation}
    \equivto{f(x)}{I_{\text{min}}(x)} \leqslant 
    \equalto{\Big(\text{expression}\Big)}{I(x)} \leqslant 
    \equivto{g(x)}{I_{\text{max}(x)}} 
\end{equation}

2 Answers 2

3

Here I use TABstacks. I also kept the same vertical alignment with respect to the equation number as the OP's original query (but that can be easily changed).

\documentclass{article}
\usepackage{amsmath,amssymb,rotating,tabstackengine}
\TABstackMath
\TABbinary
\begin{document}
\newcommand{\verteq}{\rotatebox[origin=c]{90}{$\mkern1mu=$}}
\newcommand{\vertequiv}{\rotatebox[origin=c]{90}{$\equiv$}}
\begin{equation}
\setstackgap{L}{16pt}
\tabbedLongunderstack{
f(x)
  & \leqslant \Big(\text{expression}\Big) \leqslant 
  & g(x)\\
\vertequiv & \verteq & \vertequiv\\
I_{\text{min}}(x) & I(x) & I_{\text{max}(x)}
}
\end{equation}
\end{document}

enter image description here

If you don't want the width of the under-matter to affect the spacing of the primary equation, add \renewcommand\useanchorwidth{T} to the equation.

enter image description here

2
  • Just what I was looking for, thanks!
    – WillG
    Commented Sep 19, 2019 at 19:57
  • @WillG You are welcome. See my edit, depending on how you prefer the horizontal spacing. Commented Sep 19, 2019 at 19:58
2

You should rotate with the option origin=c, rather than adding spaces by hand. Adding \mathstrut will ensure correct alignment.

Use an array for the alignments:

\documentclass{article}
\usepackage{amsmath,array,graphicx}

\newcommand{\rotaterelation}[1]{\rotatebox[origin=c]{90}{$\mathstrut#1$}}

\begin{document}

\begin{equation}
\begin{array}[t]{ @{} c *{2}{ @{} >{{}}c<{{}} @{} c } @{} }
f(x) & \le & (\text{expression}) & \le & g(x) \\[1ex]
\rotaterelation{\equiv} & & \rotaterelation{=} & & \rotaterelation{\equiv} \\[1ex]
I_{\min}(x) & & I(x) & & I_{\max}(x)
\end{array}
\end{equation}

\end{document}

enter image description here

A possible refinement, but this really depends on the real expressions you have could be making the wider objects in the bottom line zero width.

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

\newcommand{\rotaterelation}[1]{\rotatebox[origin=c]{90}{$\mathstrut#1$}}

\begin{document}

\begin{equation}
\begin{array}[t]{ @{} c *{2}{ @{} >{{}}c<{{}} @{} c } @{} }
f(x) & \le & (\text{expression}) & \le & g(x) \\[1ex]
\rotaterelation{\equiv} & & \rotaterelation{=} & & \rotaterelation{\equiv} \\[1ex]
\mathclap{I_{\min}(x)} & & I(x) & & \mathclap{I_{\max}(x)}
\end{array}
\end{equation}

\end{document}

enter image description here

2
  • hey @egreg, i was wondering what the "settings" (this part { @{} c *{2}{ @{} >{{}}c<{{}} @{} c } @{} }) would be if I wanted to increase the number of columns to 7 instead of 5 as given in the example. Thanks in advance if this reaches you! Commented May 24, 2023 at 22:51
  • 1
    @TakenSpark Change 2 into 3
    – egreg
    Commented May 25, 2023 at 8:11

You must log in to answer this question.

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