Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to duplicate the compact look of G. K. Batchelor's fluid dynamics book. Where a paragraph terminates such that the mathematical expression can collapse up into the vertical space of the paragraph, the expression moves up. If that makes no sense, see it on Google Books.

Can the align environment do this automatically? Or do I need to use another environment? I'm not aware of any way to do this automatically.

share|improve this question
2  
You might be after manipulating the value \abovedisplayshortskip. See abovedisplayskip vs abovedisplayshortskip. –  Werner Dec 10 '11 at 20:18
    
don't know of any environment that produces that compact spacing automatically. the amsmath align environment certainly doesn't, and if using left-hand equation numbers, it would be extremely difficult to implement. –  barbara beeton Dec 10 '11 at 20:18
add comment

2 Answers

up vote 12 down vote accepted

Here is a LaTeX approach at duplicating the typesetting in your link, as well as using @morbusg's \abovedisplayshortskip of -.5\baselineskip (plus some glue):

enter image description here

\documentclass{article}
\usepackage[margin=2.05in]{geometry}% http://ctan.org/pkg/geometry
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\newcommand{\pfrac}[2]{\frac{\partial #1}{\partial #2}}% Partial derivative
\begin{document}
\setlength{\abovedisplayshortskip}{-.5\baselineskip plus 3pt}% Original value: 0pt plus 3pt
\noindent \textit{Local variation of the velocity magnitude}

Some simple but useful results follow immediately from the expression 
for local vorticity in terms of rectuangular co-ordinates with axes parallel 
to the location directions of~$\mathbf{u}$, of the principal normal to the streamline 
(directed towards the centre of curvature), and of the binomial to the 
streamline. If $(s,n,b)$ represent co-ordinates in these three dimensions 
respectively, and $(u,v,w)$ are the corresponding velocity components, we 
have
\[
  v=w=0, \quad 
  u=q, \quad 
  \pfrac{v}{s}=\frac{q}{R}, \quad 
  \pfrac{w}{s}=0
\]
locally, where~$R$ is the local radius of curvature of the streamline. The 
components of the vorticity locally are then
\[
  \omega_s=\pfrac{w}{n}-\pfrac{v}{b}, \quad 
  \omega_n=\pfrac{u}{b}, \quad 
  \omega_b=\frac{u}{R}-\pfrac{u}{n}.
\]
\leavevmode\rlap{Moreover,}%\hfill
\centerline{$\displaystyle
  \left(\pfrac{}{s},\pfrac{}{n},\pfrac{}{b}\right)u=
  \left(\pfrac{}{s},\pfrac{}{n},\pfrac{}{b}\right)q$}
%\hfill\null\\
locally. Hence, in irrotational flow we have
\begin{align}
  \pfrac{q}{n}=\frac{q}{R}, \quad \pfrac{q}{b}=0. \tag{6.2.13}\label{irrotational_flow}
\end{align}

The first of the relations~\eqref{irrotational_flow} shows that, when the streamlines \ldots

\end{document}

geometry was used to reduce the margins and mimic the linked output.

The only difference in the output was from typesetting the line that has a centered alignment with respect to the text block, while still having text left-aligned ("Moreover," in this case). Some "trickery" (via \rlap) was used to obtain this, but that could also have been what the author did in their markup. As @egreg mentioned in comment, the use of \leavevmode is necessary if the paragraph was preceded by a blank line. As such, and for completeness (since it does no harm here...), I've added \leavevmode.


From a pedagogical point of view, the use of \abovedisplayshortskip is taken from the width of the (single) last line in the preceding paragraph. As such, it would take more than just modifying \abovedisplayshortskip to accommodate the display presented in your link for a general use-case when the previous paragraph consists of a single line, unless you're willing to do some compacting yourself using manual intervention (as I did in my example).

share|improve this answer
2  
The \rlap works because after a displayed equation TeX resumes horizontal mode. Were \rlap{Moreover,}\centerline{...} after a blank line it wouldn't have worked, as neither \rlap nor \centerline start horizontal mode. So \leavevmode\rlap would be more appropriate, for the general case. Nice answer, anyway. –  egreg Dec 10 '11 at 21:45
    
@egreg: Thanks; I see what you mean. I added that to my discussion. –  Werner Dec 10 '11 at 22:06
    
Actually \noindent there does nothing, and if the line is at the start of a paragraph it mustn't be used. So ... ;-) –  egreg Dec 10 '11 at 22:12
add comment

Here's an excerpt from the linked document with Werner's suggested \abovedisplayshortskip set to negative half of \baselineskip (in plain-tex):

\abovedisplayshortskip=-.5\baselineskip
\def\p#1#2{{\partial#1\over\partial#2}}
\noindent\dots represent co-ordinates in these three directions
respectively, and $(u, v, w)$ are the corresponding velocity components,
we have
$$ v=w=0,\quad u=q,\quad\p vs={q\over R},\quad\p ws=0 $$
locally, where $R$ is the local radius of curvature of the streamline.
The components of the vorticity locally are then
$$ \omega_s=\p wn-\p vb,\quad\omega_n=\p ub,\quad\omega_b={u\over R}-\p un. $$
Moreover,
$$ \left(\p{}s,\p{}n,\p{}b\right)u=\left(\p{}s,\p{}n,\p{}b\right)q $$
locally. Hence, in irrotational flow we have
$$ \p qn={q\over R},\quad\p qb=0. \eqno(\oldstyle 6.2.13) $$

The first of the relations \dots
\bye

It looks like:
negative abovedisplayshortskip

Note that I didn't touch abovedisplayskip, only the short variant.

share|improve this answer
    
That Plain Tex did not use \[..\] or \(..\) or \documentclass{..} and those things that LaTeX does. I can delete the comment, so it does not confuse anyone. –  night owl Dec 11 '11 at 8:45
    
@morbusg If you hover your mouse over your comment, you'll see a small "⨯" next to the time of posting. –  Torbjørn T. Dec 11 '11 at 9:17
    
@TorbjørnT. Thanks! –  morbusg Dec 11 '11 at 9:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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