Is possible to use LaTeX macros in pythonTeX pyblock environment and use/store theyre output on python side of pythonTeX?
Following MWE should completely illustrate my question:
\documentclass[11pt]{article}
\usepackage{fontspec}
\usepackage{lipsum}
\usepackage{pythontex}
\begin{document}
\begin{pyblock}
mytext = \lipsum[4]
print(mytext)
\end{pyblock}
\printpythontex
\end{document}
For document compilation I am using LuaLatex, so making this possible with lua as "middle man" wuold be for me perfectly acceptable.
Note: Apparently python is interpretting \ as line continuation character, naively trying to escape it \\ led to no success ...