Jupyter execution of TeX code environments.
Project description
JupyTeX
Provides Jupyter-backed execution of LaTeX code environments, and embeds the results. Similar in concept to PythonTex, but focuses on code execution, and avoids any language specific features.
How to use
- Install JupyTeX with
pip install git+https://github.com/agoose77/jupytex.git#egg=jupytex - Run
jupytex installin LaTeX project directory (or provide an install directory with-d DIR) to create the necessary.latexmkrcandjupytex.styfiles - Add
\usepackage{jupytex}to the document header - Declare code environments with
\begin{code}{language}[opts] Some source code \end{code}
See the configuration section for valid options inopts. - Run
jupytex make(which is a pass-through tolatexmk --shell-escape) to invokelatexmk.
Example Python Script
\begin{code}{python}[kernel=python3]
print("$x + y = z$")
\end{code}
Uninstallation
Run jupytex uninstall in LaTeX project directory (or provide an install directory with -d DIR) to remove the installed .latexmkrc and jupytex.sty files
Cleaning
Run jupytex clean (which is a pass-through to latexmk -c or latexmk -C) to remove both LaTeX and JupyTex-related run files.
JupyTeX flow control
jupytex.stydeclares dependency upon\jobname.timestampjupytex.stymacro writes code blocks to numbered.codefiles and attempts to include results- Code 'blocks' are written to a
\jobname.blockscsv file jupytex hashis invoked to calculate the md5 hash for all of the blocks, which is written to\jobname.hash. In future this should only be performed per-kernel-session.- If
\jobname.hashhas been modified,jupytex executeis invoked for the corresponding job, the code blocks executed, and results written to.resultfiles, and errors to.tracebackfiles. Code blocks which do not write to stdout write an empty results file.\jobname.timestampis updated with new timestamp. latexmkperforms a new pass for the dependencies upon\jobname.timestamp
Configuration
- Each code block must be given a language.
- One can specify the Jupyter kernel name with a
kernelkey parameter, which will be used instead of the language if present. One can also access an existing kernel, by passing the name of a connection file. - A
sessionkey parameter may be passed to create a new kernel associated with the kernel-session pair. If thekernelparameter is set to a connection file, then this will create a new client to the same kernel.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jupytex-0.0.3.tar.gz.
File metadata
- Download URL: jupytex-0.0.3.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.7.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b1e64032fa1948220055126afdf114cd9fd048c7bf63be1f986defb36206af8
|
|
| MD5 |
11ec2d2405dc6b75a4ac838d2c8d756a
|
|
| BLAKE2b-256 |
6edf52c207c36e4212807f8625d97ea4e9b4d7e0da36e5821355666aa4fba6b0
|
File details
Details for the file jupytex-0.0.3-py3-none-any.whl.
File metadata
- Download URL: jupytex-0.0.3-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.7.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b95b333760c0bc984bb645dc161553af6f17cf4e3cd7df11e5ce82ae19913085
|
|
| MD5 |
48d9206e09396ba3f5d83004e688a5a5
|
|
| BLAKE2b-256 |
f53f07efef0b0ddb78f831975ad1968447b66d989e9b9bfa3d222776a53efc46
|