2

I just achieved a clean install of MacOS Mojave. I have reinstalled Pythontex with the help of TeX Live Utility. Python 3 is installed with Anaconda. The package works fine when the typesetting is done with the following commands on a shell :

xelatex -8bit -synctex=1 filename
pythontex filename
xelatex -8bit -synctex=1 filename

The output is correct :

enter image description here

But I am not able to typeset with a classical bash script as above (for exemple with TexMaker or TeXPad) :

xelatex -shell-escape -8bit %.tex|pythontex %.tex|xelatex -shell-escape  -8bit %.tex|

Output enter image description here MVE :

\documentclass[a4paper]{book}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\usepackage{pythontex}
%%%%%%%%%%%%
\begin{document}

ABCDE
1+2=

\begin{pyconsole}
1+1
\end{pyconsole}

\end{document}

In the log file I see Package PythonTeX Warning: Missing autoprint content on input line 9.

  • Your script does not call pythontex. Only XeLaTeX (and that thrice)… – TeXnician Dec 29 '18 at 15:11
  • I corrected my script. – jowe_19 Dec 29 '18 at 15:17
  • 4
    Even now I would say that your script is not a typical bash script. In bash I would say xelatex … && pythontex … && xelatex …. I do not think that piping is the way to go. – TeXnician Dec 29 '18 at 15:20
  • 1
    Why note just use what works? Instead of filename use $1 and save it (e.g., mypythontex.sh), make it executable and then run it as mypythontex.sh filename. You may have to put it in the same directory as filename and run it as ./mypythontex.sh filename. – Herb Schulz Dec 29 '18 at 17:55
  • Thank you Herb Schulz for your suggestion. The file mypythontex.sh is perfect until I find a solution for typesetting directly with Texmaker or TexPad. – jowe_19 Dec 29 '18 at 20:06
1

I solved it specifying an explicit path : python /usr/local/texlive/2018/bin/x86_64-darwin/pythontex filename instead of pythontex filename

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.