4

I am trying to obtain the following alignment for my three equation

enter image description here

The best I have been able to do is the following

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage[latin1]{inputenc}

\begin{document}
\maketitle

\begin{align*}
  r(\theta)    & = & (x_0 + a \cos x) i & + & (y_0 + a \sin x) j & \\
  r'(\theta)   & = &      - a \sin x  i & + &       (a \cos x) j & \\
  F(r(\theta)) & = &                0 i & + & (x_0 + a \sin x) j &
\end{align*}
\end{document}

However this leaves huge whitespaces in the equation.

4

enter image description here

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage[latin1]{inputenc}% really? that is very 20th century, why not utf8?

\begin{document}


\begin{alignat*}{3}
  r(\theta)    ={}&&  (x_0 + a \cos x) i  + {}&& (y_0 + a \sin x) j \\
  r'(\theta)   ={}&&      - a \sin x  i   + {}&&       (a \cos x) j \\
  F(r(\theta)) ={}&&                0 i   + {}&& (x_0 + a \sin x) j
\end{alignat*}
\end{document}

alignat is a variant of align that avoids adding extra space. You need && so you only use the right aligned columns not the left aligned, and then you need {} after the = and + to preserve the correct spacing as they are before the & not after.

0

You can also use an array for this.

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}

\newcommand{\ii}{\mathbf{\,i}}
\newcommand{\jj}{\mathbf{\,j}}

\[
\begin{array}{r @{{}={}} r @{} r}
  \mathbf{r}(\theta)             & (x_0 + a \cos x) \ii +{} & (y_0 + a \sin x) \jj  \\
  \mathbf{r}'(\theta)            &      - a \sin x  \ii +{} &       (a \cos x) \jj  \\
  \mathbf{F}(\mathbf{r}(\theta)) &                0 \ii +{} & (x_0 + a \sin x) \jj 
\end{array}
\]

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.