summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/lualatex/pyluatex/example/readme-example.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/lualatex/pyluatex/example/readme-example.tex')
-rw-r--r--Master/texmf-dist/doc/lualatex/pyluatex/example/readme-example.tex32
1 files changed, 32 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/lualatex/pyluatex/example/readme-example.tex b/Master/texmf-dist/doc/lualatex/pyluatex/example/readme-example.tex
new file mode 100644
index 00000000000..177aa40c15c
--- /dev/null
+++ b/Master/texmf-dist/doc/lualatex/pyluatex/example/readme-example.tex
@@ -0,0 +1,32 @@
+%% Copyright 2021-2022 Tobias Enderle
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+
+\documentclass{article}
+
+\usepackage{pyluatex}
+
+\begin{python}
+import math
+import random
+
+random.seed(0)
+
+greeting = 'Hello PyLuaTeX!'
+\end{python}
+
+\newcommand{\randint}[2]{\py{random.randint(#1, #2)}}
+
+\begin{document}
+\py{greeting}
+
+$\sqrt{371} = \py{math.sqrt(371)}$
+
+\randint{2}{5}
+\end{document}