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 ...

  • 1
    Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. I believe that your question is a specific case of this one, which contains a survey of all reasonable ways how to typeset left scripts: Left and right subscript. – yo' Dec 10 '14 at 10:38
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

| improve this answer | |
  • 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. – user11232 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
  • 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
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

| improve this answer | |
  • 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 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

Not the answer you're looking for? Browse other questions tagged or ask your own question.