summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/expex-glossonly/expex-glossonly.tex
blob: 1301a2ad1e7fbda156bb8d5b6c35d4debfaf0e05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
% !TEX TS-program = lualatexmk
\def\EPGLversion{0.9}
\def\EPGLdate{February 5, 2024}
\documentclass[11pt]{article}
\title{\textbf{The \textsf{expex-glossonly} package}}
\author{\textbf{Alan Munn}\\Department of Linguistics, Languages, and Cultures\\Michigan State University\\\texttt{\href{mailto:amunn@msu.edu}{amunn@msu.edu}}}
\date{Version \EPGLversion\\\EPGLdate}
\usepackage[margin=1in,includefoot]{geometry}
\usepackage{fontspec}
\setmonofont[Scale=MatchLowercase]{DejaVu Sans Mono}
\usepackage{titling}
\usepackage{array, booktabs, multicol, fancyhdr, xspace,tabularx}
\usepackage{enumitem}
\usepackage{fancyvrb,listings,url}
\usepackage[sf,compact]{titlesec}
\usepackage[colorlinks=true]{hyperref}


\DefineShortVerb{\|}
\newcommand*\bs{\textbackslash}

  
\lstset{%
    basicstyle=\ttfamily\small,
    commentstyle=\itshape\ttfamily\small,
    keywordstyle={},
    showspaces=false,
    showstringspaces=false,
    breaklines=true,
    breakautoindent=true,
    breakindent=1em,
    xrightmargin=2.5em,
    captionpos=t,
    frame=tl,
    language=TeX,
}
  
