Aditya Mahajan wrote:
On Tue, 15 Dec 2009, Aditya Mahajan wrote:
I will update the module so that email and website work with mkiv.
Attached is a corrected version.
Hans, can something like \doifdefinedurl be added to the core? I am
currently using
%D We need a macro to check if a url is defined using \type{\useURL} or
not.
\def\doifdefinedurl#1{\doifdefined{\v!file:::#1}}
%D \MKIV\ uses a different internal structure to store urls, so we use a
%D different method.
\startmode[*mkiv]
\startluacode
ptj = ptj or {}
function ptj.doifdefinedurl(name, action)
if jobreferences.urls.data[name] and name ~= "" then
tex.sprint(tex.ctxcatcodes, action)
end
end
\stopluacode
\def\doifdefinedurl#1#2{\ctxlua{ptj.doifdefinedurl("#1",
\!!bs\detokenize{#2}\!!es)}}
\stopmode
i'll add:
\def\doifurldefinedelse {\ctxlua{commands.doifurldefinedelse ("#1")}}
\def\doiffiledefinedelse{\ctxlua{commands.doiffiledefinedelse("#1")}}
fyi ... you can use constructs like:
function commands.doifurldefinedelse(name)
commands.doifelse(jobreferences.urls.data[name])
end
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________