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

michal_h21 at gnu.org.ua michal_h21 at gnu.org.ua
Mon Oct 16 14:34:37 CEST 2017


Author: michal_h21
Date: 2017-10-16 15:34:37 +0300 (Mon, 16 Oct 2017)
New Revision: 332

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-4ht.tex
   trunk/lit/tex4ht-html4.tex
Log:
Added support  for TikZ externalization and PDF images

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2017-10-03 15:15:56 UTC (rev 331)
+++ trunk/lit/ChangeLog	2017-10-16 12:34:37 UTC (rev 332)
@@ -1,3 +1,8 @@
+2017-10-16  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-4ht.tex (usepackage.4ht): added support for TikZ externalization.
+	* tex4ht-html4.tex (html4.4ht): added support for PDF image inclusion.
+
 2017-10-01  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-fonts-noncjk.tex 

Modified: trunk/lit/tex4ht-4ht.tex
===================================================================
--- trunk/lit/tex4ht-4ht.tex	2017-10-03 15:15:56 UTC (rev 331)
+++ trunk/lit/tex4ht-4ht.tex	2017-10-16 12:34:37 UTC (rev 332)
@@ -3858,7 +3858,48 @@
 \endinput
 >>> \AddFile{9}{fontspec-luatex}
 
+
 %%%%%%%%%%%%%%%%%%
+\Section{TikZ}
+%%%%%%%%%%%%%%%%%
+
+\<use package\><<<
+tikz,>>>
+
+There is a support for TikZ externalization. TikZ has been instucted to don't
+externalize pictures when tex4ht is used. It is necessary to  create the PDF
+images for TikZ pictures first, by compiling the document using a PDF producing
+engine. 
+
+The tex4ht configuration for PDF graphics is used for PDF inclusion, it will be
+converted to SVG by default.
+
+\<add to usepackage\><<<
+\def\:temp{tikz}\ifx \@currname\:temp
+\AtEndOfPackage{%
+\let\use:tikzlibrary\usetikzlibrary
+\def\find:externalize#1external#2\@nil{%
+\if\relax#2\relax\else
+  \let\tikz:externalize\tikzexternalize
+  \renewcommand\tikzexternalize[1][]{\tikz:externalize[##1,mode=only graphics]}
+    \tikzset{%
+      tex4ht inc/.style={%
+        /pgf/images/include external/.code={%
+          \includegraphics[]{####1.pdf}%
+        }%
+      }
+    }
+    \tikzset{tex4ht inc}
+  \fi
+}
+\renewcommand\usetikzlibrary[1]{%
+  \use:tikzlibrary{#1}%
+  \find:externalize#1external\@nil%
+}
+}
+\fi
+>>>
+%%%%%%%%%%%%%%%%%%
 \Section{url.sty}
 %%%%%%%%%%%%%%%%%%
 

Modified: trunk/lit/tex4ht-html4.tex
===================================================================
--- trunk/lit/tex4ht-html4.tex	2017-10-03 15:15:56 UTC (rev 331)
+++ trunk/lit/tex4ht-html4.tex	2017-10-16 12:34:37 UTC (rev 332)
@@ -13618,6 +13618,15 @@
    {svg}
    {{\Configure{Needs}{File: \Gin at base.svg}\Needs{}}%
    \Picture[\a:GraphicsAlt]{{\Gin at base.svg} |<graphics dim|>}}
+
+\NewConfigure{PdfConvert}{2}
+\Configure{PdfConvert}{svg}{"inkscape -z -f '\Gin at base.pdf' -l '\Gin at base.\a:PdfConvert'"}
+\Configure{graphics*}
+   {pdf}
+   {\Needs{\b:PdfConvert}%
+   {\Configure{Needs}{File: \Gin at base.\a:PdfConvert}\Needs{}}%
+   \Picture[\a:GraphicsAlt]{{\Gin at base.\a:PdfConvert}|<graphics dim|>}}
+
 \NewConfigure{GraphicsAlt}{1}
 \Configure{GraphicsAlt}{PIC}
 |<includegraphics dim|>



More information about the tex4ht-commits mailing list