pyptexPython Preprocessor for LaTeX
PypTeX: the Python Preprocessor for TeX
Author: Sébastien Loisel
PypTeX is the Python Preprocessor for LaTeX. It allows one to embed Python code fragments in a LaTeX template file.
Installation
pip install pyptex
- You will also need a LaTeX installation, and the default LaTeX processor is
pdflatex
. - 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 intermediary pure-LaTeX file example.pyptex
. The resulting PDF can be found here
- The
pyptex
executable tries to locate the Python 3 executable using/usr/bin/env python3
. If this is causing you problems, trypython -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
评论
lita little preprocessor for literate programming
litalittlepreprocessorforliterateprogrammingQuickStartBydefault,extractscodefromMarkdownfiles:#strip
lita little preprocessor for literate programming
0
lita little preprocessor for literate programming
lita little preprocessor for literate programmingQ
lita little preprocessor for literate programming
0
latex2expUse LaTeX in R. More LaTeX, less plotmath!
latex2explatex2expisanRpackagethatparsesandconvertsLaTeXmathformulastoR’splotmathexpressions.Plotmat
latex2expUse LaTeX in R. More LaTeX, less plotmath!
0
latex-talkModern LaTeX in a Nutshell
PDF下载:放映版阅读版Copyright(C)2018–2021byXiangdongZeng.
latex-talkModern LaTeX in a Nutshell
0
latex-talkModern LaTeX in a Nutshell
PDF 下载:放映版阅读版Copyright (C) 2018–2021 by Xiangdong
latex-talkModern LaTeX in a Nutshell
0
LaTeX-examplesExamples for the usage of LaTeX
LaTeX-examplesMore than 570 examples for the usage
LaTeX-examplesExamples for the usage of LaTeX
0
LaTeX-examplesExamples for the usage of LaTeX
LaTeX-examplesMorethan570examplesfortheusageofLaTeX.Youcancheckthatwiththefollowingcommand:$find.-ty
LaTeX-examplesExamples for the usage of LaTeX
0