LaTeX-Template for inline images (base64 encoded).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Marc Wäckerlin 42ecd4f8e6 initial release, ready for ctan, typo 6 years ago
examples initial release, ready for ctan 6 years ago
screenshots initial release, ready for ctan 6 years ago
AUTHORS initial release, ready for ctan 6 years ago
LICENSE Initial commit 6 years ago
README.md initial release, ready for ctan, typo 6 years ago
autogen.sh initial release, ready for ctan 6 years ago
configure.ac initial release, ready for ctan 6 years ago
inline-images.sty initial release, ready for ctan 6 years ago
makefile.am initial release, ready for ctan 6 years ago
release.sh initial release, ready for ctan 6 years ago

README.md

LaTeX-Template for Inline Images

If you want your document to be self contained, you might want to decare inline images in base64 encoding.

Just use:

\usepackage{inline-images}
…
\inlineimg{<filename>}{<base64 encoded raw image data>}

This creates a file <filename>.base64 containning a copy of the raw image data, then a sytsem shell is executed to convert the raw data to the binary image and a file <filename> is created, which is then include in your document.

Note: The LaTeX compiler must be able to execute system commands, so option --shell-escape is required.

Note: It is desiged for Unix systems and it requires the command line tool base64 installed. Compilation calls base64 -d <filename>.img.base64 > <filename>.img.

Configuration

If you need an other command to decode base64 encoding, redefine the command \imageencoder:

\newcommand{\imageencoder}[1]{base64 -d #1.img.base64 > #1.img}

Example

This example code:

\documentclass[a5]{article}
\usepackage[paperwidth=6cm,paperheight=4cm]{geometry}

\usepackage{inline-images}

\newcommand{\img}{iVBORw0KGgoAAAANSUhEUgAAAMgAAADIC … BQ8f/JOcTkviE7+QAAAABJRU5ErkJggg==}

\begin{document}
\inlineimg{example.png}{\img}

© 2018 Marc Wäckerlin
\end{document}

Results in this example document:

example screenshot

Need More

If you are missing a feature or a configuration option, consult the project page. Just open a ticket and the author will care about it. Or extend it, it's lgpl.