diff options
author | Karl Berry <karl@freefriends.org> | 2022-08-30 19:52:05 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-08-30 19:52:05 +0000 |
commit | fe9f9c9c1780102eff942c8319f85872d2dd3e91 (patch) | |
tree | 8a586e9c91ddfff5ee6c7bbb3d3533f43df320ea /Master/texmf-dist/tex | |
parent | d838c20c4fdae5db1e2fe6e3e42d17926869fc34 (diff) |
covington (30aug22)
git-svn-id: svn://tug.org/texlive/trunk@64241 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/covington/covington.sty | 84 |
1 files changed, 64 insertions, 20 deletions
diff --git a/Master/texmf-dist/tex/latex/covington/covington.sty b/Master/texmf-dist/tex/latex/covington/covington.sty index 687e496155a..fd1921f1820 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{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@infootnote\cov@infootnotefalse +\ifownfnexcounter + % Check whether we are in a footnote + \AddToHook{cmd/@footnotetext/before}{\cov@infootnotetrue} + \AddToHook{cmd/@footnotetext/after}{\cov@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@key{cov@ex}{preamble}{\def\cov@xp{#1}} +\newcommand*\expreamblefs{\normalfont} + +\newenvironment{covexample}[1][]{% + \ifx#1\empty\else\setkeys{cov@ex}{#1}\fi% + \begin{covexamples} + \item\@ifundefined{cov@xp}{}{\bgroup\expreamblefs\cov@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@infootnote + \covexnumberfn{\thecovfnex}% + \else + \covexnumber{\@@exampleno}% + \fi +}% +{% + \addtolength{\labelwidth}{\examplenumbersep}% + \addtolength{\leftmargin}{\examplenumbersep}% + \addtolength{\leftmargin}{\exampleind}% + \ifcov@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% }% -\raggedright\covexamplefs}% % text is flushleft, not justified {\end{list}} \@ifundefined{examples}{% |