It was a pleasant surprise for me to find out that it is possible to include image named “K_{2,3}.pdf” into TeX document using \includegraphics (and pdfLaTeX).




Now I have a question, which doesn't seem to have practical meaning, but is still interesting:) Is it possible to include picture with name containing % or imbalanced figure brackets? I. e. I have files %.pdf, {.pdf and }.pdf. How to include any of them?

  • If you really have %.pdf, I'd say you have a peculiar taste for file name choices. ;-) – egreg Nov 12 '13 at 8:35
  • Imho you are generalizing your success to easily: Your code works on your OS with your current texsystem. I wouldn't accept bets that is works in all OS, for previous versions of a tex system and for other tex-engines. – Ulrike Fischer Nov 12 '13 at 10:54
  • I created %.pdf just for testing. :) But some name like Top 3%.pdf is not too weird. – Smylic Nov 12 '13 at 12:40
  • I do not generalize anything. I just say that it was possible under my constraints. Anything related to external files is OS-dependent. And even if now something is the same for all existing OSes some time new OS may appear and break the rule. – Smylic Nov 12 '13 at 12:44

If you are expecting only including such files, not automating such a process, the answer is YES. In the following we assume, that angle brackets do not appear in the names of the files and the captions are manually inserted.



 %   \namedpicture{K_{2,3}}






enter image description here

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.