TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I tried to compile the code below with

mk4ht htlatex file.tex 'xhtml, charset = utf-8 pmathml' '-cunihtf-utf8-cvalidate'

Formulas and text are transcribed, but not graphics. How to solve this problem?

0pt]{->} (0,0)(-1.5,-3)(2.5,2.5)
\psline[linestyle=dashed,dash=3pt 2pt]
(0,1)(0.666666666666,1)  (0.666666666666,0)
share|improve this question
Please see the answer of tex.stackexchange.com/questions/124682/…. Capture the content inside pspicture environment to another file and generate the PDF and later an image. Call this image in the original file using includegraphics command. – Jagath Jul 23 '13 at 14:42

It seems that default conversion method used by tex4ht to convert pictures to image formats has issues with PSTricks, resp. PostScript specials. The default result:

enter image description here

The conversion is done by processing the dvi file with some dvi processor such as dvipng or dvisvgm. Default procedure is to call dvips and then Ghostscript to convert the postscript file to png. We can modify the process fortunately, using make4ht build files. Save the following as file.mk4 (it should have the same basename as your TeX file):

if mode == "draft" then

   "dvisvgm -n -o ${output}  -p ${page} ${source}")

compile the document using

make4ht -u file.tex "svg,pmathml"

(yes, it is an equivalent of your mk4ht call). The svg option requests to use svg as image format for converted pictures,

   "dvisvgm -n -o ${output}  -p ${page} ${source}")

configures the image conversion itself.

The result:

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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