Fedora - LaTeX Typesetting – Part 1 (Lists) - Printable Version +- Sick Gaming (https://www.sickgaming.net) +-- Forum: Computers (https://www.sickgaming.net/forum-86.html) +--- Forum: Linux, FreeBSD, and Unix types (https://www.sickgaming.net/forum-88.html) +--- Thread: Fedora - LaTeX Typesetting – Part 1 (Lists) (/thread-95713.html) |
Fedora - LaTeX Typesetting – Part 1 (Lists) - xSicKxBot - 06-16-2020 LaTeX Typesetting – Part 1 (Lists) <div style="margin: 5px 5% 10px 5%;"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/06/latex-typesetting-part-1-lists.png" width="519" height="210" title="" alt="" /></div><div><p>This series builds on the previous articles: <a rel="noreferrer noopener" href="https://fedoramagazine.org/typeset-latex-texstudio-fedora" target="_blank">Typeset your docs with LaTex and TeXstudio on Fedora</a> and <a rel="noreferrer noopener" href="https://fedoramagazine.org/fedora-classroom-latex-101-beginners" target="_blank">LaTeX 101 for beginners</a>. This first part of the series is about LaTeX lists.</p> <p> <span id="more-31158"></span> </p> <h2>Types of lists</h2> <p>LaTeX lists are enclosed environments, and each item in the list can take a line of text to a full paragraph. There are three types of lists available in LaTeX. They are:</p> <ul> <li><strong>Itemized</strong>: unordered or bullet</li> <li><strong>Enumerated</strong>: ordered</li> <li><strong>Description</strong>: descriptive</li> </ul> <h2>Creating lists</h2> <p>To create a list, prefix each list item with the \<em>item</em> command. Precede and follow the list of items with the \<em>begin</em>{<type>} and \<em>end</em>{<type>} commands respectively where <type> is substituted with the type of the list as illustrated in the following examples.</p> <h3>Itemized list</h3> <div class="wp-block-jetpack-markdown"> <pre>\begin{itemize} \item Fedora \item Fedora Spin \item Fedora Silverblue \end{itemize} </pre> </div> <figure class="wp-block-image size-large"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/06/latex-typesetting-part-1-lists.png" alt="" class="wp-image-31169" /></figure> <h3>Enumerated list</h3> <div class="wp-block-jetpack-markdown"> <pre>\begin{enumerate} \item Fedora CoreOS \item Fedora Silverblue \item Fedora Spin \end{enumerate} </pre> </div> <figure class="wp-block-image size-large"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/06/latex-typesetting-part-1-lists-1.png" alt="" class="wp-image-31170" /></figure> <h3>Descriptive list</h3> <div class="wp-block-jetpack-markdown"> <pre>\begin{description} \item[Fedora 6] Code name Zod \item[Fedora 8] Code name Werewolf \end{description} </pre> </div> <figure class="wp-block-image size-large"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/06/latex-typesetting-part-1-lists-2.png" alt="" class="wp-image-31171" /></figure> <h2>Spacing list items</h2> <p>The default spacing can be customized by adding \<em>usepackage{enumitem}</em> to the preamble. The <em>enumitem</em> package enables the <em>noitemsep</em> option and the \<em>itemsep</em> command which you can use on your lists as illustrated below.</p> <h3>Using the noitemsep option</h3> <p>Enclose the <em>noitemsep</em> option in square brackets and place it on the \<em>begin</em> command as shown below. This option removes the default spacing.</p> <div class="wp-block-jetpack-markdown"> <pre>\begin{itemize}[noitemsep] \item Fedora \item Fedora Spin \item Fedora Silverblue \end{itemize} </pre> </div> <figure class="wp-block-image size-large"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/06/latex-typesetting-part-1-lists-3.png" alt="" class="wp-image-31172" /></figure> <h3>Using the \itemsep command</h3> <p>The \<em>itemsep</em> command must be suffixed with a number to indicate how much space there should be between the list items.</p> <div class="wp-block-jetpack-markdown"> <pre>\begin{itemize} \itemsep0.75pt \item Fedora Silverblue \item Fedora CoreOS \end{itemize} </pre> </div> <figure class="wp-block-image size-large"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/06/latex-typesetting-part-1-lists-4.png" alt="" class="wp-image-31173" /></figure> <h2>Nesting lists</h2> <p>LaTeX supports nested lists up to four levels deep as illustrated below.</p> <h3>Nested itemized lists</h3> <div class="wp-block-jetpack-markdown"> <pre>\begin{itemize}[noitemsep] \item Fedora Versions \begin{itemize} \item Fedora 8 \item Fedora 9 \begin{itemize} \item Werewolf \item Sulphur \begin{itemize} \item 2007-05-31 \item 2008-05-13 \end{itemize} \end{itemize} \end{itemize} \item Fedora Spin \item Fedora Silverblue \end{itemize} </pre> </div> <figure class="wp-block-image size-large"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/06/latex-typesetting-part-1-lists-5.png" alt="" class="wp-image-31175" /></figure> <h3>Nested enumerated lists</h3> <div class="wp-block-jetpack-markdown"> <pre>\begin{enumerate}[noitemsep] \item Fedora Versions \begin{enumerate} \item Fedora 8 \item Fedora 9 \begin{enumerate} \item Werewolf \item Sulphur \begin{enumerate} \item 2007-05-31 \item 2008-05-13 \end{enumerate} \end{enumerate} \end{enumerate} \item Fedora Spin \item Fedora Silverblue \end{enumerate} </pre> </div> <figure class="wp-block-image size-large"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/06/latex-typesetting-part-1-lists-6.png" alt="" class="wp-image-31177" /></figure> <h2>List style names for each list type</h2> <figure class="wp-block-table is-style-stripes"> <table> <tbody> <tr> <td class="has-text-align-left" data-align="left"><strong><span style="text-decoration: underline">Enumerated</span></strong></td> <td><strong><span style="text-decoration: underline">Itemized</span></strong></td> </tr> <tr> <td class="has-text-align-left" data-align="left">\alph*</td> <td>$\bullet$</td> </tr> <tr> <td class="has-text-align-left" data-align="left">\Alph*</td> <td>$\cdot$</td> </tr> <tr> <td class="has-text-align-left" data-align="left">\arabic*</td> <td>$\diamond$</td> </tr> <tr> <td class="has-text-align-left" data-align="left">\roman*</td> <td>$\ast$</td> </tr> <tr> <td class="has-text-align-left" data-align="left">\Roman*</td> <td>$\circ$</td> </tr> <tr> <td class="has-text-align-left" data-align="left"></td> <td>$-$</td> </tr> </tbody> </table> </figure> <h2 class="has-text-align-left">Default style by list depth</h2> <figure class="wp-block-table is-style-stripes"> <table> <tbody> <tr> <td><strong><span style="text-decoration: underline">Level</span></strong></td> <td class="has-text-align-center" data-align="center"><strong><span style="text-decoration: underline">Enumerated</span></strong> </td> <td class="has-text-align-center" data-align="center"> <strong><span style="text-decoration: underline">Itemized</span></strong> </td> </tr> <tr> <td>1</td> <td class="has-text-align-center" data-align="center">Number</td> <td class="has-text-align-center" data-align="center">Bullet</td> </tr> <tr> <td>2</td> <td class="has-text-align-center" data-align="center">Lowercase alphabet</td> <td class="has-text-align-center" data-align="center">Dash</td> </tr> <tr> <td>3</td> <td class="has-text-align-center" data-align="center">Roman numerals</td> <td class="has-text-align-center" data-align="center">Asterisk</td> </tr> <tr> <td>4</td> <td class="has-text-align-center" data-align="center">Uppercase alphabet</td> <td class="has-text-align-center" data-align="center">Period</td> </tr> </tbody> </table> </figure> <h2>Setting list styles</h2> <p>The below example illustrates each of the different itemiszed list styles.</p> <div class="wp-block-jetpack-markdown"> <pre>% Itemize style \begin{itemize} \item[$\ast$] Asterisk \item[$\diamond$] Diamond \item[$\circ$] Circle \item[$\cdot$] Period \item[$\bullet$] Bullet (default) \item[--] Dash \item[$-$] Another dash \end{itemize} </pre> </div> <figure class="wp-block-image size-large"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/06/latex-typesetting-part-1-lists-7.png" alt="" class="wp-image-31180" /></figure> <p>There are three methods of setting list styles. They are illustrated below. These methods are listed by priority; highest priority first. A higher priority will override a lower priority if more than one is defined for a list item.</p> <h3>List styling method 1 – per item</h3> <p>Enclose the name of the desired style in square brackets and place it on the \<em>item</em> command as demonstrated below.</p> <div class="wp-block-jetpack-markdown"> <pre>% First method \begin{itemize} \item[$\ast$] Asterisk \item[$\diamond$] Diamond \item[$\circ$] Circle \item[$\cdot$] period \item[$\bullet$] Bullet (default) \item[--] Dash \item[$-$] Another dash \end{itemize} </pre> </div> <h3>List styling method 2 – on the list</h3> <p>Prefix the name of the desired style with <em>label=</em>. Place the parameter, including the <em>label=</em> prefix, in square brackets on the \<em>begin</em> command as demonstrated below.</p> <div class="wp-block-jetpack-markdown"> <pre>% Second method \begin{enumerate}[label=\Alph*.] \item Fedora 32 \item Fedora 31 \item Fedora 30 \end{enumerate} </pre> </div> <h3>List styling method 3 – on the document</h3> <p>This method changes the default style for the entire document. Use the \<em>renewcommand</em> to set the values for the labelitems. There is a different labelitem for each of the four label depths as demonstrated below.</p> <div class="wp-block-jetpack-markdown"> <pre>% Third method \renewcommand{\labelitemi}{$\ast$} \renewcommand{\labelitemii}{$\diamond$} \renewcommand{\labelitemiii}{$\bullet$} \renewcommand{\labelitemiv}{$-$} </pre> </div> <h2>Summary</h2> <p>LaTeX supports three types of lists. The style and spacing of each of the list types can be customized. More LaTeX elements will be explained in future posts.</p> <p>Additional reading about LaTeX lists can be found here: <a href="https://en.wikibooks.org/wiki/LaTeX/List_Structures" target="_blank" rel="noreferrer noopener">LaTeX List Structures</a></p></p> </div> https://www.sickgaming.net/blog/2020/06/15/latex-typesetting-part-1-lists/ |