texlive[64241] Master/texmf-dist: covington (30aug22)

commits+karl at tug.org commits+karl at tug.org
Tue Aug 30 21:52:05 CEST 2022


Revision: 64241
          http://tug.org/svn/texlive?view=revision&revision=64241
Author:   karl
Date:     2022-08-30 21:52:05 +0200 (Tue, 30 Aug 2022)
Log Message:
-----------
covington (30aug22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/covington/README
    trunk/Master/texmf-dist/doc/latex/covington/covington.pdf
    trunk/Master/texmf-dist/doc/latex/covington/covington.tex
    trunk/Master/texmf-dist/tex/latex/covington/covington.sty

Modified: trunk/Master/texmf-dist/doc/latex/covington/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/covington/README	2022-08-30 19:51:52 UTC (rev 64240)
+++ trunk/Master/texmf-dist/doc/latex/covington/README	2022-08-30 19:52:05 UTC (rev 64241)
@@ -31,6 +31,11 @@
 
 == CHANGES ==
 
+* Version 2.8 (2022-08-30):
+        - Add  Add ownfncounter and ownfncounter* options to allow for separate counting
+          of examples in footnotes. The starred option resets the counter at each footnote.
+        -  Add preamble option to example environment.
+
 * Version 2.7 (2021-09-01):
         - Add postamble gloss macro option for arbitrary text that is appended to the free
           translation line (after closing quotation marks).

Modified: trunk/Master/texmf-dist/doc/latex/covington/covington.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/covington/covington.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/covington/covington.tex	2022-08-30 19:51:52 UTC (rev 64240)
+++ trunk/Master/texmf-dist/doc/latex/covington/covington.tex	2022-08-30 19:52:05 UTC (rev 64241)
@@ -94,10 +94,10 @@
 %
 % Titling
 %
-\def\pversion{Version 2.7}
-\def\pdate{September 1, 2021}
+\def\pversion{Version 2.8}
+\def\pdate{August 30, 2022}
 
-\title{\textbf{The \cvt\ Package\\Macros for Linguistics}}
+\title{\textbf{The \cvt\ Package\\\Large Macros for Linguistics}}
 \author{Michael A. Covington \and J\"urgen Spitzm\"uller\thanks{Current maintainer.
 		Please report issues via \protect\url{https://github.com/jspitz/covington}}}
 
@@ -160,6 +160,16 @@
 	in the same	paper, you get a single continuous series of numbers. While some people (including the original author of this package)
 	consider this a feature, others might prefer to number equations and linguistic examples separately. If you count to the latter sort,
 	use this option.
+
+\item{\joption{ownfncounter}:} Use a separate counter for numbered examples in footnotes.
+
+	By default, \cvt\ numbers examples in footnotes in sequence with the numbering used in the main text. With this option,
+	examples in footnotes get a different numbering. This uses by default roman numbering (see sec.~\ref{sec:custno} on how
+	to change this) and is incremented throughout the whole footnote apparatus.
+
+\item{\joption{ownfncounter*}:} Same as \joption{ownfncounter}, except that this variant resets the counter at each footnote
+	(similar to \textsf{linguex} and \textsf{gb4e}).
+
 \end{description}
 %
 Please note the following package-related caveats:
@@ -270,6 +280,16 @@
 \end{example}
 The example can be of any length; it can consist of many lines (separated by \verb"\\"), or even whole paragraphs.
 
+The \jenv{example} environment provides the following option:
+
+\begin{description}
+	\item[\joption{preamble=\{\jparam{arbitrary text}\}}] Arbitrary text that is inserted on an own line
+	after the example number (preceding the actual example text). This might be useful, for instance,
+	to give context information, to specify the language or the source in case of cited examples.
+	The advantage over just adding a line manually in the example is that you can globally set the markup
+	(see sec.~\ref{sec:custno}).
+\end{description}
+%
 If you need more space between the example number and the text, you can increase it by means of
 the length \jcsmacro{examplenumbersep} (which is preset to \texttt{0pt}). Doing \lstinline|\setlength\examplenumbersep{1em}|,
 for instance, will increase the space by 1\,em (negative values will decrease the space accordingly).
@@ -308,9 +328,9 @@
 \subsection[The \texttt{examples} environment]{The \jenv{examples} environment}\label{sec:exs}
 
 To display a series of examples together, each with its own example 
-number, use \jenv{examples} (or \jenv{covexamples}) instead of \jenv{example} or \jenv{covexample}.  The only 
-difference is that there can be more than one example, and each of them 
-has to be introduced by \jfcsmacro{item}, like this:
+number, use \jenv{examples} (or \jenv{covexamples}) instead of \jenv{example} or \jenv{covexample}.
+The only drawback is that there is no \joption{preamble} option. On the other hand, there can be more
+than one example with this environment, and each of them has to be introduced by \jfcsmacro{item}, like this:
 \begin{lstlisting}
 \begin{examples}
 \item This is the first sentence.
@@ -329,6 +349,7 @@
 \item This is the first sentence.
 \item This is the second sentence.
 \end{examples}
+%
 As for \jenv{example}, \cvt\ checks if there is already an \jenv{examples} environment defined,
 and if this is the case, \cvt\ does not define its own one. The alias environment \jenv{covexamples}
 is always available as a fallback. If you use the package option \joption{force}, \cvt\ will override
@@ -431,7 +452,12 @@
 \end{lstlisting}
 %
 with the variable \texttt{\#1} representing the number.
-
+If you use \joption{ownfncounter}, example numbers in footnote use this macro as well. If you want
+a different display, you can redefine
+\begin{lstlisting}[moretexcs={covexfnnumber}]
+\newcommand*\covexfnnumber[1]{\covennumber{#1}}
+\end{lstlisting}
+%
 In the same vein, you can customize the display of the subexample letter by redefining
 the macro \jcsmacro{covsubexnumber}, which has the following default definition:
 \begin{lstlisting}[moretexcs={covsubexnumber}]
@@ -453,11 +479,22 @@
 \jcsmacro{covexamplenofs}, which defaults to \jfcsmacro{normalfont}. Of course you are free to redefine this as well,
 if you wish do to so.
 
-Finally, you can customize the markup of the sub-example preamble text by redefining the macro
-\jcsmacro{subexpreamblefs}, which also defaults to \jfcsmacro{normalfont}. To have it italicized, analogously do:
+Finally, you can customize the markup of the example and sub-example preamble text by redefining the macro
+\jcsmacro{expreamblefs} or \jcsmacro{subexpreamblefs}, which also both default to \jfcsmacro{normalfont}.
+To have them italicized, analogously do:
 \begin{lstlisting}[moretexcs={\subexpreamblefs}]
 \renewcommand*{\subexpreamblefs}{\itshape}
 \end{lstlisting}
+or
+\begin{lstlisting}[moretexcs={\expreamblefs}]
+\renewcommand*{\expreamblefs}{\itshape}
+\end{lstlisting}
+%
+The separate footnote example number with \joption{ownfncounter} uses roman numbering by default.
+This can be changed by redefining
+\begin{lstlisting}[moretexcs={\thecovfnex}]
+\renewcommand{\thecovfnex}{\roman{covfnex}}
+\end{lstlisting}
 
 
 \subsection{Referring to examples}\label{sec:ref}
@@ -1128,6 +1165,14 @@
 
 \section{Release history}
 
+\subsection*{2.8 (2022 August 30)}
+
+\begin{itemize}
+	\item Add \joption{ownfncounter} and \joption{ownfncounter*} options to allow for separate counting of examples
+	in footnotes. The starred option resets the counter at each footnote. See sec.~\ref{sec:intro}.
+	\item Add \joption{preamble} option to \jenv{example} environment. See sec.~\ref{expl}.
+\end{itemize}
+
 \subsection*{2.7 (2021 September 1)}
 
 \begin{itemize}

Modified: trunk/Master/texmf-dist/tex/latex/covington/covington.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/covington/covington.sty	2022-08-30 19:51:52 UTC (rev 64240)
+++ trunk/Master/texmf-dist/tex/latex/covington/covington.sty	2022-08-30 19:52:05 UTC (rev 64241)
@@ -42,8 +42,8 @@
 %%% Metadata
 %%%
 
-\def\filedate{2021/09/01}
-\def\fileversion{2.7}
+\def\filedate{2022/08/30}
+\def\fileversion{2.8}
 \def\filename{covington.sty}
 
 % Force redefinition of environments?
@@ -54,6 +54,10 @@
 \newif\ifnoglossbreaks\noglossbreaksfalse
 % Use own example counter
 \newif\ifownexcounter\ownexcounterfalse
+% Use separate counter in footnote
+\newif\ifownfnexcounter\ownfnexcounterfalse
+% Reset separate counter in footnote
+\newif\ifresetownfnexcounter\resetownfnexcounterfalse
 
 \@ifundefined{ProvidesPackage}{%
 \typeout{* covington.sty : Covington's linguistic macros, \fileversion\ \filedate *}
@@ -64,6 +68,8 @@
 \DeclareOption{keeplayout}{\tweaklayoutfalse}
 \DeclareOption{noglossbreaks}{\noglossbreakstrue}
 \DeclareOption{owncounter}{\ownexcountertrue}
+\DeclareOption{ownfncounter}{\ownfnexcountertrue}
+\DeclareOption{ownfncounter*}{\ownfnexcountertrue\resetownfnexcountertrue}
 \ProcessOptions
 }
 
@@ -166,6 +172,19 @@
 \newcommand*\@@exampleno{\ifownexcounter\thecovex\else\theequation\fi}
 \newcommand*\exampleno{\@ifstar{\@@exampleno}{\@exampleno}}
 
+\newif\ifcov at infootnote\cov at infootnotefalse
+\ifownfnexcounter
+  % Check whether we are in a footnote
+  \AddToHook{cmd/@footnotetext/before}{\cov at infootnotetrue}
+  \AddToHook{cmd/@footnotetext/after}{\cov at infootnotefalse}
+  \ifresetownfnexcounter
+    \newcounter{covfnex}[footnote]
+  \else
+    \newcounter{covfnex}
+  \fi
+  \renewcommand{\thecovfnex}{\roman{covfnex}}
+\fi
+
 %%%
 %%% The 'example' environment
 %%%
@@ -200,10 +219,18 @@
 %            with packages/classes that roll their own example environment
 %            (such as beamer).
 
-\newenvironment{covexample}{\begin{covexamples}\item}{\end{covexamples}}
+% 2022-08-20 (v. 2.8): optional preceding example text
+\define at key{cov at ex}{preamble}{\def\cov at xp{#1}}
+\newcommand*\expreamblefs{\normalfont}
 
+\newenvironment{covexample}[1][]{%
+    \ifx#1\empty\else\setkeys{cov at ex}{#1}\fi%
+    \begin{covexamples}
+       \item\@ifundefined{cov at xp}{}{\bgroup\expreamblefs\cov at xp\egroup\par}% insert preamble if given
+}{\end{covexamples}}
+
 \@ifundefined{example}{%
-  \newenvironment{example}{\begin{covexample}}{\end{covexample}}
+  \newenvironment{example}[1][]{\begin{covexample}[#1]}{\end{covexample}}
 }{%
 \ifforceredef
   \renewenvironment{example}{\begin{covexample}}{\end{covexample}}
@@ -249,27 +276,44 @@
 \setlength\exampleind{0pt}
 
 \newcommand*\covexnumber[1]{(#1)}
+\newcommand*\covexnumberfn[1]{\covexnumber{#1}}
 
 \newenvironment{covexamples}%         % define "example" environment
 {%
-\begin{list}{\covexamplenofs\covexnumber{\@@exampleno}}%
+\begin{list}%
 {%
-\addtolength{\labelwidth}{\examplenumbersep}%
-\addtolength{\leftmargin}{\examplenumbersep}%
-\addtolength{\leftmargin}{\exampleind}%
-\ifownexcounter
-  \setcounter{covexsave}{\arabic{covex}}%
-  \usecounter{covex}%                          % sets it to zero, unwantedly
-  \setcounter{covex}{\arabic{covexsave}}%   % restores previous value
-\else
-  \setcounter{covexsave}{\arabic{equation}}%
-  \usecounter{equation}%                          % sets it to zero, unwantedly
-  \setcounter{equation}{\arabic{covexsave}}%   % restores previous value
-\fi
-\setlength{\listparindent}{0pt}%
-\def\makelabel##1{##1\hfil}%       % put labels flushleft in space available
+  \covexamplenofs% font
+  \ifcov at infootnote
+    \covexnumberfn{\thecovfnex}%
+  \else
+    \covexnumber{\@@exampleno}%
+  \fi
 }%
-\raggedright\covexamplefs}%     % text is flushleft, not justified
+{%
+  \addtolength{\labelwidth}{\examplenumbersep}%
+  \addtolength{\leftmargin}{\examplenumbersep}%
+  \addtolength{\leftmargin}{\exampleind}%
+  \ifcov at infootnote
+    \setcounter{covexsave}{\arabic{covfnex}}%
+    \usecounter{covfnex}%
+    \setcounter{covfnex}{\arabic{covexsave}}%
+  \else
+    \ifownexcounter
+      \setcounter{covexsave}{\arabic{covex}}%
+      \usecounter{covex}%                          % sets it to zero, unwantedly
+      \setcounter{covex}{\arabic{covexsave}}%   % restores previous value
+    \else
+      \setcounter{covexsave}{\arabic{equation}}%
+      \usecounter{equation}%                          % sets it to zero, unwantedly
+      \setcounter{equation}{\arabic{covexsave}}%   % restores previous value
+    \fi
+  \fi
+  \setlength{\listparindent}{0pt}%
+  \def\makelabel##1{##1\hfil}%       % put labels flushleft in space available
+}%
+  \raggedright%  text is flushleft, not justified
+  \covexamplefs%
+}%
 {\end{list}}
 
 \@ifundefined{examples}{%



More information about the tex-live-commits mailing list.