The question: possibility of using of working python scripts embedded in LaTeX.
When I was using \usepackage{python}, it did wonders to my dissertation (although I am very new to LaTeX, but some thousands of lines of code have been written in python). Python was drawing plots and putting them on hard drive, then LaTeX was putting them inside the document. After serious problem with the system (linux Mint), I was forced to reinstall, and python + LaTeX stopped working. I was looking for a solution and pythontex was promising. It turned out, eventually, there is some serious conflict between mwrep and pythontex.
Is it possible to use pythontex with mwrep? (mwrep is a must [EDIT: On second thought I don't know if it really is required -- I thought that the printing house wants the document of this class -- to tell the truth I do not know the difference. I'll ask about it the editor.])
Or is there a better possibility of emmbeding python scripts inside LaTeX (i.e. working scripts)?
P.S.
I was looking for an answer, but I found no definitive solution.
UPDATE
Minimal working example.
.TEX file:
% !TEX options=--shell-escape
\documentclass[11pt]{mwrep}%
\usepackage{pythontex}
\usepackage{graphicx}
\begin{document}
\section{pythontex try}
% \begin{pyconsole}
% x = 987.27
% x = x**2
% print(f"{x = }")
% print("Hello Seba :)")
% \end{pyconsole}
\end{document}
Sublime Text message:
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2022/dev/Debian) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./mwrepPythontryMini.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-01-21>
(/usr/share/texlive/texmf-dist/tex/latex/mwcls/mwrep.cls
Document Class: mwrep 2017/05/13 v0.75 A LaTeX document class (MW)
*** Beta version. Formatting may change
*** in future versions of this class.
(/usr/share/texlive/texmf-dist/tex/latex/mwcls/mw11.clo))
(... cut ...)
(./mwrepPythontryMini.aux)
No file pythontex-files-mwrepPythontryMini/mwrepPythontryMini.pytxmcr.
Run PythonTeX to create it.
! Undefined control sequence.
\newfloat@setwithin ...apter}@chapterlistsgap@on
{#1}\newfloat@@setwithin {...
l.9 \begin{document}
?
*.sublime-build:
{
"shell_cmd": "pdflatex $file_name && pythontex $file_name --interpreter python:python3 && pdflatex $file_name && xreader $file_base_name.pdf "
}
