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'm having a problem similar to this: Two-column longtable or tabular. I want the same result -- that is a two column glossary (ie a total of 4 columns) where a list of abbreviations and their descriptions wraps into a new, second column on the same page before continuing overleaf. However, I'm using the glossaries package. I've scanned the (very long) documentation and the only references to columns I can find is in the sense of adding more information (i.e. symbols) to a single glossary column. Does anyone know if there's a way to do what I'm asking?

By the by: I cannot for the life of me figure out how to make the page header for the glossary read in all-caps (like every other page header). Redefining the \glossarymark command as anything leaves me with a "CONTENTS" page header, flowing over from the ToC which is immediately before my glossary.

Edit: Not sure how much multiple questions are appreciated, but since these are all style related I have one more -- is there a style for the glossary that is similar/identical to the TOC? All the styles that come with the package appear to suck... the closest to what I want (extremely simple) is the long style, but for some reason it is indented like 1.5 in and looks hideous.

share|improve this question
1  
Could you please provide a minimal working example, that is, at least your preamble and some blind text with a glossary example? That way I could copy and paste the code, and start improving on it ;) –  Tom Bombadil Oct 7 '11 at 10:19
1  
glossaries has many different styles that support longtable, supertabular and two column lists. you can even write your own style. Have another look in chapter 3 of the manual or provide an example –  Martin H Oct 7 '11 at 11:14
1  
The glossary-mcols package supplies some styles that use multicols. This package comes with glossaries but isn't automatically loaded. –  Nicola Talbot Mar 27 '13 at 10:37
add comment

6 Answers

With regard to your first question (how to achieve a two-column glossary): Here's a solution using the labeling list environment provided by KOMA-Script's scrextend package. Note that you have to provide the longest label ("electrolyte" in my example) as argument to \begin{labeling}. It is also necessary to hack some glossaries internals to prevent \printglossaries from typesetting a heading automatically -- instead, a heading is added manually in the optional argument of \begin{multicols}.

\documentclass{article}

\usepackage{scrextend}% provides the "labeling" environment

\usepackage{glossaries}
\makeglossaries

\newglossarystyle{labeling}{%
  \renewcommand{\theglossary}{\begin{labeling}{electrolyte\quad}}%
  \renewcommand{\endtheglossary}{\end{labeling}}%
}
\glossarystyle{labeling}

\newglossaryentry{electrolyte}{name=electrolyte,%
    description={solution able to conduct electric current}}
\newglossaryentry{tex.sx}{name=tex.sx,%
    description={a website for enthusiastic users of \TeX, \LaTeX\ and related systems}}

\usepackage{multicol}
\setlength{\columnsep}{25pt}

