summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/nnext/nnext.sty
blob: bbd66120f72b4950337ccc39806cff6190be4dbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
%%
%% This is file `nnext.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% nnext.dtx  (with options: `package')
%%     This is a generated file.
%%     Copyright (C) 2020 by Nicholas LaCara
%%     This file 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 2005/12/01 or later.
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{nnext}
   [2020/10/06 v0.0 The nnext package]
\RequirePackage{xspace}
\RequirePackage{ifthen}
\newboolean{emulatelinguex}
\setboolean{emulatelinguex}{false}
\newboolean{emulateexpex}
\setboolean{emulateexpex}{false}
\newboolean{parentheses}
\setboolean{parentheses}{true}
\DeclareOption{linguex}{
    \setboolean{emulatelinguex}{true}
}
\DeclareOption{expex}{
    \setboolean{emulateexpex}{true}
    \setboolean{emulatelinguex}{false}
    \setboolean{parentheses}{false}
}
\DeclareOption{noparens}{
    \setboolean{parentheses}{false}
}
\ExecuteOptions{linguex}
\ProcessOptions\relax
\@ifpackageloaded{langsci-gb4e}%
  {\newcommand{\@countername}{equation}}
  {\@ifpackageloaded{gb4e-emulate}%
    {\newcommand{\@countername}{exei}}
    {\@ifpackageloaded{gb4e}%
      {\newcommand{\@countername}{exx}}
      {\PackageWarningNoLine{nnext}{No known compatible %
        example package loaded! Examples may not be correctly %
        referenced, or there may be fatal errors}%
        \newcommand{\@countername}{exx}}}}%
\ifthenelse{\boolean{emulatelinguex}%
            \AND \boolean{parentheses}}{%
    \newcommand{\@lparens}{(}
    \newcommand{\@rparens}{)}
    \newcommand{\@afterspace}{\xspace}}{%
    \newcommand{\@lparens}{}
    \newcommand{\@rparens}{}
    \newcommand{\@afterspace}{}}%
\newcounter{tmpcounter}
\newcommand{\settmpcounter}[1]{%
\setcounter{tmpcounter}{\value{\@countername}}%
    \addtocounter{tmpcounter}{#1}}
\newcommand{\printtmpcounter}[1]{\settmpcounter{#1}%
\@lparens\thetmpcounter\@rparens\@afterspace}
\newcommand{\@Next}{\printtmpcounter{1}}
\newcommand{\@NNext}{\printtmpcounter{2}}
\newcommand{\@Last}{\printtmpcounter{0}}
\newcommand{\@LLast}{\printtmpcounter{-1}}
\newcommand{\@LLLast}{\printtmpcounter{-2}}
\ifthenelse{\boolean{emulatelinguex}}{%
    \newcommand{\Next}{\@Next}
    \newcommand{\NNext}{\@NNext}
    \newcommand{\Last}{\@Last}
    \newcommand{\LLast}{\@LLast}}{}
\ifthenelse{\boolean{emulateexpex}}{%
    \newcommand{\nextx}{\@Next}
    \newcommand{\anextx}{\@NNext}
    \newcommand{\lastx}{\@Last}
    \newcommand{\blastx}{\@LLast}
    \newcommand{\bblastx}{\@LLLast}}{}
\endinput
%%
%% End of file `nnext.sty'.