LaTeX
  • How I learn LaTeX?
  • Installation and Customization
    • Online
    • Offline
  • LaTeX Basics
  • Text Manipulation
    • Fonts, Size and Styles
  • Math Manipulation
  • Advanced Math Manipulation
  • Lists
  • Tables
  • Pictures, Figures
  • Unit in LaTeX
  • Document Structure
  • Document Formatting
    • Headers and Footers, Page Numbering
    • Spacing in Paragraphs
    • Page size, Margins
    • Coloring
    • Footnotes
  • Multi-file LaTeX project
Powered by GitBook
On this page
  • Dots
  • Regarding other Math symbols
  • Arrays and Matrices
  • Display style in math mode

Advanced Math Manipulation

At this point, you should know how to properly typeset your mathematical idea. This article will provide you with advanced LaTeX elements and how to position them.

Dots

In LaTeX\LaTeXLATE​X, to define horizontal, vertical and diagonal dots, we are provided with \ldots, \cdots, \vdots and \ddots.

  • \ldots for horizontal dots on the line

  • \cdots for horizontal dots above the line

  • \vdots for vertical dots

  • \ddots for diagonal dots

\documentclass{article}
\usepackage[textwidth=8cm]{geometry}
\begin{document}
\noindent First, let's take a look at the difference between \verb|\ldots| and \verb|\cdots| \\
\underline{\( \ldots \cdots \)} \\

\noindent Let's these all of them in action!
\[
\Sigma = \left[
\begin{array}{ccc}
\alpha_{11} & \cdots & \alpha_{1n} \\
\vdots & \ddots & \vdots \\
\alpha_{n1} & \cdots & \alpha_{nn}
\end{array}
\right] \quad \forall n=1,\ldots,100
\]
\end{document}

The AMS (American Math Society) suggests that \cdots should be used between operators and relations (it has mathematical meaning), while \ldots should be used between variables with other punctuation (for readability purposes).

Regarding other Math symbols

Arrays and Matrices

Arrays

\begin{array}{<column spec>}
    <row 1, column 1> & <row 1, column 2> & \ldots & <row 1, column n> \\
    <row 2, column 1> & <row 2, column 2> & \ldots & <row 2, column n> \\
    \vdots & \vdots & \ddots & \vdots \\
    <row m, column 1> & <row m, column 2> & \ldots & <row m, column n> \\
\end{array}

In this code example, the dots are unnecessary and can be removed.

Let's explain the code. First, we define the array environment by the pair \begin{array} and \end{array}. After that, we have a special properties called "column spec" - which defines the alignment of the columns. <row i, column j> is just the element.

3 possible values of column spec: "l" - left, "r" - right, "c" - center. So for example: lcr, the first column will be left-aligned, the second one will be centered and so on.

Here is an example of arrays in action:

Matrices

matrix is an environment that is bundled into the amsmath package, which could simplify the process of creating a matrix. Luckily, amsmath provides us with a lot of matrices with different delimeters:

Type
Environment name
Rendered as

Plain (no parentheses)

matrix

Parentheses

pmatrix

Brackets

bmatrix

Curly brackets

Bmatrix

Pipes

vmatrix

Double pipes

Vmatrix

The syntax is very simple. Let's take pmatrix as an example:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\begin{pmatrix}
1 & 2 & 3\\
a & b & c
\end{pmatrix}
\]
\end{document}

Display style in math mode

TeX engines provide several commands which can be used to override the default style in which a piece of math is typeset:

  • \textstyle: apply the style used for mathematics typeset in paragraphs (inline mode while in display math mode)

  • \displaystyle: apply the style used for mathematics typeset on lines by themselves (display math mode while in inline mode)

  • \scriptstyle: apply the style used for subscripts or superscripts (make your math smaller)

  • \scriptscriptstyle: apply the style used for second-order subscripts or superscripts (make your math smallest)

Let's look at this example to understand how it works:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\noindent Fraction in sentence is so small $f(x) = \frac{1}{1+x}$. \break Let's change. $\displaystyle f(x) = \frac{1}{1+x}$. Now this looks better. \\[\baselineskip]
Let's enter math mode.
\[
f(x) = \frac{1}{1+{x^2}}
\]
\[
\textstyle f(x) = \frac{1}{1+{x^2}}
\]
\[
\scriptstyle f(x) = \frac{1}{1+{x}}
\]
\[
\scriptscriptstyle f(x) = \frac{1}{1+{x}}
\]
\end{document}

PreviousMath ManipulationNextLists

Last updated 1 year ago

I won't mention too much about symbols like ∈\in∈, ⊂\subset⊂, ∪\cup∪, ∩\cap∩, ∧\land∧,   ⟹  \implies⟹or ≤\leq≤. These symbols are simple and can be typeset using a single command. You can check list of LaTeX\LaTeXLATE​X symbols .

In the previous example, I have coded a document which use array to present the dots. Arrays are good ways to typeset and store a collection of elements of the same type in a sequential manner. In order to use arrays, you need to define an array environment. The basic syntax for creating an array is:

You can combine arrays with the \left and \right command introduced in to create Matrices.

If you want to know the difference between arrays and matrices, look at page.

As mentioned in , there are 2 modes in LaTeX\LaTeXLATE​X, display math mode and inline math mode. There will be a situation when you want to manually adjust the style of typeset mathematics. Right now, I'm typing a fraction f(x)=11+xf(x) = \frac{1}{1+x}f(x)=1+x1​. It's a bit small, so I enlarge it by changing to display math mode: f(x)=11+x\displaystyle f(x) = \frac{1}{1+x}f(x)=1+x1​, although it does impact heavily on the line spacing.

here
this
dots
Brackets and Parentheses
Math mode