4

I'm new to LaTeX so you're going to have to bear with me. I am trying to write a project report using it and I have got this so far for a certain section:

Then,

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

This is what it says at the top:

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

And I would like to get all three lines of equations in line- so the x and X equations- and the first and third lines have numbers assigned to them. All my other equations have \begin{equation}...\end{equation} around them and those ones have been given reference numbers- like the x equation but I wanted to have these two in line so I used the align formula instead of the equation one and then tried both together but it didn't work. (Also, the labelling isn't working but that's another issue!)

Any help would be greatly appreciated!

Ella
  • 65

2 Answers2

4

The mathtools package provides for \shortintertext; moreover one can use split in order to number together the second equation. A small adjustment is needed in this case (some small vertical space after the intertext).

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

Sorry, but I can't stand \tan^{-1} for the arctangent; also, parentheses should be round as much as possible. Also \sin(K) is redundant and \sin K is more than sufficient (and traditional); the period should never be used to denote multiplication: either nothing or a centered dot \cdot. Of course these are just my opinions.

enter image description here

egreg
  • 1,121,712
2

How about this?

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

The \intertext introduces a lot of space around the and line, unless you put that tweak in with the setlength commands, which I found out about here

I think this gives the alignment and numbering you were after?

FionaSmith
  • 1,867
  • @ella in case you didn't see, I just reduced the space around the intertext bit (I don't like it as big as the default, personally, though it probably looks way worse out of context). Right, back to the thesis... – FionaSmith May 08 '14 at 19:23