3

This mwe comes from this post Showcase of beautiful title page done in TeX (2nd example). The picture's height (blue fill) is 0.5 of the page. How can we change the ratio to, say, 0.2 or 0.3 of the cover page's height? I have searched several posts and tried different alternatives like changing the \newgeometry and \path options but was unable to find a solution. Thanks.

\documentclass[letterpaper]{article}
\usepackage{geometry}
\usepackage[some]{background}

\definecolor{mycolor}{cmyk}{1,.60,0,.40}
\backgroundsetup{
scale=1,
angle=0,
opacity=1,
contents={\begin{tikzpicture}[remember picture,overlay]
 \path [fill=mycolor](current page.west)rectangle(current page.north east); 
\end{tikzpicture}}
}

\begin{document}
\begin{titlepage}
\BgThispage
\newgeometry{left=1cm,right=6cm,bottom=2cm}
\vspace*{0.3\textheight}
\noindent

\begin{minipage}{0.63\linewidth}
\vspace{5pt}
   \end{minipage}
\end{titlepage}

\end{document}
2

After adding the calc library, you can set the ratio using $(current page.north west)!.3!(current page.south west)$ to get the blue rectangle height as 0.3 of the page height, for example.

\documentclass[letterpaper]{article}
\usepackage{geometry}
\usepackage[some]{background}
\usetikzlibrary{calc}
\definecolor{mycolor}{cmyk}{1,.60,0,.40}
\backgroundsetup{
scale=1,
angle=0,
opacity=1,
contents={\begin{tikzpicture}[remember picture,overlay]
 \path [fill=mycolor]($(current page.north west)!.3!(current page.south west)$)rectangle(current page.north east); 
\end{tikzpicture}}
}

\begin{document}
\begin{titlepage}
\BgThispage
\newgeometry{left=1cm,right=6cm,bottom=2cm}
\vspace*{0.3\textheight}
\noindent

\begin{minipage}{0.63\linewidth}
\vspace{5pt}
   \end{minipage}
\end{titlepage}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.