%%
%% This is file `aeb_mobile.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% aeb_mobile.dtx  (with options: `copyright,package')
%% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% aeb_mobile.sty package                               %%
%% Copyright (C) 2012-2018                              %%
%%   dpstory@acrotex.net                                %%
%%                                                      %%
%% This program can redistributed and/or modified under %%
%% the terms of the LaTeX Project Public License        %%
%% Distributed from CTAN archives in directory          %%
%% macros/latex/base/lppl.txt; either version 1 of the  %%
%% License, or (at your option) any later version.      %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}[1997/12/01]
\ProvidesPackage{aeb_mobile}
 [2018/04/26 v1.4 aeb\_mobile: Formatting for mobile devices (dps)]
\@ifundefined{ifsmartphone}{\newif\ifsmartphone\smartphonetrue}{}
\DeclareOption{smartphone}{\ifsmartphone\AtEndOfPackage{%
    \web@MargScrDimOpts{.25in}{.25in}{24pt}{.25in}{8in}{4in}}\fi}
\newif\ifmob@maketitledefn \mob@maketitledefntrue
\DeclareOption{nomaketitle}{\mob@maketitledefnfalse}
\newif\ifmob@useforms \mob@useformsfalse
\DeclareOption{useforms}{\mob@useformstrue}
\newif\ifmobscalefigures\mobscalefiguresfalse
\newcommand{\scalefiguresOn}{\mobscalefigurestrue}
\newcommand{\scalefiguresOff}{\mobscalefiguresfalse}
\DeclareOption{scalefigures}{\mobscalefigurestrue}
\DeclareOption{!scalefigures}{\mobscalefiguresfalse}
\ProcessOptions
\ifsmartphone\else\expandafter\endinput\fi
\RequirePackage{web}
\RequirePackage{eforms}
\@ifpackageloaded{aeb_pro}{%
    \DeclareInitView{%
        layoutmag={pagelayout=TwoColumnLeft,mag=FitWidth},
        windowoptions=showtitle}}{%
    \hypersetup{pdfdisplaydoctitle=true,%
        pdfstartview=FitH -32768,pdfpagelayout=TwoColumnLeft}}
\ifmob@maketitledefn
\renewcommand{\makeinlinetitle}
{%
    \begingroup\parskip0pt\parindent0pt
    \par\vspace*{6pt}
    \noindent\makebox[\linewidth][c]{\bfseries
    \color{\webuniversity@color}\webuniversity}\par\kern6pt\noindent
    \makebox[\linewidth][c]{\parbox[c]{.75\linewidth}{\centering
    \bfseries\color{\webtitle@color}\webtitle}}\par\kern12pt
    \noindent\parbox{\linewidth}{\scriptsize
        \web@copyright\space\the\year\hfill\thewebemail\\
        \@date\hfill\@ifundefined{aeb@talksite}{\webversion}
            {\ifx\aeb@talksite\@empty\webversion
              \else\aeb@talksite\fi}%
        }\par
    \noindent\makebox[\linewidth]{\rule{.67\linewidth}{.4pt}}%
    \par\endgroup
}
\fi
\renewcommand{\paragraph}{\edef\mob@partpgraphexp{\noexpand
    \@startsection{paragraph}{4}{0pt}%
        {\ifdim\parskip=0pt12pt\else0pt\fi}}%
        \mob@partpgraphexp{-3pt}{\bfseries}}
\def\mob@adjwidth#1{\ifmobscalefigures{\dimen0=#1
    \dimen0=2\dimen0\relax
    \xdef\mob@djwidth{\expandafter\the
        \ifdim\dimen0<\textwidth
        \dimen0 \else\textwidth\fi}%
    }\else\gdef\mob@djwidth{#1}\fi
}
\@ifpackageloaded{graphicx}{%
    \define@key{Gin}{width}{\mob@adjwidth{#1}%
        \edef\Gin@ewidth{\mob@djwidth}}%
}{}
\begin{insDLJS}[_mobileJS]{mobile}{JS supporting mobile formatting}
var _mobileJS=true
function _printIt(){
    var pp=this.getPrintParams();
    pp.pageHandling=pp.constants.handling.nUp;
    pp.nUpPageOrder=pp.constants.nUpPageOrders.Horizontal;
    pp.nUpNumPagesH=2;
    pp.nUpPageBorder=false;
    pp.nUpAutoRotate=false;
    this.print(pp);
}
function _toggleViews() {
    this.zoomType=zoomtype.fitW;
    this.layout=(this.layout!="TwoColumnLeft")?%
"TwoColumnLeft":"OneColumn";
}
\end{insDLJS}
\newcommand{\mobPrint}[1]{\def\mob@print{#1}}
\mobPrint{Print}
\newcommand{\mobPrintTip}{Click to print this document in two-column
    format, recommended.}
\newcommand{\mobToggleCols}[1]{\def\mob@toggleCols{#1}}
\mobToggleCols{Toggle Cols}
\newcommand{\mobToggleColsTip}{Click to toggle between single-column
    and two-column page layouts.}
\newcommand{\mobFormPresets}[1]{%
    \def\mob@FormPresets{#1}}
\mobFormPresets{\S{S}\BC{}\textSize{8}\autoCenter{n}}
\newcommand{\mobPrintIt}[1][]{%
    \ifmob@useforms
        {\footnotesize\def\ef@btnspcr{}%
         \settoheight{\@tempdima}{\strut}%
         \settodepth{\@tempdimb}{\strut}%
         \addtolength{\@tempdima}{\@tempdimb}%
         \raisebox{-\@tempdimb}{\pushButton[#1\F{-\FPrint}
            \TU{\mobPrintTip}
            \presets{\mob@FormPresets}%
            \CA{\mob@print}\A{\JS{_printIt();}}%
         ]{mobPrintIt}{}{\@tempdima}}}\else
        \setLink[#1\A{\JS{_printIt();}}]{\mob@print}\fi
}
\newcommand{\mobTwoCols}[1][]{%
    \ifmob@useforms
        {\footnotesize\def\ef@btnspcr{}%
         \settoheight{\@tempdima}{\strut}%
         \settodepth{\@tempdimb}{\strut}%
         \addtolength{\@tempdima}{\@tempdimb}%
         \raisebox{-\@tempdimb}{\pushButton[#1\F{-\FPrint}
         \TU{\mobToggleColsTip}\presets{\mob@FormPresets}%
            \CA{\mob@toggleCols}\A{\JS{_toggleViews();}}%
         ]{mobToggleCols}{}{\@tempdima}}}\else
    \setLink[#1\A{\JS{_toggleViews();}}]{\mob@toggleCols}\fi
}
\lheader{\mobPrintIt\relax\ifmob@useforms\kern3bp
    \else\,/\,\fi\mobTwoCols\relax}
\newcommand{\generateEvenPage}{\ifodd\value{page}\else
    \newpage\lheader{}\null\fi}
\AtEndDocument{\generateEvenPage}
\endinput
%%
%% End of file `aeb_mobile.sty'.
