summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/lualatex/pyluatex/pyluatex.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-06-05 21:02:04 +0000
committerKarl Berry <karl@freefriends.org>2022-06-05 21:02:04 +0000
commit80aa3b5de37b11d9f895cf844adcd9bb8fc127d2 (patch)
tree1453475e0f24bea856956c6326dfba3ceb01fc3a /Master/texmf-dist/doc/lualatex/pyluatex/pyluatex.tex
parent4d435df3faff5acb9f1c0f0b94944c4285980c9e (diff)
pyluatex (5jun22)
git-svn-id: svn://tug.org/texlive/trunk@63491 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/lualatex/pyluatex/pyluatex.tex')
-rw-r--r--Master/texmf-dist/doc/lualatex/pyluatex/pyluatex.tex43
1 files changed, 23 insertions, 20 deletions
diff --git a/Master/texmf-dist/doc/lualatex/pyluatex/pyluatex.tex b/Master/texmf-dist/doc/lualatex/pyluatex/pyluatex.tex
index c4a10738ac0..366a7ae8dae 100644
--- a/Master/texmf-dist/doc/lualatex/pyluatex/pyluatex.tex
+++ b/Master/texmf-dist/doc/lualatex/pyluatex/pyluatex.tex
@@ -15,7 +15,7 @@
\usepackage{url}
\title{The \emph{pyluatex} package}
\author{Tobias Enderle\\\url{https://github.com/tndrle/PyLuaTeX}}
-\date{v0.4.4 (2022/03/16)}
+\date{v0.5.0 (2022/06/05)}
\begin{document}
\maketitle
\raggedright
@@ -56,7 +56,7 @@ $\sqrt{371} = \py{math.sqrt(371)}$
\end{tcblisting}
\textbf{Note:} PyLuaTeX starts Python 3 using the command \inlcode|python3| by default.
If \inlcode|python3| does not start Python 3 on your system, find the correct command
-and replace \inlcode|\usepackage{pyluatex}| with \inlcode|\usepackage[executable={your python command}]{pyluatex}|.
+and replace \inlcode|\usepackage{pyluatex}| with \inlcode|\usepackage[executable=<your python command>]{pyluatex}|.
For example, \inlcode|\usepackage[executable=python.exe]{pyluatex}|.
\item Compile using Lua\LaTeX{} (shell escape is required)
\begin{tcblisting}{breakable,listing only,
@@ -131,32 +131,35 @@ The package options \inlcode|verbose| and \inlcode|ignoreerrors| can be changed
\subsection{Macros}
\begin{itemize}
-\item \inlcode|\py{code}|\\[0.5ex]
- Executes (object-like) \inlcode|code| and writes its string representation to the document.\\[0.5ex]
+\item \inlcode|\py{<code>}|\\[0.5ex]
+ Executes (object-like) \inlcode|<code>| and writes its string representation to the document.\\[0.5ex]
\textit{Example:} \inlcode|\py{3 + 7}|
-\item \inlcode|\pyq{code}|\\[0.5ex]
- Executes (object-like) \inlcode|code|. Any output is suppressed.\\[0.5ex]
+\item \inlcode|\pyq{<code>}|\\[0.5ex]
+ Executes (object-like) \inlcode|<code>|. Any output is suppressed.\\[0.5ex]
\textit{Example:} \inlcode|\pyq{3 + 7}|
-\item \inlcode|\pyc{code}|\\[0.5ex]
- Executes \inlcode|code|. Output (e.g. from a call to \inlcode|print()|) is written to the document.\\[0.5ex]
+\item \inlcode|\pyc{<code>}|\\[0.5ex]
+ Executes \inlcode|<code>|. Output (e.g. from a call to \inlcode|print()|) is written to the document.\\[0.5ex]
\textit{Examples:} \inlcode|\pyc{x = 5}|, \inlcode|\pyc{print('hello')}|
-\item \inlcode|\pycq{code}|\\[0.5ex]
- Executes \inlcode|code|. Any output is suppressed.\\[0.5ex]
+\item \inlcode|\pycq{<code>}|\\[0.5ex]
+ Executes \inlcode|<code>|. Any output is suppressed.\\[0.5ex]
\textit{Example:} \inlcode|\pycq{x = 5}|
-\item \inlcode|\pyfile{path}|\\[0.5ex]
- Executes the Python file specified by \inlcode|path|. Output (e.g. from a call to \inlcode|print()|) is written to the document.\\[0.5ex]
+\item \inlcode|\pyfile{<path>}|\\[0.5ex]
+ Executes the Python file specified by \inlcode|<path>|. Output (e.g. from a call to \inlcode|print()|) is written to the document.\\[0.5ex]
\textit{Example:} \inlcode|\pyfile{main.py}|
-\item \inlcode|\pyfileq{path}|\\[0.5ex]
- Executes the Python file specified by \inlcode|path|. Any output is suppressed.\\[0.5ex]
+\item \inlcode|\pyfileq{<path>}|\\[0.5ex]
+ Executes the Python file specified by \inlcode|<path>|. Any output is suppressed.\\[0.5ex]
\textit{Example:} \inlcode|\pyfileq{main.py}|
-\item \inlcode|\pysession{session}|\\[0.5ex]
- Selects \inlcode|session| as Python session for subsequent Python code.\\[0.5ex]
+\item \inlcode|\pysession{<session>}|\\[0.5ex]
+ Selects \inlcode|<session>| as Python session for subsequent Python code.\\[0.5ex]
The session that is active at the beginning is \inlcode|default|.\\[0.5ex]
\textit{Example:} \inlcode|\pysession{main}|
-\item \inlcode|\pyoption{option}{value}|\\[0.5ex]
- Assigns \inlcode|value| to the package option \inlcode|option| anywhere in the document. For more information consider
+\item \inlcode|\pyoption{<option>}{<value>}|\\[0.5ex]
+ Assigns \inlcode|<value>| to the package option \inlcode|<option>| anywhere in the document. For more information consider
the Package Options section.\\[0.5ex]
\textit{Example:} \inlcode|\pyoption{verbose}{true}|
+\item \inlcode|\pyif{<test>}{<then clause>}{<else clause>}|\\[0.5ex]
+ Evaluates the Python boolean expression \inlcode|<test>|, and then executes either the \LaTeX{} code in \inlcode|<then clause>| or the \LaTeX{} code in \inlcode|<else clause>|.\\[0.5ex]
+ \textit{Example:} \inlcode|\pyif{a == 1}{$a = 1$}{$a \neq 1$}|
\end{itemize}
\subsection{Environments}
\begin{itemize}
@@ -197,8 +200,8 @@ in your environment definition, e.g.
\item Python 3
\item Linux, macOS or Windows
\end{itemize}
-Our automated tests currently use TeX Live 2021 and Python 3.7+ on
-Ubuntu 20.04, macOS Big Sur 11 and Windows Server 2019.
+The automated tests currently use TeX Live 2022 and Python 3.8+ on
+Ubuntu 20.04, macOS Big Sur 11 and Windows Server 2022.
\section{Typesetting Code}
Sometimes, in addition to having Python code executed and the output written to your document, you also want to show the code itself in your document.