Hi Hans, You know we at Docwolves do lots of stuff with \externalfigure[extern.pdf][interaction=yes] right? That sometimes produces errors. Some of those are hard to send back to you because the PDFs tend to be confidential, but there are two cases where valid but unexpected external references wreak havoc that are easy to explain and report: The first is: mailto:"someone@gmail.com" (with embedded " symbols). Resulting in ) expected near 'someone' error from lua, and it required us to patch context like so: \def\doifreferencefoundelse#1#2#3% {\ctxcommand {doifelsereference("\referenceprefix ",[[#1]], % "#1" \luaconditional \highlighthyperlinks , \luaconditional \gotonewwindow )} {\expandtexincurrentreference #2}{#3}} The second was a variation of: C:\TEMP\FILE.PDF (I forgot the real example). This of course results in Undefined control sequence: \\TEMP from luatex, and it required an extra line in link_uri in lpdf-epa.lua: local function link_uri(x,y,w,h,document,annotation) local url = annotation.A.URI url = string.gsub(url,"\\","/") -- TH Don't want backslashes here if url then add_link(x,y,w,h,format("url(%s)",url),"url") end end For the other bugs (which are ones where I often doubt whether the external pdf was even correct in the first place) I am attaching my versions of lpdf-epa.lua and lpdf-epd.lua for you to compare with your version. Unfortunately, we are using "2012.06.20 20:43", so that may be too old to help much. But you can grep for TH in the source and perhaps get some inspiration ;) Best wishes, Taco
On 12/11/2012 10:21 AM, Taco Hoekwater wrote:
Hi Hans,
You know we at Docwolves do lots of stuff with
\externalfigure[extern.pdf][interaction=yes]
right? That sometimes produces errors. Some of those are hard to send back to you because the PDFs tend to be confidential, but there are two cases where valid but unexpected external references wreak havoc that are easy to explain and report:
The first is:
mailto:"someone@gmail.com"
(with embedded " symbols). Resulting in
) expected near 'someone'
error from lua, and it required us to patch context like so:
\def\doifreferencefoundelse#1#2#3% {\ctxcommand {doifelsereference("\referenceprefix ",[[#1]], % "#1" \luaconditional \highlighthyperlinks , \luaconditional \gotonewwindow )} {\expandtexincurrentreference #2}{#3}}
I just realized this could be fixed in link_uri as well with another gsub. Duh.
participants (1)
-
Taco Hoekwater