unix installer (tested on macport install of latex) - #4
Conversation
|
This looks good. I will merge soon. Two questions: I would like to acknowledge you in the documentation. Is that acceptable? If so, what version of OS X and what version of Python are you using, so I can mention that in the documentation regarding compatibility? |
|
Sure, Mac OS X 10.7.4, python 2.7.3. Question back to you: how do you maintain the different python version files, say I make an innocent change in pythontex2.py do I have to make the same change manually in pythontex3.py? Or do you have a script for this? On 19. juli 2012, at 00:05, gpoore wrote:
|
|
I have a script that automatically converts from 2 to 3. Basically, any code that is only for one version has special comments around it. In the Python 2 version, the special Python 2 code is un-commented and the Python 3 version is commented out. The script un-comments the Python 3 version and comments out the Python 2 version. The script is pythontex_2to3.py. I will put it up later today. |
This reverts commit cbc6268.
latex compilation junc
… error to have dissapeared (it also runs for warnings, so if you have a warning it runs that code every time which was annoying)
…ery time even when disabled)
|
I think I'm close to a solution regarding code that depends on external files. I think I can add something like pytex.add_external_dependency("ext_file1", "ext_file2", ...), and have PythonTeX automatically track changes in the code as well as changes in all user-specified external files. I'll see if I can get that up in the next week or so. Can you explain the type of situation in which you need asynchronous plotting? The code you are using doesn't work under Windows (Windows has special multiprocessing restrictions, due to the lack of fork). Before I consider creating a truly cross-platform solution, I want to make sure I'm clear on the problem. If plots are slow, that could be because you are plotting a lot of data. But it could also just be because you are using matplotlib's LaTeX option, which can really slow things down. If the LaTeX option is the real issue, the simplest thing to do is to disable the LaTeX option until everything is in final form, then enable it for one last run. Even if I don't go ahead with creating a cross-platform asynchronous plotting solution, I will modify the PythonTeX utilities class a little, so that scripts like your current async_pylab_save.py can be plugged right into the PythonTeX workflow, without requiring changes to pythontex_types2.py or any of the other PythonTeX scripts. Basically, I will make the utilities class provide an interface that imported packages can use if they need to run code automatically at the beginning or end of a session. So instead of having to modify pythontex_types2.py to add "aps.join()" to the end of each session, you can add a line like "pytex.cleanup.append("aps.join()")" somewhere in async_pylab_save.py. |
|
Yes, I use the latex option and save a lot of figures with lots of data so the async_pylab_save.py really helps to speed things up. I am not particularly happy about a "final" version, as I always want the final version. I had some problems using a different backend then 'Agg', maybe you can try that. When you say "track changes" would you look at the timestamp or read the entire file? (My files are big, so reading the entire file just to check for changes would be painfull). It would be easier if the "setpythontexcustomcode" could also add stuff to the end of file, this way async_pylab_save.py can be seperate from pythontex. Adding ""pytex.cleanup.append("aps.join()")" somewhere in async_pylab_save.py." won't work since async_pylab_save does not know about the pytex class. On 17. aug. 2012, at 07:35, gpoore wrote:
|
|
I have a few issues running pythontex under Windows. I am now at the point, where pythontex.bat py1.tex throws: C:\Users\Uwe\Documents\dokumente\LaTeX-snippets\Python>pythontex.bat py1.tex
Since there is no pythontex.py, I adjusted the bat file to use Python 2. The TeX file contains: \documentclass{article} Any ideas? |
|
UweZiegenhagen, In the future, please open a new issue rather than reusing a pull request or issue that is already open...that makes it easier for me to keep track of things. You're correct that the batch files needs to use pythontex2.py (or pythontex3.py); I've fixed that for the next release. The error message means that kpsewhich returned an error while trying to find the location of pythontex_utils2.py. This is probably because it couldn't find pythontex_utils2.py. If you run the command "kpsewhich --format texmfscripts pythontex_utils2.py" from the command prompt, you should be able to determine if that is the case. If kpsewhich can't find the file, then the file probably isn't where it should be. Which TeX distribution are you using? Is there anything special about how you have TeX installed? How did you install PythonTeX? |
|
Sorry, I saw that after sending the comment. I completely ignored the installation instructions, now it works nicely. I guess I'll write an article on your work for the German TeX Users Group. Great job! Uwe |
|
TexShop 3.11+ Texlive2012 + MacPro OS 10.8.2 Works fine. pdflatex "$1" PYTHON="/Library/Frameworks/Python.framework/Versions/Current/bin/python" Says: This is PythonTeX v0.9beta3 ---- Errors for pylab_default_0 ----
PythonTeX: test - 1 error(s), 1 warning(s) And I don't know why because if I do pythontex.py test.tex it works fine! THANKS and Merry Christmas |
|
Looks like you don't have matplotlib installed, you can either download it from http://matplotlib.org, or you may use pythontex without using the pylab family. I am guessing test.tex does not contain any pylab related stuff. PS. Installing matplotlib manually can be a pain due to the dependencies, consider installing macport and running: |
|
Thank you obtitus! |
|
FGF, do you have multiple Python installations, or are you using virtualenv or a similar tool? It appears that matplotlib isn't being found, so if you do have multiple versions etc., that could prevent matplotlib from being found. You have and then I expect your problem is related to one of these lines. In terms of a TeXShop engine, I'm afraid I can't help much with that, because I only have access to Windows and Linux machines. If you do create a good, generic engine (doesn't depend too much on your specific configuration), I could think about adding that to the distribution. |
|
obtitus, The latest commit should address almost everything you've brought up in this request.
|
|
Looks great, after giving up trying to tell git to merge I deleted my own copy and made a new clone, seems to work fine (no extensive testing, but my thesis seems to compile fine after a few changes). Love the new pythontexcustomcode environment, for reference here is my new interface to the async plotting lib (but matplotlib 1.2 seems promising): I do have a question about some of the new output, but I will open a separate issue. Great work |
No description provided.