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 encountering a weird problem when changing my list of acronyms from the long to the longragged style. This is an example for illustration:

\documentclass{article}

\usepackage[acronym,nomain,sanitize={description=false,symbol=false}]{glossaries}
\usepackage{glossary-longragged}
\makeglossaries

\newglossarystyle{longraggeduc}{%
%  \glossarystyle{long}%  <-- works
  \glossarystyle{longragged}%  <-- does not work
  \renewcommand*\glossaryentryfield[5]{%
    \glstarget{##1}{##2} & \makefirstuc{##4}##3\glspostdescription\space##5\\
  }
}

\newacronym{acr:abc}{ABC}{a b c}
\newacronym{acr:def}{DEF}{d e f}

\begin{document}
\gls{acr:abc} \gls{acr:def}

\printglossary[type=\acronymtype,style=longraggeduc,nonumberlist=true]
\end{document}

I'm redefining \glossaryentryfield because of a special style I need to have, including the capitalization of the first letter of the description. That stuff works with the long style, but stops working with the longragged style (see the commented line).

LaTeX (pdflatex) complains

! Extra alignment tab has been changed to \cr.

when processing the .acr file generated by makeglossaries.

I'm kind of stuck with that problem since I'm unable to identify the reason. Any ideas?

share|improve this question
    
@TorbjørnT. Well, no error then; anyway it does not lead to the expected result, since & is the alignment character needed to enter the second column of the longtable. –  Christoph Apr 15 '12 at 14:30
add comment

1 Answer

up vote 4 down vote accepted

longragged uses \raggedright, which redefines \\ and this means that you can't use \\ to end a tabular line. Use \tabularnewline instead:

\\newglossarystyle{longraggeduc}{%
%  \glossarystyle{long}%  <-- works
  \glossarystyle{longragged}%  <-- does not work
  \renewcommand*\glossaryentryfield[5]{%
    \glstarget{##1}{##2} & \makefirstuc{##4}##3\glspostdescription\space##5\tabularnewline
  }
}
share|improve this answer
    
Awesome - did not expect that one to cause trouble, even though I had a similar problem before. –  Christoph Apr 15 '12 at 15:22
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.