I am trying to put two subscripts at the left and right of a character. For example, something like: _{t} p_{x} where p is in the middle. How do you do this?

  • 2
    @Alan: Why a comment? – Caramdir Feb 20 '11 at 1:40
  • @Caramdir It just seemed so short. I've added it as an answer. – Alan Munn Feb 20 '11 at 1:51
  • 3
    Since this is essentially about left subscripts, you can also have a look at the answers to this question (possible duplicate). – Hendrik Vogt Feb 20 '11 at 6:54
  • 6
    @Caramdir: The space has no effect in math mode ... – Hendrik Vogt Feb 20 '11 at 6:57
  • 1
    @JPi: Done....... – PEV May 3 '17 at 18:06

There are many tools for scripts:

  • For general math scripts before something, use \prescript provided by mathtools package, for better alignment:

    $ \prescript{14}{2}{\mathbf{C}} $

  • For large operators, use \sideset from amsmath:

    $ \sideset{_a^b}{'}\sum A_n $

  • For chemical equations, use mhchem package:


  • For tensors, use tensor package:

    $ M\indices{^a_b^{cd}_e} $
    $ \tensor[^a_b^c_d]{M}{^a_b^c_d} $

Please complete this list as you can.

  • 17
    +1: I think that this is a great answer because it acknowledges the semantic element of LaTeX environments. Using tensor for, say, denoting an isotope is ontologically dodgy and its visual suitability is contingent on some hypothetical divergence of notation not occurring down the line. – Richard Terrett Feb 21 '11 at 4:53
  • 1
    I tried most of these and found the \tensor solution the best one. – Your Majesty Apr 29 '14 at 12:20
  • Are there any options besides mhchem that don't require math mode? I'd like to typeset a downarrow before a letter in a phonetic transcription. – Sjiveru Jul 19 '18 at 23:37
  • @RichardTerrett Worth mentioning that the difference is not just of semantic adherence: \sideset will only work with math operators, not with any item. – Pietro Battiston Dec 11 '19 at 20:15
  • Is there anything wrong (kerning?) with this simple approach? tex.stackexchange.com/a/317359/52160 – Pietro Battiston Dec 12 '19 at 7:39

Are you doing this in math mode?


should work.

| improve this answer | |
  • 1
    Spaces are ignored in math mode. $ _ t p _ x $ produces exactly the same effect. – TH. Feb 20 '11 at 5:31
  • 26
    I would go for {}_{t}p_{x}, otherwise things like \sum _{t}p_{x} give surprising results. – Bruno Le Floch Feb 20 '11 at 14:11
  • 3
    I think that the t and x are not aligned using this approach – becko Dec 2 '13 at 22:22
  • 1
    @becko you'll need to match upper and lower i.e., ${}_{t} p_{x}$ and ${}_{t}^{} p_{x}^{n}$ – Juhl Apr 13 '15 at 12:22
  • 1
    This is the best answer as it uses plain Latex without any need for extra packages. – Andry Apr 4 '19 at 20:42

The tensor package will do exactly what you require, and more. For your particular case, you need only type



| improve this answer | |

You could use the leftidx package which is capable of producing left and right subscripts and superscripts.

In contrast to using simply consecutive subscripts or superscripts such as in $_{t}p_{x}$ it takes care of adjusting indices to the argument using \vphantom. From its source:

| improve this answer | |
  • This is by far the best approach IMHO. – Al_Fh Sep 30 '19 at 9:05

The amsmath package has a \sideset command which lets you put indices at all four corners of a symbol (even if this symbol itself has limits above/below):

\[  \sideset{_t}{_x}p  = \sideset{^*_*}{^*_*}\prod_*^*  \]

\sideset is intended to be used with large operator symbols such as \sum and \prod. The amsmath documentation says: this command is not designed to be applied to anything other than sum-class symbols. (Thanks to Stefan Kottwitz for this additional remark.) For other symbols, have a look at the other answers here.

| improve this answer | |
  • 12
    Good addition! Just a remark: \sideset is intended to be used with large operator symbols such as \sum and \prod. The amsmath documentation says: this command is not designed to be applied to anything other than sum-class symbols. – Stefan Kottwitz Feb 20 '11 at 2:55
  • @Stefan: Ah, thanks ... I knew I should have looked it up before writing this. – So, don't use this with simple letter-symbols, use the other solutions given here. – Paŭlo Ebermann Feb 20 '11 at 3:03

The best solution I have seen so far was:



For the more general case of left and right superscript and subscript, one writes:



| improve this answer | |
  • The question is about two subscript, one before and one after. It's not the same as having an upperscript and a subscript at the same place. – Romain Picot Apr 22 '16 at 7:42
  • just added how you can have both in the same place and compared to some other solutions here I think this is rater simple in syntax. – Asking Questions Apr 22 '16 at 7:46
  • As I said, you put a subscript and an upperscript and not two subscript – Romain Picot Apr 22 '16 at 7:48
  • ah ok I see your point – Asking Questions Apr 22 '16 at 7:50
  • Fixed that now. I did that because questions about left superscripts also get redirected to this post and marked as duplicates. – Asking Questions Apr 22 '16 at 7:56

A simple method I apply - which does away with the need for extra packages - is the following:


Which produces the following: enter image description here

| improve this answer | |
  • 2
    Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. I think this solution is not ideal, because it will cause, at best, inconsistent spacing, or, at worst, a bad line break. – Paul Gessler Oct 25 '14 at 13:56

I had the same problem with the subscript and superscript, sooo I made a package to make my life easier and to other. It's a common problem with actuarial symbol, and it help align the sub and superscript. Plus, I’ve add some shortcut to save time.

The project page and the CTAN.

All you need is the actuarialsymbol package.

At the beginning of the code you have to write


For the sub/superscript


Example of output:

enter image description here

Example of shortcut for actuarial symbol : enter image description here

| improve this answer | |
  • 1
    Welcome to LaTeX! Is this meant as an answer for another question? – Moriambar Apr 26 '17 at 20:27
  • 1
    Congratulations! Nice package! – Zarko Apr 26 '17 at 20:33
  • 1
    @Moriambar it is: tex.stackexchange.com/a/366883 ;) – cgnieder Apr 26 '17 at 20:35
  • @clemens My package can fulfill many problems. – David Beauchemin Jul 31 '18 at 18:22
  • @Zarko thanks! If you have idea of upgrade we are open for it. We are working on a mathjax upgrade for ebook. – David Beauchemin Jul 31 '18 at 18:23

