LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Forum View

Use Proportional Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Heiko Oberdiek <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Tue, 4 Jan 2011 11:27:43 +0100
text/plain (70 lines)

On Tue, Jan 04, 2011 at 09:26:56AM +0000, Joseph Wright wrote:

> > [empty box test]
> Thanks for that Heiko: quite a nice idea. One obvious conceptual
> question is how to treat void boxes. You've gone for 'void boxes are
> not empty', but this might not be how everyone expects it to be.

The example was just a ``proof of concept''.
A solution without global assignments, without a new box register
and with void as empty:

% empty := empty \(h|v)box | void

\def\wrong#1{\typeout{WRONG: #1}}
\def\ok#1{\typeout{OK: #1}}
\ifboxempty0{\ok{void is empty}}{\wrong{void is not empty}}
\ifboxemptyorvoid0{\ok{null is empty}}{\wrong{null is not empty}}
\ifboxempty0{\ok{vbox{} is empty}}{\wrong{vbox{} is not empty}}
\ifboxempty0{\wrong{hbox with write is empty}}%
            {\ok{hbox with write is not empty}}
\csname @@end\endcsname\end

In an exact manner of speaking the question if a box is empty without
having a box is wrong itself. On the other hand a user might be only
interested, if there is box contents. But in the end this is a matter
of definition and naming the macro.

Yours sincerely
  Heiko <[log in to unmask]>