4

From time to time I want typeset a × symbol underset with f,g. The output command \underset{f,g}{\times} is a little clumsy for me.

How can I typeset something which looks more like the expression on the right below?

enter image description here

4

The stackengine package allows stacks to be highly customized. Here, I set in the preamble 3 things:

  1. stacks are processed in math mode

  2. the width of the understacked material will not affect the spacing of the "anchor" (in this case, \times)

  3. the gap between the anchor and the stacked material will be 0pt

Because the stack is a wrapper around its content, the \times loses its \mathbin characteristic relative to the As. That seemed to be what the OP desired; however, it can always be added back manually around the stack.

The MWE:

\documentclass{article}
\usepackage{stackengine}
\stackMath
\renewcommand\useanchorwidth{T}
\setstackgap{S}{0pt}
\begin{document}
$A\stackunder{\times}{\scriptscriptstyle f\cdot g} A$
\end{document}

enter image description here

Of course, this can all be wrapped up into a macro. Here, I show it with the \mathbin nature of \times restored. I call the macro \quork{}{}.

\documentclass{article}
\usepackage{stackengine}
\stackMath
\renewcommand\useanchorwidth{T}
\setstackgap{S}{0pt}
\newcommand\quork[2]{\mathbin{\stackunder{#1}{\scriptscriptstyle #2}}}
\begin{document}
$A\quork{\times}{f\cdot g} A$
\end{document}

enter image description here

  • Sorry, I hadn't read the details, just the image, and it struck me. I'll remove my useless comment. – Bernard May 16 '17 at 10:35
  • @Bernard It was a good comment; I edited further to make use of it. – Steven B. Segletes May 16 '17 at 10:35
3

Here is a version based on the idea of https://tex.stackexchange.com/a/169603/15925:

Sample output

\documentclass{article}

\usepackage{mathtools}

\newcommand*{\sunderbin}[3][0pt]{%
  \mathbin{\renewcommand*{\arraystretch}{0}%
    \begin{array}[t]{@{}c@{}}%
      #3\\[{#1}]%
      \mathclap{\scriptstyle #2}%
    \end{array}}%
}

\begin{document}

\begin{equation*}
  A \underset{f,g}{\times} B
  \qquad
  A \sunderbin{f,g}{\times} B
\end{equation*}

\end{document}

There is an optional argument to increase the space between the operator and the subscripts.

3

I think there's an optical illusion, due to the ascender in f. You can correct it with a negative thin space. I also suggest another possible layout, with the ‘index’ slightly on the right of ×. In the following code, I defined two commands for these:\pullback and \varpullbback:

 \documentclass{article}

\usepackage{mathtools}
\newcommand\pullback[1]{\underset{\mathclap{#1}}{\times}}
\newcommand\varpullback[1]{\times_{\clap{\raisebox{-1.2ex}{$\scriptstyle #1 $}}}\mkern-1mu}

\begin{document}

\[ A \pullback{\!f\mkern-2.5mu, g}B\qquad A \varpullback{f\mkern-2.5mu, g}B\]%

\end{document} 

enter image description here

  • The kerning or lack of it between the f and the comma doesn't help with the optical illusion. – Chris H May 16 '17 at 11:24
  • 1
    @Chris H: You're right, but that can't be automated. I've added some negative kerning in the argument to compensate. – Bernard May 16 '17 at 11:38

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.