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

learn more… | top users | synonyms

0
votes
0answers
51 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
39 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
71 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
49 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
92 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
51 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
43 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
28 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
46 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
89 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
39 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
69 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
88 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
96 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
74 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
107 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
37 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
69 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
54 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
232 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
53 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
57 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
82 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
86 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
271 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
158 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
92 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
62 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
54 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
141 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
153 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
199 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
16 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 ...
3
votes
1answer
707 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
258 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
105 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
74 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 ...
2
votes
1answer
160 views

Beamer and Pause with PythonTex

I am using PythonTex with MacTex, TexShop and anaconda3 : all versions are up-to-date, and pythontex-gallery is compiled without any problem. Now, as I am a teacher, I want to use beamer (I use the ...
0
votes
0answers
135 views

Script to extract and copy from LaTeX files

I have a large LaTeX document, one main and a lot of \input{file} for each chapter. For each of these files I would like to copy them and only keep the Theorems, in other words I'd like to extract and ...
4
votes
1answer
149 views

How to batch generate badges with a list of names?

I want to make a number of badges using LaTeX for the participants of a summer school. There are 40 or so people, so I don't want to manually change the name and compile and then print. I could think ...
1
vote
0answers
41 views

Compile to the actual location of a file [closed]

So I'm really new to Latex and using python to compile a document, using "output\pdflatex test1" However the compiled files are created in the main directory, not the subdirectory of output, where the ...
1
vote
0answers
95 views

Why lua and not python? [duplicate]

I mean instead of lualatex. I came across the python package, so I am not asking about python support. What was so special about lua that people spent so much time on that instead of doing something ...
1
vote
1answer
101 views

references to floats without ever using figure numbers (possbily using lua or python)

Stephen Wolfram's 'A New Kind of Science' states in its colophon that it has 973 illustrations spread out over 1280 pages. Remarkably, he accomplishes this without ever using figure numbers. No figure ...
2
votes
1answer
163 views

Force latex to finish compiling regardless of error? (xelatex)

I have a reoccurring problem. I want to be able to force latex to finish compiling regardless of an error. I know that this error will occur several times in my script and it is a result of the ...
0
votes
1answer
1k views

Exporting and formatting Evernote notes as a LaTeX document [closed]

I use Evernote almost exclusively for notes but I've looked into using LaTeX again because it's fast multi platform and formats documents well. Is there any way to export Evernote notes? Maybe using ...
2
votes
1answer
70 views

Conditionally change font color of number passed from pythontex

I would like to color numbers red if they are less than zero. In my final report, these number will be generated from a python script. To use the pythontex package, I first run xelatex doc.tex, then ...
9
votes
0answers
235 views

LaTeX Visual Novel Engine: Does it exist?

Did anyone in the past use LaTeX to create a "visual novel" engine? I've been using http://www.renpy.org/ for rare presentations when I need functionality the beamer class in LaTeX doesn't easily ...
1
vote
0answers
211 views

Unexplainable error using minted [closed]

After changing one argument in math.py and running _mapping.py, I managed to break minted: LaTeX Error: File `temp.out.pyg' not found. Type X to quit or <RETURN> to proceed, or enter new ...
2
votes
0answers
162 views

Syntax highlighting in minted - how does it work? [closed]

I want to customize the minted syntax highlighting, but neither the minted package documentation, nor the existing topics on syntax highlighting in minted on TeX.SX, nor google offer explanation on ...