GeneralEquations are sequentially tabbing throughout document

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
yogester
Posts: 5
Joined: Mon Oct 20, 2008 12:23 am

Equations are sequentially tabbing throughout document

Post by yogester »

First time poster.

I have been using LaTeX to typeset my documents for a while but I have not needed to have several equations in a row before so I have not encountered this issue before. Please excuse any naughty cheats that I have taken.... :oops: (but feel free to suggest any hints too! I know my doing [10pt} after each line and [40pt] after each equation is not correct but it gets the job done and I have not worked out a more elegant approach)

Back to the main problem, each time I put an equation together that is in the next {align*} environment it seems to line itself up with the tab break in the environment above it.

Here is the output:-

Image

Here is my code:-

Code: Select all

\section*{Question 2}
\renewcommand{\labelenumi}{\Alph{enumi}.}
\renewcommand{\labelenumii}{\alph{enumii}.}

\begin{enumerate}
\item


\begin{align*}
	U &= \dfrac{1}{ \sum \dfrac{x}{k} + \sum \dfrac{1}{h}}  \nonumber  \\[10pt]
	&= \dfrac{1}{\dfrac{1}{h_i} +  \dfrac{x}{k} + \dfrac{1}{h_o}}  \nonumber \\[10pt]
	&= \dfrac{1}{\dfrac{1}{260} + \dfrac{3.25 \times 10^{-3}}{17} + \dfrac{1}{8}}  \nonumber\\[10pt]
	&= \dfrac {1}{3.84 \times 10^{-3} +  1.91 \times 10^{-4}  + 0.125}  \nonumber\\[10pt]
	&= \dfrac{1}{0.129} \nonumber\\[10pt]
	&= 7.75 \; W/m^2 \cdot ^\circ K \nonumber
\end{equation*}

\item

\begin{align*}
	A &= \pi D h + \dfrac{\pi D^2}{4}  \nonumber  \\[10pt]
	&= 2.9 \cdot 3.5 \cdot \pi + \dfrac{2.9^2 \cdot \pi}{4}  \nonumber  \\[10pt]
	&= 38.5 \; m^2 \nonumber \\[40pt]
	q &= U \cdot A \cdot \Delta T  \nonumber \\[10pt]
	&= 7.75 \times \38.5 \times 14 \nonumber \\[10pt]
	&= 4.2 \; kW \nonumber	
\end{align*}

\item

\begin{align*}
	V &= \dfrac{\pi D^2}{4} \cdot h \nonumber \\[10pt]
	&= 23.12 \; m^3 \nonumber 
\end{align*}	

\end{enumerate}
Thanks very much for any input!!!!

Recommended reading 2024:

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

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

Stefan Kottwitz
Site Admin
Posts: 10347
Joined: Mon Mar 10, 2008 9:44 pm

Equations are sequentially tabbing throughout document

Post by Stefan Kottwitz »

Hi yogester,

welcome to the board!
Those math environments are centered. If you don't want it, set the document class option fleqn.
Further you are closing the first align* environment by \end{equation*}, replace it by \end{align*}.

Instead of adding [10pt] each line try

Code: Select all

\addtolength{\jot}{10pt}
once.

Stefan
LaTeX.org admin
yogester
Posts: 5
Joined: Mon Oct 20, 2008 12:23 am

Re: Equations are sequentially tabbing throughout document

Post by yogester »

thanks stefan!

it was poor copy pasting of my code that led to the \end{equation*} slipping in there...

I will try to use the \addtolength{\jot}{10pt} - do I just place it in the preamble?

yogester
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Equations are sequentially tabbing throughout document

Post by Juanjo »

Try this:

Code: Select all

\begin{enumerate}
\addtolength{\jot}{10pt}
\item
$\begin{aligned}[t]
   U &= \dfrac{1}{ \sum \dfrac{x}{k} + \sum \dfrac{1}{h}}  \\
   &= \dfrac{1}{\dfrac{1}{h_i} +  \dfrac{x}{k} + \dfrac{1}{h_o}} \\
   &= \dfrac{1}{\dfrac{1}{260} + \dfrac{3.25 \times 10^{-3}}{17} + \dfrac{1}{8}} \\
   &= \dfrac {1}{3.84 \times 10^{-3} +  1.91 \times 10^{-4}  + 0.125} \\
   &= \dfrac{1}{0.129}\\
   &= 7.75 \; W/m^2 \cdot ^\circ K
\end{aligned}$

\item
$\begin{aligned}[t]
   A &= \pi D h + \dfrac{\pi D^2}{4}  \\
   &= 2.9 \cdot 3.5 \cdot \pi + \dfrac{2.9^2 \cdot \pi}{4}  \\
   &= 38.5 \; m^2 \\
   q &= U \cdot A \cdot \Delta T  \\
   &= 7.75 \times \ 38.5 \times 14 \\
   &= 4.2 \; kW   
\end{aligned}$

\item
$\begin{aligned}[t]
   V &= \dfrac{\pi D^2}{4} \cdot h \\
   &= 23.12 \; m^3 
\end{aligned}$   

\end{enumerate}
The SIunits package will help you to correctly type units. Consider also if you really need to vertically align expressions instead of wrtting them in the same line (there is enough space in most rows!).
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
yogester
Posts: 5
Joined: Mon Oct 20, 2008 12:23 am

Re: Equations are sequentially tabbing throughout document

Post by yogester »

Didn't know there was an SIunits package - thanks for that!

What is the difference between {aligned} and {align*} other than not needing to suppress equation numbering?

Thanks!
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Equations are sequentially tabbing throughout document

Post by Juanjo »

yogester wrote: What is the difference between {aligned} and {align*} other than not needing to suppress equation numbering?
aligned should always be used inside other math environment, like equation, multline, align, $...$,... Just a simple example:

Code: Select all

\begin{equation*}
   \nabla f(x,y)=\mathbf{0}
   \Longleftrightarrow\left\{
   \begin{aligned}
      f_x(x,y)&=0 \\
      f_y(x,y)&=0
   \end{aligned}
   \right.
\end{equation*}
You should read the documentation of the amsmath package. There are several environments, like aligned, which prove to be quite useful.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
Post Reply