2

This fails during typesetting:

{\externalfigure[https://images-na.ssl-images-amazon.com/images/I/41rVft84o%2BL._SX384_BO1,204,203,200_.jpg][book]}{}

This typesets, but the image doesn't display (it shows one of those grey placeholder boxes).

{\externalfigure[https://images-na.ssl-images-amazon.com/images/I/41rVft84o\%2BL._SX384_BO1,204,203,200_.jpg][book]}{}

presumably the percent sign is the problem in both, for different reasons.

What's the right way to deal with special characters in a url of an externalfigure in context?

Further info

Input

https://pastebin.com/PkW93yf6

Log

https://pastebin.com/1eRdEgKm

Screenshots

As recommended in the comments, I tried this:

{\externalfigure[https://images-na.ssl-images-amazon.com/images/I/41rVft84o\textpercent2BL._SX384_BO1,204,203,200_.jpg][vhs]}{}

but still get the grey box:

enter image description here

enter image description here

9
  • 1
    Use \letterpecent or \textpercent to get a % which works in arguments. – Wolfgang Schuster Feb 25 '20 at 19:31
  • Thanks for the suggestions. I tried both but still get a grey box (added a screenshot). Any idea why? – Sridhar Sarnobat Feb 25 '20 at 20:29
  • I get a image when I use \letterpercent. – Wolfgang Schuster Feb 25 '20 at 20:44
  • Hmmmm, so there's something wrong with my environment (I just added a screenshot of using \letterpercent too). I'm not sure if it is relevant but I'm using Context (Luatex) rather than Context in TexShop's type setter. Thanks for trying to help. – Sridhar Sarnobat Feb 25 '20 at 20:48
  • 1
    I used the URL from your snippet but without a working minimal example or the log file from it it impossible to tell what's wrong. – Wolfgang Schuster Feb 25 '20 at 21:05
3

What's the right way to deal with special characters in a url of an externalfigure in context?

\asciimode, which changes the catcode table so that everything other than \, {, and } has letter catcode.

\starttext
\startasciimode    
{\externalfigure[https://images-na.ssl-images-amazon.com/images/I/41rVft84o%2BL._SX384_BO1,204,203,200_.jpg][book]}{}
\stopasciimode
\stoptext
1
  • I haven't had time to try this but will temporarily mark it as correct – Sridhar Sarnobat Feb 29 '20 at 18:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.