4,345 reputation
718
bio website
location
age
visits member for 2 years, 3 months
seen 2 hours ago

Apr
15
answered Seemingly trivial: verbatim, newenvironment, and colorbox
Apr
15
comment Seemingly trivial: verbatim, newenvironment, and colorbox
For fancyvrb, you need to use \VerbatimEnvironment before the \begin{Verbatim}. That tells fancyvrb to detect the name of the current environment, and look for the end of that environment, rather than looking for a literal \end{Verbatim}.
Apr
14
comment Using PythonTeX under windows
If you are under Windows with TeX Live, then you shouldn't need to modify anything from the example above. What do you get from pythontex --version on the command line? If you get the current version, everything should be installed and working correctly.
Apr
13
comment Using PythonTeX under windows
PythonTeX doesn't require -shell-escape, but it won't cause problems. You want something like pdflatex -synctex=1 -interaction=nonstopmode file.tex, then pythontex file.tex, then pdflatex -synctex=1 -interaction=nonstopmode file.tex. The middle stage may need to be modified depending on your OS, and if you have wrappers/symlinks for pythontex.py. The directories shouldn't be an issue. Did you install PythonTeX using the TeX Live package manager? It should set everything up automatically.
Apr
13
comment Using PythonTeX under windows
Have you run LaTeX, then pythontex.py (or pythontex.exe), then LaTeX again? That sounds like what happens before the Python script side of things has been run.
Apr
7
comment Latex \newcommand with python code inside
Regarding Python 3 syntax: pythontex imports everything from __future__ except for unicode_literals by default. This can be modified using the pyfuture package option.
Mar
24
reviewed Approve suggested edit on File `datatool.sty' not found
Mar
17
reviewed Approve suggested edit on Inkscape SVG with opacity exported to PDF in pdflatex document not displayed correctly on Mac OS X
Mar
12
answered How can I import and scale matplotlib plots, keeping fonts the correct size?
Mar
7
comment minted package call from function
You can't use verbatim content, like minted environments, inside commands; instead, you will probably need to save in a box. See this.
Feb
25
answered How to create a newcommand with knitr?
Feb
19
comment Is there a package manager that works directly with CTAN (or local TDS structures)?
A Python installation script I've written for one of my packages is here. It would need some modification for your purposes, but might provide some ideas if you do write something.
Feb
8
comment What are other programming languages with APIs for drawing graphs?
There are a number of ways to use other languages in your documents, so that your TeX document contains non-TeX code that generates external figures for inclusion: Sweave and knitr for R, PythonTeX for Python (and Ruby and Julia), SageTeX for Sage, etc.
Jan
31
comment I can't get pythonTEX to work, too few arguments
Are you running something like pythontex doc.tex? This looks like what happens when pythontex.py isn't getting the name of the document.
Jan
27
comment Pass (La)TeX-Length as function argument using pythontex
The problem is that the pythontex commands don't expand their arguments, so Python receives the literal string \textwidth and doesn't know what to do with it. egreg's solution expands \textwidth to avoid this. The next version of pythontex (beta on GitHub in a few days) has built-in utilities for passing contextual information like page dimensions to the Python side, as well as conversion functions for going from pt to in, cm, and mm. This can be used to make figures automatically adjust to page dimensions, etc.
Jan
27
comment Pass (La)TeX-Length as function argument using pythontex
The \py macro automatically prints a string version of whatever it is given (it can be given numbers, the names of existing Python variables, quoted strings, or any other valid Python code...it just doesn't expand its argument). The print() in printtexlength() is not needed. What is happening is that printtexlength() prints the desired value, and then \py prints the return value of the function, which is None. Instead, printtexlength() should be return 'Length is %f' % length. Then only the desired text will be printed.
Jan
25
reviewed Approve suggested edit on longtable within table environment?
Jan
23
awarded  Custodian
Jan
23
reviewed Approve suggested edit on number with subscript in siunitx
Jan
23
comment Minted PHP with line numbers
Have you tried omitting the <?php and using the startinline option?