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 am a total beginner with LaTeX and I can't find a way to solve the following problem. I have a glossary which I have printed in two columns by adding the code that I have included at the end. The problem is that the title of the glossary appears included in the first column. What I would like is that the title stays out, and the two column format begins after the title is printed. Is there an easy way to do this?

Thank you very much for your help!

\documentclass[10pt,a4paper]{book}
\usepackage[hyperfirst=true,acronym]{glossaries}
\usepackage{multicol}

\let\glsaltpl\glsuseri
\let\glsing\glsuserii

%%Formatos para la lista de acrónimos
\newglossarystyle{EstiloGlosario}{%
\glossarystyle{listgroup}% Estilo base
%Estilo de las entradas: Entrada en negrita, descripcion normal
\renewcommand*{\glossaryentryfield}[5]{%
\item[]{\bf{\glstarget{##1}{##2}}}\;\;\;\relax
\space{\footnotesize ##3}% Description,
{,}
{\footnotesize ##5}
% Page list
\vspace{-0.2mm}% end of row
}%
%Cabecera con regla debajo de la letra inicial
\renewcommand*{\glsgroupheading}[1]{\setlength{\itemsep}{0mm}\item[{\:}{\:}{\Large        \glsgetgrouptitle{##1}}]\setlength{\itemsep}{-2.5mm}
\item[\rule{3cm}{0.02 cm}]\setlength{\itemsep}{-0mm}}
}

\makeglossaries
\begin{document}
    \begin{multicols}{2}
    \printglossary[type=main,style=EstiloGlosario]
    \newpage
    \end{multicols}

    \newglossaryentry{ppm}{name=ppm,description={parts per million}} The units are expressed in \gls{ppm}.
\end{document}
share|improve this question
    
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. In particular it's important to state what package you're using for the glossary. –  egreg Jun 22 '12 at 10:33
add comment

1 Answer

Your example code produces errors, so I used a simplified document to illustrate the procedure. You can achieve what you want by redefining \glossarysection to write the title using \chapter* and then go into two-column mode, and \glossarypostamble to return to one-column mode; something along these lines:

\documentclass[10pt,a4paper]{book}
\usepackage[hyperfirst=true,acronym,section=chapter]{glossaries}
\usepackage{multicol}

\renewcommand*{\glossarysection}[2][]{%
  \begin{multicols}{2}[\chapter*{#2}]
  \setlength\glsdescwidth{0.6\linewidth}%
  \glossarymark{\glossarytoctitle}%
}
\renewcommand*{\glossarypostamble}{\end{multicols}}
\makeglossaries

\newglossarystyle{EstiloGlosario}{%
\glossarystyle{listgroup}}

\newglossaryentry{ppm}{name=ppm,description={parts per million}} 
\newglossaryentry{ppb}{name=ppb,description={parts per billion}} 

\begin{document}

The units are expressed in \gls{ppm}.
The units are expressed in \gls{ppb}.

\printglossary[type=main,style=EstiloGlosario]

\end{document}

The resulting glossary:

enter image description here

If you're not interested in balanced columns, you could use \twocolumn and \onecolumn instead of the multicols environment:

\renewcommand*{\glossarysection}[2][]{%
  \twocolumn\chapter*{#2}
  \setlength\glsdescwidth{0.6\linewidth}%
  \glossarymark{\glossarytoctitle}%
}
\renewcommand*{\glossarypostamble}{\onecolumn}
share|improve this answer
    
Also \twocolumn accepts an optional argument that's typeset in onecolumn mode. –  egreg Jun 22 '12 at 15:24
    
@egreg: I know, but when I tried \twocolumn[\chapter*{#2}], I got a ! LaTeX Error: Float(s) lost. error. –  Gonzalo Medina Jun 22 '12 at 15:27
    
A good reason for choosing multicols. :) –  egreg Jun 22 '12 at 15:48
    
Thank you very much for your help! it worked like a charm! :) –  LatexBeginner Jun 23 '12 at 7:00
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.