LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Classic View

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

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

Print Reply
Heiko Oberdiek <[log in to unmask]>
Tue, 4 Jan 2011 09:43:43 +0100
text/plain (62 lines)
On Tue, Jan 04, 2011 at 05:11:34PM +1030, Will Robertson wrote:

> On 04/01/2011, at 8:36 AM, Joseph Wright wrote:
> > Working on the galley (see the latest SVN checkin), I find that \box_if_empty:NTF is misleading. The test is for a void box, not an empty one:
> > 
> > \box_new:N \l_my_box
> > \hbox_set:Nn \l_my_box {}
> > \box_if_empty:NTF \l_my_box { NOPE } { OOPS }
> > 
> > I think it should be \box_if_void:NTF - any objections?
> Not at all.
> Is there a need to have an actual empty test?
> Oh wait, this isn't possible, right?

A non-expandable test is possible:


\def\wrong#1{\typeout{WRONG: #1}}
\def\ok#1{\typeout{OK: #1}}
\ifboxempty0{\wrong{void is empty}}{\ok{void is not empty}}
\ifboxempty0{\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

Yours sincerely
  Heiko <[log in to unmask]>