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

learn more… | top users | synonyms

3
votes
1answer
28 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
18 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
63 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
85 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
131 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
146 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
97 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
167 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
110 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
64 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
97 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
204 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
110 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
279 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
119 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
102 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
165 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
154 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
118 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
142 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
60 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
78 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
61 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
142 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
80 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
150 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
182 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
34 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
151 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
159 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
130 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
131 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
206 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
99 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
51 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
120 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
265 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
58 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
111 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
188 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
303 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
107 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
217 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
69 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} ...
4
votes
1answer
88 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} ...
5
votes
1answer
643 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
93 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
101 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
129 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 ...