## Scale Text to the maximum of a page with LaTeX

Being confronted with having to produce a simple poster that holds just a few letter but prints them as big as possible, I found myself needing to scale text (or a letter) on a page.

At first, I found \scalebox, which unfortunately takes a scaling factor, and not two dimensions. Instead of trying to do math, I found \resizebox which does take dimensions (width and height).

You could think that simply scaling up to the \textwidth is enough, but it’s not as you can see from the following “l” which was typeset using this code:

\documentclass[
landscape,
a6paper,
]{scrartcl}
\usepackage[pdftex]{graphicx}
\usepackage{palatino}
\begin{document}
\resizebox{\textwidth}{!}{l}%
\end{document}

And here’s the result:

So the character doesn’t scale well in the sense that if it is too narrow, it would grow too tall. Unfortunately, it doesn’t automatically keep the aspect ratio and it doesn’t take such an argument as \includegraphic does. Fortunately, you can still make it keep the aspect ratio by globally setting the appropriate flag! So the following will work as expected:

\documentclass[landscape]{minimal}
\usepackage[showframe,a4paper]{geometry}
\usepackage{graphicx}
\setkeys{Gin}{keepaspectratio}

\newcommand{\vstretch}[1]{\vspace*{\stretch{#1}}}
\usepackage{palatino}
\begin{document}
\resizebox{\textwidth}{\textheight}{l}%
\end{document}

Another last thing is then multiline and centered output. The awesome people over at texexchange have a solution:

\documentclass[landscape]{minimal}
\usepackage[showframe,a6paper]{geometry}
\usepackage{varwidth}
\usepackage{graphicx}
\setkeys{Gin}{keepaspectratio}

\newcommand{\vstretch}[1]{\vspace*{\stretch{#1}}}
\usepackage{palatino}
\begin{document}
\topskip0pt
% This seems to fully work
\vstretch{1}
\centering\noindent\resizebox*\textwidth\textheight{\begin{varwidth}{\textwidth}%
\centering%
foooooooooooooooo

\centering
bar%
\end{varwidth}}

\vstretch{1}

\pagebreak
% Trying to other method with the table
\vstretch{1}
\centering\noindent\resizebox*\textwidth\textheight{\begin{varwidth}{\textwidth}%
\begin{tabular}{@{}c@{}}
foooooooooooooooo\\

bar
\end{tabular}%
\end{varwidth}}
\vstretch{1}

\end{document}

And the rendered result:

## Making posters with PosteRazor

I had to create a huge poster out of an image. The normal way you do that is to somehow prepare many DIN A4 sheets, so you have to enlarge a given image, cut it into many pieces, probably add some padding and if you’re lucky, you get your PDFs you can print.

But how do you actually do this? I used to use psresize and friends because I just wasn’t aware of anything more useful. Of course, dealing with psresize, psnup etc wasn’t very comfortable and I rarely was successful. I remember that I’ve asked a friend of mine to do it for me several times in the past. He owned a Mac and it was rather comfortable with those authoring tools. I began using OpenOffice to create those posters, but it really is uncomfortable: You have to remember which cutout you’ve used in the previous page, then move the image within the page and hope that you match the previous page. Needless to say, that this takes a considerable amount of time.

I always wanted to have  a tool which works like this: makeposter --format=DINA0 < input.png > poster.pdf It would scale the image, cut it, add padding for glueing and produce several pages in a single PDF.

I now was told about PosteRazor! An incredibly useful tool to do more or less the stuff I want. It is free software and pretty easy to use. It uses neither Gtk+ nor Qt. Instead, Fulltick is used to build the GUI. I have never heard of it, but it’s okay. The widgets are not as beautiful as Gtk’s and the filechooser is especially bad, but the rest seems to be fine. So it serves almost every need I have

Awesome, isn’t it? I mean not just that it’s really easy, and you have your own poster in five minutes including printing! They even have extremely good marketing!