LaTeX forum ⇒ Math & ScienceHow to change the local vertical spacing in the align environment?

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

How to change the local vertical spacing in the align environment?

Postby Cham » Tue Dec 10, 2019 4:49 pm

I'm still having a lot of troubles in my vertical alignments. Here's a MWE showing the trouble:

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass[11pt,letterpaper,twoside]{book}
  2. \usepackage[T1]{fontenc}
  3. \usepackage[utf8]{inputenc}
  4. \usepackage[french]{babel}
  5. \usepackage{lmodern}
  6. \usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}
  7. \usepackage[nodisplayskipstretch]{setspace}
  8. \setstretch{1.1}
  9. \raggedbottom
  10. \usepackage{microtype}
  11. \usepackage{amsmath}
  12. \usepackage{amsfonts}
  13. \usepackage{mathtools}
  14.  
  15. \begin{document}
  16.  
  17. %\setlength{\abovedisplayskip}{1em}
  18. \setlength{\abovedisplayshortskip}{0pt}
  19. \setlength{\belowdisplayskip}{\abovedisplayskip}
  20. \setlength{\belowdisplayshortskip}{\belowdisplayskip}
  21. \setlength{\jot}{3ex}
  22.  
  23. Blablabla :
  24. \begin{equation}
  25. \begin{aligned}
  26. x(u, v) &= \cosh{u} \, \cos{v}, \\
  27. y(u, v) &= \cosh{u} \, \sin{v}, \\
  28. z(u, v) &= \sinh{u}.
  29. \end{aligned}
  30. \end{equation}
  31. Blabla bla bla :
  32. \begin{align*}
  33. dx &= \sinh{u} \, \cos{v} \: du - \cosh{u} \, \sin{v} \: dv, \\
  34. dy &= \sinh{u} \, \sin{v} \: du + \cosh{u} \, \cos{v} \: dv, \\
  35. dz &= \cosh{u} \: du.
  36. \end{align*}
  37. Bla bla.
  38.  
  39. \end{document}


Preview:
align.jpg
align.jpg (26.75 KiB) Viewed 1075 times


There are two problems with this code. I don't want to change the global lengths defined in the preamble, since most equations are nicely displayed in my main document. But then the vertical space is too large between the equations in both environments shown above. How can I reduce it locally? Is \\[-11pt] or \\[-1em] the only options here? I feel nervous with adding a negative spacing, it's not "natural".

Secondly, the vertical spacing between the second text line and the second align environment is clearly too large (short skip not working there?). Why is that?

User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Postby Cham » Tue Dec 10, 2019 7:31 pm

Apparently, using \begingroup\setlength{\jot}{2ex} ... \endgroup solves my issue, for the few cases where I need to change the vertical spacing in some align environments.

Is this a proper solution? Or is it better to use a negative spacing for each \\ ?


Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 3 guests