diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/covington')
-rw-r--r-- | Master/texmf-dist/tex/latex/covington/covington.sty | 210 |
1 files changed, 167 insertions, 43 deletions
diff --git a/Master/texmf-dist/tex/latex/covington/covington.sty b/Master/texmf-dist/tex/latex/covington/covington.sty index e50e2b5de67..525b2b7efe7 100644 --- a/Master/texmf-dist/tex/latex/covington/covington.sty +++ b/Master/texmf-dist/tex/latex/covington/covington.sty @@ -1,21 +1,71 @@ -%%% File covington.sty -%%% -%%% Michael A. Covington -%%% Artificial Intelligence Programs -%%% The University of Georgia -%%% Athens, Georgia 30602-7415 USA -%%% mcovingt@aisun1.ai.uga.edu +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% File covington.sty +%% +%% Some macros useful for linguistics +%% +%% Original author: +%% ================ +%% Michael A. Covington +%% Artificial Intelligence Programs +%% The University of Georgia +%% Athens, Georgia 30602-7415 USA +%% mcovingt@aisun1.ai.uga.edu +%% +%% Contributors: +%% ============= +%% Robin Fairbairns <rf10@cl.cam.ac.uk> 2014-05-16: patched setting of \textfloatsep +%% to use \setlength rather than \renewcommand; also converted to un*x line endings +%% +%% Current maintainer: +%% =================== +%% Juergen Spitzmueller <juergen@spitzmueller.org> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% The Current Maintainer of this work is Juergen Spitzmueller. +%% +%% Code repository and issue tracker: https://github.com/jspitz/covington +%% +%% See covington.tex for documentation. +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%% -%%% You may copy and distribute this file freely. -%%% (If you modify it, please change its name and add your own comments.) +%%% Metadata %%% -%%% See covington.tex for documentation. -%% -%% Robin Fairbairns: patched setting of \textfloatsep to use -%% \setlength rather than \renewcommand; also converted to un*x line endings -\typeout{* covington.sty : Covington's linguistic macros, 2001 March 27 *} -%% patched 2014-05-16 (rf10@cl.cam.ac.uk) +\def\filedate{2016/07/06} +\def\fileversion{1.1} +\def\filename{covington.sty} + +% Force redefinition of environments? +\newif\ifforceredef\forceredeffalse + +\@ifundefined{ProvidesPackage}{% +\typeout{* covington.sty : Covington's linguistic macros, \fileversion\ \filedate *} +}{% +\ProvidesPackage{covington} + [\filedate\space v\fileversion\space Covington's linguistic macros] +\DeclareOption{force}{\forceredeftrue} +\ProcessOptions +} + +% Macro to issue warnings +\newcommand\cov@warning[1]{% + \@ifundefined{PackageWarning}{% + \typeout{* covington warning : #1 *} + }{% + \PackageWarning{covington}{#1}% + } +} %%% %%% Preferences about how text is laid out @@ -31,10 +81,15 @@ % This is adapted from the \diatop macro in wsuipa.sty, which was % originally designed by Jean-Pierre Paillet. +% Length to adjust accent distance +% Introduced 2016-07-06 JSP. +\newlength\twoaccsep +\setlength{\twoaccsep}{-0.8ex} + \def\twoacc[#1|#2]{\leavevmode{\setbox1=\hbox{{#1{}}}% \setbox2=\hbox{{#2{}}}% \dimen0=\ifdim\wd1>\wd2\wd1\else\wd2\fi% - \dimen1=\ht2\advance\dimen1by-0.8ex% + \dimen1=\ht2\advance\dimen1by\twoaccsep% \setbox1=\hbox to1\dimen0{\hss#1\hss}% \rlap{\raise1\dimen1\box1}% \hbox to1\dimen0{\hss#2\hss}}}% @@ -88,8 +143,29 @@ % \item[(b)] This is the second example. % \end{itemize} % \end{example} - -\newenvironment{example}{\begin{examples}\item}{\end{examples}} +% +% New in 1.1 (2016-07-06): +% We provide a covexample environment and only (re)define +% example if it does not yet exist or if redefinition is +% forced by the "forced" option. This prevents clashes +% with packages/classes that roll their own example environment +% (such as beamer). + +\newenvironment{covexample}{\begin{covexamples}\item}{\end{covexamples}} + +\@ifundefined{example}{% + \newenvironment{example}{\begin{covexamples}\item}{\end{covexamples}} +}{% +\ifforceredef + \renewenvironment{example}{\begin{covexamples}\item}{\end{covexamples}} + \cov@warning{The example environment was already defined. Redefining it.} +\else + \cov@warning{The example environment was already defined.^^J + Covington does not touch it.^^J + Use covexample if you want to access covington's^^J + version, or use the force package option.} +\fi +} %%% %%% The 'examples' environment @@ -105,10 +181,17 @@ % % Thanks to Darrel Hankerson of Auburn University, and numerous others % across the net, for help with this macro. +% +% New in 1.1 (2016-07-06): +% We provide a covexamples environment and only (re)define +% examples if it does not yet exist or if redefinition is +% forced by the "forced" option. This prevents clashes +% with packages/classes that roll their own examples environment +% (such as beamer). \newcounter{equationsave} % used in trick with equation number -\newenvironment{examples}% % define "example" environment +\newenvironment{covexamples}% % define "example" environment {% \begin{list}{(\theequation)}% {% @@ -121,6 +204,20 @@ \raggedright}% % text is flushleft, not justified {\end{list}} +\@ifundefined{examples}{% + \newenvironment{examples}{\begin{covexamples}}{\end{covexamples}} +}{% +\ifforceredef + \renewenvironment{examples}{\begin{covexamples}}{\end{covexamples}} + \cov@warning{The examples environment was already defined. Redefining it.} +\else + \cov@warning{The examples environment was already defined.^^J + Covington does not touch it.^^J + Use covexamples if you want to access covington's^^J + version, or use the force package option.} +\fi +} + %%% %%% Sentences with word-by-word glosses %%% @@ -166,15 +263,15 @@ % baselinestretch. \@ifundefined{new@fontshape}% - {\def\@selfnt{\ifx\@currsize\normalsize\@normalsize\else\@currsize\fi}} - {\def\@selfnt{\selectfont}} + {\def\cov@selfnt{\ifx\@currsize\normalsize\@normalsize\else\@currsize\fi}} + {\def\cov@selfnt{\selectfont}} % Thanks to Hans-Peter Kolb for this macro. \def\gll % Introduces 2-line text-and-gloss. {\begin{flushleft} \vskip\baselineskip% % Added 1992 Nov 8 to force single spacing \def\baselinestretch{1}% -\@selfnt% +\cov@selfnt% \vskip-\baselineskip% \bgroup \catcode`\^^M=12 @@ -185,7 +282,7 @@ {\begin{flushleft} \vskip\baselineskip% % Added 1992 Nov 8 to force single spacing \def\baselinestretch{1}% -\@selfnt% +\cov@selfnt% \vskip-\baselineskip% \bgroup \catcode`\^^M=12 @@ -222,9 +319,18 @@ \glossglue = 5pt plus 2pt minus 1pt % allow stretch/shrink between words \newif\ifnotdone -\let\eachwordone=\it -\let\eachwordtwo=\rm -\let\eachwordthree=\rm +% Add semantic markup (with latex 2.09 backwards support) +\@ifundefined{selectfont}{% + \def\cov@emphasized{\it}% + \def\cov@normalfont{\rm}% +}{% + \def\cov@emphasized{\normalfont\itshape}% + \def\cov@normalfont{\normalfont\rmfamily}% +} + +\let\eachwordone=\cov@emphasized +\let\eachwordtwo=\cov@normalfont +\let\eachwordthree=\cov@normalfont \def\lastword#1#2#3% #1 = \each, #2 = line box, #3 = word box {\setbox#2=\vbox{\unvbox#2% @@ -311,7 +417,7 @@ % \psr To print S -> NP VP, use: \psr{S}{NP~VP} -\newcommand{\psr}[2]{\mbox{\it #1 $\rightarrow$ #2}} +\newcommand{\psr}[2]{\mbox{\cov@emphasized #1 $\rightarrow$ #2}} %%% @@ -329,9 +435,8 @@ % Modified 2001 Mar 27 so that italics are used without the user typing \it. \newcommand{\fs}[1] { - \mbox{\small + \mbox{\small\cov@emphasized $ - \it \left[ \!\! \begin{array}{l} @@ -345,15 +450,14 @@ % Modified 1990 Dec 5 so that features are left aligned. \newcommand{\lfs}[2] { - \mbox{$ - \it + \mbox{\cov@emphasized + $ \!\! \begin{array}[t]{c} #1 \\ \mbox{\small% $ - \it \left[ \!\! \begin{array}{l} @@ -411,7 +515,7 @@ \newcommand{\drs}[2] { { - \it + \cov@emphasized \begin{tabular}{|l|} \hline ~ \vspace{-2ex} \\ @@ -430,7 +534,7 @@ \newcommand{\sdrs}[3] {\begin{tabular}{l} -\mbox{\it #1} \\ +\mbox{\cov@emphasized #1} \\ ~ \\ \drs{#2}{#3} \end{tabular}} @@ -458,9 +562,15 @@ % exercise Environment for exercises, numbered by subsection. % Optional argument for describing the exercise % ("Project" or the like). +% +% New in 1.1 (2016-07-06): +% We provide a covexercise environment and only (re)define +% example if it does not yet exist or if redefinition is +% forced by the "forced" option. This prevents clashes +% with packages/classes that roll their own exercise environment. -% \bx Abbreviation for \begin{exercise} -% \ex Abbreviation for \end{exercise} +% \bx Abbreviation for \begin{covexercise} +% \ex Abbreviation for \end{covexercise} % reflist Environment for hanging-indented list % (suitable for LSA-style reference list). @@ -472,16 +582,30 @@ % large curly brackets. Good for alternatives % within sentences or PS-rules. -\newtheorem{exercise}{Exercise}[subsection] +\newtheorem{covexercise}{Exercise}[subsection] % Exercise numbering resets to 0 not only at the start of % a subsection, but also at the start of a section or chapter % even if it is not divided into subsections. -\@addtoreset{exercise}{section} -\@addtoreset{exercise}{chapter} - -\newcommand{\bx}{\begin{exercise}} -\newcommand{\ex}{\end{exercise}} +\@addtoreset{covexercise}{section} +\@addtoreset{covexercise}{chapter} + +\newcommand{\bx}{\begin{covexercise}} +\newcommand{\ex}{\end{covexercise}} + +\@ifundefined{exercise}{% + \newenvironment{exercise}{\begin{covexercise}}{\end{covexercise}} +}{% +\ifforceredef + \renewenvironment{exercise}{\begin{covexercise}}{\end{covexercise}} + \cov@warning{The exercise environment was already defined. Redefining it.} +\else + \cov@warning{The exercise environment was already defined.^^J + Covington does not touch it.^^J + Use covexercise if you want to access covington's^^J + version, or use the force package option.} +\fi +} \@ifundefined{reflist}{ \newenvironment{reflist}{\begin{list}{}% @@ -496,7 +620,7 @@ % defined. Permits using uga.sty with covingtn.sty. \newcommand{\sentence}[1] - {\begin{flushleft}{\it #1}\end{flushleft}} + {\begin{flushleft}{\cov@emphasized #1}\end{flushleft}} \newcommand{\either}[2] { |