I am dissatisfied with the existing options, including \prescript from mathtools, since they do not even make an attempt at fixing the spacing between the symbol and the left superscript. Therefore, based on egreg’s excellent answer here, I recently added the package leftindex to CTAN. It provides the command

\leftindex^{<left superscript>}_{<left subscript>} {<symbol>}

This measures the negative indentation of the right subscript and indents the left superscript by the same value. This works well for most symbols, with a few exceptions, such as A and L (and P and \Gamma in some fonts other than Computer Modern). Therefore, \leftindex takes a couple of optional arguments. The only one we shall need right now is

\leftindex[<slanting phantom>]^{<left superscript>}
    _{<left subscript>} {<symbol>}

If the command receives a <slanting phantom>, it will use this symbol instead of <symbol> to calculate the indentation of the left superscript.




Good results:
    \leftindex^a_b {f}, \leftindex^* {M}, \leftindex_q^p {H},
    \leftindex_{-\infty}^{\infty} {\int} f(x)\, dx

Bad results:
    \leftindex^* {A}, \leftindex^a_b {L}

With slanting correction:
    \leftindex[T]^* {A}, \leftindex[I]^a_b {L}


enter image description here

If you grow tired of having to write slanting phantoms manually, you can have a look at my other package, SemanTeX, which provides semantic, keyval-based mathematics where notation can be controlled centrally from the preamble. Its left index support is based on leftindex, but slanting phantoms can now be chosen once and for all from the preamble:




% No slanting phantom needed:




% Slanting phantom needed:



% Slanting phantom and a \!\! to the right of the superscript needed:



$ \vf[upperleft=a,lowerleft=b] $,
$ \vM[upperleft=*] $,
$ \vH[upperleft=p,lowerleft=q] $,

$ \vA[upperleft=*] $,
$ \vL[upperleft=a,lowerleft=b] $


enter image description here

| improve this answer | |

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.