Last active
September 16, 2017 13:09
-
-
Save wtsnjp/bc56617044e89dceb8276ec97e9569f0 to your computer and use it in GitHub Desktop.
The TeXbook exercise 11.5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%#!latex | |
\documentclass{article} | |
\makeatletter | |
\def\demobox{\bgroup\catcode`\ =12\relax\xx@demobox} | |
\def\xx@demobox#1{% | |
\fboxsep=0pt\fboxrule=.4pt | |
\fbox{% | |
\fboxrule=3\fboxrule | |
\xx@demob@x#1\relax}% | |
\egroup} | |
\def\xx@demob@x#1{% | |
\ifx#1\relax\else | |
\if\space#1\relax\space\else\fbox{\phantom{#1}}\fi | |
\xx@hop\xx@demob@x | |
\fi} | |
\@gobbletwo\if\if\def\xx@hop#1\fi{\fi #1} | |
\makeatother | |
\begin{document} | |
\demobox{Tough exercise.} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment