[tex4ht-commits] [SCM] tex4ht updated: r576 - trunk/lit

michal_h21 at gnu.org.ua michal_h21 at gnu.org.ua
Mon Jun 10 14:53:58 CEST 2019


Author: michal_h21
Date: 2019-06-10 15:53:58 +0300 (Mon, 10 Jun 2019)
New Revision: 576

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-html4.tex
Log:
better configuration for the eps image support

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2019-06-07 13:09:24 UTC (rev 575)
+++ trunk/lit/ChangeLog	2019-06-10 12:53:58 UTC (rev 576)
@@ -1,3 +1,8 @@
+2019-06-10  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-html4.tex (html4.4ht): made the command used for the EPS graphics
+	support configurable
+
 2019-06-07  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-4ht.tex (usepackage.4ht, imakeidx.4ht): added support for the

Modified: trunk/lit/tex4ht-html4.tex
===================================================================
--- trunk/lit/tex4ht-html4.tex	2019-06-07 13:09:24 UTC (rev 575)
+++ trunk/lit/tex4ht-html4.tex	2019-06-10 12:53:58 UTC (rev 576)
@@ -13668,21 +13668,35 @@
    {eps}
    {\openin15=\csname Gin at base\endcsname\PictExt\relax%
    \ifeof15% 
-   \Needs{"convert \csname Gin at base\endcsname.eps \csname Gin at base\endcsname\PictExt"}% 
+   \Needs{\a:EpsConvert}% 
    \fi%
    \closein15%
    {\Configure{Needs}{File: \Gin at base\PictExt}\Needs{}}%
    \Picture[\a:GraphicsAlt]{{\Gin at base\PictExt} |<graphics dim|>}}
 
+\edef\svg:ext{.svg}
 
+\NewConfigure{ImageMagick}{1}
 \NewConfigure{Ghostscript}{1}
+
+\Configure{ImageMagick}{convert}
+\Configure{Ghostscript}{rungs}
+
+
+\NewConfigure{EpsConvert}{1}
 \NewConfigure{PdfConvert}{2}
-\Configure{Ghostscript}{rungs}
-\edef\svg:ext{.svg}
+
+% test the picture output format
 \ifx\PictExt\svg:ext
 \Configure{PdfConvert}{svg}{"pdf2svg '\Gin at base.pdf' '\Gin at base-\Gin at page.\a:PdfConvert' \Gin at page"}
+% the quality of conversion using ImageMagick is quite bad, it rasterizes the vectors and
+% the resulting SVG is basically PNG encapsulated in SVG
+% \Configure{EpsConvert}{"\a:ImageMagick\space '\Gin at base.eps' '\Gin at base.svg'"}
+% it is better to use the following command. pdf2svg must be installed separately.
+\Configure{EpsConvert}{"epstopdf '\Gin at base.eps' '\Gin at base.pdf' && pdf2svg '\Gin at base.pdf' '\Gin at base.svg'"}
 \else
 \Configure{PdfConvert}{png}{"\a:Ghostscript\space -q -dNOPAUSE -dBATCH -sDEVICE=pngalpha -r300 \ifx\Gin at page\@empty\else -dFirstPage='\Gin at page'  -dLastPage='\Gin at page'\fi\space -sOutputFile='\Gin at base-\Gin at page.\a:PdfConvert' \Gin at base.pdf"}
+\Configure{EpsConvert}{"\a:Ghostscript\space -dSAFER    -dBATCH    -dNOPAUSE    -dEPSCrop    -r120  -sDEVICE=pngalpha -sOutputFile='\Gin at base.png' '\Gin at base.eps' "}
 \fi
 \Configure{graphics*}
    {pdf}



More information about the tex4ht-commits mailing list