From a1455f1693dcaf12974492dfb1706e292e9a468f Mon Sep 17 00:00:00 2001
From: sunye <gerson.sunye@gmail.com>
Date: Thu, 14 May 2020 12:22:59 +0200
Subject: [PATCH] Remove useless commands, add and example

---
 example.tex |  62 +++++++++++++++++++++++++
 science.sty | 129 +++++++++++++++++++++++-----------------------------
 2 files changed, 119 insertions(+), 72 deletions(-)
 create mode 100644 example.tex

diff --git a/example.tex b/example.tex
new file mode 100644
index 0000000..b0166e5
--- /dev/null
+++ b/example.tex
@@ -0,0 +1,62 @@
+% !TEX TS-program = xelatex
+%
+% Created by Gerson Sunyé on 2020-05-14.
+% Copyright (c) 2020 .
+\documentclass{article}
+
+\usepackage{polyglossia}
+\usepackage{hyperref}
+\usepackage{science}
+
+\hypersetup
+{
+  pdftitle   = {Title},
+  pdfsubject = {Subject},
+  pdfauthor  = {Gerson Sunyé}
+}
+
+\title{Title}
+\author{Gerson Sunyé}
+
+\begin{document}
+
+\maketitle
+
+\begin{abstract}
+    Abstract
+\end{abstract}
+
+\section{Abbreviations}
+
+The work of Sigmund~\etal{}, \eg{} ``Man and Father'' teach us the The Legend of a Conqueror, \ie{}, the Oedipus legend.
+
+\section{Using listings.sty environments}
+
+\subsection{OCL}
+
+\begin{ocl}
+context Person
+pre: 
+	age > 0 and 
+	not firstName.oclIsUndefined() and
+	children->forAll(each | each.isValid()|)
+\end{ocl}
+
+
+
+\subsection{ATL}
+
+\begin{atl}
+rule relationnalContextToObjectContext {
+	from
+		r : RDBMSMM!RDBMSModel
+	to
+		c : ClassMM!ClassModel (
+            classifier <- r.table->union(r.getAllDataTypes()->collect(dt | thisModule.typeToPrimitiveDataType(dt)))
+		)
+	do {
+		r.debug('relationnalContextToObjectContext');
+	}
+}
+\end{atl}
+\end{document}
\ No newline at end of file
diff --git a/science.sty b/science.sty
index 13d15a6..f4a915b 100644
--- a/science.sty
+++ b/science.sty
@@ -4,14 +4,19 @@
 \RequirePackage{listings}
 \RequirePackage{comment}
 
-%\newtheorem{property}{Property}
-%\newtheorem{example}{Example}
 