% Don't typeset a glossary heading automatically
\makeatletter
\renewcommand*{\@glossarysection}[2]{%
\ifx\@@glossarysecstar\@empty
%  \csname\@@glossarysec\endcsname{#2}% DELETED
\else
%  \csname\@@glossarysec\endcsname*{#2}% DELETED
  \@gls@toc{#1}{\@@glossarysec}%
\fi
\@@glossaryseclabel}
\makeatother

\begin{document}

Some text about \gls{electrolyte} and \gls{tex.sx}.

\begin{multicols}{2}[\section*{\glossaryname}]
\printglossaries
\end{multicols}

\end{document}

enter image description here

share|improve this answer
2  
lockstep's answer shows you how to customize everything, but if you decide you like any of the standard styles and just want to insert the multicols environment, you can use the etoolbox package to insert the multicols environment: \newglossarystyle{twocollist}{\glossarystyle{list}\BeforeBeginEnvironment{thegl‌​ossary}{\begin{multicols}{2}}\AfterEndEnvironment{theglossary}{\end{multicols}}}‌​. This would simply embed the list style in a two-column display. –  mforbes Dec 22 '11 at 9:01
add comment

Since I battled with this a while as well and I couldn't find any helpful discussions on the web, I just read carefully the manual! Maybe this is a feature newer than this topic, so it wasn't around the days the question was asked. But I like to provide an easy way to achieve multiple columns with the glossaries package so that others might find a solution faster.
One only needs the additional glossary-mcols package which provides exactly that.

\documentclass{scrreprt}

\usepackage{glossaries}
\usepackage{glossary-mcols}
\makeglossaries
\renewcommand*{\glspostdescription}{} % Removes dots at the end of each entry.

\begin{document}

% Some entries.
\newglossaryentry{glos:begin}{name=Begin, description={This is the beginning.}}
\newglossaryentry{glos:bold}{name=Bold, description=\nopostdesc}
\newglossaryentry{glos:bear}{name=Bear, description={A bear can make you run fast.}}\newglossaryentry{glos:chicken}{name=Chicken, description={Tasty...}}
\newglossaryentry{glos:elephant}{name=Elephant, description=\nopostdesc}
\newglossaryentry{glos:tantalos}{name=Tantalos, description={Just a random name.}}
\newglossaryentry{glos:zebra}{name=Zebra, description=\nopostdesc}

% Use the entries so that they show up in the glossary.
\gls{glos:begin}
\gls{glos:bold}
\gls{glos:bear}
\gls{glos:chicken}
\gls{glos:elephant}
\gls{glos:tantalos}
\gls{glos:zebra}

% Print the glossary with one of the mcol styles.
\printglossary[style=mcolindex, title=Index]

\end{document}

enter image description here

share|improve this answer
    
You may want to consider your own answer :). –  Ingo Oct 30 '13 at 14:52
add comment

This answer has the duplicate glossaries: multi-column and indentation in mind (@bioslime), where a mcolalttree glossary was used, but with the requirement to have a tabular-like look. It is established by adding a single line to the existing mcolalttree style:

\documentclass[10pt]{scrartcl}

  \usepackage[numberline,acronym]{glossaries}
  \usepackage{glossary-mcols}

  \glssetwidest{DIEASSD}% widest name - works with altree style


\makeatletter
  %%
  %% modification of mcolalttree;
  %% everything taken verbatim from mcolalttree, exception indicated
  %%
  \newglossarystyle{mymcolalttree}{%
    \glossarystyle{alttree}%
    \renewenvironment{theglossary}%
      {%
        \begin{multicols}{2}%
        \def\@gls@prevlevel{-1}%
        \mbox{}\par
      }%
      {\par\end{multicols}}%
    \renewcommand{\glossaryentryfield}[5]{%
      \ifnum\@gls@prevlevel=0
      \hangindent\glstreeindent%%%%%%%%%%%%%% this has been added
      \else
        \settowidth{\glstreeindent}{\textbf{\@glswidestname\space}}%
        \hangindent\glstreeindent
        \parindent\glstreeindent
      \fi
      \makebox[0pt][r]{\makebox[\glstreeindent][l]{%
        \glsentryitem{##1}\textbf{\glstarget{##1}{##2}}}}%
      \ifx\relax##4\relax
      \else
        (##4)\space
      \fi
      ##3\glspostdescription \space ##5\par
      \def\@gls@prevlevel{0}%
    }%
  }%
\makeatother

  % stops gaps between groups
  \renewcommand{\glsgroupskip}{}
  \usepackage{showframe}

  \makeglossaries

  \newacronym{a}{SER}{somesthing.}
  \newacronym{b}{BEB}{an awesome acronym.}
  \newacronym{c}{CCED}{yet another extended acronym description.}
  \newacronym{d}{DIEASSD}{the story about a fork, knife and a table full of spoons.}
  \newacronym{e}{IAIAIA}{short one with with with some some text text text extends.}
  \newacronym{f}{FAF}{this is a very long description for an acronym which is totally awesome.}
  \newacronym{g}{FAF2}{this is a very elaborate description for an acronym which is beyond awesome.}
  \newacronym{h}{IA}{short one again.this is a very long description. this is a very long description.}

  \begin{document}
  \printglossary[type=\acronymtype,style=mymcolalttree]
  Here are the acronyms: \gls{a}, \gls{b}, \gls{c}, \gls{d}, \gls{e}, \gls{f},
  \gls{h}, \gls{g}.%, \gls{i}.

  \end{document}

two-column glossary

share|improve this answer
add comment

Can't your question be answered by simply using the multicol package and writing:

\begin{multicols}{2}
\glossary
\end{multicols}
share|improve this answer
3  
Have you tried this? Was this supposed to be a comment? –  Werner Dec 10 '11 at 22:22
    
Problem is it crams a chapter heading into the multicolumns –  Nicholas Hamilton Jun 2 '13 at 14:53
add comment

the amsbook document class defines a two-column index with a one-column chapter heading. this code is taken from there.

\newif\if@restonecol
\def\indexchap#1{\global\topskip 7.5pc\relax
  \twocolumn[{\fontsize{\@xivpt}{18}\bfseries\centering
    \vskip\topskip\hbox{}\vskip-\baselineskip% adjust top space
    #1\par
   \global\topskip 34\p@\relax
   \ifx\@empty\indexintro
   \else
     \begingroup \normalsize
       \skip@\topskip \advance\skip@ -\baselineskip
       \vskip\skip@
       \parbox[t]{24pc}{\normalfont\indexintro\par}%
     \endgroup
     \global\topskip 24\p@\relax
   \fi
  }]%
}
\newcommand{\indexintro}{}
\newcommand{\@indextitlestyle}{%
  \let\@makeschapterhead\indexchap
  \@xp\chapter\@xp*\@xp{\indexname}%
}
\def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
  \columnseprule\z@ \columnsep 35\p@
  \@indextitlestyle
  \thispagestyle{plain}%
  ...
}
\def\indexname{Index}

\indexchap is the component that sets the heading in a single column, and the switch \if@restonecol is what is used to determine whether the page continues as one column or two. this code was adapted from book.cls but made more modular. comparing this with what's in book.cls should be enough to help you create a similar theglossary environment for your multi-chapter document. (it's not suitable for an article.)

share|improve this answer
    
The "hard part" of the OP's question is defining a "tabular-like" environment that is compatible with twocolumn mode. –  lockstep Dec 10 '11 at 21:27
1  
@lockstep -- part of the question was how to get the proper running head. using a chapter-based approach gets rid of that automatically. and since this approach makes each column a page, longtable should work without problems as well. if i have time tomorrow, i'll try to put together a working example. –  barbara beeton Dec 10 '11 at 23:42
add comment

I had a similar problem. I've tried Keks Dose's suggestion, but it was unsatisfactory because the title of the Glossary (chapter, in my case) was made part of the multicols, too. However, defining a new glossary style (based on list, in my case) which has a {multicols}{2}-Environment wrapped around the standard description, solves this issue:

\newglossarystyle{mylist}{
\glossarystyle{list}% base this style on the list style
\renewenvironment{theglossary}{
\begin{multicols}{2}\begin{description}}{\end{description}\end{multicols}} 
% the default environment for list is \begin{description} \end{description}
} 
\printglossary[style=mylist]

Edit: I just realized that this kind of solution was almost provided in a comment to a previous answer. mforbes' solution uses BeforeBeginEnvironment and AfterEndEnvironment from the etoolbox package. My solution is based on knowing the default environment of the style you are modifying, but doesn't need an extra package. mforbes' solution is agnostic of the value of theglossary

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.