I've created a method to input Norwegian-English translations into a sort of glossary. I need multiple of these little glossaries, later they will be compiled into a big glossary. It doesn't need to be complex.

I use datatool to sort the list alphabetically (ignoring Norwegian indexing problems for now), in a system I'm pretty happy with, actually.


% \usepackage[colorlinks=true]{hyperref}    % hyperlink to target
\usepackage{multicol}                   % multiple columns
\usepackage{hanging}                    % paragraph indentation control
\usepackage{datatool}                   % for sorting lists

\newcommand{\vocab}[3]{%\parskip=0pt \textbf{#1} (#2) #3~\par%
\newenvironment{vocabsection}[1]{\noindent \hspace{1em} \textbf{#1} %
{ \dtlsort{norsk}{vocabsort}{\dtlicompare}%
            \begin{DTLenvforeach*}{vocabsort}{\norsk=norsk, \class=class, \english=english}
                \textbf{\norsk} (\class) \english~\par



    \begin{vocabsection}{Map Vocab}     
        \vocab{akershus}{n.}{A castle in Oslo, the counselors' cabin} 
        \vocab{basketball bane}{n.}{basketball court}
        \vocab{sykepleirske}{n.}{nurse's cabin}


The above code results in this: Working hyperref+multicols

But uncomment \usepackage[colorlinks=true]{hyperref} and it all falls apart, producing:

Broken list

To be honest, I don't need the hyperlinks anyway, since this document will mostly be used in hard copy anyway, but now I'm curious how hypperref could possibly be causing this, and if there is a fix.

As pointed out in the comments, the bug also requires the use of hanging. The question still stands, how could the interaction of hyperref and hanging cause multicols to fail in this instance?

Compile with XeTeX, as it ignores the command-already-defined error produced by hanging.

  • LaTeX can be so bizarre sometimes: I can rearrange a page in minutes, but a package that creates hyperlinks interferes with the output of a sorted and outputted list in two columns. – Azor Ahai -him- Dec 18 '15 at 4:49
  • Your example isn't compilable at the moment, due to hanging package – user31729 Dec 18 '15 at 4:52
  • Oh, I'm compiling it with XeTeX, which gets upset but still compiles – Azor Ahai -him- Dec 18 '15 at 4:53
  • The culprit seems to be \begin{hangparas} in the \displaysorteddb macro. Uncommenting that it will use two columns again, but it doesn't look nice :-( – user31729 Dec 18 '15 at 4:55
  • Noted. But you're right, it's nigh-impossible to read without hanging, especially as these lists will grow larger. – Azor Ahai -him- Dec 18 '15 at 5:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.