首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Latex -有没有办法将公式从右边距移动到一个制表符空间(向左移动)?

Latex -有没有办法将公式从右边距移动到一个制表符空间(向左移动)?
EN

Stack Overflow用户
提问于 2010-03-09 01:55:09
回答 3查看 8.5K关注 0票数 2

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

代码语言:javascript
复制
\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}

我的输出要求是:公式应该从左边距开始一个制表符空间,公式数字应该从右边距起一个制表符空间结束

使用上面的代码,我让等式从正确的位置开始,但不是从编号开始。

任何帮助都将不胜感激。

谢谢下院议员

EN

回答 3

Stack Overflow用户

发布于 2010-03-09 03:27:23

我能做的最好的了。请注意fleqn选项和minipage环境。如果您一直需要它,那么您必须相应地重新定义align环境。

代码语言:javascript
复制
\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}

编辑

一个更优雅、更对称的版本:

代码语言:javascript
复制
\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}
票数 2
EN

Stack Overflow用户

发布于 2010-03-09 04:02:00

不要紧,我一直在使用\setlength{\mathindent}{0.5in},它使我的等式从左边距1英寸开始。我修改了下面的代码,就像这样工作!甜蜜..。

代码语言:javascript
复制
\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} 

你让我很开心!

票数 1
EN

Stack Overflow用户

发布于 2010-03-09 20:11:09

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

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

代码语言:javascript
复制
\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
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2403426

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档