Python is a general-purpose, interpreted high-level programming language.

learn more… | top users | synonyms

2
votes
1answer
34 views

Style Pygments at PythonTeX

Can I use style pygmentize with Pygments at PythonTeX. Let MWE like this : \documentclass{article} \usepackage{pythontex} \begin{document} \begin{pygments}[style= murphy]{python} % murpyhy is style ...
6
votes
1answer
22 views

Inconsistent invocation of Python versions with pythontex

I'm getting what looks to me like anomalous behavior with the pythontex system. A minimal working example is the following: \documentclass{article} \usepackage[gobble=auto]{pythontex} ...
0
votes
0answers
45 views

XeLaTeX does not compile a document when activated from Python 2.7.8

I am debugging a Python 2.7.8 script to compile a document with XeLaTeX. I have a MacTeX 2014 installation which works fine when activated through the command window or TeXmaker. Following is the ...
4
votes
1answer
39 views

How to make breaklines the result from PythonTeX ?

I try make a document with use PythonTeX like this : \documentclass[a4paper, 12pt]{article} \usepackage{pythontex} \usepackage{fullpage} \begin{document} \begin{verbatim} \py{2014/2009} ...
2
votes
0answers
79 views

How to running Pythontex ?

I have problem running pythontex , and my MWE like this : \documentclass[12pt]{scrartcl} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{pythontex} \begin{document} \py{2+2} ...
3
votes
1answer
40 views

python environment works with animate for single frames but not multiframe

I am trying to achieve some complicated animations with the animate and python packages. I can use the python environment within an animate environment for single frames, for instance: ...
0
votes
0answers
39 views

PyX with Chinese Characters / Xetex / encoding

I've been struggling with getting PyX to output some Chinese characters. The routes I have been trying are: Getting PyX to use Xetex changing my encoding using ...
3
votes
1answer
57 views

How can I use a LaTeX .sty file to get output from a Python file?

I'm currently working on a package that supposedly takes the output of a function in a Python script, and adds it to the PDF. For example, one function may scrape data from a website automatically, so ...
3
votes
0answers
60 views

run xelatex, different results when run from terminal and from python

Good evening! I would like run some service that generates images with dynamic content. Everyting is working perfectly using command line, but problems start when i call compiler from python code ...
6
votes
2answers
210 views

Automatically include a sequence of images

I want to include a sequence of images in Beamer (although it can be in another type of document). Something similar to the option Photo Album in LibreOffice and MS PowerPoint. What I did is to make ...
3
votes
1answer
80 views

Customize Color for lstset morekeywords

I have done some extensive searching and have yet to find the answer to changing the color for lstset morekeywords. I want them to be a different color than my regular keywords. Here is what I have ...
0
votes
0answers
60 views

Installing Python on portable TexLive for Mac

I managed to install a portable texlive on my mac. Now I want to install pythontex on it as well. How can I tell the system to install pythontex on my portable folder or how can I install pythontex ...
0
votes
0answers
48 views

Using tikz or pgfplots with plasTeX

I'm using plastex to convert LaTeX files to xml code. Is there any way to use tikz or pgfplots with plastex? plastex example1.tex compiles fine: %example1.tex \documentclass{article} ...
2
votes
1answer
39 views

Macro output as an input in subsequent pythontex command/environement?

I am trying to make a document with one specific math/physics exercise. Of course the exercise consists of input data (i.e. a = 2 cm, b = 3 cm,...) and part where calculations are performed. Just by ...
3
votes
1answer
71 views

Problem with listings package for Python syntax coloring

I am implementing the method I learned here for putting Python code in Latex. Everything works great except that I have problems with comments. Here's the code from the link I mentioned: ...
0
votes
0answers
98 views

“missing autoprint content” error in PythonTeX

I just installed PythonTeX in MiKTeX/windows, with latest python 2.7. The installation looks fine to me. I got all the files in MiKTeX directory and the pythontex.bat file in miktex/bin. Then I try to ...
4
votes
1answer
146 views

pythontex - How to choose the version of Python used?

