6

This is my third question in the series of transforming some (~167) documents from HTML to LaTeX. The other questions were related to {inputenc} and {wrapfig}.

The original document have several graphics (~168) from different sources and different naming conventions. I am using the graphicx package with the \includegraphics command. I don't have any problems with PNG and JPEG files with only letters, numbers and hyphens in their names.

I have a couple of GIF files (non-animated) which I attempted to solve using the receipt here: Convert gif image to png on the fly . Unsuccessfully. (Also command \epstopdfDeclareGraphicsRule fails in XeLaTeX, and as there are only two files I might rather convert them manually or with my conversion script.)

However I have a problem with PNG and JPEG files with special charactes, mainly those including a period . (includegraphics things that something.svg.png is an unrecognized .svg.png), an underscore _ (if I don't mask that character it attempts to shift to mathmode; if I mask it it does not find the file), and a percent sign % (as most of these files were downloaded from internet URL, special chars are masked using the percent sign and I preserved that convention in the filenames. Again, with the masked percent '\%' '\includegraphics' does not find the file and without it the TeX engine assumes it is an end-of-line and the code breaks).

While I can still rename the files to something LaTeX and graphicx will handle, I still would like to now what are the correct way to mask special characters, and particularly ., _, and %.

0 Answers0