Breaking a list into multiple columns in Latex

后端 未结 5 911
遇见更好的自我
遇见更好的自我 2021-01-29 18:55

Hopefully this is simple: I have a relatively long list where each list item contains very little text. For example:

* a
* b
* c
* d
* e
* f

I wish to form

相关标签:
5条回答
  • 2021-01-29 19:05

    I've had multenum for "Multi-column enumerated lists" recommended to me, but I've never actually used it myself, yet.

    Edit: The syntax doesn't exactly look like you could easily copy+paste lists into the LaTeX code. So, it may not be the best solution for your use case!

    0 讨论(0)
  • 2021-01-29 19:13

    Using the multicol package and embedding your list in a multicols environment does what you want:

    \documentclass{article}
    \usepackage{multicol}
    
    \begin{document}
    \begin{multicols}{2}
    \begin{enumerate}
        \item a
        \item b
        \item c
        \item d
        \item e
        \item f
    \end{enumerate}
    \end{multicols}
    \end{document}
    
    0 讨论(0)
  • 2021-01-29 19:15

    Another option to avoid nesting two different environments (like multicols and enumerate).

    The environment called tasks from the package with the same name seems to me very easy to customize thanks to a variety of options (pdf guide here).

    This code:

    \documentclass{article}
    \usepackage{tasks}
    
    %\settasks{style=itemize}
    
    \begin{document}
    Text text text text text text text text text text text text 
    text text text text text text text text text text text text 
    text text text text text text text text text text text text.
    
    \begin{tasks}(2)
    \task[*] a
    \task[*] b
    \task[*] c
    \task[*] d
    \task[*] e
    \task[*] f
    \end{tasks}    
    
    Text text text text text text text text text text text text 
    text text text text text text text text text text text text 
    text text text text text text text text text text text text.
    \end{document}
    

    produces this output

    The package tasks was updated in August 2020 and it was originally created specifically for horizontally columned lists (see the screenshot just above here), the motivations behind this are resumed in the guide. If such arrangement of the items/tasks is acceptable, then this may be a good choice since it keeps - IMHO - the code tidy and flexible.

    0 讨论(0)
  • 2021-01-29 19:26

    I don't know if it would work, but maybe you could break the page into columns using the multicol package.

    \usepackage{multicol}
    
    \begin{document}
    \begin{multicols}{2}[Your list here]
    \end{multicols}
    
    0 讨论(0)
  • 2021-01-29 19:29

    By combining the multicol package and enumitem package packages it is easy to define environments that are multi-column analogues of the enumerate and itemize environments:

    \documentclass{article}
    \usepackage{enumitem}
    \usepackage{multicol}
    
    \newlist{multienum}{enumerate}{1}
    \setlist[multienum]{
        label=\alph*),
        before=\begin{multicols}{2},
        after=\end{multicols}
    }
    
    \newlist{multiitem}{itemize}{1}
    \setlist[multiitem]{
        label=\textbullet,
        before=\begin{multicols}{2},
        after=\end{multicols}
    }
    
    \begin{document}
    
      \textsf{Two column enumerate}
      \begin{multienum}
        \item item 1
        \item item 2
        \item item 3
        \item item 4
        \item item 5
        \item item 6
      \end{multienum}
    
      \textsf{Two column itemize}
      \begin{multiitem}
        \item item 1
        \item item 2
        \item item 3
        \item item 4
        \item item 5
        \item item 6
      \end{multiitem}
    
    \end{document}
    

    The output is what you would hope for:

    0 讨论(0)
提交回复
热议问题