views:

404

answers:

3

I have been formatting my dissertation and one little problem is stucking me up. I used the following code to typeset an equation

\begin{align}
& R=\frac{P^2}{P+S'} \label{eqn:SCS}\\
&\mbox {where} \quad \mbox R = \mbox {Watershed Runoff} \notag\\
&\hspace{0.63in} \mbox P = \mbox{Rainfall} \notag\\
&\hspace{0.63in} \mbox S' = \mbox{Storage in the watershed $=\frac{1000}{CN}-10$ }\notag
\end{align}

My output requirement is such that: The equation should begin one tab space from the left margin The equation number should end at one tab space from the right margin

With the above code, I have the equation begin at the right place but not the numbering.

Any help will be extremely appreciated.

Thanks MP

+1  A: 

Best I could do. Notice the fleqn option and the minipage environment. If you need this all the time, you'll have to redefine the align environment accordingly.

\usepackage{amsmath}
\begin{document}

Lorem Ipsum is simply dummy text of the printing and typesetting
industry. 

\begin{minipage}{0.8\textwidth}
\begin{align}
& R=\frac{P^2}{P+S'} \label{eqn:SCS}\\
&\mbox {where} \quad \mbox R = \mbox {Watershed Runoff} \notag\\
&\hspace{0.63in} \mbox P = \mbox{Rainfall} \notag\\
&\hspace{0.63in} \mbox S' = \mbox{Storage in the watershed $=\frac{1000}{CN}-10$ }\notag
\end{align}
\end{minipage}

Lorem Ipsum is simply dummy text of the printing and typesetting
industry. 
\end{document}

EDIT

A more elegant and symmetric version:

\documentclass[fleqn]{article}
\usepackage{amsmath}
\makeatletter
\setlength\@mathmargin{0pt}
\makeatother

\begin{document}
\noindent Lorem Ipsum is simply dummy text of the printing and
typesetting
industry. The margins of the quotation environment are indented on the
left and the right. The text is justified at both margins and there is
paragraph indentation. Leaving a blank line between text produces a
new paragraph. 
\begin{quotation}
\begin{align}
& R=\frac{P^2}{P+S'} \label{eqn:SCS}\\
&\mbox {where} \quad \mbox R = \mbox {Watershed Runoff} \notag\\
&\hspace{0.63in} \mbox P = \mbox{Rainfall} \notag\\
&\hspace{0.63in} \mbox S' = \mbox{Storage in the watershed $=\frac{1000}{CN}-10$ }\notag
\end{align}
\end{quotation}
Lorem Ipsum is simply dummy text of the printing and typesetting
industry. The margins of the quotation environment are indented on the
left and the right. The text is justified at both margins and there is
paragraph indentation. Leaving a blank line between text produces a
new paragraph. 
\end{document}
AVB
Thanks!! using minipage shifted the equation number one tab space to the right!!! awesome!!But it moved the equation two tab spaces from the left margin. Is there a way I can shift the equation back to 1 tab space?
Murari
Murari
A: 

Nevermind, I had been using \setlength{\mathindent}{0.5in} that made my equation begin at 1in from left margin. I modified the code as follows at is worked JUST LIKE THAT!!!! SWEET...

\begin{minipage}{5.5in} 
\setlength{\mathindent}{0.0in}
\begin{align} 
& R=\frac{P^2}{P+S'} \label{eqn:SCS}\\ 
&\mbox {where} \quad \mbox R = \mbox {Watershed Runoff} \notag\\ 
&\hspace{0.63in} \mbox P = \mbox{Rainfall} \notag\\ 
&\hspace{0.63in} \mbox S' = \mbox{Storage in the watershed $=\frac{1000}{CN}-10$ }\notag 
\end{align} 
\end{minipage} 

You made my day!!!!

Murari
A: 

\hspace{.63in} brrrr....

The following code solves your problem.

\newskip \tabspace \tabspace = 3em % Set tab space
\def\eq{\refstepcounter{equation}(\theequation)}% To insert the next number
{
\let\\\cr \tabskip 0pt
\halign to \hsize{\hskip\tabspace$\displaystyle#$\hfil&#\hfil
   \tabskip 0pt plus 1fil &\hfil#\hskip\tabspace\tabskip 0pt\crcr
%%%% Your code %%%%
R=\frac{P^2}{P+S'}\span\omit&\eq\cr
\hbox{where }&$R$  = Watershed Runoff\cr
             &$P$  = Rainfall\cr
             &$S'$ = Storage in the watershed $=\frac{1000}{CN}-10$\cr
%%%%           %%%%
}
}
Alexey Malistov