# Reproduce a ConTeXt book cover with LaTeX [duplicate]

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.

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.

• Possible duplicate of Showcase of beautiful title page done in TeX – Cragfelt Nov 6 '19 at 18:29
• I don't see how it would be a duplicate, the link only points to ConTeXt code for this cover, hence the will to reproduce it in LaTeX. The other subject does not provide an answer. – user152057 Nov 6 '19 at 18:31
• I updated my comment. Click on the link. – Cragfelt Nov 6 '19 at 18:34
• I clicked on the link and I stand by what I said. The code provided is not in the same language as this subject. – user152057 Nov 6 '19 at 18:36
• Have you tried something? It seems to be a simple case of coloring the page, adjusting font size, and rotating text. – BlackBird Nov 6 '19 at 18:39

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:

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.

• Very nice answer! – user152057 Nov 6 '19 at 19:54
• Never put % after an assignment. TeX will keep on expanding tokens. This can easily lead to bugs, e.g. when you have \count0=1% on the first line and 99 on the second line, then \count0=199 which was obviously not intended. – Henri Menke Nov 7 '19 at 2:00
• That's a great point. Thank you. – dgoodmaniii Nov 7 '19 at 15:22
• Please also use \vspace instead of \vskip. The former is a properly documented LaTeX command. – Henri Menke Nov 7 '19 at 20:45

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}


• +1 for copy & paste – DG' Nov 6 '19 at 22:13
• All this code for a really simple title page... – BlackBird Nov 11 '19 at 20:21

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}


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