A quick and dirty solution (without any extra package):
\fbox{\parbox[t]{6em}{Title \#1\\Item\\Item\\Item\\Item}}%
\raisebox{-4ex}{$\to$}%
\fbox{\parbox[t]{6em}{Title \#2\\Item\\Item\\Item\\Item\\Item}}%
\raisebox{-4ex}{$\to$}%
\fbox{\parbox[t]{6em}{Title \#3\\Item\\Item\\Item}}
And you can define some commands for convenience.
\newcommand\mybox[2][6em]{%
\raisebox{4ex}{\fbox{\parbox[t]{#1}{#2}}}}
\newcommand\Rarrow{$\rightarrow$}
\mybox{Title \#1\\Item\\Item\\Item\\Item}%
\Rarrow
\mybox{Title \#2\\Item\\Item\\Item\\Item\\Item}%
\Rarrow
\mybox{Title \#3\\Item\\Item\\Item}
This is enough, if the requested diagrams are very simple. However, for more complicated diagrams (at arbitrary position, with curves, shaded boxes, etc.), it is better to use more powerful tools, like tikz
and pstricks
.
Using the suggestion in Fitting and centering text (both!) in a constrained area, together with Martin's answer that uses the environ
package, the following provides the environment
\begin{fitbox}{<width>}{<height>}
<stuff>
\end{fitbox}
which typesets <stuff>
using a form of binary search to fit the text within the given height <height>
while under a fixed width <width>
constraint set by a minipage
. This is required in order to maintain a proportionate scaling of the font and leading (\baselineskip
).
\documentclass{article}
\usepackage{lmodern}
\usepackage{environ}% http://ctan.org/pkg/environ
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\newdimen\fontdim
\newdimen\upperfontdim
\newdimen\lowerfontdim
\newif\ifmoreiterations
\fontdim12pt
\makeatletter
\NewEnviron{fitbox}[2]{% \begin{fitbox}{<width>}{<height>} stuff \end{fitbox}
\def\buildbox{%
\setbox0\vbox{\hbox{\minipage{#1}%
\fontsize{\fontdim}{1.2\fontdim}%
\selectfont%
\stuff%
\endminipage}}%
\dimen@\ht0
\advance\dimen@\dp0
}
\def\stuff{\BODY}% Store environment body
\buildbox
% Compute upper and lower bounds
\ifdim\dimen@>#2
\loop
\fontdim.5\fontdim % Reduce font size by half
\buildbox
\ifdim\dimen@>#2 \repeat
\lowerfontdim\fontdim
\upperfontdim2\fontdim
\fontdim1.5\fontdim
\else
\loop
\fontdim2\fontdim % Double font size
\buildbox
\ifdim\dimen@<#2 \repeat
\upperfontdim\fontdim
\lowerfontdim.5\fontdim
\fontdim.75\fontdim
\fi
% Now try to find the optimum size
\loop
%\message{Bounds: \the\lowerfontdim\space
% \the\fontdim\space \the\upperfontdim^^J}
\buildbox
\ifdim\dimen@>#2
\moreiterationstrue
\upperfontdim\fontdim
\advance\fontdim\lowerfontdim
\fontdim.5\fontdim
\else
\advance\dimen@-#2
\ifdim\dimen@<10pt
\lowerfontdim\fontdim
\advance\fontdim\upperfontdim
\fontdim.5\fontdim
\dimen@\upperfontdim
\advance\dimen@-\lowerfontdim
\ifdim\dimen@<.2pt
\moreiterationsfalse
\else
\moreiterationstrue
\fi
\else
\moreiterationsfalse
\fi
\fi
\ifmoreiterations \repeat
\box0% Typeset content
}
\makeatother
\begin{document}
\lipsum[1]
\begin{fitbox}{.5\textwidth}{0.5\textheight}
\lipsum[1-2]
\end{fitbox}
\lipsum[2]
\clearpage
\lipsum[1]
\begin{fitbox}{300pt}{300pt}
\lipsum[1-2]
\end{fitbox}
\lipsum[2]
\end{document}
In the figure below, two pages are typeset, each starting with \lipsum[1]
and ending with \lipsum[2]
to provide some frame of reference. The left page has a fitbox
of dimension .5\textwidth x .5\textwidth
while the page on the right is set at 300pt x 300pt
(square).

Interestingly enough, I'm having trouble compiling this under TeXLive 2011. Although, there is no problem compiling it using the online LaTeX compiler ScribTeX, which runs TeXLive 2009. I don't know what the cause behind this is... This has been fixed by the replacement of \protected@edef\stuff{\BODY}
with \def\stuff{\BODY}
. The original code used this form since it provided two macros - one for parsing the content (called \fillthepage{<stuff>}
) and another for updating a resized version of the content (called \buildbox
). I assume the coding structure required this. However, with everything contained in a single environ
ment fitbox
above, this is not needed anymore.
Best Answer
You can use
\framebox(200,300){}
where the size is given in multiples of\unitlength
, defaulting to1pt
.