帮助对齐方程式和编号

帮助对齐方程式和编号

我是新手,LaTeX所以你必须耐心等待。我正在尝试使用它编写项目报告,到目前为止,我已经获得了特定部分的内容:

然后,

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,graphicx,hyperref,parskip,gensymb} 
% In case you are wondering what these packages are for: 
% amsmath provides extra mathematical constructs and symbols 
% graphicx facilitates the inclusion of graphics files 
% hyperref makes links into clickable hyperlinks 
% parskip leaves more space between paragraphs 
\usepackage[cm]{fullpage} 
% The above package makes the page margins smaller. I included it 
% to save you printing costs.
% Feel free to also print two-sheets per page and double-sided

%==================
%.....
%==================

\begin{equation}\label{eq:six}  
x = Vtsin(K),  
\end{equation}  
and   
\begin{align*}  
X  
&= x-(l+h)sin(\phi), \\  
&= Vt\sin(K)-(l+h)sin[K-2\tan ^{ - 1}\{\tan(K/2).exp((-Vt)/l)\}],  
\end{align*}

上面写着:

\documentclass[a4paper,12pt]{article}  
\usepackage{amsmath,graphicx,hyperref,parskip,gensymb} 

我希望所有三行方程排成一行 - 因此 x 和 X 方程 - 并且第一行和第三行已分配编号。我所有其他方程都有\begin{equation}...\end{equation}它们,并且它们已被赋予参考编号 - 比如 x 方程,但我想让这两个方程排成一行,所以我使用了对齐公式而不是方程式公式,然后尝试两者一起但不起作用。(此外,标签不起作用,但这是另一个问题!)

任何帮助将不胜感激!

答案1

这个怎么样?

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,graphicx,hyperref,parskip,gensymb} 
% In case you are wondering what these packages are for: 
% amsmath provides extra mathematical constructs and symbols 
% graphicx facilitates the inclusion of graphics files 
% hyperref makes links into clickable hyperlinks 
% parskip leaves more space between paragraphs 
\usepackage[cm]{fullpage} 
% The above package makes the page margins smaller. I included it 
% to save you printing costs.
% Feel free to also print two-sheets per page and double-sided

%==================
%.....
%==================
\begin{document}

{%
\setlength{\belowdisplayskip}{0pt}%
\setlength{\abovedisplayskip}{0pt}%
\begin{align}\label{eq:six}  
x & = Vtsin(K)  \\
\intertext{and}  \notag
X &= x-(l+h)sin(\phi), \notag \\  
  &= Vt\sin(K)-(l+h)sin[K-2\tan ^{ - 1}\{\tan(K/2).exp((-Vt)/l)\}],  
\end{align}
}   

\end{document}

除非你对命令进行调整,否则会\intertext在行周围留出很多空间,我发现andsetlength这里

思考这给出了您所追求的对齐和编号吗?

答案2

mathtools包提供了\shortintertext;此外,还可以使用split来将第二个方程编号在一起。在这种情况下需要进行小幅调整(文本间后有一些小的垂直空间)。

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,mathtools}

\usepackage{lipsum} % just for the example

\begin{document}

\lipsum*[3]
\begin{align}
x & = Vt\sin K \label{eq:six} \\
\shortintertext{and\vspace{\jot}}
\begin{split}
X &= x-(l+h)\sin\phi, \\
  &= Vt\sin K-(l+h)\sin\bigl(K-2\arctan(\tan(K/2)\exp(-Vt/l)\bigr),
\end{split}
\end{align}
\lipsum[4]

\end{document}

抱歉,但我无法\tan^{-1}忍受反正切;另外,括号应该尽可能圆。另外\sin(K)是多余的,而且\sin K绰绰有余(而且是传统的);句号永远不应该用来表示乘法:要么什么都没有,要么是一个居中的点\cdot。当然,这些只是我的观点。

在此处输入图片描述

相关内容