\usepackage{CDCShortcuts}
\RequirePackage{wasysym
,psibycus % Greek language package, including koppa 
,ushort
%,lscape % Pages in landscape mode go inside \begin{landscape}\end{landscape} % CONFLICTS WITH EPSTOPDF 
}


\provideboolean{Web}
\setboolean{Web}{false} % reset to true if running via dvi; search for \ifdvi below

\provideboolean{bigPrint}
\setboolean{bigPrint}{true}
\setboolean{bigPrint}{false}

\provideboolean{wideMargins}
\setboolean{wideMargins}{true}
\setboolean{wideMargins}{false}

\provideboolean{BigAndWide}
\setboolean{BigAndWide}{true}
\setboolean{BigAndWide}{false}

% Options to set if being run from the shell (so autocompiled) 
\opt{FromShell}{
\setboolean{bigPrint}{false}
\setboolean{wideMargins}{false}
\setboolean{BigAndWide}{false}
}

\opt{bigWide}{
\setboolean{bigPrint}{true}
\setboolean{wideMargins}{true}
\setboolean{BigAndWide}{true}
\providecommand{\textSizeDefault}{\large}
\providecommand{\abstractSizeDefault}{\large}
}

\opt{Aquamacs}{
%\setboolean{bigPrint}{true}
%\setboolean{wideMargins}{true}
%\setboolean{BigAndWide}{true}
%\providecommand{\textSizeDefault}{\large}
%\providecommand{\abstractSizeDefault}{\large}
}

\provideboolean{KoppaOn}
\setboolean{KoppaOn}{true}
%\setboolean{KoppaOn}{false}

\ifthenelse{\boolean{KoppaOn}}{
\providecommand{\koppa}{\text{\greek{k+}}}
\providecommand{\Koppa}{\text{\greek{K+}}}
\providecommand{\sampi}{\text{\greek{s+}}}
\providecommand{\cigma}{\text{\greek{c+}}}
\providecommand{\Cigma}{\text{\greek{C+}}}
}{
\def\koppa{\mathbf{q}}\providecommand{\koppa}{$\mathbf{q}$}\providecommand{\Koppa}{$\mathbf{Q}$}
}

% Keep the elements in the argument #1 together on the same page
\newcommand{\together}[1]{\noindent\parbox{\linewidth}{#1}} 

% html version of document must be constructed by running pdflatex in
% dvi output mode; code below creates an ifdvi construct that detects
% whether running in dvi mode and sets the options necessary to generate
% html version of document using tex4ht

%\makeatletter
%\newif\ifdvi\dvitrue
%\@ifundefined{pdfoutput}{}{\ifnum\pdfoutput>0 \dvifalse\fi}
%\makeatother

% dvi compilation only occurs if making the html version
\ifdvi
    \setboolean{Web}{true}   
    \RequirePackage{tex4ht}
    \RequirePackage{graphicx}
    \RequirePackage[tex4ht]{hyperref}
    \provideboolean{bigPrint}\setboolean{bigPrint}{true}  % HTM output looks better in a larger font size
    \providecommand{\wideMargins}{\null{}} % Wide margins doesn't mean anything for html documents
    \newcommand{\CDCFig}[1]{\centerline{\includegraphics{#1}}}
    \newcommand{\CDCFigSideways}[1]{\centerline{\includegraphics{#1}}}
    \DeclareGraphicsExtensions{.png}
    \providecommand{\textSizeDefault}{\large}
    \providecommand{\titlepagefinish}{\newpage\textSizeDefault}
    \providecommand{\abstractSizeDefault}{\large}
    \providecommand{\ushort}{\underline} % ushort seems to not work properly for tex4ht
    \let\footnoterule\relax
    \makeatletter
    \renewenvironment{abstract}{%
       \begin{spacing}{0.9}
       \noindent {\tiny \phantom{.}} \\ % Trick to get proper spacing in html
       \noindent \hrule height 0.4pt depth 0.0pt width \textwidth \relax
       \vspace*{5mm}
       \noindent \textbf{Abstract}\\
       \indent \abstractSizeDefault
        }{%
           \noindent {\tiny \phantom{.}} \\  % Trick to get proper spacing in html
%           \noindent \hrule height 0.4pt depth 0.0pt width \textwidth \relax
       \vspace*{3mm}
       \ifthenelse{ \isundefined\@keywords }{
       \ClassWarningNoLine{bejournal}{No keywords specified.
          Please use the command \protect\keywords}
       }{
       }
       \end{spacing}
    \begin{quote}
    \begin{Description}
    \item[\textbf{~~~~~~~~~~~~Keywords~}] \@keywords
    \ifthenelse{ \isundefined\@jelclass }{
    \ClassWarningNoLine{bejournal}{No JEL classification specified.
       Please use the command \protect\jelclass}
    }{
    \item[\textbf{~~~~~~~~~~~~JEL codes~}] \@jelclass
    \end{Description}
    }
    \end{quote}
    \makeatother
    }
\else
    \RequirePackage[pdftex]{graphicx}
    \RequirePackage[plainpages=false]{hyperref}
    \hypersetup{
       pdffitwindow = false,     % Don't rescale to fit size of window
       pdfpagemode=UseThumbs,
       pdfstartview=FitH,
       pdfnewwindow = true,       % Links open in new window
       pdfproducer = {pdfLaTeX with hyperref}
    }
    \providecommand{\wideMargins}{\usepackage[twoside,marginparwidth=0in,left=0.5in,right=0.5in,top=0.5in,bottom=0.5in]{geometry}\usepackage{layouts}}
    \ifthenelse{\boolean{wideMargins}}{\wideMargins}{}
    \newcommand{\CDCFig}[1]{\centerline{\includegraphics[width=0.75\textwidth]{../Figures/#1}}}
    \newcommand{\CDCFigSideways}[1]{\centerline{\includegraphics[width=7.8in,height=5.5in]{../Figures/#1}}}
    \DeclareGraphicsExtensions{.pdf}
    \ifthenelse{\boolean{bigPrint}}{\renewcommand{\titlepagefinish}{\newpage\large}}{}
\fi

\newcolumntype{d}[1]{D{.}{.}{#1}} % Seems to need to come after hyperref

\definecolor{darkblue}{rgb}{0.055,0.094,0.3}
\definecolor{darkred}{rgb}{0.2,0,0}
\hypersetup{colorlinks=true,           % put a box around links
   linkbordercolor = {1 0 0}, % the box will be red
   pdfborder = {1 0 0},       % 
%   bookmarks=true,            % PDF will contain an index on the RHS
   urlcolor=darkred,
   citecolor=darkblue,
   linkcolor=darkred
}

%% Define the title table as different from the regular table

%\let\tabularTitle\tabular
%\let\endtabularTitle\endtabular

%\newenvironment{tabularTitle}{\tabularTitle}{\endtabularTitle}
\newenvironment{tabularTitle}{\tabular}{\endtabular}
