Skip to content
Snippets Groups Projects
cover.tex 2.76 KiB
Newer Older
  • Learn to ignore specific revisions
  • \documentclass{bookcover}
    
    Malin Freeborn's avatar
    Malin Freeborn committed
    
    % Loading the glossaries-extra packages won't work here, so LaTeX
    % won't understand the .aux file section headers which have \gls
    % commands. We resolve this with a little white lie.
    \newcommand\glsentrylongpl{}
    
    \newcommand\Glsentrytext[1]{\MakeUppercase#1}
    \newcommand\glsentrytext[1]{\MakeUppercase#1}
    
    \newcommand\Glsfmtplural[1]{\MakeUppercase#1s}
    \newcommand\Glsfmtlongpl[1]{\MakeUppercase#1s}
    
    \newcommand\Gls[1]{\MakeUppercase#1}
    \newcommand\Glsfmttext[1]{\MakeUppercase#1}
    
    Malin Freeborn's avatar
    Malin Freeborn committed
    \newcommand\gls{}
    \newcommand\glspl{}
    \newcommand\Glspl{}
    \newcommand\spellName{}
    
    \RequirePackage{xr-hyper}
    \RequirePackage{hyperref}
    
    \RequirePackage{adforn}
    \RequirePackage[copies]{contour}
    \contourlength{3pt}
    
    \input{images/extracted/inclusion.tex}
    
    \newcommand\showChap[1]{\pageref{#1}: \nameref{#1}}
    
    \newcounter{titleHeight}
    \setcounter{titleHeight}{0}
    
    \newcommand\placeTitle{%
      \node at (8,\value{titleHeight}+1) {\includegraphics[width=4cm]{svg-inkscape/logo_svg-tex.pdf}};
    
    Malin Freeborn's avatar
    Malin Freeborn committed
      \node[fill=white,fill opacity=0.1,text opacity=1, rounded corners=9pt] at (8,\value{titleHeight}-0.5) {\Huge \bookTitle};
    
    }
    
    \newcommand\placeChap[2]{%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
      \node[fill=white,fill opacity=0.5,text opacity=1, rounded corners=9pt] at (#1) {\pageref{#2}: \nameref{#2}};
    
    }
    
    \newcommand\backBlurb[1]{
      This book has many words, most of which you can read.
      These words you should not read, as someone should have replaced them with proper words long ago.
      However, it is evident that you are reading them, and not only evidence, but as true as Descartes' famous \textit{cogito ergo sum}.
      In short, the statement is the axiom which it asserts.
    }
    
    \newcounter{adf}
    \setcounter{adf}{\month}
    \addtocounter{adf}{15}
    
    \newif\ifruler
    \rulertrue
    
    \newcommand\bookChapters{}
    
    % This inputs the cover in the project.
    % It should look like this:
    % \renewcommand\bookTitle{Title}
    % \renewcommand\backBlurb{Overview}
    % \renewcommand\bookChapters{
    %   \placeChap{15,7.3}{cosmology}
    % }
    % \setbookcover{coverwidth=25cm}
    % \setbookcover{markcolor=black}
    % \setbookcover{coverheight=20cm}
    % \setbookcover{spinewidth=25mm}
    % \setbookcover{flapwidth=0cm}
    % \setbookcover{wrapwidth=5mm}
    % \rulerfalse
    
    \input{cover.tex}
    
    
    Malin Freeborn's avatar
    Malin Freeborn committed
    \begin{document}
    
    Malin Freeborn's avatar
    Malin Freeborn committed
    \begin{bookcover}
    
    \bookcovercomponent{picture}{bg whole}{images/\cover}
    
    
    \ifruler
      \bookcovercomponent{ruler}{front}[,1cm,2cm,]{,lowerright,gray}
    \fi
    
    Malin Freeborn's avatar
    Malin Freeborn committed
    
    \begin{bookcoverelement}{normal}{front}[,,,0.4\partheight]
    
    \bfseries
    
    \begin{tikzpicture}[overlay, anchor = north]
    
      \placeTitle
      \bookChapters
    
    \end{tikzpicture}
    
    
    Malin Freeborn's avatar
    Malin Freeborn committed
    \end{bookcoverelement}
    
    
    \bookcovercomponent{center}{spine}{
    \rotatebox[origin=c]{-90}{\bfseries\Large\adforn{\value{adf}}~\bookTitle~\addtocounter{adf}{28}\adforn{\value{adf}}}}
    
    \begin{bookcoverelement}{normal}{back}[2cm,2cm,2cm,2cm]
      \backBlurb
    \end{bookcoverelement}
    
    
    Malin Freeborn's avatar
    Malin Freeborn committed
    \end{bookcover}
    
    \end{document}