Latex --- 有没有办法将方程式编号为一个制表符的空格从右边距移动(向左移动)?

发布于 2024-08-24 12:13:08 字数 486 浏览 5 评论 0原文

我一直在格式化我的论文,但一个小问题困扰着我。 我使用以下代码来排版方程

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

我的输出要求是这样的: 方程应从左边距开始一个制表符空间 方程编号应以距离右边距一个制表符空格结束。

使用上面的代码,我让方程从正确的位置开始,但没有编号。

任何帮助将不胜感激。

谢谢 国会议员

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一梦等七年七年为一梦 2024-08-31 12:13:08

我能做到的最好的。请注意 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}

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}
压抑⊿情绪 2024-08-31 12:13:08

没关系,我一直在使用 \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} 

你让我很开心!!!!

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!!!!

爱殇璃 2024-08-31 12:13:08

\hspace{.63in} brrrrr...

以下代码解决了您的问题。

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

\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
%%%%           %%%%
}
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文