| 1 |
%% BEGIN frame-doc |
| 2 |
%% |
| 3 |
%% $Id: frame-doc.tex 320 2010-05-15 09:42:13Z herbert $ |
| 4 |
\documentclass[12pt]{article} |
| 5 |
\usepackage[T1]{fontenc} |
| 6 |
\usepackage{mathpazo,url} |
| 7 |
\usepackage[colorlinks,linktocpage]{hyperref} |
| 8 |
|
| 9 |
\usepackage{frame} |
| 10 |
\let\Ffv\fileversion |
| 11 |
% Usage: |
| 12 |
% \fancyframebox {rule thickness} {separation from inner guy} {inner guy} |
| 13 |
% |
| 14 |
% \makeemptybox {width} {height} {depth} |
| 15 |
\begin{document} |
| 16 |
\title{Documentation for frame.tex:\\ |
| 17 |
fancy frames for generic TeX} |
| 18 |
\author{Timothy Van Zandt\thanks{The documentation was put into |
| 19 |
\LaTeX\ format by Herbert Vo\ss}\\ \url{[email protected]}} |
| 20 |
\date{Version \Ffv\\[3pt] \today} |
| 21 |
|
| 22 |
\maketitle |
| 23 |
\thispagestyle{empty} |
| 24 |
|
| 25 |
\begin{abstract} |
| 26 |
\texttt{frame.tex/frame.sty} provides fancy frames for generic TeX |
| 27 |
\end{abstract} |
| 28 |
|
| 29 |
\clearpage |
| 30 |
\tableofcontents |
| 31 |
\clearpage |
| 32 |
|
| 33 |
\section{Usage} |
| 34 |
|
| 35 |
\setbox0=\hbox{\it the center} |
| 36 |
\count11=1 |
| 37 |
\loop\ifnum\count11<11 |
| 38 |
\setbox0=\hbox{\fancyframebox{.1pt}{5pt}{\unhbox0}} |
| 39 |
\advance\count11 by1 |
| 40 |
\repeat |
| 41 |
|
| 42 |
\vbox{\centerline{\box0}\vss} |
| 43 |
|
| 44 |
This paragraph is probably rather hard to read. I have used \TeX's |
| 45 |
rule-drawing and macro capability to set 10 boxes on top of the |
| 46 |
text. This was rather easy to do in \TeX. I challenge anyone |
| 47 |
to come up with as simple a method for {\it troff}. |
| 48 |
|
| 49 |
\def\\{\char`\\}\def\{{\char`\{}\def\}{\char`\}} |
| 50 |
The command I used was: |
| 51 |
|
| 52 |
$$\hbox{\tt \\fancyframebox\{.1pt\}\{5pt\}\{{\it text to be boxed}\}}$$ |
| 53 |
|
| 54 |
{\tt \\fancyframebox} makes a framed {\tt \\hbox} containing its |
| 55 |
third argument, surrounded by extra space (its second argument), |
| 56 |
and rules on all four sides whose width is its first argument. |
| 57 |
To get 10 boxes, you just re-frame 10 times. I used a {\tt \\loop} |
| 58 |
construct, but one could just write out 10 nested {\tt \\fancyframebox} |
| 59 |
calls. |
| 60 |
|
| 61 |
In order to center the fancy boxes, I put them into {\tt \\box0} and |
| 62 |
used {\tt \\centerline\{\\box0\}} to write it out. To make the |
| 63 |
text come out on top, I put it in a {\tt \\vbox to 0pt} construct, |
| 64 |
making \TeX\ try to squeeze everything vertically to zero. A |
| 65 |
{\tt \\vss} allowed the {\tt \\vbox} to shrink (without it \TeX |
| 66 |
\ would still have done the job, but would have complained about |
| 67 |
an ``overfull {\tt \\vbox}'').[Ed.-Example was changed...] |
| 68 |
|
| 69 |
Thus, the final set of commands, including the \TeX\ loop instructions, |
| 70 |
to typeset the boxes was |
| 71 |
|
| 72 |
\bigskip |
| 73 |
|
| 74 |
\begin{verbatim} |
| 75 |
\setbox0=\hbox{\it the center} |
| 76 |
\count11=1 |
| 77 |
\loop\ifnum\count11<11 |
| 78 |
\setbox0=\hbox{\fancyframebox{.1pt}{5pt}{\unhbox0}} |
| 79 |
\advance\count11 by1 |
| 80 |
\repeat |
| 81 |
|
| 82 |
\vbox{\centerline{\box0}\vss} |
| 83 |
\end{verbatim} |
| 84 |
|
| 85 |
\bigskip |
| 86 |
|
| 87 |
Simple---at least when you consider the task\dots. |
| 88 |
|
| 89 |
\section{Macros} |
| 90 |
|
| 91 |
|
| 92 |
\begin{verbatim} |
| 93 |
\fancyframebox{rule thickness}{separation from inner guy}{inner guy} |
| 94 |
\makeemptybox{width}{height}{depth} |
| 95 |
\end{verbatim} |
| 96 |
|
| 97 |
\end{document} |