1

I have tried to get the pythontex package to work in LaTeX but I get the typical(?) output, after I ran LaTeX, the python code and the LaTeX again. Then I found that I get "pythontex.py: error: too few arguments" when I run the code. So I guess I'll have to give in the name of the pythontex code but where?

\documentclass[oneside]{memoir}
\usepackage{pgfplots}
\usepackage{pythontex}
\begin{document}
\py{2+2}
\end{document}
6
  • 1
    I get no error.
    – egreg
    Jan 31, 2014 at 21:36
  • 1
    Are you running something like pythontex doc.tex? This looks like what happens when pythontex.py isn't getting the name of the document.
    – G. Poore
    Jan 31, 2014 at 22:26
  • BTW: Welcome to TeX.SX! Feb 1, 2014 at 5:58
  • @egreg do you just run the pythontex.py or do you give it the texfile as argument because it won't accept any argument I give.
    – candela137
    Feb 1, 2014 at 9:12
  • 1
    I called the file candela.tex and ran pdflatex candela, then pythontex candela, then pdflatex candela again.
    – egreg
    Feb 1, 2014 at 11:04

1 Answer 1

2

If the file is candela.tex, you have to run

pdflatex candela
pythontex candela
pdflatex candela

Running pythontex is not necessary if no change to the Python code have been made between a run of pdflatex and the next one.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .