6

How can I make a list as shown in the picture?

enter image description here

I want to have a similar list of abbreviations/notions where everything is lined up as shown in the picture. I have tried to use the glossaries package, but that didn't give me the dots inbetween. I have also tried to use \begin{description}, but then I had to manually enter the dots.

Can someone help me with this?

0

2 Answers 2

7

This is possible either with the main glossary and using listdotted as glossary style or defining another special glossary for this.

Please note that listdotted ignores the value of the symbol key, however.

\documentclass{article}

\usepackage{glossaries}

\makeglossaries


\newglossaryentry{energy}{name={$E$}, description={Energy}}
\newglossaryentry{speedoflight}{name={$c$}, description={Speed of light}}
\newglossaryentry{mass}{name={$m$}, description={Mass}}

\begin{document}

\glsaddall

\setglossarystyle{listdotted}
\printglossary[title={Symbols}]


\end{document}

enter image description here

6
  • Hello Christian, somehow I'm getting an additional line: latex ................. Is a markup languag especially suited for scientific documents. Is there a bug in the glossary package? Aug 10, 2017 at 10:38
  • @AidanRocke: As you can see from my screen shot: There's no extra ...... line
    – user31729
    Aug 11, 2017 at 7:28
  • I managed to fix this problem actually but only by inserting the glossary entries into the page where I wanted the glossary to appear. Aug 11, 2017 at 9:05
  • @AidanRocke: I doubt that is the correct way to do so..
    – user31729
    Aug 13, 2017 at 16:16
  • When I tried your suggestion, everything was correct but I got an extra line with latex... Could the 'correct' solution depend on the latex editor? Aug 13, 2017 at 16:26
5

An example using the acro package (borrowing from Christian's answer):

\documentclass{article}

\usepackage{acro}

% use KOMA-Script's `labeling' list:
\usepackage{scrextend}
\newenvironment{mylist}
  {\labeling[ \dotfill]{alongwordthatdeterminesthewidth}}
  {\endlabeling}

% declare a list style for acro using the new list:
\DeclareAcroListStyle{dotted-list}{list}{
  list = mylist
}

% tell acro to use the new list style:
\acsetup{
  list-style = dotted-list
}

% declare the acronyms:
\DeclareAcronym{energy}{
  short = {$E$},
  long  = {energy}
}
\DeclareAcronym{speedoflight}{
  short = {$c$},
  long  = {speed of light}
}
\DeclareAcronym{mass}{
  short = {$m$},
  long  = {mass}
}

\begin{document}

\acuseall

\printacronyms[name=Notation]

\end{document}

enter image description here

Update 2021/acro v3:

With acro v3 and greater the following definition in the preamble will result in the same output:

% use KOMA-Script's `labeling' list:
\usepackage{scrextend}
\newenvironment{mylist}
  {\labeling[ \dotfill]{alongwordthatdeterminesthewidth}}
  {\endlabeling}

% make acro's default list use the new list:
\SetupAcroTemplate[list]{description}{%
  \let\description\mylist
  \let\enddescription\endmylist
}

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.