5

What is the best way to typeset \sqcup with two subscripts left/right.

For sure, 1st and 2nd are wrong. But they help us to see the baseline for the indexes.

The 3rd and 4th look equal except by the space around. Also, they insert the index too low (I think).

The 5th produces almost the same but change the baseline for indexes. However it gives me an error (since \sqcup is not an operator).

Limit controls must follow a math operator. $A \sideset{_f}{_g}{\sqcup}

MWE

\documentclass[a5paper]{report}
\usepackage{mathtools}
\usepackage{tensor}

\begin{document}

$A_g  \sqcup_f B$

$A{}_g\sqcup_f B$

$A\prescript{}{g}{\sqcup}_fB$

$A\tensor[_g]{\sqcup}{_f}B$

% $A\sideset{_g}{_f}{\sqcup} B$

\end{document}

enter image description here

2
  • As explained in amsmath documentation, \sideset is meant for big operators.
    – egreg
    Feb 10, 2015 at 22:39
  • @egreg, OK. I just inserted to show the good positioning of indexes. Its spacing looks better than the others.
    – Sigur
    Feb 10, 2015 at 22:41

1 Answer 1

5

You should define the symbol as \mathbin:

\documentclass{article}

\newcommand{\dsqcup}[2]{% #1 presubscript, #2 postsubscript
  \mathbin{_{#1}\sqcup_{#2}}%
}

\begin{document}

$A\dsqcup{f}{f}B$

$A\dsqcup{g}{f}B$

\end{document}

enter image description here

3
  • Very nice solution.
    – Sigur
    Feb 10, 2015 at 22:46
  • Is \sqcup a mathbin char? If yes, it inserts space before/after it, isn't? In this case, are the spaces between the indexes and \sqcup the right ones?
    – Sigur
    Feb 10, 2015 at 22:49
  • @Sigur Yes, it is: \DeclareMathSymbol{\sqcup}{\mathbin}{symbols}{"74}
    – egreg
    Feb 10, 2015 at 22:50

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.