2

in order to use subscript, the format used is:

\[ A_{k} \]

But whenever I use this, it puts the expression in a new line. But I don't want it to be placed in a new line, what should I do.

Max
  • 438
girl101
  • 529
  • 4
    Use $A_k$ instead of \[ A_k \] (no need for grouping as well {...}. – jak123 Oct 19 '15 at 06:01
  • 1
    As jak mentions, you need to look up the difference between in line math written in a pair of dollar signs and displayed math, which is usually indicated by environments. You will need to know about both – daleif Oct 19 '15 at 06:13
  • 1
    @jak although the subscript works without braces (no grouping anyway: they act as argument delimiters) it is correct LaTeX syntax to use them – cgnieder Oct 19 '15 at 08:52
  • @clemens I just mentioned this to let the OP know that they are not part of the syntax. But I totally agree with you. – jak123 Oct 19 '15 at 09:31
  • 1
    @jak123 but that's the point: they are part of the LaTeX syntax, see http://tex.stackexchange.com/questions/82329/ (It's different in plain TeX) – cgnieder Oct 19 '15 at 09:44
  • @clemens I see your point. I agree it is a good/important practice. However, for casual typesetting, like most of us use LaTeX for, I would say that for the case of single sub/super-scripts, omitting the braces is worth it. – jak123 Oct 19 '15 at 10:14
  • @jak123 personally I also omit braces for one token subscripts because I find the source more readable then – but I'd never advertise it… – cgnieder Oct 19 '15 at 10:16
  • @clemens Good point, I repent from my sin :) Sadly, SX does not allow late editing of comments. – jak123 Oct 19 '15 at 10:19
  • 1
    @jak123 never mind :) (actually braces or not isn't even worth the whole discussion…) – cgnieder Oct 19 '15 at 10:25
  • @jak, try to formulate your first comment as answer. In it consider comment of Daleif. Regarding the OP problem the use of curly braces in formatting of indices is another problem, not related with inline and display form of equations (this should be emphasized). – Zarko Oct 19 '15 at 11:39
  • @Zarko Done! I expected this to be a duplicate (it might be). – jak123 Oct 19 '15 at 12:54

1 Answers1

2

There are two modes of typing equations in LaTeX:

  • Inline (no line breaks are added). This can be achieved by the $ ... $ or \( ... \) (see this question for more details on the two).
  • Display (equations are printed in a separate line with certain formatting). This can be achieved using different methods. The shortcut \[ ... \] is quite popular when you don't want to give a number to your equation.

For example:

\documentclass{article}

\begin{document}

$A_k$ are the coefficients...

While \[ A_k \] are the coefficients...
\end{document}

Produces the following output. enter image description here

jak123
  • 4,252
  • 5
  • 26
  • 49