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

learn more… | top users | synonyms

2
votes
0answers
38 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
38 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
47 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
49 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
30 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
40 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
44 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 ...
2
votes
0answers
60 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
62 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
65 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
82 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
30 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
0answers
91 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 ...
0
votes
0answers
63 views

What are some ways to evaluate latex expressions in an Ipython Notebook?

I posted this question in Stack exchange, but it seemed like it wasn't getting much attention, so I am posting it here as well. What are some of the ways in which a mathematical expression written in ...
2
votes
1answer
108 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
78 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
100 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
79 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
62 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
87 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
38 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
74 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
183 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
48 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
83 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
116 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 ...
2
votes
0answers
162 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
85 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, ...
3
votes
1answer
145 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
50 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
86 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
70 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} ...
3
votes
1answer
364 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
64 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
72 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
97 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
118 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
379 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
247 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
115 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
66 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
59 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 ...
4
votes
1answer
220 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
200 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
232 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
17 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 ...
7
votes
1answer
1k 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
305 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
152 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
93 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 ...