Text FormattingAlignment errors

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
IsleofGough
Posts: 5
Joined: Tue Oct 15, 2019 10:33 pm

Alignment errors

Post by IsleofGough »

I've had lots of errors with the alignment environment. Sometimes it fails to compile but other times the formula does not accurately transcribe exponents. What am I doing wrong? An example:

Code: Select all

\documentclass[10pt]{article}
\usepackage[inner=1.125in, outer=1in, top=1in, bottom=1in]{geometry}  
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{lmodern}
\usepackage{commath}
\raggedbottom

\begin{document}

\section*{\textsf{Series of increasing powers}}

\begin{align}
S &= 1+2+x^2+x^3+\ldots+x^n\\
x\times S &= x+x^2+x^3+ \ldots x^n + x^(n+1)\\
\end{align}

\end{document}
This generates:
LatexProblem.jpg
LatexProblem.jpg (39.64 KiB) Viewed 3198 times

Recommended reading 2024:

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

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

IsleofGough
Posts: 5
Joined: Tue Oct 15, 2019 10:33 pm

Alignment errors

Post by IsleofGough »

never mind. It looks like I should be using curly brackets on exponents.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

Alignment errors

Post by Stefan Kottwitz »

Hi,

yes, it's using curly braces.

By the way, I see that you use sans-serif headings. That is a good decision. I would just not use text formatting commands in headings. I recommend using scrartcl as document class, which automatically has sans-serif headings since it's a more modern design. It also offers more customizing options than the base article class.

Stefan
LaTeX.org admin
IsleofGough
Posts: 5
Joined: Tue Oct 15, 2019 10:33 pm

Alignment errors

Post by IsleofGough »

Thank you!
Post Reply