| 1 |
This package enables you to embed Python code (www.python.org) in LaTeX and insert the output into your LaTeX document. |
| 2 |
|
| 3 |
In you LaTeX document insert: |
| 4 |
|
| 5 |
\usepackage{python} |
| 6 |
... |
| 7 |
\begin{python}[optional.py] |
| 8 |
print("42") |
| 9 |
\end{python} |
| 10 |
|
| 11 |
The file optional.py is included together with the code between \begin{python} and \end{python}. Hence, you can extract common code to a shared file. |
| 12 |
|
| 13 |
Compile the document with the shell escape option and of course Python installed: |
| 14 |
|
| 15 |
% latex -shell-escape document.tex |
| 16 |
|
| 17 |
or insert/change "shell_escape = t" in your texmf.cnf |
| 18 |
|
| 19 |
If you have any comments, suggestions, or patches please email them to me. |
| 20 |
|
| 21 |
Please note that this material is subject to the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. |
| 22 |
See http://www.gnu.org/copyleft/gpl.html for the details of that license. |
| 23 |
|
| 24 |
Martin R. Ehmsen |
| 25 |
[email protected] |