37

I was taught to make a left subscript as a right subscript to {}. For example, I would use

f: {}_RA \rightarrow {}_RB

to typeset this:

If you instead use

f: _RA \rightarrow _RB

the left subscripts end up in the wrong place (because LaTeX thinks they are right subscripts of the object before):

However, this trick doesn't work well with operators like /otimes. The code

A {}_\varphi\otimes_\psi B

puts too much spaace between the tensor product symbol and the subscript:

One solution I've found is to use spaces (including a negative thin space) to adjust the spacing. The code

A \; {}_\varphi \! \otimes_\psi B

produces this:

However, this is a kludge and doesn't communicate to LaTeX that \varphi should be attached to the \otimes. Also, the left subscript is still just a tad too far to the left. Does anyone know a more elegant solution to this?

diabonas
  • 25,784
PersonX
  • 2,185
  • 3
  • 20
  • 23
  • There's the \sideset command for large operator symbols (like \sum), but it is specifically described as "unreliable" for ordinary symbols like \otimes. – Mark Meckes Jul 28 '10 at 17:05
  • Not directly relevant, but how do you get the underscores into the TeX snippets? The MO workaround of backquoting the snippet doesn't seem to work. – András Salamon Jul 28 '10 at 21:59
  • 4
    @András Salamon: In "code mode" — not backquotes, but on a separate line starting with at least 4 spaces (or hit the "1001" button in the toolbar) — everything is printed exactly as you type. – ShreevatsaR Jul 29 '10 at 04:29
  • Okay can delete comments now (by the way previously the comment was "Possible duplicate of X", but since SE made it "more friendly" I've been getting a few users comment to reply "yes" to such comments) – user202729 Jan 05 '22 at 11:39

3 Answers3

25

Try the tensor package. You can just issue

$A \tensor[_\varphi]{\otimes}{_\psi} B$

to get what you specified as an example. Note that if you have mixed upper and lower indices, the standard \tensor command will leave "phantom" spaces. To make all indices flush against the central symbol, use \tensor*.

Willie Wong
  • 24,733
  • 8
  • 74
  • 106
14

The problem here is the special treatment of \otimes as a relational symbol, which adds space on either side of the symbol. Put it in braces to suppress this behaviour:

A {}_\varphi{\otimes}_\psi B

The accepted answer, using tensor, does this implicitly.

For best spacing one should declare the decorated operation as a new mathematical symbol. Instead of \mathop (suggested by François G. Dorais) which is used for large operators like \prod and \sum, \mathbin as used for \otimes, + and \cap might be suitable:

A \mathbin{{}_\varphi{\otimes}_\psi} B

András Salamon
  • 2,145
  • 3
  • 25
  • 33
4

I think there are a few packages that support this, such as leftidx and mathtools.

Torbjørn T.
  • 206,688