Skip to main content
Updated the answer to fit with the syntax of version 0.500
Source Link
Gaussler
  • 15k
  • 7
  • 48
  • 125

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.

\documentclass{article} \usepackage{leftindex} \begin{document} Good results: $ \leftindex^a_b {f}, \leftindex^* {M}, \leftindex_q^p {H}, \displaystyle \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} $ \end{document} 

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:

\documentclass{article} \usepackage{semantex} \NewVariableClass\MyVar[output=\MyVar] % No slanting phantom needed: \NewObject\MyVar\vf{f} \NewObject\MyVar\vM{M} \NewObject\MyVar\vH{H} % Slanting phantom needed: \NewObject\MyVar\vL{L}[slantingphantom=I][slanting phantom=I] \NewObject\MyVar\vGamma{\Gamma}[slantingphantom=][slanting phantom=] % Slanting phantom and a \!\! to the % right of the superscript needed: \NewObject\MyVar\vA{A}[slantingphantom=I[ slanting phantom=I,postupperleft=\ post upper left=\!\!, ] \begin{document} $ \vf[upperleft=a\vf[upper left=a,lowerleft=b]lower left=b] $, $ \vM[upperleft=*]\vM[upper left=*] $, $ \vH[upperleft=p\vH[upper left=p,lowerleft=q]lower left=q] $, $ \vA[upperleft=*]\vA[upper left=*] $, $ \vL[upperleft=a\vL[upper left=a,lowerleft=b]lower left=b] $ \end{document} 

enter image description here

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.

\documentclass{article} \usepackage{leftindex} \begin{document} Good results: $ \leftindex^a_b {f}, \leftindex^* {M}, \leftindex_q^p {H}, \displaystyle \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} $ \end{document} 

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:

\documentclass{article} \usepackage{semantex} \NewVariableClass\MyVar[output=\MyVar] % No slanting phantom needed: \NewObject\MyVar\vf{f} \NewObject\MyVar\vM{M} \NewObject\MyVar\vH{H} % Slanting phantom needed: \NewObject\MyVar\vL{L}[slantingphantom=I] \NewObject\MyVar\vGamma{\Gamma}[slantingphantom=] % Slanting phantom and a \!\! to the right of the superscript needed: \NewObject\MyVar\vA{A}[slantingphantom=I,postupperleft=\!\!] \begin{document} $ \vf[upperleft=a,lowerleft=b] $, $ \vM[upperleft=*] $, $ \vH[upperleft=p,lowerleft=q] $, $ \vA[upperleft=*] $, $ \vL[upperleft=a,lowerleft=b] $ \end{document} 

enter image description here

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.

\documentclass{article} \usepackage{leftindex} \begin{document} Good results: $ \leftindex^a_b {f}, \leftindex^* {M}, \leftindex_q^p {H}, \displaystyle \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} $ \end{document} 

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:

\documentclass{article} \usepackage{semantex} \NewVariableClass\MyVar[output=\MyVar] % No slanting phantom needed: \NewObject\MyVar\vf{f} \NewObject\MyVar\vM{M} \NewObject\MyVar\vH{H} % Slanting phantom needed: \NewObject\MyVar\vL{L}[slanting phantom=I] \NewObject\MyVar\vGamma{\Gamma}[slanting phantom=] % Slanting phantom and a \!\! to the % right of the superscript needed: \NewObject\MyVar\vA{A}[ slanting phantom=I, post upper left=\!\!, ] \begin{document} $ \vf[upper left=a,lower left=b] $, $ \vM[upper left=*] $, $ \vH[upper left=p,lower left=q] $, $ \vA[upper left=*] $, $ \vL[upper left=a,lower left=b] $ \end{document} 

enter image description here

added 41 characters in body
Source Link
Gaussler
  • 15k
  • 7
  • 48
  • 125

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.

\documentclass{article} \usepackage{leftindex} \begin{document} Good results: $ \leftindex^a_b {f}, \leftindex^* {M}, \leftindex_q^p {H}, \displaystyle \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} $ \end{document} 

enter image description here


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

\documentclass{article} \usepackage{semantex} \NewVariableClass\MyVar[output=\MyVar] % No slanting phantom needed: \NewObject\MyVar\vf{f} \NewObject\MyVar\vM{M} \NewObject\MyVar\vH{H} % Slanting phantom needed: \NewObject\MyVar\vL{L}[slantingphantom=I] \NewObject\MyVar\vGamma{\Gamma}[slantingphantom=] % Slanting phantom and a \!\! to the right of the superscript needed: \NewObject\MyVar\vA{A}[slantingphantom=I,postupperleft=\!\!] \begin{document} $ \vf[upperleft=a,lowerleft=b] $, $ \vM[upperleft=*] $, $ \vH[upperleft=p,lowerleft=q] $, $ \vA[upperleft=*] $, $ \vL[upperleft=a,lowerleft=b] $ \end{document} 

enter image description here

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.

