7

I'm still new to Latex, and I can't seem how to write f.ex. q0 where the 0 is small. Hard to explain/search google when I don't know what you call this in english.

Hope someone can help :)

user16655
  • 193

1 Answers1

9

What you're looking for is subscript and you write it like this: $q_0$.

Note that this only works in math mode. The $ tell LaTeX to switch from text to math mode or back (there are different possibilities of switching to math mode, see here).

When you want to have multiple digits (or other symbols) in subscript, you will have to enclose them in curly braces (q_{12 + x}), since the _ only "sees" the next symbol. The curly braces make LaTeX see everything inside as a group that cannot be separated.

If you want to use subscript in normal text, have a look at this question.

Superscript works the same way but with ^ instead of _. Write x^2 for x².

schtandard
  • 14,892
  • I'd like to add that adding dollar signs around the expression will avoid a horrible spam of errors. (So it's important to let LaTeX know that you're using math code) – 1010011010 May 05 '14 at 21:12
  • Unless you mean oldstyle (lowercase) numbers. You can have them with \oldstylenums{25} for instance. – Bernard May 05 '14 at 21:14
  • One more question, what if it is supposed to be "up"? Like 2^2 = 4? – user16655 May 05 '14 at 21:31
  • @user16655 You just write exactly that, except between the dollar signs, $2^2=4$. If you want to have multiple characters in the sub- or super-script, you have to enclose them in curly braces - $2^{12}=4096$, $q_{0,1}$. – darthbith May 05 '14 at 21:33
  • Thank you so much for the quick answer :) I really appreciate it. It's a lot of symbols to learn ;) – user16655 May 05 '14 at 21:36
  • @user16655: I added some more detail to the answer. If you are very new to LaTeX, consider having a look at an introduction, like this one, first. It's even available in many different languages. – schtandard May 05 '14 at 21:49