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

learn more… | top users | synonyms

4
votes
0answers
30 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
79 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
63 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} % ...
2
votes
0answers
48 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
23 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
33 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
35 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
53 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
21 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
77 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
95 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} ...
1
vote
2answers
217 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
321 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
192 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
403 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
162 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
130 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
298 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
136 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} ...
2
votes
1answer
606 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
170 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
131 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: ...
2
votes
1answer
265 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
203 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 ...
1
vote
1answer
175 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
191 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
87 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 ...
0
votes
1answer
121 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
67 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 ...
3
votes
0answers
197 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
96 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
187 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
240 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
218 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
180 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
170 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
141 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
268 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
115 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} ...
0
votes
0answers
88 views

miktex - anaconda/python - nbconvert notebook to pdf error [duplicate]

I have the anaconda environment for python development. i installed pandoc, and miktex (for all users). When i try to convert my notebook using : ipython nbconvert notebook.ipynb --to latex --post ...
2
votes
1answer
69 views

pythontex custom commands for pyconsole

I'm trying to use PythonTex (v 0.14), its pyconsole environment, and custom commands, and having some trouble. Here is an MWE: \documentclass[article,letterpaper,times,11pt]{article} ...
2
votes
1answer
158 views

Strange characters appearing with alpha and beta [closed]

I used a python regex file to edit a section of LaTex that contained alpha and beta. Here it is: Jacobi & $\JacobiP{\alpha}{\beta}{n}@{x}$ \MarkDefn[P z 3 - ...
1
vote
1answer
303 views

fancyhdr novel's pages need headers with CHAPTER ONE, TWO etc. spelled out

I'd like to use the fancyhdr package to have odd number pages with the chapter number spelled out, for instance, "CHAPTER ONE" OR "CHAPTER TWO" etc., and the even number pages with the actually title ...
1
vote
0answers
65 views

Unknown Syntax Error's [closed]

#!/usr/bin/env python import time import random # Game Function def game(): print ("Welcome to the cavern of secrets!") time.sleep(3) print("You enter a dark cavern out of curiosity. It is dark ...
0
votes
1answer
120 views

Can I make IPython notebook from PythonTeX ?

Let's example like this : \begin{ipythonconsole} 1+1 \end{ipythonconsole} then I will get the result like this : In[1] : 1+1 Out[1] : 2
2
votes
1answer
221 views

Pretty Printing is not pretty at PythonTeX ?

I try make LaTeX document with PythonTeX and this my MWE : \documentclass{article} \usepackage{pythontex} \begin{document} \section{Perhitungan Pangkat} \paragraph{} SymPy dapat melakukan ...
3
votes
0answers
371 views

Why isn't pgf honouring my font selections for matplotlib-generated graphics?

I wanted to use a euro symbol in my axis descriptions for matplotlib plots saved as pgf files with the pgf backend. When I use the following code: import numpy as np import matplotlib.pyplot as mplot ...
3
votes
2answers
118 views

Exsheets and pythontex compatibility

I am using exsheets and pythontex packages in order to make a book of exercises. I have noticed that pycode environment cannot be used inside question (or solution) environment of exsheets. However, ...