% Macros to typeset Dom Casmurro
% \newcommand{\lastedit}{2012-02-26 05:44:24 by stolfilocal}

\makeatletter\endlinechar=-1

\usepackage{datetime}
\renewcommand{\dateseparator}{-}
\newcommand{\todayiso}{\the\year \dateseparator \twodigit\month \dateseparator \twodigit\day}

\newcommand{\pgpic}[2]{
  \vbox to 0pt{%
    \hrule height 0pt
    \kern -1in
    \kern -12pt
    \kern -\topmargin
    \kern -\headsep
    \kern -\headheight
    % \kern -32pt
    \hbox to 0pt{%
      \vrule width 0pt
      \kern -1in
      \kern -\oddsidemargin
      \epsbox{#1}{#2}
      \hss
    }
    \hss
  }
}

\newcommand{\gentitpg}[5]{
  \thispagestyle{empty}
  \cleardoublepage
  \thispagestyle{empty}
  \hrule height 0pt
  \vfill
  \begin{flushright}
    {\Large\bf \uppercase{#1}\\}
  \end{flushright}
  \vfill
  \hrule height 0pt
  
  \newpage
  
  \thispagestyle{empty}
  \hrule height 0pt
  \vfill
  \begin{center}
    {\small\sc #3\\}
    \vspace{3mm}
    \leavevmode
    \epsbox{cc-by-sa-343x127}{0.25}\par
  \end{center}
  \vfill
  \hrule height 0pt
  
  \newpage
  
  \thispagestyle{empty}
  \begin{center}
    {\Huge\bf \uppercase{#1}\\}
    \vspace{7mm}
    {\Large \uppercase{#2}\\}
    \vspace{3mm}
    {\large #4}
    \vfill
    \leavevmode
    \hbox{\epsbox{retrato-57}{0.25}}
    \vfill
    {\small\sc #5\\}
    {\small \todayiso\\}
    \vspace*{2mm}
    \leavevmode
    \hbox{\vrule width 0pt height 0pt depth 0pt}
  \end{center}
  
  \def\ovchap{
    \begin{center}
      \leavevmode
      {\Huge \uppercase{#1}}
      \vspace{3mm}
      \hrule
      \vspace{-5mm}
    \end{center}
  }
  \newpage
  \thispagestyle{empty}
  \cleardoublepage
}
  
\newcommand{\chapt}[2]{
  \newpage
  \thispagestyle{empty}
  \ovchap
  \begin{center}
    \vspace*{24mm}
    {\Huge #1\\}
    \vspace{8mm}
    {\Large \bf #2}
    \vspace{8mm}
  \end{center}
  \addcontentsline{toc}{chapter}{\protect\numberline{#1}{#2}}
  \def\ovchap{}
}

\newcommand{\appix}[1]{
  \cleardoublepage
  \thispagestyle{empty}
  \begin{center}
    \vspace*{5mm}
    {\Large #1}
    \vspace{5mm}
  \end{center}
}

\newcommand{\finpg}[1]{
  \vfill
  \begin{center}
    {\large\bf #1\\}
  \end{center}
  \vfill
}
  
\newcommand*{\l@chapter}{\@dottedtocline{0}{0pt}{5.5em}}
  
\newcommand{\genmytoc}[1]{
  \cleardoublepage
  \thispagestyle{empty}
  \markboth{#1}{#1}
  \begin{center}
    \vspace*{5mm}
    {\large #1\\}
    \vspace{5mm}
    \leavevmode
    \vbox{\hrule width 1cm}
    \vspace*{8mm}
  \end{center}
  \par
  \@starttoc{toc}
}

\newcommand{\signed}[2]{
  \vspace{10mm}
  \hbox to \textwidth{
    \kern 5cm
    \begin{minipage}{4cm}
      #1\\#2
    \end{minipage}
    \hss
  }
}      

\newcommand{\mth}[1]{{$#1$}}

\newcommand{\wqt}[1]{``#1''}

\makeatother\endlinechar=`\^^M

% END
