% definitions.tex
%
% The documentation in this file is part of Pyxplot
% <http://www.pyxplot.org.uk>
%
% Copyright (C) 2006-2012 Dominic Ford <coders@pyxplot.org.uk>
%               2008-2012 Ross Church
%
% $Id: definitions.tex 1302 2012-09-05 17:30:27Z dcf21 $
%
% Pyxplot is free software; you can redistribute it and/or modify it under the
% terms of the GNU General Public License as published by the Free Software
% Foundation; either version 2 of the License, or (at your option) any later
% version.
%
% You should have received a copy of the GNU General Public License along with
% Pyxplot; if not, write to the Free Software Foundation, Inc., 51 Franklin
% Street, Fifth Floor, Boston, MA  02110-1301, USA

% ----------------------------------------------------------------------------

% LaTeX source for the Pyxplot Users' Guide

% This file contains a list of macro definitions used in the manual

\def\version{0.9.2}
\def\reldate{September 2012}

\newif\ifplastex
\plastexfalse

% Put ticks and crosses next to code examples
\newlength{\dontdowidth}
\setlength{\dontdowidth}{\textwidth}
\addtolength{\dontdowidth}{-2.5cm}
\newenvironment{dontdo}{\vspace{3mm}\noindent\begin{tabular}{p{1cm}p{\dontdowidth}}\noindent{\ifplastex\includegraphics{cross}\else\Large \XSolidBrush\fi }&\noindent\begin{minipage}{\dontdowidth}\tt}{\end{minipage}\end{tabular}\vspace{3mm}}
\newenvironment{dodo}  {\vspace{3mm}\noindent\begin{tabular}{p{1cm}p{\dontdowidth}}\noindent{\ifplastex\includegraphics{tick}\else\Large \CheckmarkBold\fi}&\noindent\begin{minipage}{\dontdowidth}\tt}{\end{minipage}\end{tabular}\vspace{3mm}}

% Place commands in the index in typewriter face
\newcommand\indcmd[1]{\index{#1 command@{\tt #1} command}}
\newcommand\indmod[1]{\index{#1 modifier@{\tt #1} modifier}}
\newcommand\indfun[1]{\index{#1 function@{\tt #1} function}}
\newcommand\indps [1]{\index{#1 plot style@{\tt #1} plot style}\index{plot styles!#1@{\tt #1}}}
\newcommand\indkey[1]{\index{#1 keyword@{\tt #1} keyword}}
\newcommand\indco [1]{\index{coordinate systems!#1@{\tt #1}}}

% As above, but also insert command name in text
\newcommand\indcmdt [1]{{\tt #1} command\indcmd{#1}}
\newcommand\indcmdts[1]{{\tt #1}\indcmd{#1}}
\newcommand\indmodt [1]{{\tt #1}\indmod{#1}}
\newcommand\indfunt [1]{{\tt #1}\indfun{#1}}
\newcommand\indpst  [1]{{\tt #1}\indps{#1}}
\newcommand\indkeyt [1]{{\tt #1}\indkey{#1}}
\newcommand\indcot  [1]{{\tt #1}\indco{#1}}

% Names of software packages where there's controversy over capitalisation
\newcommand\latexdcf{latex}
\newcommand\gnuplot{gnuplot}
\newcommand\ghostview{ghostview}
\newcommand\imagemagick{imagemagick}

% There's some controversy over whether these should have a space in them
\newcommand\subpart[1]{\vspace{4mm}\noindent{\bf\large #1}\vspace{4mm}}
\newcommand\datafile{data file}
\newcommand\Datafile{Data file}
\newcommand\datapoint{data point} % "Datum", surely?

\def\sinc{{\rm sinc}}

\newcommand{\funcdef}[2]{
\vspace{5mm}
\begin{samepage}
\noindent
{\large \bf #1}
\newline
\noindent
The #1 function #2
\indfun{#1}
\end{samepage}

}

\newcommand{\methdef}[2]{
\vspace{5mm}
\begin{samepage}
\noindent
{\large \bf #1}
\newline
\noindent
The #1 method #2
\indfun{#1}
\end{samepage}

}

