%% mathsPICmanual.tex
%%  RWD Nickalls
%% May  2011 
%%========================
%% this is the TOP file 
%%======================
\documentclass[a4paper,oneside]{book}
\usepackage{mathspic}
\usepackage{subfiles}
\usepackage[hyphens]{url}
\usepackage{fancyhdr} %% put this *after* geometry
\usepackage{amssymb} % for table1 characters
\usepackage{fancyvrb}  % for big-V Verbatim environment
\usepackage{ifpdf}
\usepackage{gmlatex} %% nice format for LaTeX logo

%%----references------------
\newcommand{\journal}[1]{\textit{#1}}
\newcommand{\book}[1]{\textit{#1}}
\newcommand{\vol}[1]{\underline{#1}}
\newcommand{\etal}{\textit{et al.}}

%%----------PDF--------
\ifpdf
      \usepackage[a4,pdftex]{crop} %% Forces a4 size with PDF %%<<--%-------------
      %\usepackage[cross,a4,pdftex]{crop} %% show PAPER edge with cross
    % \usepackage[frame,a4,pdftex]{crop} %% show PAPER edge with line
    %% test on cover with  crop frame to show paper edge

     \usepackage[verbose]{microtype}  %% pdftex  nicer margin alignment **********
     \usepackage{mathptmx}
     \usepackage{cmap} %%  allows searching
    %%------------to join top and bottom blue sections in verbatim{}
    %\newcommand{\joinverbatim}{\vspace{-1.6\baselineskip}} %-1.63
    \newcommand{\joinverbatim}{\vspace{-19pt}} %-17.93 with cmr
     %\newcommand{\joinverbatim}{\vspace{-1.58\baselineskip}} 
     %\newcommand{\joinverbatim}{\vspace{-4\topsep}} 

\else % dvi
  \usepackage{mathptmx}
  \usepackage{color} %%
  \newcommand{\joinverbatim}{\vspace{-19pt}} %-17.93 with cmr
\fi
%------------------- PREAMBLE -------------------

%\usepackage{rnbook} %% after pdf stuff and BEFORE showfram
%% same as for mathsbook
%%---------------


%%-----------------see paper/text edges--------------------
%%\usepackage[frame]{crop}  %% shows paper edge
%%\usepackage{showframe}    %% shows textframe


%%-----syntax stuff-------------
%%%% note that \syntax{} and \sit{} are defined & used in
%%%%%% chapter on mathsPIC commands
\newcommand{\syntax}[1]{\noindent\texttt{#1}}
%% -- anglebracket macro (chapter on mathsPIC commands)
\newcommand{\ab}[1]{$\langle$\textit{#1}$\rangle$}
%%

%----------center the section heading-----------
%% copied from my thoracic book cfg file
%% see Latex Companion page 37
\usepackage{titlesec}
\titleformat*{\section}{\centering\Large\bfseries}
%---------------------------------------------


%% Claudio Beccari stuff---------------------------------------
\newcommand\T{\rule{0pt}{2.6ex}}        %% Top strut of a Table
\newcommand\B{\rule[-1.2ex]{0pt}{0pt}}  %% Bottom strut of a Table
%% from TeX and TUG News, vol 2, No 3, 1993
%%----------------------------------------------------------------
%%
%%---------some table macros---(used in script.tex chapter)----------
\newcommand{\tstrut}{\rule{0pt}{12pt}}  % for top line
\newcommand{\mstrut}{\rule{0pt}{12pt}}  % middle lines
\newcommand{\bstrut}{\rule{0pt}{12pt}}  % bottom lines
%%
%%----------dunhill fonts for rwdn logo-------------
\newfont{\dunfont}{cmdunh10}
\newfont{\largedunfont}{cmdunh10 scaled\magstep2}
\newfont{\Largedunfont}{cmdunh10 scaled\magstep3}
\newfont{\LARGEdunfont}{cmdunh10 scaled\magstep4}
%%
%%-----------------------------------------------
%% the virtual space character
%% redefine it to use Knuth's original version
\newcommand{\gap}{\protect\texttt{\char'40}\protect} %% the <space> symbol
\renewcommand{\textvisiblespace}{\gap}
%%------------------------------------------------
\newcommand{\bs}{$\backslash$}
%%----------texlive----------
\newcommand{\TeXLive}{{\TeX}Live}
\newcommand{\TeXlive}{{\TeX}Live}
\newcommand{\texlive}{{\TeX}Live}
%-----------------------------------

\ifpdf 
%%-------------hyperref--(from howtodn6.tex)----------------
%% use in separate ifpdf..fi  environment
%% Guide to Latex (Kopke) p 257
%% NOTE place hyperref LAST before /begin{document} in order to get page hyperrefs correct
%% note the \pdfinfo{} does not work with hyperref
%% make hyperlinks etc------------
   \usepackage{hyperref}
   \usepackage{breakurl}
   \hypersetup{%%% pdftex,  % not if using \ifpdf
        debug=true,
        pdftoolbar=true,  pdfmenubar=true,
        %backref=true,  pagebackref=true,  %% only with bibliography
        plainpages=false,
        breaklinks=true,
        linktocpage=true,
      %  pdfpagemode=None, %% bookmark window closed
        bookmarksopen=true,
        bookmarksopenlevel=0,  %% (book=0, chap=1, article=2)
        bookmarksnumbered=true,
        bookmarkstype=toc,
        pdfwindowui=true, 
        hyperindex, hyperfigures=true, hyperfootnotes,
        colorlinks, urlcolor=blue,  linkcolor=blue, 
        %% in the pdfinfo stuff use just one  comma /ONLY/ at end of line
        %% or use {} if want to use commas
        %% for pdfstartview see p 253 Guide to latex (Kopka)
        pdfstartview=FitH,   %%FitH, FitV ,
        pdfview=FitH, %% make same as pdfstartview
        pdfcenterwindow=true,
        pdfnewwindow=true,
        pdfpagelayout=SinglePage, %TwoColumnRight,
        pdfpagelabels=true, 
        %---------------------
        pdftitle={The mathsPIC manual},
        pdfauthor={A Syropoulos \& RWD Nickalls May 2011},
        pdfsubject={TeX LaTeX}, 
        pdfkeywords={TeX, LaTeX, mathspic, graphics},
        %% pdfcreator=latex,
      }
\fi
%------------------

\usepackage{decimal}  %% AFTER (? mathpazo), hyperref
%----------
\usepackage{rotating} %% P 296 needs dvips driver for Beccari table
%%-----------------------------------------------


%======================================================
\begin{document}

%%------front to the booklet------------
\subfile{mpicp-cover.tex}
\frontmatter         
\pagenumbering{roman}
\subfile{mpicp-front.tex}  
\mainmatter   
%-------------------
\subfile{mpicp-intro.tex}  %% Introduction
\subfile{mpicp-run.tex}    %% running mathsPIC
\subfile{mpicp-script.tex} %% file and script
\subfile{mpicp-comm-mathspic.tex} %% mathespic commands
\subfile{mpicp-comm-pictex.tex}   %% Pictex commands
\subfile{mpicp-comm-latex.tex}    %% Latex commands
\subfile{mpicp-examples.tex}      %% examples
\subfile{mpicp-oxfordtalk.tex}    %% accessing TeX values
\subfile{mpicp-misc.tex}   %% prog history, acknowledgements etc
\appendix     
\subfile{mpicp-tables.tex}  %% tables
\subfile{mpicp-arrows.tex}  %% code to arrow box figure
\subfile{mpicp-posfigs.tex} %% positioning figures
\subfile{mpicp-windows.tex} %% positioning figures
\subfile{mpicp-pictex.tex}  %% PiCTeX
\backmatter         
\subfile{mpicp-refs.tex}   %% all references
%%---------------------------
\end{document}
