[luatex] Inserting hyperlinks (URLs)

Patrick Gundlach patrick at gundla.ch
Wed Feb 27 17:30:06 CET 2013



> I'd like to insert hyperlinks in my document via nodes/nodelist. AFAICS there are two mechanisms: pdf_annot and pdf_start_link (... pdf_end_link) nodes. Which one to use?


this seems to work. Is this the way to go?

\documentclass{article}
\usepackage{luacode}
\begin{document}

\begin{luacode}
ai = node.new("action")
ai.action_type = 3
ai.data = "/Subtype/Link/A<</Type/Action/S/URI/URI(http://www.tug.org)>>"
stl = node.new("whatsit","pdf_start_link")
stl.action = ai
stl.width = -1073741824
stl.height = -1073741824
stl.depth = -1073741824

enl = node.new("whatsit","pdf_end_link")
\end{luacode}

Hello \directlua{node.write(stl)}TeX user's group\directlua{node.write(enl)} world

\end{document}




More information about the luatex mailing list