I have two versions. How can I tell to pythontex the path to the Python3 to be used if it is possible ?
2
votes
0answers
16 views

How to highlight Python syntax in LaTeX using verbments and utf8 [duplicate]

I'm using Latex and the verbments package to display some python 3 code (with syntax highlighting) inside a document, but I have a problem with UTF-8. I'm using the verbments package ...
2
votes
1answer
366 views

Matplotlib's PGF vs Matplotlib2Tikz

I want to generate some plots to be integrated into a LaTeX document compiled with pdflatex. I also want the plot font (legend, title ...) to follow the settings of the LaTeX document. My search so ...
2
votes
1answer
197 views

pythontex on Ubuntu 14.04

After installing the package pythontex via latex pythontex.ins, I tried the following example to test it: \documentclass[10pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} ...
0
votes
0answers
77 views

get spyder-like color highlighting in pythontex

In my work with Python 3.4, I use spyder (anaconda3 2.0.1) and I like the highlighting of the Spyder editor (version 2.3). Is it possible to have the same highlighting scheme in latex documents ...
2
votes
1answer
55 views

Printing stdout with pythontex and line referencing

I have a problem with PythonTeX and Beamer : I don't understand why the code below doesn't work: \stdoutpythontex is supposed to print the last output of the last block of python instructions, but it ...
2
votes
1answer
117 views

Beamer and Pause with PythonTex

