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

learn more… | top users | synonyms

1
vote
0answers
21 views

Vim LaTeX-suite auto-completion: unable to run outline.py

I am having a hard time getting autocompletion to work in Vim Latex-suite. When I type \ref{ and press , OS window pops up with a message: Windows can't open this file: outline.py After closing ...
1
vote
1answer
41 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
139 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
34 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
44 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 ...
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
54 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 ...
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
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
53 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
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
37 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)) ...
3
votes
1answer
43 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
80 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 ...
5
votes
2answers
98 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
261 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
384 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 ...
2
votes
1answer
209 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} \...
7
votes
1answer
475 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
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 ...
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 ...
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
316 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
142 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[...
3
votes
1answer
696 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 ...
1
vote
0answers
187 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
356 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 ...
2
votes
1answer
216 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,...
1
vote
1answer
196 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 ...
0
votes
0answers
203 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. ...
3
votes
1answer
90 views

Passing unit macro to siunitx with pythontex

I want to write a macro combining \pythontex and \siunitx packages. More precisely, I want to make calculation with (complex) numbers in python and then typeset result in \SI{number from python}{unit}....
0
votes
1answer
125 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
0answers
70 views

Is there an option in PlasTeX to return the processed document, rather than writing it to a file?

Normally running plasTeX gives a file/files as output. However, I don't have the ability to save the documents to the filesystem. Looking through the documentation I have only found cases where the ...
4
votes
0answers
207 views

figure formatting with python

I'm trying to use the python package to automate figure generation for figures containing multiple image files. My output seems okay, except that the imgaes are coming out as a single column, whereas ...
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 $ ...
1
vote
1answer
196 views

“pdflatex: Not writing to” error when using python [closed]

I use python3 (with code not from me) to insert data from a database (bsddb3) into a LaTeX document and I receive the following error messages: pdflatex: Not writing to .aux (openout_any = p). ! I ...
3
votes
1answer
249 views

Pythontex: trying to compile an example I found on TeX

I found a simple example here answered by G. Poore but I cannot get it work. The output to the pdf is ?? PythonTeX ?? ?? PythonTeX ?? What am I missing something? Below you will find the .tex, ....
1
vote
0answers
35 views

How may I program the following with Python? [closed]

please help me do the following with python create a directory - say - dir_01. open a file - say - file_01 and write "hello - 01" into that file and close the file. run the command (on a Linux ...
0
votes
1answer
241 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 ...
3
votes
1answer
182 views

Anyone have experience with PythonTeX?

I have been trying to get PythonTeX working, but can't seem to solve the errors I'm getting. My current Minimum Broken Example is this: % !TEX TS-program = xelatex \documentclass{article} \...
0
votes
1answer
179 views

LaTeX interaction with the OCaml toplevel system

I would like to be able to write an OCaml expression inside a LaTeX document, and have it loaded in the OCaml toplevel system, which would compile it and evaluate it. Then both the expression and its ...
4
votes
1answer
144 views

pythontex + sage preparsing

I am trying to use pythontex for SAGE computations inside a .tex document. I am aware that there exists a sagetex engine which allows for exactly my use case, but pythontex's concept of sessions is ...
1
vote
1answer
276 views

Passing values from PythonTeX to LaTeX

I have read in the PythonTeX manual about how to pass LaTeX values to PythonTeX, but I cannot find any documentation (or a way) to do the reverse. For example, in the LaTeX package datenumber, one ...
4
votes
1answer
117 views

Using pythontex \py with fancyhdr

I don't know what I'm doing wrong, but this MWE does not work for me: \documentclass[a4paper]{article} \usepackage{pythontex} \usepackage{lipsum} \usepackage{fancyhdr} \pagestyle{fancy} \fancyfoot[...