Math & Scienceamsmath align pdflatex problem

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
nickpe
Posts: 3
Joined: Mon Jun 28, 2010 8:31 pm

amsmath align pdflatex problem

Post by nickpe »

learning LaTeX i decided to try and write down some basic math formula's.
However I immediately bumped into a problem. When trying to compile this:

Code: Select all

\documentclass{article}
\usepackage{amssymb,amsmath}
\begin{document}
\begin{align}
f(x) &= a^{x}   f'(x) &= n \cdot x^{n-1} \\
f(x) &= sin{x}  f'(x) &= cos{x} \\
f(x) &= e^{x}  f'(x) &= e^{x} \\
f(x) &= g^{x}  f'(x) &= g^{x} \cdot ln{g} \\
\end{align}
\end{document}
LaTex code with the pdflatex command i get a lot of errors (log attached).
I searched Google and this forum but couldn't find anything useful.
I am using Ubuntu 10.04 and i checked all dependencies and packages. i would find it very helpfull if someone could help me with this. :)
Attachments
test.log
logfile
(7.25 KiB) Downloaded 346 times
Last edited by nickpe on Tue Jun 29, 2010 10:21 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

torbjorn t.
Posts: 162
Joined: Wed Jun 17, 2009 10:18 pm

amsmath align pdflatex problem

Post by torbjorn t. »

The provided code compiles without errors for me, but there are some mistakes:
1. Do not end the last line with \\, as that will give an empty line, which will be numbered.
2. When having two "columns" such as this in the align-enviroment, you need an extra ampersand (&) between them. See below code.
3. sin, cos and ln should not be in italics, so write \sin, \cos.

Code: Select all

\documentclass{article}
\usepackage{amssymb,amsmath}
\begin{document}
\begin{align}
f(x) &= x^{n}  &  f'(x) &= n \cdot x^{n-1} \\
f(x) &= \sin x &  f'(x) &= \cos x \\
f(x) &= e^{x}  &  f'(x) &= e^{x} \\
f(x) &= g^{x}  &  f'(x) &= g^{x} \cdot \ln g
\end{align}
\end{document}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

amsmath align pdflatex problem

Post by Stefan Kottwitz »

Hi nickpe,

welcome to the board!
Here you may find further information regarding this subject: Mathematics with LaTeX.

Stefan
LaTeX.org admin
nickpe
Posts: 3
Joined: Mon Jun 28, 2010 8:31 pm

Re: amsmath align pdflatex problem

Post by nickpe »

I still can't find the exact cause of the problem, but with the suggested changes applied it compiles without errors, So thanks for helping.

The nice welcome and useful link are also much appreciated :)
Post Reply