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!

  • 1
    Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – user31729 May 8 '14 at 18:46
  • And: Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 May 8 '14 at 18:46
  • 1
    Your question about equation numbering may be answered by this question – darthbith May 8 '14 at 18:50
  • @Ella it would be better if you put that comment into the question. You can edit your question with the link just to the left of your name and above the comments – darthbith May 8 '14 at 18:51
  • @darthbith thanks, that's helped the numbering situation I think – Ella May 8 '14 at 18:59
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?

  • @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 8 '14 at 19:23
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.