Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I utilize the glossariespackage with acronym option as well as an self-defined symbols list. Unfortunately, each glossary aligns different horizontally. Is it possible to make them aligned? Otherwise, it looks distracting to me.

vertical glossaries alignment

Code:

  \documentclass[8pt]{scrartcl}

  % LuaLaTeX
  \usepackage{luatextra}

  \usepackage[xindy,style=long,numberline,savewrites=true,acronym,nomain]{glossaries}
  % new group for symbols
  \newglossary[slg]{symbolslist}{syi}{syg}{Symbols}
  \makeglossaries

  % SYMBOLS:
  \newglossaryentry{sy:te}{name=$\text{T}_\text{E}$, description={echo time}, sort=sy-echotime, type=symbolslist}
  \newglossaryentry{sy:tr}{name=$\text{T}_\text{R}$, description={repetition time}, sort=sy-repetitiontime, type=symbolslist}
  % ACRONYMS:
  \newacronym{adc}{ADC}{anlog-to-digital converter}
  \newacronym{peg}{PEG}{polyethylene glycol}

  \begin{document}
  \printglossaries
  Text Text  Text Text Text Text Text Text
   Text Text Text Text Text Text Text Text.
  .... \gls{peg} .... \gls{adc}
  .... \gls{sy:tr} .... \gls{sy:te}

  \end{document}
share|improve this question
add comment

2 Answers

I suggest you use the alttree style instead of long and set the width of the name field using \glssetwidest:

\usepackage[xindy,style=alttree,numberline,savewrites=true,acronym,nomain]{glossaries}
\glssetwidest{ADC}% widest name
\renewcommand*{\glsnamefont}[1]{\textmd{#1}}
share|improve this answer
    
Mh it sure is a an alternative. Is it possible to avoid setting the abbrevation bold? Some math symbols do not get bold rendering it inconsistent. What still bothers me as well is that long entries (page references exceeding a line) start at the beginning of the next line and not at the explanation indentation (as in long). Gonna keep the question open for a little bit longer. –  bioslime Feb 7 '13 at 11:22
    
@bioslime Just redefine \glsnamefont to cancel the bold. I've added the code to my answer. –  Nicola Talbot Feb 7 '13 at 11:28
add comment
up vote 0 down vote accepted

Okay, as i was eager to keep style=long i came up with something. As Nicola posted you can set \glssetwidestfor the alttree style. Unfortunately, i can't find something similiar for the first entry within long. Therefore, i simply put a dummy entry (blank line) to my symbols list (sorted to be at the end of the list):

  % blanc entry used for spacing
  \newglossaryentry{sy:space}{name=\makebox[\widthof{ADC-long}][l]{}, description={}, sort=sy-zz, type=symbolslist,nonumberlist}
  \glsadd{sy:space}

Not the nicest solution but it works: horziontal alignment glossaries

Full Code:

  \documentclass[8pt]{scrartcl}

  % LuaLaTeX
  \usepackage{luatextra}
  \usepackage{calc}
  \usepackage[xindy,style=long,numberline,savewrites=true,acronym,nomain]{glossaries}
  % new group for symbols
  \renewcommand{\glsgroupskip}{}
  \newglossary[slg]{symbolslist}{syi}{syg}{Symbols}
  \renewcommand{\glsgroupskip}{}
  % remove dot after each description
  \renewcommand*{\glspostdescription}{}
  \makeglossaries

  % SYMBOLS:
  \newglossaryentry{sy:te}{name=$\text{T}_\text{E}$, description={echo time}, sort=sy-echotime, type=symbolslist}
  \newglossaryentry{sy:tr}{name=$\text{T}_\text{R}$, description={repetition time}, sort=sy-repetitiontime, type=symbolslist}
  \newglossaryentry{sy:ga}{name=\gamma, description={gamma}, sort=sy-gamma, type=symbolslist}
  % blanc entry used for spacing
  \newglossaryentry{sy:space}{name=\makebox[\widthof{ADC-long}][l]{}, description={}, sort=sy-zz, type=symbolslist,nonumberlist}
  \glsadd{sy:space}

  % ACRONYMS:
  \newacronym{adc}{ADC-long}{anlog-to-digital converter}
  \newacronym{peg}{PEG}{polyethylene glycol}

  %\renewcommand*{\glsnamefont}[1]{\textmd{#1}}
  %\renewcommand{\glsnamefont}[1]{#1}
  \glssetwidest{ADC}

  %\setlength{\glsdescwidth}{0.3\linewidth}
  \begin{document}
  \printglossaries
  \vspace{1cm}
  Text Text  Text Text Text Text Text Text
   Text Text Text Text Text Text Text Text.
  .... \gls{peg} .... \gls{adc}
  .... \gls{sy:tr} .... \gls{sy:te} .... \gls{sy:ga}.

  \end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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