Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for automated conversion of PDF figures into PNGs #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.

Expand Down
17 changes: 15 additions & 2 deletions html-plain.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
\Preamble{xhtml}
\Preamble{xhtml}

\RequirePackage{ifthen}

Expand Down Expand Up @@ -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