-% \newtheorem{hypothesis}{Hypothesis}
-% \newtheorem{protocol}{Proof protocol}
-%\newtheorem{definition}{Definition}
-% \newtheorem{challenge}{Challenge}
-% \newtheorem{issue}{Issue}
+% Useful commands
+
+\newcommand{\etal}{et al.}
+\newcommand{\eg}[0]{e.\,g.}
+\newcommand{\ie}[0]{i.\,e.}
+\newcommand{\set}[1]{\ensuremath{\left \{ #1 \right \}}}
+\newcommand{\tuple}[1]{\ensuremath{\left \langle #1 \right \rangle }}
+\newcommand{\code}[1]{\lstinline{#1}}
+\newcommand{\uml}[1]{\texttt{\textbf{#1}}}
+
+
+% Listings.sty grammars
 
 \lstnewenvironment{java}{\lstset{language=Java,
 		frame=tb,
@@ -30,32 +35,62 @@
         literate={->}{$\to$}{2} {--}{-$\,$-}{2} {<=}{$\le$}{2} {>=}{$\ge$}{2} {<>}{$<\,>$}{3},
  	  	}}{}
 		
-\lstnewenvironment{ocl}{\lstset{language=[decorative]OCL,
-	frame=tb,
-	tabsize=3,
-	morekeywords={quota,implies,result,flatten,body,init,one,OrderedSet,Tuple,TupleType,def,attr,oclIsUndefined,oclIsInvalid,OclState,let,in},
-	basicstyle=\footnotesize,
-	keywordstyle=\bfseries,
-	ndkeywordstyle=\bfseries,
-	commentstyle=\itshape,
-	stringstyle=\ttfamily,
-	showspaces=false,
+\lstnewenvironment{ocl}{
+	\lstset{
+		language=[decorative]OCL,
+		style=ocl,
+		frame=tb,
+		tabsize=3,
+		basicstyle=\footnotesize,
+		keywordstyle=\bfseries,
+		ndkeywordstyle=\bfseries,
+		commentstyle=\itshape,
+		stringstyle=\ttfamily,
+		showspaces=false,
+		flexiblecolumns,
+		sensitive, extendedchars, texcl
+	}
+}{}
+
+\lstnewenvironment{atl}{
+	\lstset{
+		language=atl,
+		frame=tb,
+		tabsize=3,
+		basicstyle=\footnotesize,
+		keywordstyle=\bfseries,
+		ndkeywordstyle=\bfseries,
+		commentstyle=\itshape,
+		stringstyle=\ttfamily,
+		showspaces=false,
+		flexiblecolumns,
+		sensitive, extendedchars, texcl
+	}
+}{}
+
+\lstdefinestyle{ocl}{
+	language=[decorative]OCL,
+	morekeywords={quota,implies,result,flatten,body,init,one,OrderedSet,Tuple,TupleType},
+	morekeywords={def,attr,oclIsUndefined,oclIsInvalid,OclState,let,in},
+	emph={Boolean,Integer,String,Real,UnlimitedNatural},
 	morecomment=[l]{--},
-	flexiblecolumns,
-	literate={->}{$\to$}{2} {--}{-$\,$-}{2} {<=}{$\le$}{2} {>=}{$\ge$}{2} {<>}{$<\,>$}{3},
-	sensitive, extendedchars, texcl}}{}
+	literate={->}{$\to$}{2} {--}{-$\,$-}{2} {<=}{$\le$}{2} {>=}{$\ge$}{2} {<>}{$<\,>$}{3}
+}
 
 \lstdefinelanguage{atl}{
-	morekeywords={rule,module,from,to,create,uses,using,embedded,refining},
+	morekeywords={rule,module,from,to,create,uses,using,embedded,refining,debug},
 	morekeywords={context,def,let,in,if,then,else,endif},
 	morekeywords={lazy,unique,helper,extends},
+	morekeywords={union,intersection},
+	morekeywords={select,collect,forAll},
 	morekeywords={and,or},
 	morekeywords={do},
-	emph={Boolean,Integer,String,Sequence},
+	emph={Boolean,Integer,String,Sequence,thisModule},
 	sensitive=true,
 	morecomment=[l]{--},
 	morestring=[b]',
 	showstringspaces=false,
+	literate={->}{$\to$}{2} 
 }
 
 \lstdefinelanguage{gremlin}{
@@ -113,54 +148,4 @@ numberbychapter=false}
   morestring=[b]"
 }
 
-
-\newcommand{\etal}{et al.}
-\newcommand{\eg}[0]{e.\,g.}
-\newcommand{\ie}[0]{i.\,e.}
-\newcommand{\set}[1]{\ensuremath{\left \{ #1 \right \}}}
-\newcommand{\tuple}[1]{\ensuremath{\left \langle #1 \right \rangle }}
-\newcommand{\code}[1]{\textbf{#1}}
-\newcommand{\uml}[1]{\texttt{\textbf{#1}}}
-
-\newcommand{\thomas}[1]{\textcolor{green}{#1}}
-\newcommand{\adrien}[1]{\textcolor{blue}{#1}}
-\newcommand{\christina}[1]{\textcolor{red}{#1}}
-
-\newcommand{\add}[1]{\textcolor{blue}{#1\xspace}}
-\newcommand{\del}[1]{}%\textcolor{red}{#1\xspace}}
-
-\newcommand{\filename}[1]{{\small\texttt{#1}}}
-
-\newcommand{\testerL}{T}
-\newcommand{\instanceL}{I}
-\newcommand{\userL}{U}
-\newcommand{\bundleL}{B}
-\newcommand{\providerL}{P}
-\newcommand{\providerResourceL}{R}
-\newcommand{\providerFunctionsL}{F}
-\newcommand{\exampleL}{X}
-\newcommand{\scriptsL}{S}
-\newcommand{\scriptDeploymentL}{D}
-\newcommand{\scriptInstantiationL}{L}
-
-\newcommand{\tester}{$\testerL$\xspace}
-\newcommand{\instance}{$\instanceL$\xspace}
-\newcommand{\user}{$\userL$\xspace}
-\newcommand{\bundle}{$\bundleL$\xspace}
-\newcommand{\provider}{$\providerL$\xspace}
-\newcommand{\providerResource}{$\providerResourceL$\xspace}
-\newcommand{\providerFunctions}{$\providerFunctionsL$\xspace}
-%\newcommand{\example}{$\exampleL$\xspace}
-\newcommand{\scripts}{$\scriptsL$\xspace}
-\newcommand{\scriptDeployment}{$\scriptDeploymentL$\xspace}
-\newcommand{\scriptInstantiation}{$\scriptInstantiationL$\xspace}
-
-\newcommand{\scriptDeploymentI}[1]{$\scriptDeploymentL_{#1}$}
-\newcommand{\scriptInstantiationI}[1]{$\scriptInstantiationL_{#1}$}
-
-\newcommand{\subIntext}[2]{${#1}{_{#2}}$}
-\newcommand{\subInmath}[2]{{#1}{_{#2}}}
-\newcommand{\grammarIntext}[1]{$\mathcal{{#1}}$}
-
-
 \endinput
\ No newline at end of file
-- 
GitLab