summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/covington
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-12-10 22:57:48 +0000
committerKarl Berry <karl@freefriends.org>2018-12-10 22:57:48 +0000
commitabdd389db8b3e93f1620166b736970d77a459fbd (patch)
treea31df1d774d385e17b12196c6ca7eda1d5c8cec4 /Master/texmf-dist/tex/latex/covington
parentcdde74fc51a74159b464afaf5a1570117d90c858 (diff)
covington (10dec18)
git-svn-id: svn://tug.org/texlive/trunk@49376 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/covington')
-rw-r--r--Master/texmf-dist/tex/latex/covington/covington.sty165
1 files changed, 162 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/latex/covington/covington.sty b/Master/texmf-dist/tex/latex/covington/covington.sty
index 4d40d34bd4a..437fb55395c 100644
--- a/Master/texmf-dist/tex/latex/covington/covington.sty
+++ b/Master/texmf-dist/tex/latex/covington/covington.sty
@@ -42,8 +42,8 @@
%%% Metadata
%%%
-\def\filedate{2018/12/07}
-\def\fileversion{1.8}
+\def\filedate{2018/12/10}
+\def\fileversion{2.0}
\def\filename{covington.sty}
% Force redefinition of environments?
@@ -61,6 +61,11 @@
\ProcessOptions
}
+%
+% Required packages
+%
+\RequirePackage{xkeyval}
+
% Macro to issue warnings
\newcommand\cov@warning[1]{%
\@ifundefined{PackageWarning}{%
@@ -578,6 +583,145 @@
\egroup % matches \bgroup in \gloss
}
+% V. 2.0: enquotable translation line
+\newcommand*\glosslinetrans[1]{\covenquote{#1}}
+\newcommand*\glot[1]{%
+ \def\tempx{#1}%
+ \ifx\tempx\empty\gln
+ \else\glt\glosslinetrans{#1}\fi%
+}
+
+% V. 2.0: More convenient gloss macros
+%
+% Key-val options for the macros
+%
+% 1. ex=<true|false>
+\newif\ifgexample\gexamplefalse
+\newif\ifggexample\ggexamplefalse
+\define@boolkey+{covington}{ex}[true]{%
+ \ifKV@covington@ex
+ \gexampletrue
+ \else
+ \gexamplefalse
+ \fi
+}{%
+ \cov@warning{unknown env value '#1' in gloss macro}%
+}
+\define@boolkey+{gcovington}{ex}[true]{%
+ \ifKV@gcovington@ex
+ \ggexampletrue
+ \else
+ \ggexamplefalse
+ \fi
+}{%
+ \cov@warning{unknown env value '#1' in setglossoptions}%
+}
+\newif\ifgtright\gtrightfalse
+\newif\ifggtright\ggtrightfalse
+%
+% 2. tlb=<true|false>
+\define@boolkey+{covington}{tlr}[true]{%
+ \ifKV@covington@tlr
+ \gtrighttrue
+ \else
+ \gtrightfalse
+ \fi
+}{%
+ \cov@warning{unknown tlr value '#1' in gloss macro}%
+}
+\define@boolkey+{gcovington}{tlr}[true]{%
+ \ifKV@gcovington@tlr
+ \ggtrighttrue
+ \else
+ \ggtrightfalse
+ \fi
+}{%
+ \cov@warning{unknown tlr value '#1' in setglossoptions}%
+}
+%
+% 3. font settings for gloss line i, ii, iii
+\define@key{covington}{fsi}{\def\lglosslineone{#1}}
+\define@key{covington}{fsii}{\def\lglosslinetwo{#1}}
+\define@key{covington}{fsiii}{\def\lglosslinethree{#1}}
+\define@key{gcovington}{fsi}{\def\glosslineone{#1}}
+\define@key{gcovington}{fsii}{\def\glosslinetwo{#1}}
+\define@key{gcovington}{fsiii}{\def\glosslinethree{#1}}
+%
+% General setting option
+\newcommand*\setglossoptions[1]{\setkeys{gcovington}{#1}}
+%
+% 1. \digloss[<opts>]{<line 1>}{<line 2>}{<translation>}
+\newcommand*\digloss[4][\empty]{%
+ \ifggexample
+ \setkeys{covington}{ex=true}
+ \else
+ \setkeys{covington}{ex=false}
+ \fi%
+ \ifggtright
+ \setkeys{covington}{tlr=true}
+ \else
+ \setkeys{covington}{tlr=false}
+ \fi%
+ \ifx#1\empty\else\setkeys{covington}{#1}\fi%
+ \ifgexample
+ \begin{covexample}
+ \fi%
+ \@ifundefined{lglosslineone}{}{\def\glosslineone{\lglosslineone}}%
+ \@ifundefined{lglosslinetwo}{}{\def\glosslinetwo{\lglosslinetwo}}%
+ \@ifundefined{lglosslinethree}{}{\def\glosslinethree{\lglosslinethree}}%
+ \xgll #2\xgle
+ #3\xgle
+ \ifgtright
+ \gln #4
+ \else
+ \glot{#4}
+ \fi
+ \glend
+ \ifgexample
+ \end{covexample}
+ \fi%
+ \let\lglosslineone\relax%
+ \let\lglosslinetwo\relax%
+ \let\lglosslinethree\relax%
+}
+
+% 2. \trigloss[<opts>]{<line 1>}{<line 2>}{<line 3>}{<translation>}
+\newcommand\trigloss[5][\empty]{%
+ \ifggexample
+ \setkeys{covington}{ex=true}
+ \else
+ \setkeys{covington}{ex=false}
+ \fi%
+ \ifggtright
+ \setkeys{covington}{tlr=true}
+ \else
+ \setkeys{covington}{tlr=false}
+ \fi%
+ \ifx#1\empty\else\setkeys{covington}{#1}\fi%
+ \ifgexample
+ \begin{covexample}
+ \fi%
+ \@ifundefined{lglosslineone}{}{\def\glosslineone{\lglosslineone}}%
+ \@ifundefined{lglosslinetwo}{}{\def\glosslinetwo{\lglosslinetwo}}%
+ \@ifundefined{lglosslinethree}{}{\def\glosslinethree{\lglosslinethree}}%
+ \xglll #2\xgle
+ #3\xgle
+ #4\xgle
+ \ifgtright
+ \gln #5
+ \else
+ \glot{#5}
+ \fi
+ \glend
+ \ifgexample
+ \end{covexample}
+ \fi%
+ \let\lglosslineone\relax%
+ \let\lglosslinetwo\relax%
+ \let\lglosslinethree\relax%
+}
+
+
%\def\gloss % raw TeX macro for 2 aligned lines
% {\bgroup
% \catcode`\^^M=12
@@ -800,8 +944,23 @@
% Modified 1992 Nov 8 to skip defining reflist if reflist is already
% defined. Permits using uga.sty with covingtn.sty.
+% V. 2.0: Add macro for font settings customization
+\newcommand*\sentencefs{\cov@emphasized}
+
\newcommand{\sentence}[1]
- {\begin{flushleft}{\cov@emphasized #1}\end{flushleft}}
+ {\begin{flushleft}{\sentencefs #1}\end{flushleft}}
+
+% V. 2.0: Further semantic markup
+\providecommand*\lexp[1]{\textit{#1}}
+\providecommand*\lcon[1]{\textsc{#1}}
+\newcommand*\covenquote[1]{\textquoteleft #1\textquoteright}
+\providecommand*\lmean[1]{\covenquote{#1}}
+
+\AtBeginDocument{%
+ \@ifundefined{enquote}{}{%
+ \renewcommand\covenquote[1]{\enquote*{#1}}
+ }
+}
\newcommand{\either}[2]
{