GeneralScale down equations

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
User avatar
Steztric
Posts: 12
Joined: Sat Oct 25, 2008 2:00 pm

Scale down equations

Post by Steztric »

Hi everybody,

I have an equation that I want to fit onto one line. The only problem is, I don't know how to resize equations. I tried using \small but this has no effect. I also tried using the \scalebox method of the graphicx package, but no luck.

Does anybody know any way to do this? Here is the equation for interests' sake.

Code: Select all

\begin{eqnarray}
Total\ Cost &=& Transport\ Cost + Process\ Cost - Energy\ Recovery + Haulage\ Cost\nonumber\\
&=& \sum_D\sum_O T_{OD}V_O + \sum_D C_D\sum_O V_O S_O - \sum_D W_D\sum_O V_O S_O + V_D H_D + \sum_D\frac{H_O}{S_D}\left(1 + \Delta_D\right)\sum_O V_O S_O\\
\end{eqnarray}
Thanks, Steve
I can do magic too... Pass me that muffin. Now you see it; now woo down'.

Recommended reading 2024:

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

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

phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Scale down equations

Post by phi »

Hi,

first of all, get rid of the obsolete eqnarray environment and use the environments from the amsmath package instead. Here is a suggestion:

Code: Select all

\documentclass{article}

\usepackage{array}
\usepackage{amsmath}
\usepackage{mathtools}

\newcolumntype{d}{>{\displaystyle}c}


\begin{document}

\begin{equation}
	\setlength\arraycolsep{2pt}
	\begin{matrix*}[d]
	\text{Total Cost} &=& \text{Transport Cost} &+& \text{Process Cost} &-& \text{Energy Recovery} &+& \text{Haulage Cost} \\
	&=& \sum_D\sum_O T_{OD}V_O &+& \sum_D C_D\sum_O V_O S_O &-& \sum_D W_D\sum_O V_O S_O &+& V_D H_D + \sum_D\frac{H_O}{S_D}\left(1 + \Delta_D\right)\sum_O V_O S_O\\
	\end{matrix*}
\end{equation}

\end{document}
This is still too wide, of course. I think there is no general possibility for shrinking equations. It is important that your document looks consistent and that the equations are readable. Even if you choose the smallest font size (by prefixing the equation environment with \tiny), the equation is too wide (at least in this example). My suggestion is to rewrite the equation by introducing auxiliary variables:

Code: Select all

\begin{align}
	&\text{Transport cost:}		& C_{\text T} \coloneqq{}	&\sum_D \sum_O T_{OD} V_O \\
	&\text{Process cost:}		& C_{\text P} \coloneqq{}	&\sum_D C_D \sum_O V_O S_O \\
	&\text{Energy recovery:}	& R_{\text E} \coloneqq{}	&\sum_D W_D \sum_O V_O S_O \\
	&\text{Haulage cost:}		& C_{\text H} \coloneqq{}	&V_D H_D + \sum_D \frac{H_O}{S_D} \left(1 + \Delta_D\right) \sum_O V_O S_O \\
	&\text{Total cost:}			& C ={}						&C_{\text T} + C_{\text P} - R_{\text E} + C_{\text H}
\end{align}
User avatar
Steztric
Posts: 12
Joined: Sat Oct 25, 2008 2:00 pm

Re: Scale down equations

Post by Steztric »

Thanks for the help. Unfortunately if I abstract the equation then I cannot show the steps to simlifying the algebra, which is what I intended. That's why I need it on one line, because they are steps in a derivation.

Does anybody else have an idea?
I can do magic too... Pass me that muffin. Now you see it; now woo down'.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Scale down equations

Post by gmedina »

Hi Steztric,

as phi has mentioned, scaling down a single equation could not be the better solution. Anyway, the following code shows a possible solution. The idea is to use \tiny before the align environment, so that it inherits this font size and then restore the normal size using \normalsize. Inside the align environment, I used split to treat the two lines as parts of a single equation. The \raisetag command letś you adjust the placement of the equation number.

Code: Select all

\documentclass{article}
\usepackage{amsmath}

\begin{document}

text text text text text text text
\tiny
\begin{align}
\begin{split}
  \text{Total Cost} &= \text{Transport Cost} + \text{Process Cost} 
  - \text{Energy Recovery} + \text{Haulage Cost}\\
  &= \sum_D\sum_O T_{OD}V_O + \sum_D C_D\sum_O V_O S_O - \sum_D W_D\sum_O V_O S_O + V_D H_D + \sum_D\frac{H_O}{S_D}\left(1 + \Delta_D\right)\sum_O V_O S_O\raisetag{.8cm}\\
\end{split}
\end{align}
\normalsize
text text text text text text text

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Scale down equations

Post by phi »

You could also split the equation, using environments like split or multline. But then you cannot use the alignment of the text descriptions any more. Perhaps something like this?

Code: Select all

\begin{equation}
 \begin{split}
   \text{Total Cost} &= \text{Transport Cost} \\ &{}+{} \text{Process Cost} \\ &{}-{} \text{Energy Recovery} \\ &{}+{} \text{Haulage Cost} \\
   &=& \sum_D\sum_O T_{OD}V_O \\ &{}+{} \sum_D C_D\sum_O V_O S_O \\ &{}-{} \sum_D W_D\sum_O V_O S_O \\ &{}+{} V_D H_D + \sum_D\frac{H_O}{S_D}\left(1 + \Delta_D\right)\sum_O V_O S_O
   \end{matrix*}
 \end{split}
\end{equation}
User avatar
Steztric
Posts: 12
Joined: Sat Oct 25, 2008 2:00 pm

Re: Scale down equations

Post by Steztric »

Hi, thank you both for your help. Both those solutions are excellent. Don't hate me for this, but the reason I wanted to make it fit on one line is because I am porting this document over from, *ahem*, Microsoft Word... It happened to fit on one line on there and looked fine.

The reason I did this is because a) I started the document before the wonderful discovery of LaTeX, and b) MS Word kept cocking up my illustrations and annotations on diagrams. Now I am armed with a an array of possibilities, so thanks.

Steve
I can do magic too... Pass me that muffin. Now you see it; now woo down'.
Post Reply