\newcommand*{\pkg}[1]{\texttt{#1}\xspace}
\setitemize[1]{label={}}
\setitemize[2]{label={}}
\setdescription{font={\normalfont}}
\setlength{\droptitle}{-1in}

\lhead{}
\chead{}
\rhead{}
\lfoot{\emph{}}
\cfoot{\thepage}
\rfoot{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\pagestyle{fancy}


\begin{document}
\maketitle
\thispagestyle{empty}
\renewcommand{\abstractname}{\sffamily Abstract}
\abstract{\noindent\begin{quote}This is an experimental package which is designed to let \pkg{gb4e}, \pkg{linguex} and \pkg{covington} package users use the advanced glossing capabilities of the very powerful ExPex package.\end{quote}}
\section{Introduction}
The ExPex package by John Frampton provides very fine-grained control over glossing and example formatting, including unlimited gloss lines and various ways of formatting multiline glosses.  By contrast the \pkg{cgloss4e} glossing macros provided with both \pkg{gb4e} and \pkg{linguex}, and to some extent, the glossing macros of \pkg{covington} although very capable at basic glossing, lack the degree of customization that is sometimes needed for more complex glossing.

On the other hand, for those users who have heavily invested in using \pkg{gb4e}, \pkg{linguex}, or \pkg{covington}, shifting to ExPex can be quite daunting and burdensome, especially since the basic syntax of the examples is quite different.

This package is an attempt to have the best of both worlds: it allows \pkg{gb4e}, \pkg{linguex}, or \pkg{covington} users to keep using those packages for basic example numbering and formatting, but also allows them to use the glossing macros that ExPex provides.

\section{Package usage}
Usage of the package is simple: simply load it instead of your usual example numbering package, and specify as a package option which numbering package you're using. So for example. Four example numbering packages are currently supported: \pkg{gb4e}, \pkg{linguex}, \pkg{covington}, and \pkg{gb4e-emulate}. The latter is an experimental reimplementation of \pkg{gb4e} using \pkg{enumitem} and is not currently released to CTAN, but available on \href{https://github.com/amunn/gb4e-emulate}{GitHub}.  Package options for loading \pkg{covington} can be given by adding them to the |covington| package option. Since they are an argument of the |covington| key, the set of options must be enclosed in |{...}|.

\begin{table}
\centering
\caption{Package loading options}
\begin{tabular}{l}
\toprule
\begin{lstlisting}[frame=none]
\usepackage[gb4e]{expex-glossonly}
\end{lstlisting}\\
\begin{lstlisting}[frame=none]
\usepackage[linguex]{expex-glossonly}
\end{lstlisting}\\
\begin{lstlisting}[frame=none]
\usepackage[covington={<covington package options>}]{expex-glossonly}
\end{lstlisting}\\
\begin{lstlisting}[frame=none]
\usepackage[gb4e-emulate]{expex-glossonly}
\end{lstlisting}\\
\bottomrule
\end{tabular}
\end{table}

The package checks for which example numbering package you have loaded and then patches the main glossing macro in ExPex to adjust to the horizontal spacing parameters of the particular example package you loaded.

It disables some incompatible commands from ExPex (specifically any commands that would introduce a numbered or lettered example, such as |\ex|, |\pex|, |\xe|) so you should not use them. Since it it is assumed that you will not be using ExPex for numbering, only for glosses, and parts of the ExPex code that deal with example numbering should be assumed not to work.

The package does \emph{not} change the existing glossing macros of the base numbering package. This means that using the package does \emph{not} require you to use ExPex glossing macros for all your glossing. You can continue to use the glossing macros provided by the base numbering package. What this package does is \emph{extend} the capabilities of the base numbering package to allow you to use ExPex glosses as well as the regularly provided glossing facilities of the base package. 
\section{Examples}
Here are some sample documents using the supported packages:

\subsection{\pkg{gb4e}}
\begin{quote}
\begin{lstlisting}
\documentclass{article}
\usepackage[gb4e]{expex-glossonly}
\usepackage{cgloss}
\begin{document}

\begin{exe}
\ex
\begin{xlist}
\ex[*]{ This is a regular example.}
\ex[]{\label{foo}
	\begingl
    \gla\rightcomment{(Hungarian)}János háza//
    \glb John house.his//
    \glft `John's house'//
    \endgl
}
\ex[]{\gll János háza\\
	       John house\\\hfill(Hungarian)
	  \glt `John's house'
	  }
\end{xlist}	  
\end{exe}

\end{document}
\end{lstlisting}
\end{quote}
\clearpage
\subsection{\pkg{linguex}}
\begin{quote}
\begin{lstlisting}
\documentclass{article}

\usepackage[linguex]{expex-glossonly}

\begin{document}

\ex.
\a.
    \begingl
    \gla\rightcomment{(Hungarian)}János háza//
    \glb John house.his//
    \glft `John's house'//
    \endgl
\bg. János háza\\
     John house.his\\
    `John's house'

\end{document}
\end{lstlisting}
\end{quote}

\subsection{\pkg{covington}}

\begin{quote}
\begin{lstlisting}
\documentclass{article}
\usepackage[covington]{expex-glossonly}

\begin{document}

\begin{examples}
\item An example
\item Another example
\end{examples}
\begin{subexamples}
\item
   \begingl
    \gla\rightcomment{(Hungarian)}János háza//
    \glb John house.his//
    \glft `John's house'//
    \endgl
\item \digloss{János háza}[(Hungarian)]
			  {John house.his}
			  {`John's house}
\end{subexamples}
\end{document}
\end{lstlisting}
\end{quote}

\section{Bugs and support}
This is \emph{experimental} and has not been extensively tested. Use at your own risk. You're welcome to raise issues at the \href{https://github.com/amunn/expex-glossonly}{GitHub repository}, however.
\section{Version history}
The initial version of the package (0.6) supported only \pkg{linguex} and \pkg{gb4e}. Version 0.7 changed the loading interface to provide support for \pkg{covington} and added support for \pkg{gb4e-emulate}. Version 0.8  fixed a spacing bug with grammaticality judgements in \pkg{linguex}. Version 0.9 fixed more spacing problems with \pkg{linguex}.
\section{Acknowledgements}
As always, thanks to the members of the LaTeX development team and other users who are always happy to answer questions in the \href{https://tex.stackexchange.com}{TeX.se} chat room. Thanks especially to Ulrike Fischer who told me of the magical |\@totalleftmargin| length.  Thanks also to Jürgen Spitzmüller for discussion of the \pkg{covington} support.
\end{document}