I'm preparing a TeX document including PDF figures as an HTML document. The solution to this question works fairly well:
However it does not handle image filenames with "(" or ")" characters, is there a way to include these in an HTML document?
I'm preparing a TeX document including PDF figures as an HTML document. The solution to this question works fairly well:
However it does not handle image filenames with "(" or ")" characters, is there a way to include these in an HTML document?
The filenames needs to be escaped, because the special characters, such as "(" or ")" may cause problems in the conversion step, which is executed by system shell. Something like this happens on Linux:
System call: convert he(ll)o.pdf he(ll)o.png
sh: -c: line 0: syntax error near unexpected token ,,("
sh: -c: line 0: `convert he(ll)o.pdf he(ll)o.png'
MWE:
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics{hello.pdf}
\includegraphics{"he(ll)o"}
\includegraphics{he(ll)o.pdf}
\end{document}
Fixed configuration file:
\Preamble{xhtml}
\Configure{graphics*}
{pdf}
{\Needs{"convert '\csname Gin@base\endcsname.pdf'
'\csname Gin@base\endcsname.png'"}%
\Picture[pict]{\csname Gin@base\endcsname.png}%
\special{t4ht+@File: \csname Gin@base\endcsname.png}
}
\DeclareGraphicsExtensions{.pdf,.png,.jpg,.eps}
\begin{document}
\EndPreamble
And the result:
\includegraphics{{"/home/tomkelly/directory/image".pdf}}– Tom Kelly May 11 '17 at 15:42