Debian Codegraph @

texmf-dist/doc/latex/expex-glossonly/expex-glossonly.tex

raw
1 % !TEX TS-program = lualatexmk
2 \def\EPGLversion{0.9b}
3 \def\EPGLdate{February 14, 2024}
4 \documentclass[11pt]{article}
5 \title{\textbf{The \textsf{expex-glossonly} package}}
6 \author{\textbf{Alan Munn}\\Department of Linguistics, Languages, and Cultures\\Michigan State University\\\texttt{\href{mailto:[email protected]}{[email protected]}}}
7 \date{Version \EPGLversion\\\EPGLdate}
8 \usepackage[margin=1in,includefoot]{geometry}
9 \usepackage{fontspec}
10 \setmonofont[Scale=MatchLowercase]{DejaVu Sans Mono}
11 \usepackage{titling}
12 \usepackage{array, booktabs, multicol, fancyhdr, xspace,tabularx}
13 \usepackage{enumitem}
14 \usepackage{fancyvrb,listings,url}
15 \usepackage[sf,compact]{titlesec}
16 \usepackage[colorlinks=true]{hyperref}
17
18
19 \DefineShortVerb{\|}
20 \newcommand*\bs{\textbackslash}
21
22
23 \lstset{%
24 basicstyle=\ttfamily\small,
25 commentstyle=\itshape\ttfamily\small,
26 keywordstyle={},
27 showspaces=false,
28 showstringspaces=false,
29 breaklines=true,
30 breakautoindent=true,
31 breakindent=1em,
32 xrightmargin=2.5em,
33 captionpos=t,
34 frame=tl,
35 language=TeX,
36 }
37
38 \newcommand*{\pkg}[1]{\texttt{#1}\xspace}
39 \setitemize[1]{label={}}
40 \setitemize[2]{label={}}
41 \setdescription{font={\normalfont}}
42 \setlength{\droptitle}{-1in}
43
44 \lhead{}
45 \chead{}
46 \rhead{}
47 \lfoot{\emph{}}
48 \cfoot{\thepage}
49 \rfoot{}
50 \renewcommand{\headrulewidth}{0pt}
51 \renewcommand{\footrulewidth}{0pt}
52 \pagestyle{fancy}
53
54
55 \begin{document}
56 \maketitle
57 \thispagestyle{empty}
58 \renewcommand{\abstractname}{\sffamily Abstract}
59 \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}}
60 \section{Introduction}
61 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.
62
63 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.
64
65 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.
66
67 \section{Package usage}
68 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 |{...}|.
69
70 \begin{table}
71 \centering
72 \caption{Package loading options}
73 \begin{tabular}{l}
74 \toprule
75 \begin{lstlisting}[frame=none]
76 \usepackage[gb4e]{expex-glossonly}
77 \end{lstlisting}\\
78 \begin{lstlisting}[frame=none]
79 \usepackage[linguex]{expex-glossonly}
80 \end{lstlisting}\\
81 \begin{lstlisting}[frame=none]
82 \usepackage[covington={<covington package options>}]{expex-glossonly}
83 \end{lstlisting}\\
84 \begin{lstlisting}[frame=none]
85 \usepackage[gb4e-emulate]{expex-glossonly}
86 \end{lstlisting}\\
87 \bottomrule
88 \end{tabular}
89 \end{table}
90
91 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.
92
93 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.
94
95 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.
96 \section{Examples}
97 Here are some sample documents using the supported packages:
98
99 \subsection{\pkg{gb4e}}
100 \begin{quote}
101 \begin{lstlisting}
102 \documentclass{article}
103 \usepackage[gb4e]{expex-glossonly}
104 \usepackage{cgloss}
105 \begin{document}
106
107 \begin{exe}
108 \ex
109 \begin{xlist}
110 \ex[*]{ This is a regular example.}
111 \ex[]{\label{foo}
112 \begingl
113 \gla\rightcomment{(Hungarian)}János háza//
114 \glb John house.his//
115 \glft `John's house'//
116 \endgl
117 }
118 \ex[]{\gll János háza\\
119 John house\\\hfill(Hungarian)
120 \glt `John's house'
121 }
122 \end{xlist}
123 \end{exe}
124
125 \end{document}
126 \end{lstlisting}
127 \end{quote}
128 \clearpage
129 \subsection{\pkg{linguex}}
130 \begin{quote}
131 \begin{lstlisting}
132 \documentclass{article}
133
134 \usepackage[linguex]{expex-glossonly}
135
136 \begin{document}
137
138 \ex.
139 \a.
140 \begingl
141 \gla\rightcomment{(Hungarian)}János háza//
142 \glb John house.his//
143 \glft `John's house'//
144 \endgl
145 \bg. János háza\\
146 John house.his\\
147 `John's house'
148
149 \end{document}
150 \end{lstlisting}
151 \end{quote}
152
153 \subsection{\pkg{covington}}
154
155 \begin{quote}
156 \begin{lstlisting}
157 \documentclass{article}
158 \usepackage[covington]{expex-glossonly}
159
160 \begin{document}
161
162 \begin{examples}
163 \item An example
164 \item Another example
165 \end{examples}
166 \begin{subexamples}
167 \item
168 \begingl
169 \gla\rightcomment{(Hungarian)}János háza//
170 \glb John house.his//
171 \glft `John's house'//
172 \endgl
173 \item \digloss{János háza}[(Hungarian)]
174 {John house.his}
175 {`John's house}
176 \end{subexamples}
177 \end{document}
178 \end{lstlisting}
179 \end{quote}
180
181 \section{Bugs and support}
182 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.
183 \section{Version history}
184 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}.
185 \section{Acknowledgements}
186 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.
187 \end{document}