\documentclass{article} \usepackage{leftindex} \begin{document} Good results: $ \leftindex^a_b {f}, \leftindex^* {M}, \leftindex_q^p {H}, \displaystyle \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} $ \end{document} 

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. Therefore, slanting phantoms can be chosen once and for all from there, too:

\documentclass{article} \usepackage{semantex} \NewVariableClass\MyVar[output=\MyVar] % No slanting phantom needed: \NewObject\MyVar\vf{f} \NewObject\MyVar\vM{M} \NewObject\MyVar\vH{H} % Slanting phantom needed: \NewObject\MyVar\vL{L}[slantingphantom=I] \NewObject\MyVar\vGamma{\Gamma}[slantingphantom=] % Slanting phantom and a \!\! to the right of the superscript needed: \NewObject\MyVar\vA{A}[slantingphantom=I,postupperleft=\!\!] \begin{document} $ \vf[upperleft=a,lowerleft=b] $, $ \vM[upperleft=*] $, $ \vH[upperleft=p,lowerleft=q] $, $ \vA[upperleft=*] $, $ \vL[upperleft=a,lowerleft=b] $ \end{document} 

enter image description here

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.

\documentclass{article} \usepackage{leftindex} \begin{document} Good results: $ \leftindex^a_b {f}, \leftindex^* {M}, \leftindex_q^p {H}, \displaystyle \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} $ \end{document} 

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:

\documentclass{article} \usepackage{semantex} \NewVariableClass\MyVar[output=\MyVar] % No slanting phantom needed: \NewObject\MyVar\vf{f} \NewObject\MyVar\vM{M} \NewObject\MyVar\vH{H} % Slanting phantom needed: \NewObject\MyVar\vL{L}[slantingphantom=I] \NewObject\MyVar\vGamma{\Gamma}[slantingphantom=] % Slanting phantom and a \!\! to the right of the superscript needed: \NewObject\MyVar\vA{A}[slantingphantom=I,postupperleft=\!\!] \begin{document} $ \vf[upperleft=a,lowerleft=b] $, $ \vM[upperleft=*] $, $ \vH[upperleft=p,lowerleft=q] $, $ \vA[upperleft=*] $, $ \vL[upperleft=a,lowerleft=b] $ \end{document} 

enter image description here

added 1211 characters in body
Source Link
Gaussler
  • 15k
  • 7
  • 48
  • 125

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.

\documentclass{article} \usepackage{leftindex} \begin{document} Good results: $ \leftindex^a_b {f}, \leftindex^* {M}, \leftindex_q^p {H}, \displaystyle \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} $ \end{document} 

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. Therefore, slanting phantoms can be chosen once and for all from there, too:

\documentclass{article} \usepackage{semantex} \NewVariableClass\MyVar[output=\MyVar] % No slanting phantom needed: \NewObject\MyVar\vf{f} \NewObject\MyVar\vM{M} \NewObject\MyVar\vH{H} % Slanting phantom needed: \NewObject\MyVar\vL{L}[slantingphantom=I] \NewObject\MyVar\vGamma{\Gamma}[slantingphantom=] % Slanting phantom and a \!\! to the right of the superscript needed: \NewObject\MyVar\vA{A}[slantingphantom=I,postupperleft=\!\!] \begin{document} $ \vf[upperleft=a,lowerleft=b] $, $ \vM[upperleft=*] $, $ \vH[upperleft=p,lowerleft=q] $, $ \vA[upperleft=*] $, $ \vL[upperleft=a,lowerleft=b] $ \end{document} 

enter image description here

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.

\documentclass{article} \usepackage{leftindex} \begin{document} Good results: $ \leftindex^a_b {f}, \leftindex^* {M}, \leftindex_q^p {H}, \displaystyle \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} $ \end{document} 

enter image description here

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.

\documentclass{article} \usepackage{leftindex} \begin{document} Good results: $ \leftindex^a_b {f}, \leftindex^* {M}, \leftindex_q^p {H}, \displaystyle \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} $ \end{document} 

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. Therefore, slanting phantoms can be chosen once and for all from there, too:

\documentclass{article} \usepackage{semantex} \NewVariableClass\MyVar[output=\MyVar] % No slanting phantom needed: \NewObject\MyVar\vf{f} \NewObject\MyVar\vM{M} \NewObject\MyVar\vH{H} % Slanting phantom needed: \NewObject\MyVar\vL{L}[slantingphantom=I] \NewObject\MyVar\vGamma{\Gamma}[slantingphantom=] % Slanting phantom and a \!\! to the right of the superscript needed: \NewObject\MyVar\vA{A}[slantingphantom=I,postupperleft=\!\!] \begin{document} $ \vf[upperleft=a,lowerleft=b] $, $ \vM[upperleft=*] $, $ \vH[upperleft=p,lowerleft=q] $, $ \vA[upperleft=*] $, $ \vL[upperleft=a,lowerleft=b] $ \end{document} 

enter image description here

Source Link
Gaussler
  • 15k
  • 7
  • 48
  • 125
Loading