diff options
Diffstat (limited to 'Master/texmf-dist/doc/lualatex/pyluatex/example')
-rw-r--r-- | Master/texmf-dist/doc/lualatex/pyluatex/example/beamer.tex | 38 | ||||
-rw-r--r-- | Master/texmf-dist/doc/lualatex/pyluatex/example/repl.tex | 4 |
2 files changed, 25 insertions, 17 deletions
diff --git a/Master/texmf-dist/doc/lualatex/pyluatex/example/beamer.tex b/Master/texmf-dist/doc/lualatex/pyluatex/example/beamer.tex index 6dea2ea6c96..31ba69db821 100644 --- a/Master/texmf-dist/doc/lualatex/pyluatex/example/beamer.tex +++ b/Master/texmf-dist/doc/lualatex/pyluatex/example/beamer.tex @@ -8,7 +8,7 @@ %% and version 1.3c or later is part of all distributions of LaTeX %% version 2005/12/01 or later. -\documentclass{beamer} +\documentclass[t]{beamer} \usepackage{pyluatex} \usepackage{listings} @@ -64,13 +64,17 @@ end %%%%%%%%%%%%%%%%%%%%%% frame \begin{frame}{Important} -Using PyLuaTeX environments (\emph{python} or \emph{pythonq}) inside BEAMER frames -requires the \emph{fragile} option for those frames. +Using PyLuaTeX environments (\texttt{python}, \texttt{pythonq}, or \texttt{pythonrepl}) inside BEAMER frames +requires the \texttt{fragile} option for those frames. + +\medskip +If you don't use overlays in a frame, i.e. the frame contains only a single slide, +you can use the \texttt{fragile=singleslide} option. \end{frame} %%%%%%%%%%%%%%%%%%%%%% frame -\begin{frame}[fragile]{Slide 1} +\begin{frame}[fragile=singleslide]{Python environment inside frame} \begin{pythonq} msg = 'Hello slide 1' @@ -96,27 +100,31 @@ msg = 'Hello slide 2' print(msg) \end{pythonq} -\begin{frame}{Slide 1} +\begin{frame}{Python environment outside frame} \pytypeset -The \emph{fragile} option is not required in this frame because -the \emph{pythonq} environment is outside the frame. -Only the macro \emph{\textbackslash pytypeset} for typesetting the code and output is inside +The \texttt{fragile} option is not required in this frame because +the \texttt{pythonq} environment is outside the frame. +Only the macro \texttt{\textbackslash pytypeset} for typesetting the code and output is inside the frame. + +\medskip +Inline Python still works: The result of \pyq{17 + 300}$\coderaw$ is \outputraw \end{frame} %%%%%%%%%%%%%%%%%%%%%% frame -\newenvironment{typesetpython} - {\PyLTVerbatimEnv\begin{pythonq}} - {\end{pythonq}\pytypeset} - -\begin{frame}[fragile]{Slide 2} -\begin{typesetpython} +\begin{frame}[fragile]{Overlays} +\begin{pythonq} msg = 'Custom environment' print(msg) -\end{typesetpython} +\end{pythonq} +\pytypeset +\pause + +In this frame, \texttt{fragile} is required instead of \texttt{fragile=singleslide}, +because we use overlays. \end{frame} \end{document} diff --git a/Master/texmf-dist/doc/lualatex/pyluatex/example/repl.tex b/Master/texmf-dist/doc/lualatex/pyluatex/example/repl.tex index 28de0090cf9..8622223ef3c 100644 --- a/Master/texmf-dist/doc/lualatex/pyluatex/example/repl.tex +++ b/Master/texmf-dist/doc/lualatex/pyluatex/example/repl.tex @@ -57,9 +57,9 @@ square(5) \maketitle PyLuaTeX allows you to run and typeset Python code in an interactive console -or read–eval–print loop (REPL) fashion. Very much like in an IPython session, +or read–eval–print loop (REPL) fashion. Very much like in an interactive python session, code is prefixed with \verb|>>>| (or \verb|...| in case of multi-line commands) -and the results are printed automatically. +and the results are added to the output buffer automatically. Both code and output are stored in PyLuaTeX's ouput buffer and can be accessed by \verb|pyluatex.get_last_output()|. In this way, you can adjust the typesetting |