2

I have an enumerated list where each list item has an itemized sublist which I want to be displayed in 3 columns. Based on other questions/answers I decided the best way was to use the multicol package.

This works fine if the sub-list is small, 3 or fewer items, but if the list is longer than the number of columns I specify in the multicols tag, the list comes out as a single item list.


\documentclass{article}
\usepackage{multicol}
\begin{document}
\begin{enumerate}
    \item Programming Languages:
        \begin{multicols}{3}
            \begin{itemize}
                \item awk
                \item bash
                \item C 
                \item C++
                \item java
                \item perl
                \item python
            \end{itemize}
        \end{multicols}
    \item Operating Systems:
        \begin{multicols}{3}
            \begin{itemize}
                \item Linux
                \item Windows
            \end{itemize}
        \end{multicols}
    \item Network Tools:
\end{enumerate}
\end{document}

enter image description here

I expect the output to look like this:


1. Programming Languages:
awk  bash  c
c++  java  perl
python
2. Operating Systems:
Linux  Windows
3. Network tools

With the columns aligned properly.

It may just be how my screenreader is reading the resulting pdf, but I see the list of languages in a single column and the operating systems beside each other.

  • I added a screen shot of the output of your code. – Dr. Manuel Kuehner Sep 7 '17 at 18:45
  • I do not understand your problem though ... what is wrong with the output? – Dr. Manuel Kuehner Sep 7 '17 at 18:50
  • how you imagine that result should be? – Zarko Sep 7 '17 at 18:50
  • @Zarko Same idea/question here ;) – Dr. Manuel Kuehner Sep 7 '17 at 18:51
  • Maybe it is my screenreader's problem, but I picture the result to look something like: – dnraikes Sep 7 '17 at 18:55
4

The itemize environment is working vertically, not horizontally. Either reorder the \item statements (tedious) or use a better method, say tasks package, defining a \NewTasks environment and giving it the style=itemize option

\documentclass{article}
\usepackage{enumitem}
\usepackage{tasks}

\NewTasks[style=itemize]{ComputerScience}

\setlist[enumerate,1]{wide=0pt}
\begin{document}

\begin{enumerate}
    \item Programming Languages:
      \begin{ComputerScience}(3)
      \task awk
      \task bash
      \task C 
      \task C++
      \task java
      \task perl
      \task python
    \end{ComputerScience}
    \item Operating Systems:
       \begin{ComputerScience}(2)
        \task Linux
        \task Windows
      \end{ComputerScience}
    \item Network Tools:
\end{enumerate}

\end{document}

For a more basic approach, just use tasks and label=\textbullet.

\documentclass{article}
\usepackage{tasks}
\begin{document}
\begin{enumerate}
    \item Programming Languages:
      \begin{tasks}[label=\textbullet](3)
      \task awk
                \task bash
                \task C 
                \task C++
                \task java
                \task perl
                \task python
         \end{tasks}
    \item Operating Systems:
        \begin{tasks}[label=\textbullet](2)
                \task Linux
                \task Windows
        \end{tasks}
    \item Network Tools:
\end{enumerate}
\end{document}

Both show

enter image description here

  • @dnraikes: Happy TeXing then! – user31729 Sep 7 '17 at 19:17
  • I would improve the layout loading enumitem and setting [wide=0pt] for enumerate. – Bernard Sep 7 '17 at 19:41
  • @Bernard: That's not a dramatic improvement in my point of view – user31729 Sep 7 '17 at 19:58
  • It doesn't make it the layout of the century, but it looks nicer for me, especially if there ordinary text around. – Bernard Sep 7 '17 at 20:03
  • @Bernard: Sigh... I've added your propositions, but I will change the screen shot only later on... – user31729 Sep 7 '17 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.