Search code examples
alignmentlatex

Left align a block of equations inside a proof using LaTeX


I am suffering with this LaTeX document. I am trying to left align the block of equations inside a proof. There is a famous question about this on stack overflow:

Left align block of equations

However, I tried using \documentclass[fleqn]{article}. It didn't work. I also tried using \begin{flalign}, it didn't work.

The math in my text looks ugly. I wish it was centralized or left aligned.

That's how it looks: appearance of the text

This is the code:

\documentclass[fleqn]{article}
\usepackage[utf8x]{inputenc} 
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{gensymb}
\usepackage{titling}
\usepackage{lipsum}
\usepackage{url}
\usepackage{graphicx}
\usepackage{color}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{amsmath}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\graphicspath{{images/}}


\begin{document}

\newpage


\begin{proof}
  \begin{align*}
    \text{Seja: } \gamma(t) = (r \cos t,r\sin t, a\sin t + b\cos t +c)  \\
    \text{Primeira derivada: }\gamma'(t) = (-r\sin t,r\cos t,   a\cos t - b\sin t)  \\
    \text{Segunda derivada: }\gamma''(t) = (-r\cos t,-r\sin t,    -a\sin t - b\cos t)  \\
    \text{Terceira derivada: }\gamma'''(t) = (r\sin t,-r\cos t, -a\cos t + b\sin t)  \\
    \text{A torção pode ser expressa por: }\tau  = {{\left(   {r' \times r''} \right) \cdot r'''} \over {\left\| {r' \times r''} \right\|^2}}\\
    \text{A fórmula acima não exige que a curva esteja      parametrizada pelo cumprimento   de arco} \\
    \text{Desenvolvendo os cálculos do numerador}  \\
    \text{O produto vetorial das duas primeiras derivadas é:  } {\gamma'(t) \times \gamma''(t)= (-rb, -  ra, r²)}\\
    \text{O produto escalar é o produto vetorial vezes a   terceira derivada: } \\
    (-rb, -ra, r²)\cdot \gamma'''(t)  \\
    (-rb, -ra, r²)\cdot (r\sin t,-r\cos t, -a\cos t + b\sin t)   = 0 \\
    \text{O numerador é zero. Logo, a torção é zero. } \\
    \tau = 0 \\
    \text{Se a torção é zero, a curva é plana.} 
  \end{align*}
\end{proof}

Solution

  • This is the answer:

    Align expects a two-part entry (or multiples of two parts) on each line, with the first part right-aligned and the second part (usually after a sign of relation) left-aligned. the alignment point is marked by &. you haven't entered any alignment points. if you place a & before each line, all the lines will be aligned on the left.

    \begin{proof}
      \begin{align*}
      &  \text{Seja: } \gamma(t) =  (r \cos t,r\sin t, a\sin t + b\cos t +c)  \\
       & \text{Primeira derivada: }\gamma'(t) = (-r\sin t,r\cos t,   a\cos t - b\sin t)  \\
       & \text{Segunda derivada: }\gamma''(t) = (-r\cos t,-r\sin t,    -a\sin t - b\cos t)  \\
       & \text{Terceira derivada: }\gamma'''(t) = (r\sin t,-r\cos t, -a\cos t + b\sin t)  \\
       & \text{A torção pode ser expressa por: }\tau  = {{\left(   {r' \times r''} \right) \cdot r'''} \over {\left\| {r' \times r''} \right\|^2}}\\
       & \text{A fórmula acima não exige que a curva esteja      parametrizada pelo cumprimento   de arco} \\
       & \text{Desenvolvendo os cálculos do numerador}  \\
       & \text{O produto vetorial das duas primeiras derivadas é:  } {\gamma'(t) \times \gamma''(t)= (-rb, -  ra, r²)}\\
       & \text{O produto escalar é o produto vetorial vezes a   terceira derivada: } \\
       & (-rb, -ra, r²)\cdot \gamma'''(t)  \\
       & (-rb, -ra, r²)\cdot (r\sin t,-r\cos t, -a\cos t + b\sin t)   = 0 \\
       & \text{O numerador é zero. Logo, a torção é zero. } \\
       & \tau = 0 \\
       & \text{Se a torção é zero, a curva é plana.} 
      \end{align*}
    \end{proof}