I am using PythonTex with MacTex, TexShop and anaconda3 : all versions are up-to-date, and pythontex-gallery is compiled without any problem. Now, as I am a teacher, I want to use beamer (I use the ...
0
votes
0answers
98 views

Script to extract and copy from LaTeX files

I have a large LaTeX document, one main and a lot of \input{file} for each chapter. For each of these files I would like to copy them and only keep the Theorems, in other words I'd like to extract and ...
4
votes
1answer
132 views

How to batch generate badges with a list of names?

I want to make a number of badges using LaTeX for the participants of a summer school. There are 40 or so people, so I don't want to manually change the name and compile and then print. I could think ...
1
vote
0answers
41 views

Compile to the actual location of a file [closed]

So I'm really new to Latex and using python to compile a document, using "output\pdflatex test1" However the compiled files are created in the main directory, not the subdirectory of output, where the ...
1
vote
0answers
91 views

Why lua and not python? [duplicate]

I mean instead of lualatex. I came across the python package, so I am not asking about python support. What was so special about lua that people spent so much time on that instead of doing something ...
1
vote
1answer
99 views

references to floats without ever using figure numbers (possbily using lua or python)

Stephen Wolfram's 'A New Kind of Science' states in its colophon that it has 973 illustrations spread out over 1280 pages. Remarkably, he accomplishes this without ever using figure numbers. No figure ...
2
votes
1answer
105 views

Force latex to finish compiling regardless of error? (xelatex)

I have a reoccurring problem. I want to be able to force latex to finish compiling regardless of an error. I know that this error will occur several times in my script and it is a result of the ...
0
votes
1answer
707 views

Exporting and formatting Evernote notes as a LaTeX document [closed]

I use Evernote almost exclusively for notes but I've looked into using LaTeX again because it's fast multi platform and formats documents well. Is there any way to export Evernote notes? Maybe using ...
2
votes
1answer
52 views

Conditionally change font color of number passed from pythontex

I would like to color numbers red if they are less than zero. In my final report, these number will be generated from a python script. To use the pythontex package, I first run xelatex doc.tex, then ...
8
votes
0answers
180 views

LaTeX Visual Novel Engine: Does it exist?

Did anyone in the past use LaTeX to create a "visual novel" engine? I've been using http://www.renpy.org/ for rare presentations when I need functionality the beamer class in LaTeX doesn't easily ...
1
vote
0answers
100 views

Unexplainable error using minted [closed]

After changing one argument in math.py and running _mapping.py, I managed to break minted: LaTeX Error: File `temp.out.pyg' not found. Type X to quit or <RETURN> to proceed, or enter new ...
2
votes
0answers
126 views

Syntax highlighting in minted - how does it work? [closed]

I want to customize the minted syntax highlighting, but neither the minted package documentation, nor the existing topics on syntax highlighting in minted on TeX.SX, nor google offer explanation on ...
0
votes
0answers
63 views

error while running latex code with embedded python code

I am trying to run python code within my latex code. i tried simple hellow world example but i have occured through this error . my latex file name is pyinlt.tex Error: i can't find file ...
3
votes
1answer
121 views

How to plot barplot horizontally in LaTeX

I want to plot a barplot horizontally. I have tried using the following code, but it prints a vertical plot: \documentclass[varwidth=true, border=2pt]{standalone} \usepackage{pgfplots} ...
3
votes
1answer
521 views

Use Parameter defined in PythonTex in Latex to open File

I have a Python code which detects my files. Now I will open it in Latex. But it seems not possible to give the detected names to Latex I have tried this: \begin{pycode} l = [f for f in ...
5
votes
1answer
150 views

Latex \newcommand with python code inside

I'm extremely new to Latex. I'm using python package to insert graphics in a loop. What I can not understand is how I can transform this code \documentclass{article} \usepackage{python} ...
2
votes
1answer
305 views

HTML to LaTex: How can I use python and lxml to convert an html document to LaTeX with custom macros

I want to use python to take html5 documents with a known set of tags and convert them to LaTeX for high-quality printing using customized LaTeX macros.
0
votes
1answer
100 views

How to create pdf with latex?

Sorry about asking a stupid question. I'm just trying to use this, but don't know anything. My problem is: I want to plot graph with python code. I run it in terminal (I'm using mac) by calling: ...
18
votes
1answer
574 views

How to typeset programming code syntax with annotations?

If possible I would like to know how to this on latex/tikz to add this like (environment and graph) on my ebook. Thanks a lot!!! Code im trying to implement: \documentclass[11pt,fleqn]{book} ...
11
votes
1answer
4k views

MiKTeX and Perl scripts (and one Python script)

Again and again here on TeX.SX users of MiKTeX ask a question having a problem with a package or included program, where it turns out, that a Perl script is involved, in particular glossaries (because ...
2
votes
0answers
168 views

I can't get pythonTEX to work, too few arguments

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 ...
4
votes
1answer
137 views

Pass (La)TeX-Length as function argument using pythontex

I'm trying to pass a LaTeX-Length (\textwidth) to a python function specified in an pyblock-environment provided by the pythontex-package. Running pythontex gives me an error message, that does not ...
2
votes
2answers
467 views

Plot theoretical Binomial distribution with pgfplots

I am trying to plot the theoretical binomial distribution with pgfplots but don't get the desired output: \documentclass{article} \usepackage{pgfplots} \usepackage{python} \begin{document} ...
4
votes
1answer
180 views

tcolorbox minted library with python3 non-determinism

Later versions of the package tcolorbox allows formatting source code with its minted library (which uses the minted package). When a document is compiled, a temporary file with extension .pyg is ...
0
votes
1answer
105 views

Python variables not accesible in pyconsole (PythonTeX)

This MWE is self explanatory: % Compile this with pdflatex -> pythontex.py -> pdflatex \documentclass[a6paper]{article} \usepackage{pythontex} \usepackage{geometry} \begin{document} ...
2
votes
2answers
722 views

Installation of pythontex

I am trying to install pythontex on Ubuntu 13.04. but cant find the way how. Downloaded ZIP from http://www.ctan.org/pkg/pythontex. Tried to follow instructions but unfortunately something went ...
3
votes
1answer
449 views

Command line SVG2TikZ

(Apologies if this is too far from topic, but I thought it might be of interest to some here) I am writing a makefile to take a bunch of SVGs that I have drawn and turn them into TikZ pictures via ...
1
vote
0answers
283 views

Cannot install pythontex

I have been trying to install pythontex on Windows 8 (64-bit) with MiKTeX installed. I have tried running "latex pythontex.ins" from the directory but it doesn't work. I have tried using the package ...