build open-axiom
%% Copyright (C) 2009, Gabriel Dos Reis1%% All rights reserved.2%% Redistribution and use in source and binary forms, with or without3%% modification, are permitted provided that the following conditions are4%% met:5%%6%% - Redistributions of source code must retain the above copyright7%% notice, this list of conditions and the following disclaimer.8%%9%% - Redistributions in binary form must reproduce the above copyright10%% notice, this list of conditions and the following disclaimer in11%% the documentation and/or other materials provided with the12%% distribution.13%%14%% - Neither the name of The Numerical Algorithms Group Ltd. nor the15%% names of its contributors may be used to endorse or promote products16%% derived from this software without specific prior written permission.17%%18%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS19%% IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED20%% TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A21%% PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER22%% OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,23%% EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,24%% PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR25%% PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF26%% LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING27%% NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS28%% SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.293031\NeedsTeXFormat{LaTeX2e}32\ProvidesPackage{open-axiom}[2009/10/11 OpenAxiom LaTeX package]3334%% We build on top of the listings package35\RequirePackage{listings}363738%% The base Spad language39\lstdefinelanguage{Spad}{%40keywords={add,and,break,case,else,false,for,has,if,import,%41in,is,isnt,iterate,macro,mod,or,pretend,%42quot,rem,rule,repeat,return,then,true,with,where,while},%43otherkeywords={->,<,<=,>,>=,=,==,~=,=>,\#,::,\@,\$,|},%44alsoletter={\%},%45comment=[l]{++},%46morecomment=[l]{--},%47morestring=[b]",%48sensitive=true49}5051%% OpenAxiom's Spad52\lstdefinelanguage[OpenAxiom]{Spad}[]{Spad}{%53morecomment=[l][\itshape\bfseries]{++}54}5556\lstdefinestyle{spad}{%57language=[OpenAxiom]spad,%58basicstyle=\renewcommand{\ttdefault}{txtt}\footnotesize\ttfamily,%59columns=flexible,%60showstringspaces=false61}6263%% Inline Spad code64%% FIXME: This definition prohibits '!' as valid identifier65%% in inline Spad code. That is unfortunate.66\newcommand{\OpenAxiomCode}[1]{\lstinline[style=Spad]!#1!}6768%% The main inout environment69\lstnewenvironment{OpenAxiomInput}{\lstset{style=spad}}{}7071%% Include a whole Spad file72\newcommand{\OpenAxiomFile}[1]{\lstinputlisting[style=Spad]{#1}}7374%% Some legacy commands75\newcommand{\spad}[1]{\ensuremath{\mathtt{#1}}}767778