幫助對齊方程式和編號

幫助對齊方程式和編號

我是新手,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。當然這些只是我的意見。

在此輸入影像描述

相關內容