我一直在格式化我的论文,但有一个小问题困扰着我。我使用下面的代码排版一个方程式
\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}我的输出要求是:公式应该从左边距开始一个制表符空间,公式数字应该从右边距起一个制表符空间结束
使用上面的代码,我让等式从正确的位置开始,但不是从编号开始。
任何帮助都将不胜感激。
谢谢下院议员
发布于 2010-03-09 03:27:23
我能做的最好的了。请注意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}编辑
一个更优雅、更对称的版本:
\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}发布于 2010-03-09 04:02:00
不要紧,我一直在使用\setlength{\mathindent}{0.5in},它使我的等式从左边距1英寸开始。我修改了下面的代码,就像这样工作!甜蜜..。
\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} 你让我很开心!
发布于 2010-03-09 20:11:09
\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
%%%% %%%%
}
}https://stackoverflow.com/questions/2403426
复制相似问题