[l2h] Checking whether a label is defined

Igor Pechtchanski pechtcha at cs.nyu.edu
Fri Nov 12 17:58:45 CET 2004


Hi, everyone,

I'm attempting to write a macro that would test whether a label being
referenced by a \ref command has been defined.  The following LaTeX
snippet illustrates what I would like to do, but it doesn't work in
LaTeX2HTML:

\newcommand\plabel[1]{\@namedef{p@#1}{}\label{#1}\nobreak\@gobblecr}
\newcommand\plabelref[1]{\@ifundefined{p@#1}{below}{above}~\ref{#1}}

Is there a way to do this test in LaTeX2HTML?  It doesn't have to work in
LaTeX, BTW -- I can put the test in an {htmlonly} environment.
Thanks in advance,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha at cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor at watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT



More information about the latex2html mailing list