# -*- mode: Perl -*-
# /=====================================================================\ #
# | neurips_2019.sty                                                    | #
# | Implementation for LaTeXML                                          | #
# |=====================================================================| #
# | Part of LaTeXML:                                                    | #
# |  Public domain software, produced as part of work done by the       | #
# |  United States Government & not subject to copyright in the US.     | #
# |---------------------------------------------------------------------| #
# | Bruce Miller <bruce.miller@nist.gov>                        #_#     | #
# | http://dlmf.nist.gov/LaTeXML/                              (o o)    | #
# \=========================================================ooo==U==ooo=/ #
package LaTeXML::Package::Pool;
use strict;
use warnings;
use LaTeXML::Package;

#======================================================================
RequirePackage('geometry');
RequirePackage('lineno');
# certain package options may induce \linenumbers as active, ignored for now.

DeclareOption('final',    sub { AssignValue('neurips_final'    => 1, 'global'); });
DeclareOption('preprint', sub { AssignValue('neurips_preprint' => 1, 'global'); });
DeclareOption('nonatbib', sub { AssignValue('neurips_nonatbib' => 1, 'global'); });

ProcessOptions();

if (!LookupValue('neurips_nonatbib')) {
  RequirePackage('natbib'); }

DefMacro('\AND',                                   Tokens());
DefMacro('\And',                                   Tokens());
DefMacro('\bottomfraction',                        Tokens());
DefMacro('\patchAmsMathEnvironmentForLineno',      Tokens());
DefMacro('\patchBothAmsMathEnvironmentsForLineno', Tokens());
DefMacroI('\subsubsubsection', undef, '\@startsection{subsubsubsection}{4}{}{}{}{}', locked => 1);
DefMacro('\textfraction', Tokens());
DefMacro('\topfraction',  Tokens());
#======================================================================

## Additions for neurips 2022:
# These intenrals need to be changed every year, which we can't emulate unless we create all versioned
# neurips_2019.sty, ... neurips_2022.sty files
# since we currently aren't stamping them (i.e. they won't get used), just leaving them here
DefMacro('\@neuripsordinal',  '36th');
DefMacro('\@neuripsyear',     '2022');
DefMacro('\@neuripslocation', 'New Orleans');

DefMacro('\acksection', '\section*{Acknowledgments and Disclosure of Funding}');
DefEnvironment('{ack}', '#body',
  beforeDigest => sub { $_[0]->getGullet->unread(T_CS('\acksection')); return; });

DefMacro('\answerYes[]',  '\textcolor{blue}{[Yes] #1}');
DefMacro('\answerNo[]',   '\textcolor{orange}{[No] #1}');
DefMacro('\answerNA[]',   '\textcolor{gray}{[N/A] #1}');
DefMacro('\answerTODO[]', '\textcolor{red}{\bf [TODO]}');

DefEnvironment('{hide}', '');

1;