#  /====================================================================\
# | mn2e.cls for LaTeXML                                                 |
# | Generated by texscan --stub --base=article.cls mn2e.cls              |
#  >====================================================================<
# | Released to public domain.                                           |
# | Bruce Miller <bruce.miller@nist.gov>                                 |
# | http://dlmf.nist.gov/LaTeXML/                                        |
#  \====================================================================/
package LaTeXML::Package::Pool;
use strict;
use LaTeXML::Package;


if(LookupValue('@usedcolumn')){
  RequirePackage('dcolumn'); }
if(LookupValue('@usenatbib')){
  RequirePackage('natbib'); }
if(LookupValue('@usegraphicx')){
  RequirePackage('graphicx'); }

#======================================================================
# Front Matter

DefMacro('\title[]{}',
	 '\ifx.#1.\else\@add@frontmatter{ltx:toctitle}{#1}\fi'
	 .'\@add@frontmatter{ltx:title}{#2}');
DefMacro('\author[]{}', sub { andSplit(T_CS('\@author'),$_[2]); });

DefMacro('\newauthor',Tokens()); # ????

DefMacro('\journal{}',    '\@add@frontmatter{ltx:note}[role=journal]{#1}');
DefMacro('\volume{}',     '\@add@frontmatter{ltx:note}[role=volume]{#1}');
DefMacro('\pubyear{}',    '\@add@frontmatter{ltx:note}[role=pubyear]{#1}');
DefMacro('\microfiche{}', '\@add@frontmatter{ltx:note}[role=microfiche]{#1}');
DefMacro('\pagerange{}',  '\@add@frontmatter{ltx:note}[role=pagerange]{#1}');

# Editorial comments (?)  
DefConstructor('\BSLquery{}',"<ltx:note class='query'>#1</ltx:note>");
DefConstructor('\aquery{}',  "<ltx:note class='query'>#1</ltx:note>");
DefConstructor('\tquery{}',  "<ltx:note class='query'>#1</ltx:note>");
DefEnvironment('{query}',    "<ltx:note class='query'>#body</ltx:note>");
DefConstructor('\authorquery{}{}',  "<ltx:note class='query'>#1: #2</ltx:note>");

DefEnvironment('{keywords}','',
 	       afterDigest=> sub {
		 my $frontmatter = LookupValue('frontmatter');
 		 push(@{$$frontmatter{'ltx:classification'}},
 		      ['ltx:classification',{role=>'keywords'},@LaTeXML::LIST]);
 		 return; });
DefMacro('\nokeywords',Tokens());

#======================================================================
DefMacro('\eqsecnum',
	 '\@addtoreset{equation}{section}'
	 .'\def\theequation{\arabic{section}.\arabic{equation}}');
DefMacro('\eqsubsecnum',
	 '\@addtoreset{equation}{subsection}'
	 .'\def\theequation{\arabic{subsection}.\arabic{equation}}');

#======================================================================
# Math & Symbols
DefConstructor('\mn@boldsymbol{}', '#1', bounded=>1, requireMath=>1, font=>{forcebold=>1});

