Aligning equations · Alinhamento de equações
Lining equations up
- When you show working, readers like the
=signs to line up. Thealign*environment does this:
- The
&marks where to align (just before each=), and\\ends each line.
Alinhando equações
- Ao mostrar cálculos, os leitores gostam que os sinais de
=fiquem alinhados. O ambientealign*faz isso:
\begin{align*}
y &= 2(x + 3) \\
y &= 2x + 6
\end{align*}
- O
&marca onde alinhar (logo antes de cada=), e\\encerra cada linha.
Numbered or not
align*(with the star) gives no equation numbers.- Drop the star —
align— and LaTeX numbers each line(1),(2), … for you to refer to.
Numerado ou não
align*(com o asterisco) não gera números de equação.- Remova o asterisco —
align— e o LaTeX numerará cada linha(1),(2), … para você referenciar.
Matrices
amsmathalso gives matrices.bmatrixdraws square brackets:
- Again
&separates columns and\\separates rows — the same idea as alignment.
Matrizes
amsmathtambém fornece matrizes.bmatrixdesenha colchetes quadrados:
\[
\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}
\]
- Novamente
&separa colunas e\\separa linhas — a mesma ideia do alinhamento.
Common mistakes
- In
align, line up on&and end each line with\\. - Use
align*when you do not want equation numbers.
Erros comuns
- Em
align, alinhe em&e termine cada linha com\\. - Use
align*quando não quiser números de equação.
Show the two steps lined up at the = sign. Put them in an align* environment, with & just before each = and · e \\ between the lines. · Mostre as duas etapas alinhadas no sinal de =. Coloque-as em um ambiente align*, com & logo antes de cada = e \\ entre as linhas.
Draw a 2×2 matrix with bmatrix (square brackets). Separate columns with & and rows with \\, e.g. \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}. · Desenhe uma matriz 2×2 com bmatrix (colchetes quadrados). Separe colunas com & e linhas com \\, ex. \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}.