Skip to main content

CL tool to convert tex-files that contain \input{|command} with the actual output of these commands.

Project description

CLI to convert LaTeX source with piped \input{|...} commands into pure LaTeX.

Install

pip install pipetex2tex

Usage

pipetex2tex manuscript.tex > manuscript_with_executed_commands.tex
cat manuscript.tex | pipetex2tex > manuscript_cmds.tex

Or in python:

import pipetex2tex as p2t

tex = "There's \inp{|python -c 'print(int(24*60*60*365.25))'} seconds in a year."
print("source:", tex)
print("out   :", p2t.convert(tex), '\n')

tex = "There's $\input { | ls -al ~ | wc -l }$ files/directories in your user directory."
print("source:", tex)
print("out   :", p2t.convert(tex))

Results in

source: There's \inp{|python -c 'print(int(24*60*60*365.25))'} seconds in a year.
out   : There's 31557600 seconds in a year.

source: There's $\input { | ls -al ~ | wc -l }$ files/directories in your user directory.
out   : There's $      62$ files/directories in your user directory.

Dependencies

pipetex2tex only uses the Python standard library.

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pipetex2tex-0.0.0.tar.gz (4.9 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page