In mathematics, it is common to use as part of the language notation small symbols written at the top or bottom of a given symbol. These are called subscript and superscript, respectively. In this short tutorial, we will learn how to do subscript and superscript in LaTeX!
The most usual example of superscript we all learn in school is when we want to square a number \(2^2 = 4\), cube it \(2^3 = 8\), or, in general, raise it to the power of \(n\), \(2^n\). Superscripts can be done in LaTeX using the symbol ^. For example, $2^2=4$ produces the output \(2^2 = 4\).
Subscripts are mainly used when we want to list certain elements, like let \(x_1,x_2,…,x_n\) be rational numbers. Subscript in LaTeX can be created easily using the symbol _ (underscore). For example, $x_1,x_2,\ldots,x_n$ produces the list \(x_1,x_2, \ldots ,x_n\).
When we want to include more than one element in the subscript we will have to enclose those elements inside braces. For example, you can check the output produced by the following code: $ x_ \quad x_12$ which is: \( x_ \quad x_12\) You can see the difference between using the braces and not using them. The same goes for the superscripts!
Subscripts and superscripts can be both used at the same time, as in the equation: $a_b_=\delta_^$ which produces the output: \( a_b_=\delta_^ \) And they can even be nested (e.g. double subscript), for example: x^>=a_>> produces: \(x^>=a_>>\) It is a bit subtle, but observe that the first nested subscripts or superscript has a slightly smaller size than the previous one. However, from that point on, all nested subscripts or superscripts will have the same size as the second level.
Certain mathematical operators require subscripts, superscripts, or both. These sub and superscripts are also inserted using the _ and ^ symbols; LaTeX automatically knows where to typeset them depending on the kind of operator that is being used. Some of the most common ones are the following: \[
\int_<-\infty>^ <\infty>\quad
\sum_^ <\infty>\quad
\prod_^ \quad
\bigcup_ \quad
\bigcap_ \quad
\coprod_^ <\infty>\quad
\lim_
\] which are produced with the code:
% Math Operators with subscripts and superscripts \[ \int_<-\infty>^ <\infty>\quad \sum_^ <\infty>\quad \prod_^ \quad \bigcup_ \quad \bigcap_ \quad \coprod_^ <\infty>\quad \lim_ \]
Most subscript and superscript, also called limits, in the case of the operators will be printed differently when used inline, mainly by positioning them at the top or bottom right. For instance, the first two operators of the previous example are: \( \int_<-\infty>^<\infty>\) and \(\sum_^<\infty>\) If you don’t like this new behavior and prefer for legibility that they take up a larger amount of space than a normal line, you can use the command \displaystyle inside math mode. For example: $\displaystyle \int_<-\infty>^<\infty>$ produces the output \( \displaystyle \int_<-\infty>^ <\infty>\) compared to the previous one: \( \int_<-\infty>^ <\infty>\). We reached the end of this tutorial, If you have any remarks or suggestions, please feel free to reach us via email at admin@latex-tutorial.com
n this tutorial, we will see how to write a multiple-choice exam in LaTeX, using the exam document class. This document class provides multiple tools to easily typeset exams in LaTeX, and we have.
In this step by step tutorial, we will learn how to typeset a professional CV, and gain some more insight into how LaTeX works with a practical example.
LaTeX-Tutorial provides step-by-step lessons to learn how to use LaTeX in no time. It allows you to start creating beautiful documents for your reports, books and papers through easy and simple tutorials.