diff options
author | Karl Berry <karl@freefriends.org> | 2024-03-30 19:55:01 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-03-30 19:55:01 +0000 |
commit | 806bb58716423a6f1170989fb6ce5c4be2529a2e (patch) | |
tree | c34dda2b67a9830924f793e5e9dc09bba5ce5781 /Master/texmf-dist/doc | |
parent | fce96fb14ef55dc09927cf3fb882415b73dd8953 (diff) |
pynotebook (30mar24)
git-svn-id: svn://tug.org/texlive/trunk@70818 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc')
-rw-r--r-- | Master/texmf-dist/doc/latex/pynotebook/pynotebook-doc.pdf | bin | 436049 -> 436863 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/pynotebook/pynotebook-doc.tex | 40 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/pynotebook/pynotebook-examples-pitonpyluatex.pdf | bin | 83036 -> 103153 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/pynotebook/pynotebook-examples-pitonpyluatex.tex | 42 |
4 files changed, 72 insertions, 10 deletions
diff --git a/Master/texmf-dist/doc/latex/pynotebook/pynotebook-doc.pdf b/Master/texmf-dist/doc/latex/pynotebook/pynotebook-doc.pdf Binary files differindex e64acd414c1..47e8ae1f0ec 100644 --- a/Master/texmf-dist/doc/latex/pynotebook/pynotebook-doc.pdf +++ b/Master/texmf-dist/doc/latex/pynotebook/pynotebook-doc.pdf diff --git a/Master/texmf-dist/doc/latex/pynotebook/pynotebook-doc.tex b/Master/texmf-dist/doc/latex/pynotebook/pynotebook-doc.tex index ca6d4511e1d..b721cb848d6 100644 --- a/Master/texmf-dist/doc/latex/pynotebook/pynotebook-doc.tex +++ b/Master/texmf-dist/doc/latex/pynotebook/pynotebook-doc.tex @@ -33,8 +33,8 @@ \usepackage[margin=2cm]{geometry} \setlength{\parindent}{0pt} -\def\TPversion{0.1.1} -\def\TPdate{19/02/2024} +\def\TPversion{0.1.3} +\def\TPdate{30/03/2024} \sethlcolor{lightgray!25} \NewDocumentCommand\ShowCode{ m }{% @@ -189,6 +189,10 @@ Recommencer [o/n] ? n \section{History} +\verb|v0.1.3|~:~~~~Modification with \texttt{gobble} (for \textsf{piton}) + +\verb|v0.1.2|~:~~~~Enhancements with \texttt{gobble} (for \textsf{piton}) + \verb|v0.1.1|~:~~~~New block \textsf{In/Out} with \textsf{piton/pyluatex} (tks to F. Pantigny) \verb|v0.1.0|~:~~~~Initial version @@ -474,25 +478,37 @@ The package provides environments : \end{itemize} \begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] -\begin{NotebookPitonIn}(*)[options tcbox]{<width>} +\begin{NotebookPitonRaw}[options tcbox]{width}<gobble options> +<code> +\end{NotebookPitonRaw} +\end{codehigh} + +\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] +\begin{NotebookPitonMarkdown}[options tcbox]{width} +<code> +\end{NotebookPitonMarkdown} +\end{codehigh} + +\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] +\begin{NotebookPitonIn}(*)[options tcbox]{width}<gobble options> <code> \end{NotebookPitonIn} \end{codehigh} \begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] -\begin{NotebookPitonOut}(*)[options tcbox]{<width>} +\begin{NotebookPitonOut}(*)[options tcbox]{width}<gobble options> <code> \end{NotebookPitonOut} \end{codehigh} \begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] -\begin{NotebookPitonInOut}(*)[options tcbox]{<width>} +\begin{NotebookPitonInOut}(*)[options tcbox]{width}<gobble options> <code> \end{NotebookPitonInOut} \end{codehigh} \begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] -\begin{NotebookPitonConsole}[options tcbox]{<width>} +\begin{NotebookPitonConsole}[options tcbox]{width}<gobble options> <code> \end{NotebookPitonConsole} \end{codehigh} @@ -501,6 +517,18 @@ The starred versions removes the counter, and don't display it. The blocks with \textit{header} (\texttt{In/Out}) are automatically numbered, and the global style is fixed. +\smallskip + +\texttt{gobble options} are given within \textsf{piton} syntax : + +\begin{itemize} + \item \texttt{auto-gobble} ; + \item \texttt{env-gobble} ; + \item \texttt{gobble=xx} ; + \item \texttt{tabs-auto-gobble} ; + \item a mix of them. +\end{itemize} + \subsection{Examples} Due to the necessary usage of \hologo{LuaLaTeX} and \textsf{--shell-escape}, examples are given in a separate file. diff --git a/Master/texmf-dist/doc/latex/pynotebook/pynotebook-examples-pitonpyluatex.pdf b/Master/texmf-dist/doc/latex/pynotebook/pynotebook-examples-pitonpyluatex.pdf Binary files differindex f5a8cfb3313..5a816e5ebaa 100644 --- a/Master/texmf-dist/doc/latex/pynotebook/pynotebook-examples-pitonpyluatex.pdf +++ b/Master/texmf-dist/doc/latex/pynotebook/pynotebook-examples-pitonpyluatex.pdf diff --git a/Master/texmf-dist/doc/latex/pynotebook/pynotebook-examples-pitonpyluatex.tex b/Master/texmf-dist/doc/latex/pynotebook/pynotebook-examples-pitonpyluatex.tex index 6dfdc9bd531..34112ed0c77 100644 --- a/Master/texmf-dist/doc/latex/pynotebook/pynotebook-examples-pitonpyluatex.tex +++ b/Master/texmf-dist/doc/latex/pynotebook/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 |