DefMacroI('\balpha',undef,'\mn@boldsymbol{\alpha}');
DefMacroI('\bbeta',undef,'\mn@boldsymbol{\beta}');
DefMacroI('\bgamma',undef,'\mn@boldsymbol{\gamma}');
DefMacroI('\bdelta',undef,'\mn@boldsymbol{\delta}');
DefMacroI('\bepsilon',undef,'\mn@boldsymbol{\epsilon}');
DefMacroI('\bzeta',undef,'\mn@boldsymbol{\zeta}');
DefMacroI('\btheta',undef,'\mn@boldsymbol{\theta}');
DefMacroI('\biota',undef,'\mn@boldsymbol{\iota}');
DefMacroI('\bkappa',undef,'\mn@boldsymbol{\kappa}');
DefMacroI('\blambda',undef,'\mn@boldsymbol{\lambda}');
DefMacroI('\bmu',undef,'\mn@boldsymbol{\mu}');
DefMacroI('\bnu',undef,'\mn@boldsymbol{\nu}');
DefMacroI('\bxi',undef,'\mn@boldsymbol{\xi}');
DefMacroI('\bpi',undef,'\mn@boldsymbol{\pi}');
DefMacroI('\brho',undef,'\mn@boldsymbol{\rho}');
DefMacroI('\bsigma',undef,'\mn@boldsymbol{\sigma}');
DefMacroI('\btau',undef,'\mn@boldsymbol{\tau}');
DefMacroI('\bupsilon',undef,'\mn@boldsymbol{\upsilon}');
DefMacroI('\bphi',undef,'\mn@boldsymbol{\phi}');
DefMacroI('\bchi',undef,'\mn@boldsymbol{\chi}');
DefMacroI('\bpsi',undef,'\mn@boldsymbol{\psi}');
DefMacroI('\bomega',undef,'\mn@boldsymbol{\omega}');
DefMacroI('\bvarepsilon',undef,'\mn@boldsymbol{\varepsilon}');
DefMacroI('\bvartheta',undef,'\mn@boldsymbol{\vartheta}');
DefMacroI('\bvarrho',undef,'\mn@boldsymbol{\varrho}');
DefMacroI('\bvarsigma',undef,'\mn@boldsymbol{\varsigma}');
DefMacroI('\bvarphi',undef,'\mn@boldsymbol{\varphi}');
DefMacroI('\bvarpi',undef,'\mn@boldsymbol{\varpi}');

DefMacroI('\boldeta',undef,'\mn@boldsymbol{\eta}');


# Various degrees etc.
# Copied from aas_support
DefConstructor('\aas@@fstack{}',
	       "<ltx:XMApp role='POSTFIX'>"
	       .  "<ltx:XMTok role='SUPERSCRIPTOP' scriptpos='#scriptpos'/>"
	       .  "<ltx:XMTok>.</ltx:XMTok>"
	       .  "<ltx:XMWrap>#1</ltx:XMWrap>"
	       ."</ltx:XMApp>",
	       properties=>{scriptpos=>sub{ "mid".$_[0]->getBoxingLevel; }},
	       mode=>'math', bounded=>1);
DefMacro('\aas@fstack{}','\ensuremath{\aas@@fstack{#1}}');
DefMacro('\fd','\aas@fstack{d}');
DefMacro('\fh','\aas@fstack{h}');
DefMacro('\fm','\aas@fstack{m}');
DefMacro('\fs','\aas@fstack{s}');
DefMacro('\fdg','\aas@fstack{\circ}');
DefMacro('\farcm','\aas@fstack{\prime}');
DefMacro('\farcs','\aas@fstack{\prime\prime}');
DefMacro('\fp','\aas@fstack{p}');
DefConstructor('\degr',   UTF(0xB0));
DefConstructor('\arcmin',"\x{2032}");
DefConstructor('\arcsec',"\x{2033}");

DefConstructor('\squareforqed',
	       "?#isMath(<ltx:XMTok role='PUNCT'>\x{220E}</ltx:XMTok>)(\x{220E})");
Let(T_CS('\sq'),T_CS('\squareforeqd'));
Let(T_CS('\proofbox'),T_CS('\squareforeqd'));

DefConstructor('\sun',     "\x{2609}");
DefConstructor('\diameter',"\x{2300}");
DefConstructor('\earth',   "\x{2295}");

