LaTeX forum ⇒ Math & ScienceSmall vertical spacing glitch in footnote Topic is solved

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

Small vertical spacing glitch in footnote

Postby Cham » Sat Aug 24, 2019 9:05 pm

I'm having an extra vertical space under an align environment that I need to remove. Here's a MWE to show the problem:
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass[12pt,letterpaper,twoside]{book}
  2. \usepackage[T1]{fontenc}
  3. \usepackage{lmodern}
  4. \usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot,showframe]{geometry}
  5. \usepackage{setspace}
  6. \setstretch{1.1}
  7. \raggedbottom
  8. \usepackage{microtype}
  9. \usepackage[bottom]{footmisc} % Options : [ perpage ], [ symbol ], [ multiple ]
  10. \usepackage{amsmath}
  11. \usepackage{amsfonts}
  12. \usepackage{amssymb}
  13. \usepackage{mathtools}
  14.  
  15. \begin{document}
  16.  
  17. Blablabla\footnote{Blablabla :
  18. \begin{align*}
  19. x &= \frac{A}{B},
  20. & y &= \frac{C}{D}.
  21. \end{align*}
  22. }
  23.  
  24. \end{document}


Here's a preview with the spacing problem shown in red:
extraspace.jpg
extraspace.jpg (15.38 KiB) Viewed 215 times


How can I remove the extra space just under these aligned equations, in that footnote?

Adding the command \vspace{-12pt} just under the align environment is a solution, but it feels like an ugly hack to me. Is there a better solution?

User avatar
Stefan Kottwitz
Site Admin
Posts: 9444
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sat Aug 24, 2019 9:32 pm

Hi Cham,

an align environment is not perfect in a footnote, since it comes with space before and after. You could set it to zero within the footnote:

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. Blablabla\footnote{\setlength{\belowdisplayskip}{0pt}Blablabla :
  2. \begin{align*}
  3. x &= \frac{A}{B},
  4. & y &= \frac{C}{D}.
  5. \end{align*}%
  6. }


Stefan
Site admin

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

Postby Cham » Sat Aug 24, 2019 10:15 pm

Thanks Stefan,

it's working. But I also get the same problem with an equation environment (unless I used your trick). That's occuring with a more complicated preamble settup. The MWE below doesn't show it:
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass[12pt,letterpaper,twoside]{book}
  2. \usepackage[T1]{fontenc}
  3. \usepackage{lmodern}
  4. \usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot,showframe]{geometry}
  5. \usepackage{setspace}
  6. \setstretch{1.1}
  7. \raggedbottom
  8. \usepackage{microtype}
  9. \usepackage[bottom]{footmisc} % Options : [ perpage ], [ symbol ], [ multiple ]
  10. \usepackage{amsmath}
  11. \usepackage{amsfonts}
  12. \usepackage{amssymb}
  13. \usepackage{mathtools}
  14.  
  15. \begin{document}
  16.  
  17. Blablabla\footnote{Blablabla :
  18. \begin{equation*}
  19. x = \frac{A}{B},
  20. \qquad\qquad
  21. y = \frac{C}{D}.
  22. \end{equation*}
  23. }
  24.  
  25. \end{document}

User avatar
Stefan Kottwitz
Site Admin
Posts: 9444
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sat Aug 24, 2019 10:32 pm

Yes, also equation is for "displayed" math, centered with space before and after.

Aligned math without additional space can be done using an aligned environment, such as

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. Blablabla\footnote{Blablabla :
  2.  
  3. \centering
  4. $\begin{aligned}
  5. x &= \frac{A}{B},
  6. & y &= \frac{C}{D}.
  7. \end{aligned}$
  8. }


Such an aligned block can be arranged in footnotes, text, or even in tables.

Stefan
Site admin

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

Postby Cham » Sat Aug 24, 2019 10:38 pm

Thanks again, Stefan. I prefer your first solution. I believe my case is solved now :) .


Return to “Math & Science”

Who is online

Users browsing this forum: MSN [Bot] and 5 guests