\usepackage[lined,boxed]{}
\usepackage{latex_packages/lastpage}
\usepackage{latex_packages/here}
\usepackage{latex_packages/makeidx}
\usepackage{latex_packages/subfigure}
\usepackage{latex_packages/multicols}
\usepackage{listings, longtable, xcolor}
\usepackage{color, listings, tabularx, amsfonts, epsfig, psfrag, cite}
\usepackage{url, array, amsmath, fancyhdr, verbatim, graphicx, index, fancyvrb}  
% For better formatting to take advantage of pdflatex
\usepackage{microtype}

\usepackage[footnotesize]{caption}
\usepackage[bookmarksopen=true,colorlinks=true,linkcolor=blue,citecolor=green,bookmarks,pdftex,urlcolor=menublue]{hyperref}

\interdisplaylinepenalty=2500

\setlength{\textwidth}{6.5in}
\setlength{\textheight}{8.5in}
\setlength{\topmargin}{-0.25in}
\setlength{\evensidemargin}{0.1in}
\setlength{\oddsidemargin}{0.1in}
\setlength{\parskip}{0pt}
\setcounter{tocdepth}{3}

%==================================================
\definecolor{mbeige}{rgb}{0.875,0.859,0.765}
\definecolor{param-blue}{rgb}{0.1,0.1,0.765}
\definecolor{mygrey}{rgb}{0.94,0.94,0.94}
\definecolor{menublue}{rgb}{0.22,0.38,0.71}
\definecolor{menugreen}{rgb}{0,0.6,0}
\definecolor{myorange}{rgb}{1,0.65,0.35}
\definecolor{bhvcolor}{rgb}{0.73,0.35,0.18}
\definecolor{magenta}{rgb}{0.8,0,0.8}
%==================================================

\newcommand{\pd}{{$P_{_D}$}}
\newcommand{\pc}{{$P_{_C}$}}
\newcommand{\dth}{{\Delta_{\theta}}}
\newcommand{\pfa}{$P_{_{FA}}$}