DefMath('\la',    "\x{2272}", role=>'RELOP', meaning=>'less-than-or-similar-to');
DefMath('\ga',    "\x{2273}", role=>'RELOP', meaning=>'greater-than-or-similar-to');
DefMath('\cor',   "\x{2258}", role=>'RELOP', meaning=>'corresonds-to');
DefMath('\sol',   "\x{2A9D}", role=>'RELOP', meaning=>'similar-to-or-less-than');
DefMath('\sog',   "\x{2A9E}", role=>'RELOP', meaning=>'similar-to-or-greater-than');
DefMath('\lse',   "\x{2A8D}", role=>'RELOP', meaning=>'less-than-or-similar-to-or-equal');
DefMath('\gse',   "\x{2A8E}", role=>'RELOP', meaning=>'greater-than-or-similar-to-or-equal');
DefMath('\leogr', "\x{2276}", role=>'RELOP', meaning=>'less-than-or-greater-than');
DefMath('\grole', "\x{2277}", role=>'RELOP', meaning=>'greater-than-or-less-than');
DefMath('\loa',   "\x{2A85}", role=>'RELOP', meaning=>'less-than-or-aproximately-equals');
DefMath('\goa',   "\x{2A86}", role=>'RELOP', meaning=>'greater-than-or-aproximately-equals');
DefMath('\lid',   "\x{2266}", role=>'RELOP', meaning=>'less-than-or-equals');
DefMath('\gid',   "\x{2267}", role=>'RELOP', meaning=>'greater-than-or-equals');

DefMath('\getsto', "\x{21C6}", role=>'ARROW');
DefMath('\leqslant',           "\x{2A7D}", role=>'RELOP',
	meaning=>'less-than-or-equals');
DefMath('\geqslant',           "\x{2A7E}", role=>'RELOP',
	meaning=>'greater-than-or-equals');
DefConstructor('\micron',UTF(0xB5)."m");

DefMacro('\rmn{}','\mathrm{#1}');
DefMacro('\romn{}','\mathrm{#1}');
DefMacro('\itl{}','\mathit{#1}');
DefMacro('\bld{}','\mathbf{#1}');
DefMacro('\textbfit{}','\textbf{\textit{#1}}');
DefMacro('\textbfss{}','\textbf{\textsf{#1}}');
DefMacro('\mathbfit{}','\textbf{\textit{#1}}');
DefMacro('\mathbfss{}','\textbf{\textsf{#1}}');
DefMacro('\bmath{}','\mn@boldsymbol{#1}'); # ?
Let(T_CS('\oldle'),T_CS('\le'));
Let(T_CS('\oldleq'),T_CS('\leq'));
Let(T_CS('\oldge'),T_CS('\ge'));
Let(T_CS('\oldgeq'),T_CS('\geq'));

Let(T_CS('\upi'),T_CS('\pi'));
Let(T_CS('\umu'),T_CS('\mu'));
Let(T_CS('\upartial'),T_CS('\partial'));

#======================================================================
# Table, Figure, etc.

DefMacro('\contcaption',      '\caption{continued}');

DefEnvironment('{proof}',
	       '<ltx:proof><ltx:title>Proof</ltx:title>#body</ltx:proof>');
DefEnvironment('{lquote}','<ltx:quote>#body</ltx:quote>');
#======================================================================
# Random..

DefMacro('\bsp','');
DefMacro('\loadboldmathitalic','');
DefMacro('\loadboldgreek','');
DefMacro('\fixfootnotes','');
DefMacro('\bibtitle',"References");
DefMacro('\bibheadtitle',"REFERENCES");

DefMacro('\makeRLlabel{}', '#1');
DefMacro('\makeRRlabel{}', '#1');
DefMacro('\makenewlabel{}','#1');
DefMacro('\boxit{}','#1');

DefRegister('\smallindent'=>Glue('1.5em'));
Let(T_CS('\fullhline'),T_CS('\hline'));
RawTeX('\newif\ifCUPmtlplainloaded');
RawTeX('\newif\iffirstta');
DefMacro('\sevensize','\small');
DefMacro('\plate','');
DefMacro('\hexnumber{}', sub { Explode(sprintf('%x',ToString($_[1]))); });
DefMacro('\mathch{}{}', '\ensuremath{#2}');

Let(T_CS('\@internalcite'),T_CS('\cite'));
DefMacro('\cite','\def\citename##1{##1}\@internalcite');
DefMacro('\shortcite','\def\citename##1{}\@internalcite');
DefMacro('\citename{}','#1');	# ?
#======================================================================

1;
