diff options
author | Karl Berry <karl@freefriends.org> | 2024-10-28 20:26:25 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-10-28 20:26:25 +0000 |
commit | bdbd1e76f0af9dae60e2ba6c32032165b1b2df18 (patch) | |
tree | 4f5f16b4980e48f4e754d4d431180fae4a67ee04 /Master/texmf-dist/tex/latex | |
parent | 1380e2f7c6c3838a87c48736cbebe585ce2d9775 (diff) |
gb4e-next (28oct24)
git-svn-id: svn://tug.org/texlive/trunk@72692 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/gb4e-next/gb4e-next.sty | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/gb4e-next/gb4e-next.sty b/Master/texmf-dist/tex/latex/gb4e-next/gb4e-next.sty new file mode 100644 index 00000000000..5974f21feb7 --- /dev/null +++ b/Master/texmf-dist/tex/latex/gb4e-next/gb4e-next.sty @@ -0,0 +1,58 @@ +\def\gbnext@version{0.5} +\def\gbnext@date{2024-10-27} +% The gb4e-next package provides gb4e users two relative example reference commands. \Next refers to the next +% example in the document and \Prev refers to the previous example. No explicit label command is required. +% +% Copyright 2024 by Alan Munn +% +% This package may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or 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 2005/12/01 or later. +% +% This package has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this package is Alan Munn. +% +% This package consists of the file gb4e-next.sty and documentation files +% gb4e-next.tex and gb4e-next.pdf. +% +% This package is currently experimental. Use at your own risk. +% +\ProvidesPackage{gb4e-next}[\gbnext@date\ Provides relative example reference to gb4e v. \gbnext@version ] +\RequirePackage{gb4e} +\DeclareKeys[gb4e-next]{ +fn.store = \gbnext@fnformat +} +\SetKeys[gb4e-next]{fn=roman} +\ProcessKeyOptions[gb4e-next] +\newcounter{gbnext@tmpcnt} +\NewDocumentCommand{\Next}{o}{% +\IfNoValueTF{#1}% +{\save@exx}% +{\save@exx[#1]}% +\stepcounter{gbnext@tmpcnt}\printExNo} +\NewDocumentCommand{\Prev}{o}{% +\IfNoValueTF{#1}% +{\save@exx}% +{\save@exx[#1]}% +\printExNo} +\NewDocumentCommand{\save@exx}{o}{% +\if@noftnote% +\setcounter{gbnext@tmpcnt}{\value{exx}}% +\IfNoValueTF{#1}% +{\def\thegbnext@tmpcnt{\arabic{gbnext@tmpcnt}}}% default format of printed number +{\def\thegbnext@tmpcnt{\csname#1\endcsname{gbnext@tmpcnt}}}% +\else% +\setcounter{gbnext@tmpcnt}{\value{fnx}}% +\IfNoValueTF{#1}% +{\def\thegbnext@tmpcnt{\csname\gbnext@fnformat\endcsname{gbnext@tmpcnt}}}% default format of printed number +{\def\thegbnext@tmpcnt{\csname#1\endcsname{gbnext@tmpcnt}}}% +\fi} +\newcommand\printExNo{(\thegbnext@tmpcnt)} +\endinput + + |