0

I'm having trouble getting a glossary (with the leipzig package) to print. I use TeXShop on the Mac with xelatexmk.

The MWE uses the style from the leipzig manual:

% !TEX TS-program = xelatexmk
\documentclass{report}
\usepackage[nomain,section=chapter]{glossaries}%
 \usepackage{glossary-inline}%
 \newglossarystyle{mysuper}{%
 \glossarystyle{super}% based on super
   \renewenvironment{theglossary}%
     {\tablehead{}\tabletail{}%
      \begin{supertabular}{@{}lp{\glsdescwidth}}}%
     {\end{supertabular}}%
   \renewcommand*{\glossaryheader}{}%
   \renewcommand*{\glsgroupheading}[1]{}%
   \renewcommand*{\glossaryentryfield}[5]{%
     \glsentryitem{##1}\glstarget{##1}{##2}
       & \makefirstuc{##3}\glspostdescription{}\\}%
   \renewcommand*{\glossarysubentryfield}[6]{%
      &
      \glssubentryitem{##2}%
      \glstarget{##2}{\strut}\makefirstuc{##4}\glspostdescription{}\\}%
   \renewcommand*{\glsgroupskip}{}%
}%
\usepackage{leipzig}%
\makeglossaries
\glsdisablehyper

\begin{document}
\printglossary[style=mysuper,type=\leipzigtype]
Testing Leipzig {\Aarg} {\Pst} {\Det}
\end{document}

I've followed the instructions here and edited ~/Library/TeXShop/bin/latexmkrcedit, adding the lines from the answer here:

add_cus_dep('glo', 'gls', 0, 'run_makeglossaries');
add_cus_dep('acn', 'acr', 0, 'run_makeglossaries');

sub run_makeglossaries {
  if ( $silent ) {
    system "makeglossaries -q '$_[0]'";
  }
  else {
    system "makeglossaries '$_[0]'";
  };
}

However, it still doesn't bring up the glossary, so I assume I did something wrong. Any help much appreciated.

EDIT: I have added the above lines to both ~/Library/TeXShop/bin/latexmkrcedit and ~/.latexmkrc but no success. I do get a warning about no file testfile.lzs and a deprecated command \glossarystyle.

jan
  • 2,236

1 Answers1

1

With your document, glossary type is leipzig, for which the glossary files are lzs and lzo. So you need the corresponding custom dependency. In the latexmkrc file (which is in your case ~/Library/TeXShop/bin/latexmkrcedit), add the line

add_cus_dep('lzo', 'lzs', 0, 'run_makeglossaries');
John Collins
  • 11,183
  • 3
  • 32
  • 33
  • Fantastic! You saved me! – jan Dec 06 '16 at 18:46
  • In case someone tries this with leipzig 2.0 (just added to CTAN, 2017-06-16), this is not always the case anymore. Gloss abbreviations are put into the main glossary by default ('glo', 'gls'). Only if you use the package option [glosses] will they be put into a glossary type=leipzig ('lzo', 'lzs'). Probably the safest action is to add lines for all of the above. – Natalie Weber Jun 17 '17 at 17:11