formattinglatextexmaker

Inconsistent list formatting in TexMaker


Any items in a list where the name of an item (in the brackets) has <=2 character, the description is put on the same line as the name. I'm looking for a way to make it so all of the descriptions are all indented on the next line, thanks.

\documentclass[11pt]{article}

%% Layout Alteration
%% --------------------------
\usepackage{
            enumitem,           % indented items for glossary
            framed,             % nice boxes; used in Supervisor's Approval
            geometry,           % change the margins for specific PAGES
            }
\setlist[description]{style=nextline}
\geometry{                      % specify page size options for (geometry)
            a4paper,            % paper size
            margin=1in,         % specified independently with hmargin vmargin
         }

% Hides the formatting for the glossary
\newenvironment{Glossary}
    {
        \begin{description}
    }
    {
        \end{description}
    }

\begin{document}

\begin{Glossary}
    \item[Uvic] University of Victoria
    \item[2-FSK] 2 tone Frequency Shift Keying
    \item[Core blocks] The pre installed modules and blocks in Gnuradio
    \item[CSA] Canadian Space Agency
    \item[CubeSat] A miniaturized space satellite for research
    \item[DSP] Digital Signal Processor
    \item[FM] Frequency Modulation
    \item[FPGA] Field-Programmable Gate Array
    \item[FSK] Frequency Shift Keying
    \item[GFSK] Gaussian Frequency Shift Keying
    \item[GNU Radio] A DSP and SDR creation software
    \item[GPIO] General Purpose Input/Output
    \item[GRC] GNU Radio Companion, GUI interface for GNU Radio
    \item[gr\_modtool] A script that simplifies the process of creating OOT Modules
    \item[GUI] Graphical User Interface
    \item[IO] Input/Output
    \item[OS] Operating System
    \item[OOT Module] Out-of-tree Module
    \item[PDU] Protocol Data Unit, A PMT that is a pair of a dictionary and a uniform vector type
    \item[PMT] Polymorphic Type, An opaque data type designed as generic containers of data that can be safely passed between blocks in Gnuradio
\end{Glossary}

\end{document}

"FM", "IO, and "OS" names all have their descriptions on the same line


Solution

  • There are a couple of options. For example: Format the item yourself with a new command. Then you can decide the spacing yourself.

    \newcommand{\myitem}[2]{
    \item[] \textbf{#1} \newline \hspace*{.5cm} #2}
    
    \begin{document}
    
    \begin{Glossary}
        \myitem{Uvic} University of Victoria
        \myitem{2-FSK} 2 tone Frequency Shift Keying
        \myitem{Core blocks} The pre installed modules and blocks in Gnuradio
        \myitem{CSA} Canadian Space Agency
        \myitem{CubeSat} A miniaturized space satellite for research
        \myitem{DSP} Digital Signal Processor
        \myitem{FM} Frequency Modulation
        \myitem{FPGA} Field-Programmable Gate Array
        \myitem{FSK} Frequency Shift Keying
        \myitem{GFSK} Gaussian Frequency Shift Keying
        \myitem{GNU Radio} A DSP and SDR creation software
        \myitem{GPIO} General Purpose Input/Output
        \myitem{GRC} GNU Radio Companion, GUI interface for GNU Radio
        \myitem{gr\_modtool} A script that simplifies the process of creating OOT Modules
        \myitem{GUI} Graphical User Interface
        \myitem{IO} Input/Output
        \myitem{OS} Operating System
        \myitem{OOT Module} Out-of-tree Module
        \myitem{PDU} Protocol Data Unit, A PMT that is a pair of a dictionary and a uniform vector type
        \myitem{PMT} Polymorphic Type, An opaque data type designed as generic containers of data that can be safely passed between blocks in Gnuradio
    \end{Glossary}
    
    

    Gives you this (excerpt): output

    An even simpler (but hacky) solution is to just insert invisible letters in the shorter items to match the longer ones and thereby force the same formatting:

        \item[GUI] Graphical User Interface
        \item[IO\phantom{XYZ}] Input/Output
        \item[OS\phantom{XYZ}] Operating System
    

    And better yet, organize your acronyms using a package that does the formatting and bookkeeping for you, e.g. acro.