# LyX left subscript in math formula

Does anyone know how to make a subscript on the left hand side in LyX in a formula?

• Should be no different from making a subscript on the right side of a symbol, place the cursor to the left of the symbol and click the subscript-button. Nov 22, 2016 at 19:58
• The LaTeX code uses the `leftidx` package (eponymous command) or `mathtools` (`\prescript` command). Nov 22, 2016 at 20:03
• Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. Jun 4, 2018 at 20:37

In LaTeX, without using any additional package, you could use

``````\${}_x F_x\$
``````

to write xFx. Using this as the baseline approach, inside a math formula, insert a subscript to "nothing", followed by the "middle symbol", followed by another subscript. • This is not very good, since if you have something before the first "_{x}", e.g. A _{x}F_{x} then it would be typeset as if you have a subscript for A May 22, 2018 at 11:54
• @UrYa'ar: There are ways around that. Do you have any suggestions? Perhaps not using LyX? ;)
– Werner
May 22, 2018 at 19:22
• One way it to put a `{}` before. Another is to implement `\prescript` in a macro, I gave a detailed answer below. Jul 12, 2018 at 8:32

The `mathtools` package defines `\prescripts` which is supposed to give the right spacing for left super/sub-scripts.The syntax of the command is `\prescript{<sup>}{<sub>}{<arg>}`. To implement it in LyX one should define a macro as follows: To get it, on the "TeX" box you write the following string (don't copy-paste as it won't work. While typing the script LyX will change e.g. `\{` into the correct form of `{}`)

`````` \prescript\{\#1 \{\#2 \{\#3
``````

and in order for it to preview nicely, write in the "LyX" box

``````^\#1 _\#2 \#3
``````

of course you can skip either the sup or sub script argument, but you still need to have an empty '{}' for it, e.g Note that if you get a compilation error you need to tell LyX to load `mathtools` via Document->Settings->Math options.

Here's a solution that I found to be easier than Werner's, and not requiring the extra packages and macros that Ur's solution needs:

Simply press `CTRL+SPACE` to make a half-space, which allows you to make the desired subscript: Then delete the halfspace!
Unlike Werner's solution, I never needed to click anything. My hands never had to leave the keyboard!