Skip to main content

Overview

sphinxcontrib-texfigure is a Sphinx extension for generating figures and diagrams from TeX files.

For an example of a diagram this extension could produce, please see http://htsql.org/doc/overview.html#htsql-in-a-nutshell. For more examples, see demo directory in the source distribution.

This extension is similar in scope to sphinxcontrib-tikz extension, but with different approach to input and options.

This software is written by Kirill Simonov (Prometheus Research, LLC) and released under BSD license.

Prerequisites

The following executables are used for rasterizing TeX documents:

  • pdflatex

  • pdftoppm

  • pnmcrop

  • pnmtopng

On a Debian or a Debian-derived system, they could be installed with:

# apt-get install texlive
# apt-get install poppler-utils
# apt-get install netpbm

If you want to generate diagrams with TikZ, install:

# apt-get install texlive-pictures

Usage

To enable this extension, add the following line to conf.py:

extensions.append('sphinxcontrib.texfigure')

Use texfigure directive to convert a TeX/LaTeX document to an image. For example:

.. texfigure:: hello-world.tex

This directive will render Hello, World! in a box assuming that hello-world.tex contains the following LaTeX document:

\documentclass{article}
\usepackage{tikz}
\pagestyle{empty}

\begin{document}
\begin{tikzpicture}
\node[draw] {Hello, World!};
\end{tikzpicture}
\end{document}

Use option align to specify horizontal alignment, alt to specify text content of the image:

.. texfigure:: hello-world.tex
   :align: center
   :alt: Hello, World!

Reference

Directives

texfigure

Renders a figure from a TeX document.

The parameter of the directive must be the path to a TeX/LaTeX file. This directive has no body.

Options:

align

Horizontal alignment (left, center, or right)

alt

Alternative text content of the image.

Configuration parameters

texfigure_pdftex (default: pdflatex)

Path to pdftex or pdflatex executable.

texfigure_pdftoppm (default: pdftoppm)

Path to pdftoppm executable.

texfigure_pnmcrop (default: pnmcrop)

Path to pnmcrop executable.

texfigure_pnmtopng (default: pnmtopng)

Path to pnmtopng executable.

texfigure_texinputs (default: [])

List of directories where TeX searches for input files.

texfigure_resolution (default: 110)

Image resolution, in DPI.

CSS classes

texfigure

Applies to the generated image.

Metadata

Release files for sphinxcontrib-texfigure 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinxcontrib-texfigure 0.1.3
File Size Uploaded
sphinxcontrib-texfigure-0.1.3.tar.gz 6.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinxcontrib-texfigure 0.1.3
File Interpreter ABI Platform
sphinxcontrib_texfigure-0.1.3-py2-none-any.whl Python 2 none any Details

Total release size: 14.2 kB

Release files / sphinxcontrib-texfigure-0.1.3.tar.gz

Download URL sphinxcontrib-texfigure-0.1.3.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
02511585d01052e4fa2ebc2bda9d242eae08aa9ac0142b2d4ab411d11fcc711e
BLAKE2b-256 checksum
How to use checksums
bb7d6f9128033fa361d69c6f89a0c8d34dbfe5fa822a53ef3dc1a198aa3cff93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / sphinxcontrib_texfigure-0.1.3-py2-none-any.whl

Download URL sphinxcontrib_texfigure-0.1.3-py2-none-any.whl
Size 7.4 kB
Tags Python 2
SHA-256 checksum
How to use checksums
67f8f1b6ce4bbe2d8cbdbb3dd82b52afa68d5789333c4079d5f7a7c7e239b427
BLAKE2b-256 checksum
How to use checksums
4840dc6ca60dae7e2c8b4e7d712a7a59ed56988388923327b2d461a1de8798d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page