[pdftex] howto adjust \fontsize to \textwidth

Verwalter Dr.Betz kla at fh-landshut.de
Mon Apr 15 04:25:38 CEST 2002

The following is a working example on how to maximize the fontsize (named
\MAXSIZE) of a textbox (named \INTRO), so that the textbox will fit
exactly to \textwidth of the page.

I have but one problem with it: I find it hard to display the text
centered *within* the textbox.
If I format it centered using \begin{center} or {\hfill #1 \hfill},
I can no longer use the same textbox for calculating maximum fontsize.

Thanks for any help,
kla at fh-landshut.de

%%  example:

\usepackage{pslatex}% contains PostscriptHelvetica as SansSerif(Lipkin155)

\hbox{Office for}\par%
\hbox{Traditional Medicine}\par%
\hbox{Esoteric Thinking}\par% \par for line spacing above
%\par\vspace{0 pt plus 1 fill}% \vfill here not working?
%\parbox{\textwidth}{\Huge\centering Join us!}%

\renewcommand{\familydefault}{\sfdefault}% serifenlos


%calculate maximum scriptsize \MAXSIZE from \INTRO:

\fontsize{\MAXSIZE}{\MAXSIZE}\selectfont #1 \normalfont\normalsize}


\par\vspace{0 pt plus 1 fill}%
\fbox{\MAXFONT{Here we are \dots}}%


More information about the pdftex mailing list