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

learn more… | top users | synonyms

1
vote
1answer
40 views

Listing Python code with Strings and all characters

I have a little issue concerning the representation of a string in Python. I have the following Python Code #!/usr/bin/env python import sys import math import string from vmtk import pypes from ...
1
vote
0answers
11 views

Start up texlive under the Windows 7

I successfully installed texlite under Windows 7 for using it by Python package for the creation of PDF - PyX. And it worked well after installation, but after rebooting I receive an error TeX didn't ...
8
votes
2answers
138 views

How can I change the build system of python.sty from Python2 to Python3?

I am using the python.sty package, downloaded here. I found the default build path is to use Python2.7: \documentclass{article} \usepackage{python} \begin{document} \begin{python}% import sys print (...
0
votes
0answers
10 views

Matplotlib OSError after manual texlive install

After setting matplotlib.rcParams["text.usetex"] = True in Python, the matplotlib.pyplot.savefig command raises OSError: [Errno 2] No such file or directory: '/home/my_name/cmr9 I believe this ...
1
vote
0answers
21 views

Sympy in for Loop runaway argument error

I am trying to have the following document compile using sympytex. The goal is to generate squares of integers using sympy and the latex forloop into exsheets. I have been trying to fix the error for ...
0
votes
0answers
32 views

LaTeX code as a Python Subroutine

This is my problem. I have a rather sophisticated LaTeX code, namely master.tex It reads a .csv file as an imput It reads .pdf drawings as an imput It calls other subordinate .tex files It contains ...
0
votes
0answers
40 views

Including a Python-produced, .avi saved animation into Beamer with Multimedia

I am trying to produce an animation with Python as shown in Jakevdp's blog, using the animation function of matplotlib. It produces an avi, or mp4. In this case I saved it in .avi Then, I want to ...
10
votes
3answers
2k views

Pythontex workflow with LyX

I've recently learned about PythonTeX (Conference presentation). It's a tool that lets you execute python code in your LaTeX documents. This is useful for, e.g., creating matplotlib figures inside ...
0
votes
0answers
34 views

Use python as data source for Latex and DOxygen

I have python code where the comments contain latex code. Will it be possible to parse the code with doxygen and display the latex code as latex symbols. include the same code in latex (using ...
5
votes
0answers
50 views

Export matplotlib triangle mesh to an asymptote surface

This is a followup of a question of mine at stackoverflow partially reproduced here for clarity. I'm playing a bit with scikit-image marching cubes algorithm. Here is a simplified version of the ...
35
votes
7answers
3k views

What are the advantages of Lua over other scripting languages for a TeX implementation?

The question is inspired by Martin Schröder's answer to I am new to TeX. Should I use LaTeX, XeLaTeX, …? as well as my two previous questions on this forum: Automatic document update Generate LaTeX ...
5
votes
1answer
87 views

Python colormaps in Tikz

I would like to reproduce in Tikz examples of colormaps in Python. The one which is of interest to me is YlOrRd. I can extract it from the provided pdf but a Tikz solution is better. I've tried three ...
2
votes
1answer
99 views

Missing $ inserted in python code

I use python3 (with code not from me) to insert data from a database (bsddb3) from the program GRAMPS into a LaTeX document (TeX Live 2014) and I receive the following error messages: ! Missing $ ...
11
votes
2answers
2k views

Set fonts in matplotlib graphs equal to tex document

I am writing my PhD in LaTeX and I am generating all my graphical content in Python with the matplotlib package. For my TeX document, I am using a math-supported font -- e.g. Kurier Light Condensed -- ...
2
votes
1answer
180 views

How to remove LaTeX control sequences from a .tex document using plasTeX?

I need to get just the text and math expressions (ignoring tables, pictures and styling) from a set of LaTeX documents and represent them in html. Looks like plasTeX and MathJaX are enough for this ...
3
votes
1answer
687 views

How can I add the Latex on python path?

I'm using Cent OS i386. I got a error message when I use matplotlib python package. RuntimeError: LaTeX was not able to process the following string: 'lp' So, I did yum install tetex. but it still ...
0
votes
1answer
240 views

Embedding Python in LaTeX

As of today, what is the best package for embedding functional Python code in LaTeX? I've searched this site and others, which recommend the python, pythontex, and sympy packages, amongst others, but ...
2
votes
1answer
70 views

Why this LaTeX-Python not loading Graphics in OS X?

Code [depreciated; see revision 2] which I run with XeLaTeX--shell-escape in TextMate of OS X 10.11.4 El Capitan \documentclass{article} \usepackage{graphicx} \usepackage{python} % http://tex....
2
votes
0answers
51 views

Latex in Inkscape: error when writing

I am trying to use Latex in Inkscape. After several installations, I am now able to see the Latex option in Extensions-> Render. However, when I tried to use it, I got the following error: The ...
2
votes
1answer
352 views

Convert LaTeX to SymPy format

I'm trying to convert LaTeX to SymPy understandable format and I feel it's hard to comply all conditions. So Im wondering if you can suggest any tools, free or paid, that will be great. What I'm ...
36
votes
2answers
26k views

How to highlight Python syntax in LaTeX Listings \lstinputlistings command

I am using package listings to import my Python source code into my LaTeX document. I use the command \lstinputlistings. I have a Python source like class MyClass(Yourclass): def __init__(self, ...
2
votes
1answer
25 views

Problems with using the result from an external python function

I am trying to implement a python function (which processes text for me) in my tex document. Thus I started as following: Tex: %& -shell-escape \documentclass{article} \usepackage{pythontex} \...
0
votes
0answers
36 views

How to include a pandas boxplot in my document?

Usually, I include matplotlib plots in my tex document like that: I use matplotlib to plot and save the figure as vector graphic (svg) import matplotlib.pyplot as plt plt.figure(figsize=(15, 8)) ...
4
votes
2answers
2k views

Unable to use python.sty package

When compiling a .tex file that uses python.sty package and contains: \begin{python} ... \end{python} I keep getting an error: ./main.tex:33:I can't find file 'bin/main.py.out' \end{python} ...
3
votes
1answer
39 views

Is it possible to have two separate listings?

I have defined two listings environments, one for Python and other for Bash, both have different settings, this is a minimal example of what i'm using: \documentclass[a4paper,12pt]{article} \...
3
votes
1answer
55 views

Newcommand with PythonTex

I want to realize pytontex \pyc as newcommand so that I can use it in a generic way. When I use the newcommand I just get some strange "i" (I use it for enumerating the spec variable) and no output ...
2
votes
1answer
23 views

`make4ht`, `tex4ht`: when called from python, hits a write permission error if input file supplied with forward slashes

I have a directory where I have the following .tex file: \documentclass[fontsize=16pt, paper=letter]{scrartcl} \usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage{amsmath} \begin{document} \...
1
vote
0answers
79 views

How to fill the calendar from an excel file

I am creating a calendar with marked dates of influential personalities births and deaths with one sentence of description like "the death of mr. XY in YEAR". The "input" is an Excel file containing ...
0
votes
1answer
379 views

Python error while generating code snippets with minted and Pygments in Anki

On the command line everything works fine but in in Anki I get a python error. My computer: MacBook Air (13-inch, Mid 2012) Processor 2 GHz Intel Core i7 Memory 8 GB 1600 MHz DDR3 My operating ...
5
votes
2answers
97 views

Which python does % !TEX TS-program = pythontex use?

On my macbook, I'm trying to run pythontex from Textmate using % !TEX TS-program = pythontex Here's a minimal document: % !TEX TS-program = pythontex \documentclass{article} \usepackage[makestderr]{...
2
votes
2answers
258 views

How to invoke minted with python3

I have 2 versions of Python on my machine. Version 2.7.10 can be invoked with python, whereas python3 uses 3.5.0 under the hood. I'd like to use minted with python3, which is why I installed Pygments ...
0
votes
1answer
241 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 'pyinlt....
7
votes
1answer
472 views

Automatic document generation based on a database

I want to automatically create business card based on a database containing my employees' data. (i.e. to generate one .pdf file per person, filling in a pre-filled document with the information of the ...
2
votes
1answer
345 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 ...
2
votes
1answer
206 views

python environment returns error “I can't find file `document.py.out'” using texlipse in Eclipse

I'm tinkering with adding Python functionality to LaTeX, and I prefer to use Eclipse as my editor. I have tried a simple code: \documentclass{article} \usepackage{python} \begin{document} \...
1
vote
1answer
68 views

Auto-select page orientation for tables

I am trying to write a python script that takes a matrix and converts it to a latex document containing just one table. I have most things sorted out, and I can get e.g. a table TeX file outputted ...
2
votes
0answers
177 views

Pythontex Problem

I dont know how I cant solve the problem with pythonTeX, I've install Anaconda(python) and I thought that the packages were the problem but no, the problem is with LaTeX, TeXstudio is my tex-editor ...
5
votes
1answer
825 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} \end{...
9
votes
4answers
3k views

LaTeX to HTML: PolyTeXnic and PlasTeX

I was stunned by the elegant appearance of the Tau manifesto page, for which the source is in LaTeX. The author used a home-made tool that he calls PolyTeXnic, but which he is not willing to release. ...
3
votes
1answer
137 views

Running pythonTeX with Lyx under Windows

I am trying to get pythonTeX running with Lyx 2.4.1 in Windows 10 by following this post. I have installed pythonTeX and verified it is working when running a test file with the commands: pdflatex ...
5
votes
2answers
315 views

Issue with special characters in Python code

I am trying to insert a Python code into a LaTeX document. The Python code (an example) is the following and contains many special characters (>, <, °): valeur = input('Veuillez entrer une valeur ...
3
votes
1answer
141 views

Issue with accents from Python source code

I am inserting a Python source code in a LaTeX document using the fancyvrb package. Here is a MWE: \documentclass{article} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage[...
1
vote
0answers
186 views

How to use pythontex.py from TeXnicCenter?

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: . It seems to ...
3
votes
1answer
137 views

LateX minted code in two pages

I use minted in LateX. My code in Python is too big, and one page is too little. I need to split my code for two pages. I know that minted has not auto wrap pages. So I tried this: \begin{...
2
votes
1answer
503 views

Font size change in svg included in pdflatex beamer document

I include an svg I created with matplotlib (see here how - at the bottom) using pyplot.savefig("test.svg") in my latex document. \documentclass{beamer} \usepackage{graphicx} \usepackage{svg} \begin{...
2
votes
1answer
215 views

converting Mathml to LaTeX in python programming

I am writing one educational software right now. It's kind of online test for school students. I add up the questions using my editor, I need the math functionality therefore I need to use this editor,...
0
votes
1answer
124 views

lstlistings: Regexp quotation mark/apostrophe error

I am attempting to display a long Python Regexp in LaTeX lstlistings. When compiling I get the following error message though. ! Package inputenc Error: Unicode char \u8:�\lst@FillFixed@\lst@EC� not ...
1
vote
1answer
193 views

How to merge data and create multiple documents?, similar to personalized mailings

I would like to use LATEX combined with EXCEL data files (or CSV if it were neccessary) to create "proof of payment". Supose a list of people John McEnroe, NYC (USA), 110.23$, 10$,May...... Mary ...
18
votes
1answer
14k 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 ...
0
votes
0answers
201 views

Block comment using Latex's listings package to show Python code

I want to put a piece of Python code in Latex, using the listings package. In principle this works fine, except that it does not seem to recognize block comments, but these are shown as normal code. ...