%%
%% 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'.
