I have installed Windows 7, MiKTeX 2.9, TeXnicCenter 2.02 stable and Python 3.4.1 (distribution pyzo2015a). I use

latex pythontex.ins

form cmd to install the package pythontex:

enter image description here.

It seems to me that no files have been created in MiKTeX. Hence I have recopied manually the files to the appropriate directories as README.

My pythontex.bat (in C:\MiKTeX 2.9\miktex\bin) contains

@echo off "C:\MiKTeX 2.9\scripts\pythontex\pythontex.py" %*

My PATH contains

C:\pyzo2015a;C:\MiKTeX 2.9\miktex\bin;C:\windows\system32

I used the following commands in the cmd:

enter image description here

From the quickstart of this package:

"Compiling a document that uses pythontex involves three steps: run LATEX, run pythontex.py, and finally run LATEX again".

I tried: enter image description here

And the .pdf file obtained from the tex file (after several latex compilation) looks like this: ??

1) I am not able to process the second step. How do I activate pythontex.py on a .tex file from TeXnicCenter? My feeling is that my system does not recognise pythontex.py: there is a problem in my installation of pythontex.

2) Is it possible to make automatic this task with TeXnicCenter (by using a postprocessor?)? I use

C:\MiKTeX 2.9\miktex\bin\pdflatex.exe

in my profile.

  • Using a postprocessor would work. It should add only a tiny amount of overhead compared to creating a special profile or keyboard shortcut for running pythontex, and then manually running pythontex as needed. If you used the pythontex installation script, there should be a batch file pythontex.bat under C:\MiKTeX 2.9\miktex\bin that you can use to run pythontex. Otherwise, you could run pythontex.py directly. – G. Poore Aug 4 '15 at 13:00
  • Thank you for your answer. I have updated the question. Any help is welcome. – Zouba Aug 5 '15 at 6:21
  • I should have clarified that the installation script I meant was pythontex_install.py, which can be used after generating pythontex.sty to move files automatically. At this point, running pdflatex test.tex, pythontex test.tex, and finally pdflatex test.tex should work. If pythontex is giving any error messages, please add those to your question. Also, knowing what is in test.tex might help. – G. Poore Aug 5 '15 at 11:37
  • It has been more than 10 years since I used TeXnicenter. You need to open Help-Search-Contents-Configuration-ManualConfiguration. You will read about how to use the different tabs. Now set your LaTeX compiler choice on the first tab, the python compiler in the preprocessing tab, and choose the viewer on the fourth tab if desired. When I was using TeXnicenter with students, we ran Python, C+, Java, MySQL, sed, awk, perl, asmptote, and R either as pre- and/or post-processors with settings in the build menu. – R. Schumacher Aug 5 '15 at 11:56

Your Answer

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

Browse other questions tagged or ask your own question.