From 64a46314af02747ee9595488a7f1f244ff443147 Mon Sep 17 00:00:00 2001 From: "B. Arman Aksoy" Date: Mon, 21 Sep 2015 15:31:06 -0400 Subject: [PATCH] add snippet from SO that adds PDF->PNG support --- README.md | 9 +++++---- html-plain.cfg | 17 +++++++++++++++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 67e17e5..afb89ce 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,10 @@ the Web to concentrate on the semantic elements and provide a suitable CSS file. ### Requirements - - tex4ht aka htlatex - - tidy, see https://github.com/htacg/tidy-html5 - - Python + - [tex4ht](https://www.ctan.org/pkg/tex4ht?lang=en) *a.k.a.* htlatex + - [tidy](https://github.com/htacg/tidy-html5) + - Python ([BeautifulSoup4](https://pypi.python.org/pypi/beautifulsoup4) and [html5lib](https://pypi.python.org/pypi/html5lib)) + - convert (from [ImageMagick](http://www.imagemagick.org/script/index.php)), if you have your figures as PDF files ### Usage @@ -29,7 +30,7 @@ The output file is going to be `tex-file-final.html`. ### Status and Contributions The current status of this project is: *highly experimental and optimized for -myself*, ah, and of course, it works on my machine... +myself*, ah, and of course, it works on my machine... Pull requests to improve the situation are very welcome. diff --git a/html-plain.cfg b/html-plain.cfg index 15ddd44..4d64eed 100644 --- a/html-plain.cfg +++ b/html-plain.cfg @@ -1,4 +1,4 @@ -\Preamble{xhtml} +\Preamble{xhtml} \RequirePackage{ifthen} @@ -68,6 +68,19 @@ % done configuring listing } +% Adds PDF to PNG conversion support +% code from: http://tex.stackexchange.com/questions/46156/pdf-image-files-and-htlatex +\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} + } \begin{document} +\EndPreamble -\EndPreamble +\begin{document} + +\EndPreamble