3

I recently find a book cover generated with ConTeXt. It looks quite simple but I guess there is a few things to take into account like adjusting the text size to the height of the page.

cover How could it be done in LaTeX?

Edit: The left part is easily doable:

\documentclass{amsbook}

\usepackage{afterpage}

\usepackage{xcolor}
\definecolor{emerald}{HTML}{0a6666}

\newcommand{\upperbold}[1]{\textbf{\textsf{\MakeUppercase{#1}}}}

\begin{document}
    \begin{titlepage}
        \color{white}
        \pagecolor{emerald}\afterpage{\nopagecolor}

        \Huge \noindent\upperbold{Hans Hagen}\bigskip\par
        \huge \noindent\upperbold{Context MKIV}
    \end{titlepage}
\end{document}

Edit: My question is not solved by Showcase of beautiful title page done in TeX because the code offered is not in LaTeX.

3 Answers3

8

In fact, using luamplib and just a handful of definitions, you can directly copy the MetaPost code from the Units manual and paste it into your LaTeX document.

\documentclass[a4paper]{article}
\usepackage{dejavu-otf}
\usepackage{luamplib}
\mplibsetformat{metafun}
\mplibtextextlabel{enable}
\everymplib{
  def StartPage =
    begingroup ;
    path Page ;
    Page := unitsquare xscaled (\mpdim{\paperwidth}) yscaled (\mpdim{\paperheight}) ;
  enddef;

  def StopPage =
    setbounds currentpicture to Page ;
    endgroup ;
  enddef;

  verbatimtex \leavevmode etex;
  beginfig(0);
}
\everyendmplib{endfig;}

\usepackage{xcolor}
\definecolor{darkcyan}{rgb}{0,.4,.4}

\newcommand\MPcolor[1]{mplibcolor("#1")}
\newcommand\ssbf{\sffamily\bfseries}
\newcommand\WORD{\MakeUppercase}
\newcommand\documentvariable[1]{\begincsname @#1\endcsname}
\newcommand\setdocumentvariable[1]{\long\expandafter\def\csname @#1\endcsname}

\newbox\MPpagebox
\def\stopMPpage{}
\long\def\startMPpage#1\stopMPpage{%
  \clearpage
  \begingroup
    \setbox\MPpagebox\hpack{%
      \begin{mplibcode}%
      #1%
      \end{mplibcode}}
    \hoffset=-1in
    \voffset=-1in
    \pagewidth=\wd\MPpagebox
    \pageheight=\ht\MPpagebox
    \advance\pageheight by \dp\MPpagebox % will this box ever have non-zero depth?
    \shipout\box\MPpagebox
  \endgroup}

\title{Units}
\author{Hans Hagen}
\setdocumentvariable{extra}{ConTeXt MkIV}

\begin{document}

% from "doc/context/sources/general/manuals/units/units-mkiv.tex"

\startMPpage

    StartPage ;
        fill Page enlarged 2mm withcolor \MPcolor{darkcyan} ;
        pickup pencircle scaled 2mm ;
        picture p, q, r ;
        p := textext("\ssbf\WORD{\documentvariable{title}}")  xsized (bbheight Page - 2cm) rotated 90 ;
        q := textext("\ssbf\WORD{\documentvariable{author}}") ysized 1cm ;
        r := textext("\ssbf\WORD{\documentvariable{extra}}")  xsized bbwidth q ;
        draw anchored.rt (p, center rightboundary Page shifted (-1cm,   0mm)) withcolor white ;
        draw anchored.lft(q, ulcorner             Page shifted ( 1cm, -84mm)) withcolor white ; % \MPcolor{darkred} ;
        draw anchored.lft(r, ulcorner             Page shifted ( 1cm,-108mm)) withcolor white ; % \MPcolor{darkred} ;
    StopPage ;

\stopMPpage

\end{document}

enter image description here

Henri Menke
  • 109,596
3

This brings it a bit closer to the desired title page. (I also see that the fonts do not precisely match, but maybe that is OK.)

\documentclass{amsbook}
\usepackage{afterpage}
\usepackage{xcolor}
\usepackage{graphicx}
\definecolor{emerald}{HTML}{0a6666}
\newcommand{\upperbold}[1]{\textbf{\textsf{\MakeUppercase{#1}}}}
\begin{document}
    \begin{titlepage}
        \color{white}%
        \pagecolor{emerald}\afterpage{\nopagecolor}%
        \hspace*{-3cm}\begin{tabular}{lp{4cm}c}
        \begin{tabular}{l}
        \scalebox{3}{\upperbold{Hans Hagen}}\\[2cm]
        \scalebox{2}{\upperbold{Context MKIV}}\\[8cm]
        \end{tabular}       & &
        \rotatebox[origin=c]{90}{\scalebox{18}{\upperbold{Units}}}
        \end{tabular}
    \end{titlepage}
\end{document}

enter image description here

You can play with the distances and scale factors as needed.

2

I think ultimately the correct way to solve this problem is with textpos, but it's certainly possible to do so with tables (as in the previous answer) or with creative mucking around with TeX boxes.

If you choose the latter course, the trick is to get TeX to treat the boxes as independent for positioning purposes. I do this by making them all essentially of zero dimensions: I wrap them all in \vbox to0pt{\vss\rlap{\llap{contents}}\vss} so that TeX thinks that they're 0 points tall and 0 points wide. This lets me position them as I will. Then it's just a matter of \hskiping and \vskiping everything into place.

\documentclass{amsbook}
\usepackage{afterpage}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage{xcolor}
\definecolor{emerald}{HTML}{0a6666}
\newcommand{\upperbold}[1]{\textbf{\textsf{\MakeUppercase{#1}}}}

\begin{document}
    \begin{titlepage}
        \color{white}
        \pagecolor{emerald}\afterpage{\nopagecolor}

          \noindent\hskip-0.75in\vbox to0pt{%
              \vskip2in%
              \fontsize{42pt}{42pt}\selectfont%
              \noindent\upperbold{Hans Hagen}\bigskip\par%
              \vskip1em%
              \fontsize{35pt}{35pt}\selectfont%
              \noindent\upperbold{Context MKIV}\bigskip\par%
          }%

          \vskip3.45in%
          \hskip0.75\linewidth%
          \vbox to0pt{%
              \vss%
              \llap{%
                  \rlap{%
                      \rotatebox{-90}{%
                          {\fontsize{220pt}{220pt}\selectfont\upperbold{UNITS}}%
                        }%
                    }%
                }%
                \vss%
          }%
    \end{titlepage}
\end{document}

This coughs up the following:

Cover Duplicated

Now, I tend to sprinkle % at the end of all my lines in the paranoid fear that I'll forget it where it's actually needed, and I did much more indenting than is really required here, but it does the trick.

Still, I'll say again: I think looking into textpos is the way to go. But since you seemed to want something more basic TeX/LaTeX, I did it that way.

dgoodmaniii
  • 4,270
  • 1
  • 19
  • 36