跳到主要内容

TeX 图形扩展程序用于 Sphinx

项目描述

概览

sphinxcontrib-texfigure 是一个 Sphinx 扩展程序,用于从 TeX 文件生成图形和图表。

要查看此扩展程序可以生成的图表示例,请参阅 http://htsql.org/doc/overview.html#htsql-in-a-nutshell。有关更多示例,请参阅源分布中的 demo 目录。

此扩展程序的范围与 sphinxcontrib-tikz 扩展程序类似,但在输入和选项方面采用不同的方法。

此软件由 Kirill Simonov (Prometheus Research, LLC) 编写,并按 BSD 许可证发布。

先决条件

以下可执行文件用于将 TeX 文档转换为位图

  • pdflatex

  • pdftoppm

  • pnmcrop

  • pnmtopng

Debian 或基于 Debian 的系统上,可以使用以下命令安装

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

如果您想使用 TikZ 生成图表,请安装

# apt-get install texlive-pictures

使用方法

要启用此扩展程序,请将以下行添加到 conf.py

extensions.append('sphinxcontrib.texfigure')

使用 texfigure 指令将 TeX/LaTeX 文档转换为图像。例如

.. texfigure:: hello-world.tex

此指令将渲染 你好,世界! 并在框中呈现,假设 hello-world.tex 包含以下 LaTeX 文档

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

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

使用选项 align 来指定水平对齐,使用 alt 来指定图像的文本内容

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

参考

指令

texfigure

从TeX文档中渲染图像。

指令的参数必须是TeX/LaTeX文件的路径。此指令没有主体。

选项

align

水平对齐(leftcenterright

alt

图像的替代文本内容。

配置参数

texfigure_pdftex(默认:pdflatex

pdftexpdflatex 可执行文件的路径。

texfigure_pdftoppm(默认:pdftoppm

pdftoppm 可执行文件的路径。

texfigure_pnmcrop(默认:pnmcrop

pnmcrop 可执行文件的路径。

texfigure_pnmtopng(默认:pnmtopng

pnmtopng 可执行文件的路径。

texfigure_texinputs(默认:[]

TeX搜索输入文件的目录列表。

texfigure_resolution(默认:110

图像分辨率,以DPI为单位。

CSS类

texfigure

应用于生成的图像。

项目详情


下载文件

下载适用于您平台文件。如果您不确定要选择哪个,请了解更多关于 安装包 的信息。

源分布

sphinxcontrib-texfigure-0.1.3.tar.gz (6.8 kB 查看哈希值

上传时间

构建分布

sphinxcontrib_texfigure-0.1.3-py2-none-any.whl (7.4 kB 查看哈希值

上传时间 Python 2

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面