pyptex

Python Preprocessor for LaTeX
授权协议 MIT License
开发语言 Python
所属分类 企业应用、 LaTeX排版系统
软件类型 开源软件
地区 不详
投 递 者 别浩漫
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

PypTeX: the Python Preprocessor for TeX

Author: Sébastien Loisel

PypTeX is the Python Preprocessor for LaTeX. It allows one to embed Pythoncode fragments in a LaTeX template file.

An example plot with PypTeX

Installation

pip install pyptex

  1. You will also need a LaTeX installation, and the default LaTeX processor is pdflatex.
  2. You need a Python 3 installation.

Hello, world

Put the following in example.tex:

\documentclass{article}
@{from sympy import *}
\begin{document}
$$\int x^3\,dx = @{S('integrate(x^3,x)')}+C$$
\end{document}

The command pyptex example.tex will generate example.pdf and an intermediarypure-LaTeX file example.pyptex. The resulting PDF can be foundhere

  • The pyptex executable tries to locate the Python 3 executable using /usr/bin/env python3. If this is causing you problems, try python -u -m pyptex example.tex instead.

Slightly bigger examples

  • 2d and 3d plotting tex|pdf
  • Matrix inverse exercise tex|pdf
  • The F19NB handout for numerical linear algebra at Heriot-Watt university is generated with PypTeX. pdf

TeXShop

If you want to use TeXShop on Mac, put the following into ~/Library/TeXShop/Engines/pyptex.engine and restart TeXShop:

#!/bin/bash
pyptex $1

Documentation

Detailed documentation can be found here

相关阅读

相关文章

相关问答

相关文档