summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/pynotebook/doc/pynotebook-examples-pitonpyluatex.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/pynotebook/doc/pynotebook-examples-pitonpyluatex.tex')
-rw-r--r--macros/latex/contrib/pynotebook/doc/pynotebook-examples-pitonpyluatex.tex42
1 files changed, 38 insertions, 4 deletions
diff --git a/macros/latex/contrib/pynotebook/doc/pynotebook-examples-pitonpyluatex.tex b/macros/latex/contrib/pynotebook/doc/pynotebook-examples-pitonpyluatex.tex
index 6dfdc9bd53..34112ed0c7 100644
--- a/macros/latex/contrib/pynotebook/doc/pynotebook-examples-pitonpyluatex.tex
+++ b/macros/latex/contrib/pynotebook/doc/pynotebook-examples-pitonpyluatex.tex
@@ -3,7 +3,7 @@
% arara: lualatex: {shell: yes, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)')
\documentclass[a4paper,11pt]{article}
-\def\PLver{0.1.1}
+\def\PLver{0.1.3}
\usepackage[margin=1.5cm]{geometry}
\usepackage{pynotebook}
\usepackage[executable=python]{pyluatex}
@@ -21,6 +21,23 @@
\usepackage[executable=python]{pyluatex} % with a specific compilation !!
\end{codehigh}
+\section{With gobble}
+
+Due to \texttt{gobble} options with \textsf{piton}, it's possible to add \texttt{gobble} parameters to the environments, given within last argument between \texttt{<...>}, and default is \texttt{empty} :
+
+\begin{itemize}
+ \item \texttt{<gobble=xx>} ;
+ \item \texttt{<env-gobble>} ;
+ \item \texttt{<auto-gobble>} ;
+ \item \texttt{<tabs-auto-gobble>}.
+\end{itemize}
+
+\noindent{}\textbf{Explanations} are given in the doc of \textsf{piton} :
+
+\begin{itemize}
+ \item \texttt{https://ctan.org/pkg/piton}
+\end{itemize}
+
\section{Examples of text blocks}
\begin{codehigh}
@@ -116,7 +133,7 @@ print([fibonacci_of(n) for n in range(10)])
\end{NotebookPitonOut}
\end{codehigh}
-\begin{NotebookPitonOut}{\linewidth}
+\begin{NotebookPitonOut}{0.75\linewidth}
def fibonacci_aux(n,a,b):
if n == 0 :
return a
@@ -279,6 +296,20 @@ def fibonacci_of(n):
print([fibonacci_of(n) for n in range(10)])
\end{NotebookPitonInOut}
+\subsection{Alternate environment for In/Out}
+
+Thanks to F. Pantigny, an alternate environment for \texttt{In/Out} is available, with \textit{all} line numbers and continuation symbol.
+
+\begin{codehigh}
+\begin{NotebookPitonAllNum}{0.66\linewidth}
+print([i**2 for i in range(50)])
+\end{NotebookPitonAllNum}
+\end{codehigh}
+
+\begin{NotebookPitonAllNum}{0.66\linewidth}
+print([i**2 for i in range(50)])
+\end{NotebookPitonAllNum}
+
\pagebreak
\section{Global example}
@@ -353,14 +384,14 @@ def calculPerimetre(cote1, cote2, cote3) :
perimetre1 = calculPerimetre(6, 4, 3)
perimetre2 = calculPerimetre(10, 3, 11)
-print(f"Le périmètre de mon 1er triangle est {perimetre1}, et celle de mon 2d est {perimetre2}.")
+print(f"Le périm de mon 1er triangle est {perimetre1}, et celui de mon 2d est {perimetre2}.")
\end{NotebookPitonInOut}
\begin{NotebookPitonInOut}{\linewidth}
A = 15
B = 10
C = 11
-print(f"Le périmètre de mon triangle est {calculPerimetre(A, B, C)}.")
+print(f"Le périmètre de mon triangle est {calculPerimetre(A,B,C)}.")
\end{NotebookPitonInOut}
\begin{NotebookPitonIn}{\linewidth}
@@ -371,4 +402,7 @@ calculPerimetre(4, 4, 4)
print(calculPerimetre(4, 4, 4))
\end{NotebookPitonConsole}
+\begin{NotebookPitonInOut}{0.5\linewidth}
+print([i**2 for i in range(50)])
+\end{NotebookPitonInOut}
\end{document} \ No newline at end of file