\newcommand{\pskip}{\vspace{4pt}}
\newcommand{\prevblue}[1][0.07in]{\vspace{#1} \small \color{menublue}}
\newcommand{\prevgreen}[1][0.07in]{\vspace{#1} \small \color{menugreen}}
\newcommand{\prevbhv}[1][0.07in]{\vspace{#1} \small \color{bhvcolor}}
\newcommand{\postverb}[1][0.07in]{\vspace{#1}  \normalsize \color{black}}

%=======================================================
% special formatting for MOOS parameters
%=======================================================
% default size
\newcommand{\pvar}[1]{\textcolor{menublue}{\small \bf \tt #1}%
\index[params]{\textcolor{menublue}{\small \tt #1}}}
\newcommand{\pivar}[1]{\index[params]{\textcolor{menublue}{\small \tt #1}}}
\newcommand{\psvar}[1]{\textcolor{menublue}{\small \tt #1}}
% bit bigger
\newcommand{\psvvar}[1]{\textcolor{menublue}{\footnotesize \tt #1}}
\newcommand{\pvvar}[1]{\textcolor{menublue}{\footnotesize \tt #1}%
\index[params]{\textcolor{menublue}{\tt #1}}}
% bit bigger
\newcommand{\psvarr}[1]{\textcolor{menublue}{\tt #1}}
\newcommand{\pvarr}[1]{\textcolor{menublue}{\tt #1}%
\index[params]{\textcolor{menublue}{\tt #1}}}

%=======================================================
% special formatting for Behavior parameters
%=======================================================
% default size
\newcommand{\bvar}[1]{\textcolor{bhvcolor}{\small \bf \tt #1}%
\index[behaviors]{\textcolor{bhvcolor}{\small \tt #1}}}
\newcommand{\bivar}[1]{\index[behaviors]{\textcolor{bhvcolor}{\small \tt #1}}}
\newcommand{\bsvar}[1]{\textcolor{bhvcolor}{\small \tt #1}}
% bit bigger
\newcommand{\bsvvar}[1]{\textcolor{bhvcolor}{\footnotesize \tt #1}}
\newcommand{\bvvar}[1]{\textcolor{bhvcolor}{\footnotesize \tt #1}%
\index[behaviors]{\textcolor{bhvcolor}{\tt #1}}}
% bit bigger
\newcommand{\bsvarr}[1]{\textcolor{bhvcolor}{\tt #1}}
\newcommand{\bvarr}[1]{\textcolor{bhvcolor}{\tt #1}%
\index[behaviors]{\textcolor{bhvcolor}{\tt #1}}}

%=======================================================
% special formatting for MOOS variables
%=======================================================
\newcommand{\mvar}[1]{\textcolor{menugreen}{\small \tt #1}%
\index[vars]{\textcolor{menugreen}{\small \tt #1}}}
\newcommand{\mivar}[1]{\index[vars]{\textcolor{menugreen}{\small \tt #1}}}

\newcommand{\msvar}[1]{\textcolor{menugreen}{\small \tt #1}}

% bit smaller
\newcommand{\mvvar}[1]{\textcolor{menugreen}{\footnotesize \tt #1}%
\index[vars]{\textcolor{menugreen}{\small \tt #1}}}
\newcommand{\msvvar}[1]{\textcolor{menugreen}{\footnotesize \tt #1}}

% bit bigger
\newcommand{\mvarr}[1]{\textcolor{menugreen}{\tt #1}%
\index[vars]{\textcolor{menugreen}{\small \tt #1}}}
\newcommand{\msvarr}[1]{\textcolor{menugreen}{\tt #1}}


%=======================================================
% special formatting for MOOS applications
%=======================================================
\newcommand{\app}[1]{{\textcolor{magenta}{\small \tt #1}}}
\newcommand{\aapp}[1]{{\textcolor{magenta}{\footnotesize \tt #1}}}
%\newcommand{\app}[1]{{\small \tt #1}\index{#1}}
%\newcommand{\aapp}[1]{{\footnotesize \tt #1}}

%=======================================================
% special formatting for variables in general
%=======================================================
\newcommand{\var}[1]{{\small \tt #1}}
\newcommand{\varr}[1]{{\tt #1}}
\newcommand{\vvar}[1]{{\footnotesize \tt #1}}

%=======================================================
% special formatting for functions
%=======================================================
\newcommand{\func}[1] {\textcolor{myorange}{\small \tt #1}\index{#1}}
\newcommand{\funcc}[1]{{\tt #1}\index{#1}}
\newcommand{\ffunc}[1]{{\footnotesize \tt #1}\index{#1}}

%=======================================================
% special formatting for verbatim inside math
%=======================================================
\newcommand{\hvar}[1]{\mbox{{\small \tt #1}}}
\newcommand{\hvvar}[1]{\mbox{{\footnotesize \tt #1}}}
\newcommand{\hvvvar}[1]{\mbox{{\tiny \tt #1}}}


\newcommand{\wiki}[1]{}
\newcommand{\wikisec}[1]{}
\newcommand{\wikihint}[1]{}
\newcommand{\wikitablehint}[1]{}

%==================================================

\newlength{\pin}
\setlength{\pin}{0.2in}
\newcommand{\helm}{IvP Helm}
\newcommand{\phelm}{pHelmIvP}
\newcommand{\ibuff}{info\_buffer}

\newenvironment{hangpar}[1]{\list{}{
    \setlength{\listparindent}{1.5em}       \setlength{\itemindent}{0pt}
    \setlength{\itemsep}{0pt}               \setlength{\parindent}{0pt}
    \setlength{\rightmargin}{0pt}           \setlength{\leftmargin}{#1}}
    \item\hspace{-\leftmargin}\noindent\ignorespaces}
    {\endlist}

\newcounter{alisting}
\newcounter{listing}
\newcounter{expnum}
\newcounter{exnum}

\newenvironment{packed_itemize}[1][1]{
\begin{itemize}
  \setlength{\itemsep}{#1pt}
  \setlength{\parskip}{0pt}
  \setlength{\parsep}{0pt}
}{\end{itemize}}

\newenvironment{packed_enumerate}[1][1]{
\begin{enumerate}
  \setlength{\itemsep}{#1pt}
  \setlength{\parskip}{0pt}
  \setlength{\parsep}{0pt}
}{\end{enumerate}}

\newenvironment{consoleverb}{\SaveVerbatim{SVerbEnv}}
  {\endSaveVerbatim%
  \vspace{0.1in}%
  \noindent%
  \fcolorbox{black}{mygrey}{\footnotesize\BUseVerbatim{SVerbEnv}%
  \normalsize}%
  \vspace{0.1in}}

%==================================================
\makeindex
\newindex{vars}{adx}{and}{Index of MOOS Variables}
\newindex{params}{bdx}{bnd}{Index of Configuration Parameters: All MOOS Apps}
\newindex{behaviors}{cdx}{cnd}{Index of Behavior Parameters}


