+5 votes
94 views
in Office by (242k points)
reopened
LaTeX: Create vector

1 Answer

+3 votes
by (1.6m points)
 
Best answer

How to make a vector without an additional package
Create a vector using the amsmath package

Would you like to insert a vector for your mathematical calculations in LaTeX? Here's how it works..

image image

Vectors are used in linear algebra and analytical geometry to represent a vector space, among other things. This is represented in the coordinate notation similar to a matrix in LaTeX. In this article you will find out which command you have to enter in order to get a vector in LaTeX.

How to make a vector without an additional package

In LaTeX, a vector can be created using the array environment. Make sure that your environment is $ introduced and closed in the body of the text . The definition of the required columns and their alignment must be determined when inserting the array with \begin{array}{c} and \end{array} . This creates an array with only one centered column. Above \left( and \right) defined the parentheses. Otherwise the vector would be mapped without brackets. In order to display a vector with the coordinates (1,0,1) correctly, you have to enter the following in LaTeX:

$
\vec{e}_1= \left(\begin{array}{c} 1 \\ 0 \\ 1 \end{array}\right)
$

image

The commands mean in detail:

  • $ starts the math environment and closes it with another $ sign.
  • \vec{e}_1 outputs the vector e1 in vector notation with an arrow.
  • \begin{array} or \end{array} defines the beginning or the end of a new environment, in this case the array environment.
  • {c} stands for a centered column of the vector.
  • \\ creates a line break.
  • \left( and \right) create the round brackets.

Create a vector using the amsmath package

Alternatively, you can use different matrix environments via the amsmath package , which is \usepackage{amsmath} imported in the preamble at the beginning . These include the environments pmatrix, bmatrix, Bmatrix, vmatrix , which are bracketed through (), [], {} and | | . The parameters for the brackets and the centering of the column are thus omitted, since the surroundings automatically center the columns and generate the brackets. The round brackets are interesting for vectors, which is why we also use the pmatrix . This is introduced and closed with \begin{pmatrix} and \end{pmatrix} . A complete example for the same vector (1,0,1) looks like this:

$
\vec{e}_1=\begin{pmatrix} 1 \\ 0 \\ 1 \end{pmatrix}
$

image

...