LaTeX forum ⇒ Text FormattingExtra line between section heading and 2-column list Topic is solved

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
VivianU
Posts: 6
Joined: Tue Jul 28, 2020 6:28 pm

Extra line between section heading and 2-column list

Postby VivianU » Tue Jul 28, 2020 7:11 pm

Hi,

I hope this is the right part of the forum for posting this question. I did my resume in LaTeX, and it looks pretty good for the most part. My only problem is a section with a 2-column list. The white space between the heading and the list is bigger than the white space between all other headings and their text.

Here's a screenshot. You can see that the section below this one has a normal gap.

2col-big-gap.gif
2col-big-gap.gif (14.87 KiB) Viewed 164 times


Here's the code:

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \subsection*{Subjects}
  2. \begin{multicols}{2}
  3. \begin{asparaitem}[\textbullet]
  4. \item Arts and art history
  5. \item Biography
  6. \item Classics
  7. \item Computers
  8. \item Culture
  9. \item Cooking
  10. \item Deaf studies
  11. \item Environmental studies
  12. \item History
  13. \item Indigenous studies
  14. \item Literature
  15. \item Mathematics
  16. \item Medicine
  17. \item Nutrition
  18. \item Politics
  19. \item Psychology
  20. \item Science
  21. \item Self-help
  22. \end{asparaitem}
  23. \end{multicols}
  24.  
  25. \subsection*{Software}
  26. \textsc{Macrex}, Adobe InDesign, \LaTeX


It must have to do with the columns; when I comment out the "multicols" lines, the extra space disappears.

Is there any way around this? It's a small thing, but it bugs me a bit now that I've noticed it. Thanks.

Bartman
Posts: 96
Joined: Fri Jan 03, 2020 2:39 pm

Postby Bartman » Tue Jul 28, 2020 8:51 pm

Please post a Infominimal working example that shows the problem. If I expand the source code to a full example, I don't see the extra space shown in the picture.

VivianU
Posts: 6
Joined: Tue Jul 28, 2020 6:28 pm

Postby VivianU » Tue Jul 28, 2020 9:20 pm

Thanks for responding Bartman. Here you go.

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass[11pt,letterpaper,oneside]{article}
  2. \usepackage{multicol}
  3. \usepackage{paralist}
  4.  
  5. \begin{document}
  6.  
  7. \subsection*{Subjects}
  8. \begin{multicols}{2}
  9. \begin{asparaitem}[\textbullet]
  10. \item Arts and art history
  11. \item Biography
  12. \item Classics
  13. \item Computers
  14. \item Culture
  15. \item Cooking
  16. \item Deaf studies
  17. \item Environmental studies
  18. \item History
  19. \item Indigenous studies
  20. \item Literature
  21. \item Mathematics
  22. \item Medicine
  23. \item Nutrition
  24. \item Politics
  25. \item Psychology
  26. \item Science
  27. \item Self-help
  28. \end{asparaitem}
  29. \end{multicols}
  30.  
  31. \subsection*{Software}
  32. \textsc{Macrex}, Adobe InDesign, \LaTeX
  33.  
  34. \end{document}

Bartman
Posts: 96
Joined: Fri Jan 03, 2020 2:39 pm

Postby Bartman » Tue Jul 28, 2020 11:10 pm

If I understand the asparaitem environment correctly, you don't need the \textbullet command as an optional argument.

Your headings are set in small caps in your picture. This change of the default setting of the class probably takes place somewhere in the preamble. Maybe the reason for the extra space can be found there.

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

Postby Stefan Kottwitz » Wed Jul 29, 2020 3:59 pm

Hi Vivian!

multicol adds some extra spacing for separation. You can set it to zero, in your preamble:

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \setlength\multicolsep{0pt}


Stefan
LaTeX.org admin

User avatar
Ijon Tichy
Posts: 296
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Wed Jul 29, 2020 5:22 pm

Stefan Kottwitz wrote:multicol adds some extra spacing for separation. You can set it to zero, in your preamble:

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \setlength\multicolsep{0pt}

And I would also recommend to set the heading via the optional argument of the multicols environment, because otherwise in some circumstances there could be a page break between the heading and the list. And it may also be useful to use the second optional argument to force at least two or three items to the same page as the heading:
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass[11pt]{article}% letterpaper and oneside are defaults of article
  2. \usepackage{multicol}
  3. \usepackage{paralist}
  4.  
  5. \setlength{\multicolsep}{0pt}% No extra space before and after multicols
  6.  
  7. \begin{document}
  8.  
  9. \begin{multicols}{2}[\subsection*{Subjects}]
  10. % or: \begin{multicols}{2}[\subsection*{Subjects}][3\normalbaselineskip]
  11. \begin{asparaitem}[\textbullet]
  12. \item Arts and art history
  13. \item Biography
  14. \item Classics
  15. \item Computers
  16. \item Culture
  17. \item Cooking
  18. \item Deaf studies
  19. \item Environmental studies
  20. \item History
  21. \item Indigenous studies
  22. \item Literature
  23. \item Mathematics
  24. \item Medicine
  25. \item Nutrition
  26. \item Politics
  27. \item Psychology
  28. \item Science
  29. \item Self-help
  30. \end{asparaitem}
  31. \end{multicols}
  32.  
  33. \subsection*{Software}
  34. \textsc{Macrex}, Adobe InDesign, \LaTeX
  35.  
  36. \end{document}


See the first column of page 3 of the multicol manual for more information.

VivianU
Posts: 6
Joined: Tue Jul 28, 2020 6:28 pm

Postby VivianU » Wed Jul 29, 2020 6:32 pm

Thanks Stefan, the \setlength command worked nicely.

Thanks for the suggestion, Ijon, I didn't know you could do that!

You're right, Bartman; I tried taking out \textbullet and there was no change. Good to know.


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 3 guests