CTAN Comprehensive TeX Archive Network

Direc­tory macros/latex/contrib/hybrid-latex

README.md

Hy­brid - adding ac­tive Python code to

Overview

This is a col­lec­tion of Python and Bash shell scripts that al­lows doc­u­ments to con­tain ac­tive Python code. The ac­tive code blocks are pro­cessed ahead of and their re­sults are ac­ces­si­ble within the same doc­u­ment. Thus a cal­cu­la­tion that might oth­er­wise be done us­ing in two doc­u­ments, one us­ing Python to do the maths, and a sep­a­rate doc­u­ment to record the re­sults can be con­sol­i­dated into a sin­gle source.

There are other col­lec­tions that achieve the same re­sult, see Py­h­ton and Sage .

The main dif­fer­ences be­tween this pack­age and Py­h­ton and Sage are:

  • The tools are writ­ten in Python and Bash rather than , thus al­low­ing easy ex­ten­sion to other lan­guages,
    • The re­sults of the ac­tive code blocks are saved to a sin­gle file that can be eas­ily shared with col­leagues, jour­nals or in­cluded in other doc­u­ments.

This ver­sion of the pack­age is spe­cific to em­bed­ded Python code. Ex­ten­sions for Math­e­mat­ica, Maple, Mat­lab and Cadabra can be found on the github repos­i­tory.

In­stal­la­tion

There are a hand­ful of files to in­stall (by hand) for each lan­guage. Th­ese in­clude Bash shell scripts, Python scripts and style files. Each file can be copied to wher­ever their re­spec­tive pro­gram ex­pects to find them. For ex­am­ple, the Bash and Python scripts could be sudo copied to /usr/local/bin (for ac­cess by all users) or to ~/bin (for your per­sonal ac­cess). The style files can be copied to wher­ever they will be vis­i­ble to (see this dis­cus­sion on tex.stack­ex­change for use­ful sug­ges­tions). If you place the files in non-stan­dard lo­ca­tions you may need to ad­just your PATH and TEXINPUT en­vi­ron­ment vari­ables ac­cord­ingly. If all else fails, you can copy all of the Bash, Python and files into the same di­rec­tory as your doc­u­ment (though this is a very bad so­lu­tion).

More de­tails on the in­stal­la­tion can be found in the main doc­u­men­ta­tion, doc/hybrid.pdf.

Doc­u­men­ta­tion

The main doc­u­men­ta­tion can be found in doc/hybrid.pdf. See also the ex­am­ples in examples/.

Ver­sion

v0.1 (2018/08/22)

  • Ini­tial re­lase.

Author

>Leo Brewin, >School of Math­e­mat­ics, >Monash Univer­sity, >Leo.Brewin@monash.edu

Li­cense

All files in this col­lec­tion are dis­tributed un­der the MIT li­cense. See the file LICENSE.txt for the full de­tails.

Down­load the con­tents of this pack­age in one zip archive (1.8M).

hy­brid-la­tex – Al­low ac­tive Python code in doc­u­ments

This is a col­lec­tion of Python and Bash shell scripts that al­lows doc­u­ments to con­tain ac­tive Python code. The ac­tive code blocks are pro­cessed ahead of and their re­sults are ac­ces­si­ble within the same doc­u­ment. Thus a cal­cu­la­tion that might oth­er­wise be done in two doc­u­ments, one us­ing Python to do the maths, and a sep­a­rate doc­u­ment to record the re­sults, can be con­sol­i­dated into a sin­gle source.

Pack­agehy­brid-la­tex
Re­pos­i­toryhttps://github.com/leo-brewin/hy­brid-la­tex
Ver­sion0.1 2018-08-22
Li­censesMIT Li­cense
Copy­right2018 Leo Brewin
Main­tainerLeo Christo­pher Brewin
Con­tained inMiKTeX as hy­brid-la­tex
TopicsCall­back
...
Guest Book Sitemap Contact Contact Author