123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568 |
- \ProvidesPackage{Graphlet}
- \RequirePackage{ifthen}
- \newboolean{Report}
- \setboolean{Report}{false}
- \DeclareOption{Report}{\setboolean{Report}{true}}
- \newboolean{Article}
- \setboolean{Article}{false}
- \DeclareOption{Article}{\setboolean{Article}{true}}
- \newboolean{Psfonts}
- \setboolean{Psfonts}{false}
- \DeclareOption{Psfonts}{\setboolean{Psfonts}{true}}
- \newboolean{Float}
- \setboolean{Float}{false}
- \DeclareOption{Float}{\setboolean{Float}{true}}
- \newboolean{Headings}
- \setboolean{Headings}{false}
- \DeclareOption{Headings}{\setboolean{Headings}{true}}
- \newboolean{Frames}
- \setboolean{Frames}{false}
- \DeclareOption{Frames}{\setboolean{Frames}{true}}
- \ProcessOptions
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %
- % Customization
- %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- \ifthenelse{\boolean{Frames}}{%
- \newcommand{\Frame}[1]{\fbox{#1}}
- }{
- \newcommand{\Frame}[1]{#1}
- }
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %
- % Packages
- %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %
- % Use alltt to include source code
- %
- \usepackage{alltt}
- %
- % Support Index
- %
- \usepackage{makeidx}
- %
- % ``float'' package for enhanced floats
- %
- %
- \ifthenelse{\boolean{Float}}%
- {
- \usepackage{float}
- \restylefloat{figure}
- \restylefloat{table}
- }{}
- %
- % extended tabular
- %
- \usepackage{array}
- %
- % Pagestyle
- %
- \ifthenelse{\boolean{Report}}%
- {
- \ifthenelse{\boolean{Headings}}{
- \RequirePackage{fancyheadings}
- \pagestyle{fancy}
-
- \renewcommand{\chaptermark}[1]{\markboth{#1}{}}
- \renewcommand{\sectionmark}[1]{\markright{#1}}
-
- \lhead%
- [\fancyplain{}{\rmfamily\bfseries \thepage\qquad\leftmark}]%
- {\fancyplain{}{\rmfamily\bfseries Section \thesection}}
- \chead{}
- \rhead%
- [\fancyplain{}{\rmfamily\bfseries Chapter \thechapter}]%
- {\fancyplain{}{\rmfamily\bfseries \rightmark\qquad\thepage}}
- \lfoot{}
- \cfoot%
- [\emph{Draft Version}]%
- {Graphlet Version \GraphletVersion}
- \rfoot{}
- }{}
- }{}
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %
- % Commands
- %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %
- % \Param{x} should be used to indicate parameters of functions within
- % a tt-style text. \emph should be used in normal text.
- %
- % \ttcomment{c} is a commment in a text which is set in
- %
- % Both are needed to avoid a tt-style \emph.
- %
- \newcommand{\Param}[1]{\mbox{\textnormal{\emph{#1}}}}
- \newcommand{\ttcomment}[1]{\mbox{\textnormal{\emph{#1}}}}
- %
- % \GT{x} creates GT_x in typewriter font
- % \GTTcl{x} creates GT_Tcl_x in typewriter font
- % \gt{x} creates gt_x in typewriter font
- %
- \newcommand{\GT}[1]{\texttt{GT\_#1}}
- \newcommand{\GTTcl}[1]{\texttt{GT\_Tcl\_#1}}
- \newcommand{\gt}[1]{\texttt{gt\_#1}}
- %
- % Names (Compatibility only)
- %
- %\newcommand{\GraphScript}{GraphScript}
- %\newcommand{\Graphlet}{Graphlet}
- %\newcommand{\GML}{GML}
- %
- % Shortcuts
- % ---------
- %
- % \TDB ``To be done''
- % \ToDo ``To do''
- % \NYI ``Not Yet Implemented''
- %
- \newcommand{\TBD}{\emph{To be done}}
- \newcommand{\ToDo}{\emph{To Do}}
- \newcommand{\NYI}[1][foot]{%
- \ifthenelse{\equal{#1}{foot}}{%
- \footnote{Not yet implemented in Graphlet.}%
- }{%
- \emph{Not yet implemented in Graphlet.}%
- }%
- }
- \newcommand{\NYD}{\emph{Not yet documented.}}
- %
- % \Important
- %
- \newcommand{\Important}{\marginpar[$\Rightarrow$]{$\Leftarrow$}}
- %
- % Symbols
- %
- \newcommand{\Left}{\symbol{'133}}
- \newcommand{\Right}{\symbol{'135}}
- \newcommand{\Tilde}{\symbol{'176}}
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %
- %
- %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- \setcounter{secnumdepth}{3}
- \setcounter{tocdepth}{3}
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %
- % Graphlet Environments
- %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %
- % Notes et al
- %
- \newenvironment{note}%
- {\begin{small}\textsc{Note:}}%
- {\end{small}}
- \newenvironment{interna}%
- {\begin{small}}%
- {\end{small}}
- \newenvironment{WhoNeedsThis}%
- {\marginpar{\emph{Who needs this section ?}}}%
- {}
- \newenvironment{WhoCanSkipThis}%
- {\marginpar{\emph{Who can skip this section ?}}}%
- {}
- \newcounter{notes}
- \newenvironment{notes}%
- {\begin{small}\begin{list}%
- {\textsc{Note} \arabic{notes}. }%
- {\usecounter{notes}%
- \setlength{\labelsep}{0pt}%
- \setlength{\labelwidth}{0pt}%
- \setlength{\leftmargin}{0pt}%
- \setlength{\listparindent}{0pt}%
- }%
- }%
- {\end{list}\end{small}}
- \newenvironment{Standard}{\strut\marginpar{\emph{Standard}}}{}
- %
- % Example
- %
- % \begin{example}{label}{caption}
- % .. here is the example ...
- % \end{example}
- \newenvironment{example}[3][htbp]%
- {%
- \begin{figure}[#1]
- \newcommand{\exampleRef}{#2}
- \newcommand{\exampleCaption}{#3}
- \hrule\hrule\hspace*{1ex}
- }%
- {%
- \hrule\hrule%
- \caption{\exampleCaption}%
- \label{\exampleRef}%
- \end{figure}%
- }
- %
- % Skills: describe what skills are needed for the current section.
- %
- \newenvironment{skills}[1][section]%
- {%
- Readers \Important{} of this #1 should have basic
- knowledge in the following topics:
- \begin{quote}
- }%
- {\end{quote}}
- %
- % Utilities to describe the location of source code and the include
- % files
- %
- \newcommand{\CIncludeStatement}[3]{%
- \begin{small}
- To\Important{} use #1 include the following in your C++ code:
- \begin{quote}
- \texttt{\#include $<$\gt{#2}/#3.h$>$}
- \end{quote}
- \end{small}
- }
- \newcommand{\CSourceCodeLocation}[3]{%
- \begin{small}
- The source code for #1 is in the files
- \begin{itemize}
- \item \texttt{src/gt\_#2/#3.h}
- \item \texttt{src/gt\_#2/#3.cpp}
- \end{itemize}
- \end{small}
- }
- \newcommand{\CSourceCode}[3]{%
- \CSourceCodeLocation%
- {\ifthenelse{\equal{#1}{}}{class \GT{#3}}{#1}}{#2}{#3}
- \CIncludeStatement%
- {\ifthenelse{\equal{#1}{}}{class \GT{#3}}{#1}}{#2}{#3}
- }
- \newcommand{\TclSourceCodeLocation}[2]{%
- \begin{small}
- The source code for #1 is in the file
- \begin{itemize}
- \item \texttt{lib/graphscript/#2.tcl}
- \end{itemize}
- \end{small}
- }
- %
- % List of defintitions
- %
- \newenvironment{ttdescription}%
- {\renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\texttt{##1}}
- \begin{description}}%
- {\end{description}}
- \newenvironment{Cdefinition}%
- {
- \renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\texttt{##1}}
- \begin{description}
- \newcommand{\Hints}[2]{
- \ifthenelse{\equal{##1}{}}%
- {\strut\marginpar{\footnotesize \Frame{##2}}}
- {\strut\marginpar{\footnotesize \Frame{##2,##1}}}}
- }
- {\end{description}}
- \newenvironment{CAttributes}%
- {\renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\texttt{##1}}
- \begin{description}}%
- {\end{description}}
- %
- % Tcl commands, arguments etc.
- %
- %\newenvironment{TclArguments}[1]%
- %{
- % \renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\texttt{##1}}
- % \begin{description}
- %}%
- %{
- % \end{description}
- %}
- \newenvironment{TclAttributes}[1]%
- {
- \renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\texttt{##1}}
- \newcommand{\Entry}[3]{\item[##1] \te{##2} \hfill ##3\strut\\}
- \begin{ttdescription}
- }%
- {
- \end{ttdescription}
- }
- %\newenvironment{TclOptions}[2]%
- %{%
- % \begin{table}[htbp]
- % \newcommand{\TclOptionsRef}{#1}
- % \newcommand{\TclOptionsCaption}{#2}
- % \hrule\hrule\hspace*{1ex}
- % \begin{tabular}{>{\tt}p{0.3\textwidth}@{}p{0.6\textwidth}}
- %}%
- %{%
- % \end{tabular}
- % \hrule\hrule%
- % \caption{\TclOptionsCaption}%
- % \label{\TclOptionsRef}%
- % \end{table}%
- %}
- \newenvironment{TclOptions}%
- {%
- \renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\texttt{##1}}
- \newcommand{\Entry}[2]{\item[##1]\te{##2}\strut\\}
- \newcommand{\Optional}[1]{?##1?}
- \begin{description}
- }%
- {%
- \end{description}
- }
- %\newenvironment{TclArray}[2]%
- %{%
- % \begin{table}[htbp]
- % \newcommand{\TclOptionsRef}{#1}
- % \newcommand{\TclOptionsCaption}{#2}
- % \newcommand{\Entry}[2]{##1 & ##2 \\}
- % \hrule\hrule\hspace*{1ex}
- % \begin{tabular}{>{\tt}p{0.3\textwidth}@{}p{0.6\textwidth}}
- %}%
- %{%
- % \end{tabular}
- % \hrule\hrule%
- % \caption{\TclOptionsCaption}%
- % \label{\TclOptionsRef}%
- % \end{table}%
- %}
- \newenvironment{TclArray}%
- {%
- \renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\texttt{##1}}
- \newcommand{\Entry}[1]{\item[##1]\strut\\}
- \begin{description}
- }%
- {%
- \end{description}
- }
- \newenvironment{Handlers}[1]%
- {%
- \texttt{#1}\marginpar{\Frame{\emph{Handlers}}} calls the following handlers~:
- \begin{itemize}
- }{%
- \end{itemize}
- }
- \newenvironment{Hooks}[1]%
- {%
- \texttt{#1}\marginpar{\Frame{\emph{Hooks}}} calls the following hooks~:
- \begin{itemize}
- }{%
- \end{itemize}
- }
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %
- % C/C++ declaration
- %
- % \begin{Cdeclaration}{Name}{LongName}
- % \end{Cdeclaration}
- %
- % The environment Cdeclaration should be used to include the listing of a
- % C/C++ declaration. Argument 1 is the name which is used in the label,
- % argument 2 is the long name as used in the caption.
- %
- % Example:
- %
- % \begin{Cdeclaration}{GTSamle}{class \GT{Samle}}
- % \end{Cdeclaration}
- %
- % The declaration of class \GT{Sample} is shown in
- % Figure \ref{Cdeclaration:GTSample}
- %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- \newenvironment{Cdeclaration}[2]%
- {%
- \begin{figure}[h]
- \newcommand{\CdeclarationName}{#1}
- \newcommand{\CdeclarationLongName}{#2}
- \hrule\hspace*{1ex}
- }%
- {%
- \hrule
- \caption{The declaration of \CdeclarationLongName.}
- \label{Cdeclaration:\CdeclarationName}
- \end{figure}
- }
- %
- % quote + tt + tabbing
- %
- \newenvironment{ttquote}%
- {\begin{quote}\begin{alltt}}%
- {\end{alltt}\end{quote}}
- %\Newenvironment{Qttt}%
- %{\Begin{Quote}
- % \Begin{Tt}\Begin{Tabbing}
- % \ \ \ \ \=\ \ \ \ \ \ \=\ \ \ \ \=\ \ \ \ \=\ \ \=\Kill
- % }%
- %{\End{Tabbing}\End{Tt}\End{Quote}}
- %
- % GML Definition
- %
- \newtheorem{definition}{Definition}
- \newenvironment{GMLAttributes}%
- {%
- %\renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\texttt{##1}}
- \begin{description}
- \newcommand{\GMLAttr}[4][safe]{%
- \item[\texttt{##2}]
- \ifthenelse{\equal{##3}{B}}{\emph{Boolean}}{%
- \ifthenelse{\equal{##3}{I}}{\emph{Integer}}{%
- \ifthenelse{\equal{##3}{L}}{\emph{List}}{%
- \ifthenelse{\equal{##3}{S}}{\emph{String}}{%
- \ifthenelse{\equal{##3}{R}}{\emph{Real}}{%
- \emph{##3}%
- }%
- }%
- }%
- }%
- }%
- \hfill
- \makebox[6cm][l]{\texttt{##4}}\qquad
- \ifthenelse{\equal{##1}{safe}}{\textbf{Safe}}{\textbf{Unsafe}}\\
- }
- }%
- {\end{description}}
- %
- % Definitions for easy BNF grammar descriptions
- %
- \newenvironment{bnf}[1]%
- {
- \newcommand{\Assign}{\=::=\=}
- \newcommand{\Choice}{\mbox{$\,\mid\,$}}
- \newcommand{\Newline}{\\\>\>}
- \newcommand{\Declare}[2]{\NonTerm{##1}\>::=\>##2\\[1.0ex]}
- % \newcommand{\NonTerm}[1]{\mbox{\emph{##1}}}
- % \newcommand{\Term}[1]{\mbox{\underline{\tt ##1}}}
- \newcommand{\NonTerm}[1]{$<$\emph{##1}$>$}
- \newcommand{\Term}[1]{`##1'}
- \newcommand{\ZeroOrMore}[1]{\mbox{##1$^*$}}
- \newcommand{\OneOrMore}[1]{\mbox{##1$^+$}}
- \newcommand{\ZeroOrOne}[1]{\mbox{##1$_{0}^{1}$}}
- \newcommand{\Range}[1]{$\left[\textnormal{##1}\right]$}
- \newcommand{\FromTo}[2]{\Term{##1}-\Term{##2}}
- \newcommand{\Alternative}[1]{\Choice{} ##1}
- \newcommand{\AlternativeLine}[1]{\Choice{}\Newline{}##1}
- \newcommand{\Empty}{\mbox{$\lambda$}}
- \newcommand{\Group}[1]{(##1)}
- \begin{tabbing}
- #1\quad\= ::=\quad\=\kill\\
- }
- {
- \end{tabbing}
- }
- \newenvironment{program}%
- {\begin{tabbing}
- \ \ \ \ \=\ \ \ \ \=\ \ \ \ \=\ \ \ \ \=\kill
- }{\end{tabbing}}
- \ifthenelse{\boolean{Psfonts}}%
- {
- \usepackage{pslatex}
- \renewcommand{\rmdefault}{phv}
- }{%
- }
- \newcommand{\te}[1]{\texttt{\emph{#1}}}
- \usepackage{shortvrb}
- \MakeShortVerb{\|}
- \newcommand{\Ref}[1]{\ref{#1}}
- %%% Local Variables:
- %%% mode: latex
- %%% End:
|