LaTeX forum ⇒ Math & ScienceHow to adjust the vertical spacements in two columns lists? Topic is solved

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

How to adjust the vertical spacements in two columns lists?

Postby Cham » Wed Aug 08, 2018 7:12 pm

I would like to adjust the vertical spacements in the lists made with the MWE below. I want all vertical spacings to be constant (fixed). Currently, I'm hacking the vertical spacements using the \displaystyle and \vphantom commands.
  1. \documentclass[11pt,twoside]{book}
  2. \usepackage{microtype,textcomp}
  3. \usepackage[total={6.25in,10in},left=1.25in,top=0.5in,includehead,includefoot]{geometry}
  4. \usepackage{amsmath}
  5. \usepackage{enumitem}
  6. \usepackage{multicol}
  7.  
  8. \begin{document}
  9.  
  10. \begin{enumerate}
  11. \item Some questions :
  12. \begin{multicols}{2}
  13. \begin{enumerate}[label=\alph*)]
  14. \item $\displaystyle{\vphantom{\frac{1}{2}} x + 2 = 0}$.
  15. \medskip
  16. \item $\displaystyle{\vphantom{\frac{1}{2}} x + 2 = 5}$.
  17. \medskip
  18. \item $\displaystyle{\vphantom{\frac{1}{2}} 2 x + 2 = 0}$.
  19. \medskip
  20. \item $\displaystyle{\vphantom{\frac{1}{2}} 2 x = 4 x + 1}$.
  21. \medskip
  22. \item $\displaystyle{\vphantom{\frac{1}{2}} 4 x - 2 (x - 2) = 10}$.
  23. \medskip
  24. \item $\displaystyle{\vphantom{\frac{1}{2}} 5 x + 3 (2 x + 4) = 4 x - 9}$.
  25. \medskip
  26. \item $\displaystyle{\frac{5 x}{2} = 0}$.
  27. \medskip
  28. \item $\displaystyle{\frac{1}{2 x} = 5}$.
  29. \medskip
  30. \item $\displaystyle{\frac{1}{2 x - 1} = 5}$.
  31. \medskip
  32. \item $\displaystyle{\frac{1}{2 x - 5} + \frac{1}{5} = 0}$.
  33. \end{enumerate}
  34. \end{multicols}
  35.  
  36. \item Some questions :
  37. \begin{multicols}{2}
  38. \begin{enumerate}[label=\alph*)]
  39. \item $\displaystyle{\frac{2}{3} + \frac{5}{9}}$.
  40. \medskip
  41. \item $\displaystyle{\frac{11}{15} + \frac{6}{20}}$.
  42. \medskip
  43. \item $\displaystyle{\frac{9}{4} + 2}$.
  44. \medskip
  45. \item $\displaystyle{\frac{5}{6} - \frac{2}{3}}$.
  46. \end{enumerate}
  47. \end{multicols}
  48.  
  49. \item Some questions :
  50. \begin{multicols}{2}
  51. \begin{enumerate}[label=\alph*)]
  52. \item $\displaystyle{\vphantom{\frac{1}{2}} x \cdot x}$.
  53. \medskip
  54. \item $\displaystyle{\vphantom{\frac{1}{2}} 2 x \cdot 3 x^2}$.
  55. \medskip
  56. \item $\displaystyle{\frac{\displaystyle{4 x^2 \cdot 3 x y^2}}{\displaystyle{2 y^5}}}$.
  57. \medskip
  58. \item $\displaystyle{\frac{\displaystyle{8 x (x^2 + 4 x y)}}{\displaystyle{4 x^2}}}$.
  59. \end{enumerate}
  60. \end{multicols}
  61. \end{enumerate}
  62.  
  63. \end{document}


Here's a preview of what this code is doing :
list.jpg
list.jpg (27.47 KiB) Viewed 174 times


As you can see on that preview, the spacing between each item isn't exactly constant. How to fix the spacements between each item in a given list?

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

Postby Cham » Wed Aug 08, 2018 9:10 pm

Hmmm, apparently, the simplest solution is to add the option itemsep=12pt to the itemize list, and remove all the \medskip from the list.

Is this the simplest and the best solution?

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

Postby Stefan Kottwitz » Wed Aug 08, 2018 11:35 pm

multicols environment are meant to be balanced, so they will be stretched. \raggedcolumns prevents this. But that's probably not perfect too. I guess I would use a table with two columns, the items in cells, to get this into a grid.

Stefan
Site admin

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

Postby Cham » Thu Aug 09, 2018 1:55 am

Well, apparently my issue is solved by the itemsep option. Try this MWE code:

  1. \documentclass[11pt,twoside]{book}
  2. \usepackage{microtype,textcomp}
  3. \usepackage[total={6.25in,10in},left=1.25in,top=0.5in,includehead,includefoot]{geometry}
  4. \usepackage{amsmath}
  5. \usepackage{enumitem}
  6. \usepackage{multicol}
  7.  
  8. \begin{document}
  9.  
  10. \begin{multicols}{2}
  11. \begin{enumerate}[label=\alph*),itemsep=11pt]
  12. \item $\displaystyle{\vphantom{\frac{1}{2}} A}$.
  13. \item $\displaystyle{\vphantom{\frac{1}{2}} B}$.
  14. \item $\displaystyle{\vphantom{\frac{1}{2}} C}$.
  15. \item $\displaystyle{\vphantom{\frac{1}{2}} D}$.
  16. \item $\displaystyle{\vphantom{\frac{1}{2}} E}$.
  17. \end{enumerate}
  18. \end{multicols}
  19.  
  20. \end{document}

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

Postby Stefan Kottwitz » Thu Aug 09, 2018 9:06 am

There are still the \vphantom commands in the code.

Stefan
Site admin

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

Postby Cham » Thu Aug 09, 2018 2:44 pm

Right. Removing the \vphantom commands reduces a bit the vertical spacing (set to 11 points), but it's still all uniform (no stretching). I think the issue is solved now, but I'll see this later, after my code as evolved.


Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 8 guests