Латекс --- Есть ли способ сместить уравнение с номером одной табуляции от правого поля (смещение влево)? - PullRequest
1 голос
/ 08 марта 2010

Я форматировал диссертацию, и одна маленькая проблема застревает. Я использовал следующий код, чтобы набрать уравнение

\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}

Мои выходные требования таковы: Уравнение должно начинаться на одну вкладку с левого поля Номер уравнения должен заканчиваться на одну позицию табуляции от правого поля

С приведенным выше кодом, у меня есть уравнение, начинающееся в правильном месте, но не с нумерации.

Буду очень признателен за любую помощь.

Спасибо MP

Ответы [ 3 ]

1 голос
/ 08 марта 2010

Лучшее, что я мог сделать. Обратите внимание на параметр fleqn и среду minipage. Если вам это нужно постоянно, вам придется соответствующим образом переопределить среду align.

\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

Более элегантная и симметричная версия:

\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}
0 голосов
/ 09 марта 2010

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

Следующий код решает вашу проблему.

\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
%%%%           %%%%
}
}
0 голосов
/ 08 марта 2010

Неважно, я использовал \ setlength {\ mathindent} {0.5in}, который заставил мое уравнение начаться в 1in от левого поля. Я изменил код следующим образом на работает просто так, что !!!! СЛАДКИЙ ...

\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} 

Ты сделал мой день !!!!

...