11

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.

Adam Liter
  • 12,567
  • 1
    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

3 Answers3

8

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.

Jason Zentz
  • 4,158
  • This doesn't work as advertised. – egreg Mar 02 '15 at 08: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 02 '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 02 '15 at 18:11
  • To understand more what egreg is talking about, you might want to look at the follow up question that I asked. Also, trying to figure this out is the first time that I've ever looked at the glossaries package, so I have no idea what I'm doing, but according to the manual, \defglsdisplay and \defglsdisplayfirst were deprecated for \defglsentryfmt. – Adam Liter Mar 03 '15 at 04:29
  • 1
    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 03 '15 at 04:31
  • In addition to the manual, see also: http://www.dickimaw-books.com/cgi-bin/featuretracker.cgi?action=view&key=13 – Adam Liter Mar 03 '15 at 04:43
  • @AdamLiter, thanks for filling me in on the context of the follow-up question. I did try using \defglsentryfmt but I couldn't manage to get the OP's error resolved using that (I also hadn't worked with glossaries until this issue came up for me). I agree that it is really a leipzig bug that should be fixed by Natalie -- thanks for contacting her. – Jason Zentz Mar 05 '15 at 14:05
  • 1
    @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 05 '15 at 14:12
  • Changing a package file is something like a deadly sin, not just for licensing issues. Can you please change the answer and suggest to make changes to a copy with a distinct name? – Johannes_B Aug 08 '15 at 18:11
  • @Johannes_B, I have now edited the answer to make it more explicit that users should change a copy of the style file and not the original. – Jason Zentz Mar 29 '16 at 18:57
  • Thank you. Did you know, that this answer is quite confusing for me? I was born in a little town called Zeitz which is about 50 km away from Leipzig. I always misread your name. – Johannes_B Mar 30 '16 at 16:23
3

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}
adam.baker
  • 1,116
0

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!

whatisit
  • 1,870