3

Any idea at how I can have a subscript on the left side of a variable?

subscript behind variable

This is for an agent-based model that requires a little too many indices --- so I thought of trailing the one refer ...

Jaap Eldering
  • 1,760
  • 15
  • 20
Ricardo Cruz
  • 1,770
  • 1
  • 22
  • 34

2 Answers2

5

You can use \prescript macro provided by mathtools

\documentclass{report}
\usepackage{mathtools}
\usepackage{atbegshi}
\begin{document}
   \[
   \prescript{}{5}{\mathit{edu}}_{2,3}= \prescript{}{5}{\mathit{yr}} \prescript{}{5}{\mathit{wg}} + 2
   \]
\end{document}

enter image description here

  • As well, if edu is an token, it should probably be \mathit{edu}. – yo' Dec 10 '14 at 10:39
  • @tohecz Honestly, I have no idea what edu is. So I will change it as you said. :) Thanks. –  Dec 10 '14 at 10:40
  • @tohecz Why \mathit{edu} and not \textit? I still don't understand the place for \mathit and \mathrm. – Manuel Dec 10 '14 at 10:43
  • @Manuel They are semantic. IMHO, direct usage of \text?? command in math-mode shows some lack of it (well, \text?? shouldn't ever be used outside preamble, IMHO). For example, try this semantically correct variant: \[ \mathrm{e}^{x} = 1 \quad\text{if and \emph{only if}}\quad x = 0\] versus: \[ \textrm{e}^{x} \quad\textrm{if and }\textit{only if}\quad x = 0 \]. The result is very likely the same, unless you are inside {theorem} for instance, but the semantics are lost. Of course, even better would be having a macro for the constant if you use it more than once or twice. – yo' Dec 10 '14 at 10:58
  • The one problem I see is the prescript is set at a different vertical height than the regular subscripts. – Steven B. Segletes Dec 10 '14 at 11:03
  • @StevenB.Segletes That is how it is in the picture provided by OP! –  Dec 10 '14 at 11:05
  • I hadn't noticed that before. Good point. – Steven B. Segletes Dec 10 '14 at 11:07
  • @tohecz Well, there \mathrm{e} is what you want, a math upright to identify some letters. But in case of a subscript, or in this case, I still don't see the place for \mathit or \mathrm (in fact, if I were to choose, I think I would go for \text··). I just want to make up my mind; but I think it's not solved the place for those “alphabets”. – Manuel Dec 10 '14 at 15:47
  • 1
    @Manuel Think of it this way: If it should be italic in theorem statement, then it's text. Otherwise it's math. (Last comment from me here to avoid off-topic chatter here, we can continue in the chat.) – yo' Dec 10 '14 at 15:51
  • @tohecz No discussion, since I don't have an opinion, but that's a good and nice one idea. – Manuel Dec 10 '14 at 16:21
2
\documentclass{report}
\usepackage{mathtools}
\begin{document}

   \[
   \sideset{_5}{_{2,3}}{\mathop{edu}}= \sideset{_5}{}{\mathop{yr}} \sideset{_5}{}{\mathop{wg}} + 2
   \]
   \[ \sideset{_{ll}^{ul}}{_{lr}^{ur}}\prod \]

\end{document}

enter image description here

  • Herbert, I will select Harish's answer, but thank you and @tohecz for your replies as well. I did not realized this had been answered before... Thank you! – Ricardo Cruz Dec 10 '14 at 13:56
  • As explained in http://tex.stackexchange.com/questions/11542/left-and-right-subscript, this is an abuse of \sideset. That is as well clear from the fact that you need explicit \mathop to make it work. – yo' Dec 10 '14 at 15:55