# Issues with leipzig and glossaries used together

I am preparing a document containing some interlinear glossing, the glossing conventions themselves appearing as a separate list. I use the leipzig package to typeset the glosses, the expex package to format numbered examples and the glossaries package to create the list of abbreviations.

MWE#1 gets the shape of the glosses right, both inside a numbered example and outside: there is no spacing between the 1, the SG, the colon and the DAT in the pdf output.

\documentclass{article}

\usepackage{expex}
\usepackage{leipzig}

\begin{document}

\ex
\begingl
\gla mulle //
\glb \First\Sg:\Dat{} //
\endgl
\xe

go.\Pst{}

\end{document}


However, if I load the glossaries package in line with the instructions in the leipzig manual, as shown in MWE#2, I get unwanted spacing on either side of the SG bit. Besides, inline glosses appear in the output unfolded into go.PSTpastpst as opposed to the desired go.PST

\documentclass{article}

\usepackage{expex}

\usepackage[nomain,nostyles]{glossaries}
\usepackage{glossary-inline}
\usepackage{leipzig}
\makeglossaries

\begin{document}

\ex
\begingl
\gla mulle//
\glb \First\Sg:\Dat{}//
\endgl
\xe

go.\Pst{}

\printglossary[style=inline,type=\leipzigtype]

\end{document}


Is there a way of rectifying this? I'm compiling these particular MWEs with pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013) but have tried both Xe- and LuaLaTeX as well, both times with the same result.

• leipzig 2.0 is now available on CTAN (2017-06-16), and it fixes this issue (among others). However, if you are still using leipzig 1.0/1.1, then you can hack this by using \glsunsetall in your preamble. The reason you see PSTpastpst is a combination of bugs, but mostly because leipzig thinks you want the full abbreviation printed, as if on first use. Using \glsunsetall unsets the first use flag that is used by glossaries. (Sorry, I don't know why the extra spaces were showing up! Perhaps the above hack will fix that too.) – Natalie Weber Jun 17 '17 at 16:24

I couldn't replicate the spacing issue around the SG, so this answer might not help you with that.

The go.PSTpastpst issue is related to the usage of the obsolete glossaries commands \defglsdisplay and \defglsdisplayfirst in leipzig.sty.

Here is what is in v1.0 of leipzig.sty on line 128:

\newcommand*{\SetLeipzigDisplayStyle}[1]{%
\defglsdisplay[#1]{\leipzigfont{##1}##4}%
\defglsdisplayfirst[#1]{\firstleipzigfont{##1}##4}%
}


You should create a copy of leipzig.sty, save it with a new name, and then change the above lines to the following. You will then need to load the modified style file instead of leipzig.sty.

\newcommand*{\SetLeipzigDisplayStyle}[1]{%
\renewcommand*{\glstextformat}[1]{\leipzigfont{#1}}%
}


This gets rid of the obsolete command errors and also solves your go.PSTpastpst issue.

• This doesn't work as advertised. – egreg Mar 2 '15 at 8:42
• @egreg, can you elaborate? Are you saying that after modifying leipzig.sty as I suggested you still get the error that the OP mentions? Or do you mean that the fix works but has unintended consequences? – Jason Zentz Mar 2 '15 at 17:27
• If I apply \renewcommand... in the file, instead of changing leipzig.sty, I don't seem to get the right result. – egreg Mar 2 '15 at 18:11
• Anyway, the real answer is that this is a bug in leipzig and should be fixed since those commands were deprecated in glossaries. I've emailed Natalie about this, but I think she's writing her dissertation right now and might be preoccupied. – Adam Liter Mar 3 '15 at 4:31
• @egreg, I'm puzzled as to why this fix doesn't work within \renewcommand... in the .tex file. But given that I didn't suggest doing that, is it really fair to say the answer doesn't work as advertised? I'm not claiming this is the best solution, but I identified the source of the problem (the deprecated commands) and provided a solution that resolves the problem, even if it can't be extended to work in the .tex file. – Jason Zentz Mar 5 '15 at 14:12

At least as of the June 16, 2017 release of leipzig, this no longer seems to be a problem. You just need to use the glosses package option. (This is explained in the “Multiple glossaries” section of the documentation.)

\usepackage[glosses]{leipzig}


Changing leipzig.sty is the correct way to go. There is a little confusion, however...

There are two locations where leipzig.sty appears (in Miktex on Windows 7, 8, 8.1):
1. C:\Program Files\MiKTeX 2.9\tex\latex\leipzig
2. C:\Users\USERNAME\AppData\Roaming\MiKTeX\2.9\tex\latex\leipzig

When changing the first one, I had no success. When changing the second one, recompiling my file got the workaround to function properly. Thanks, @Jason Zentz!