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

learn more… | top users | synonyms

0
votes
1answer
178 views

pythontex3.py does not compile very simple xelatex file

I have the following environment LinuxMint 15 (which has python2.7 and 3.3 as part of its install. I installed Texlive, Texworks, Pygments for 2.7 and 3. Working with Texworks and creating xelatex ...
7
votes
2answers
222 views

Underscore in filenames in \textit{} imported from a python script

I'm trying to import the name of a result file from a python script and displaying it in the report. In the LaTeX template I have a bunch of variables defined as ${variablename}. The python script ...
1
vote
0answers
26 views

How to use \lstinline inside figure environment's caption argument [duplicate]

Here is the code that I have (I have removed parts which I think are not relevant): \documentclass[12pt]{article} \usepackage{listings} % Python style for highlighting ...
16
votes
4answers
663 views

Calculate prices

I want to calculate prices in a LaTex file. This means I want to add two numbers with exactly 2 decimal places and I want to multiply these values by an integer. An other thing is the output format. ...
1
vote
1answer
262 views

PythonTeX texing problem

I am trying to play with PythonTeX package. Installation went smoothly on this machine running old TeXLive 2011. However when I try to pdflatex or lualatex example provided with installation ...
8
votes
2answers
750 views

Pythontex workflow with LyX

I've recently learned about PythonTeX (Conference presentation). It's a tool that lets you execute python code in your LaTeX documents. This is useful for, e.g., creating matplotlib figures inside ...
3
votes
0answers
245 views

What is a working python code snippet for escaping a string, so that it can be included in a tex file? [closed]

I'm using python to populate a tex template with arbitrary strings - and I would like to escape the strings so they're interpreted and displayed properly inside the tex file (rather than having them ...
6
votes
1answer
956 views

Adding words to lstlisting for Python langaue

I wish to add a few keywords to some python code inserted into a latex document. I want to make 'True' & 'False' appear yellow and also some module calls such as 'ttk' appear red. I have tried ...
3
votes
1answer
483 views

PythonTeX rendering problem

I tried the PythonTeX package, and the output it produced contained question marks instead of running python code, what should i do ??
6
votes
2answers
198 views

Does anyone know an easy way to produce a table with cells spanning multiple pages using latex? [closed]

I'm looking into the possibility of using latex for programmatically generating PDFs from templates with placeholders and some textual data. The current solution I have is based on reportlab, and it ...
2
votes
2answers
673 views

How to automatically insert values into latex code/template

I'm in the process of generating an automated report in pdf from latex. Each report is the same, but has different values/graphs. The graphs is no problem, but what is the best way to process a latex ...
-1
votes
1answer
3k views

Using Latex in Matplotlib plot title/axis label [closed]

Sorry if this is a repost; I'm sure this question gets asked often but I couldn't find exactly what I was after in the search. I'm trying to write a scientific plotting program in matplotlib (using ...
2
votes
1answer
180 views

Configure TeXShop to run a script on the document before typesetting

Is it possible to configure TeXshop to automatically run a script on a document at the beginning of the typesetting process? I am interested in having the application run a python script on the ...
16
votes
2answers
7k views

How to highlight Python syntax in LaTeX Listings \lstinputlistings command

I am using package listings to import my Python source code into my LaTeX document. I use the command \lstinputlistings. I have a Python source like class MyClass(Yourclass): def __init__(self, ...
3
votes
1answer
474 views

Page a day calendar problems

I am really new to the whole LaTeX thing, but it really interests me, so I'd like to learn more about it. I am also looking mostly to do just words, maybe a picture here and there but i just want ...
13
votes
1answer
1k views

Embedding python in tikz

I just discovered the python package, and I'm trying to use it in Tikz code. Unfortunately, this doesn't work: \documentclass[oneside]{memoir} \usepackage{pgfplots} \usepackage{python} ...
1
vote
1answer
724 views

Minted working from terminal but not Texpad [duplicate]

Possible Duplicate: minted not working on mac I'm using the minted package in latex on my mac (running lion). Now when I use the terminal to type pdflatex -shell-escape MintedProblem.tex ...
4
votes
2answers
780 views

minted doesn't escape LaTeX code inside python docstring

How can I get minted to escape LaTeX code inside docstrings? Should I use some switch? \documentclass[a4paper,12pt]{article} \usepackage[italian]{babel} \usepackage[T1]{fontenc} ...
8
votes
2answers
3k views

Python code in LaTeX document

I want to include some Python code into LaTex document, so I "imported" the listings package with \usepackage{listings} and \lstdefinelanguage{Python}{ keywords={typeof, null, catch, switch, in, ...
2
votes
2answers
258 views

Adding additional blank lines in Minted

I currently have two minted environments in each their minipage environment, so that they can be situated next to each other: \begin{figure}[!h] \centering \begin{minipage}{0.45\linewidth} ...
2
votes
3answers
2k views

Error when using the python package

I am very new to LaTeX. I need to run python package in LaTeX but I can't. I use MiKTeX 2.9 under Windows 7 but the programs gives me this error: Latex error: ! I can't find file ...
4
votes
2answers
1k views

Unable to use python.sty package

When compiling a .tex file that uses python.sty package and contains: \begin{python} ... \end{python} I keep getting an error: ./main.tex:33:I can't find file 'bin/main.py.out' \end{python} ...
2
votes
1answer
170 views

Use of \\minted@pygmentize doesn't match its definition

Having followed the installation instructions for the minted package (CTAN), I keep encountering the error, and variations thereof, listed in the title when trying to compile the document. The ...
8
votes
3answers
2k views

LaTeX to HTML: PolyTeXnic and PlasTeX

I was stunned by the elegant appearance of the Tau manifesto page, for which the source is in LaTeX. The author used a home-made tool that he calls PolyTeXnic, but which he is not willing to release. ...
2
votes
1answer
821 views

Printing Envelopes and Labels

I am wondering what people use to print envelopes and shipping labels? Namely, I had to send yesterday 40-50 big envelopes. Normally, I use labels but I find it default sizes avery 5360 to be too ...
29
votes
7answers
2k views

What are the advantages of Lua over other scripting languages for a TeX implementation?

The question is inspired by Martin Schröder's answer to I am new to TeX. Should I use LaTeX, XeLaTeX, …? as well as my two previous questions on this forum: Automatic document update Generate LaTeX ...
11
votes
6answers
3k views

Generate LaTeX Truth Table with Python Cheetah

While looking for code which can automatically generate truth table in LaTeX I stumbled on this Python generator. It appears that the code can be used from Cheetah's framework. Can anybody point me to ...
14
votes
3answers
864 views

Automatic document update

As many of you I do quite a bit of teaching to make living. The worst part of the semester is usually beginning when I create and upload course Syllabi as well as the end of the semester when I ...
1
vote
1answer
751 views

Sphinx error in converting latex to pdf

I'm trying to convert latex to pdf of CherryPy docs for offline usage. After I generated the latex I changed into build/latex directory and run "make all-pdf" and error happened. Sorry I don't know to ...
34
votes
3answers
946 views

How to publish a package that includes scripts and/or executables?

I'm preparing to publish my first package, and am not sure about the best way to proceed. I understand the standard CTAN publishing approach, but I'm dealing with a somewhat atypical case since my ...
12
votes
0answers
1k views

Matplotlib and Python as the main TeX graphics engine [closed]

As many people here who do some scientific computing, I'm increasingly using Python as my main prototyping language in favor of MATLAB. A colleague of mine whose husband got me into Python approached ...
4
votes
1answer
141 views

How to let minted highlight a whole file from disk

I am using the minted package to highlight source code in LaTeX. It works well for a piece of code embedded in \begin{minted} ... \end{minted}. Now the question is if it is possible to highlight a ...
0
votes
1answer
231 views

DB dump into LaTeX with Python and R?

I have quite a large index. I am planning to create a full-blown DB for it and later export the information to LaTeX. I am comfortable with R and Python so I would like to work with them but I feel ...
3
votes
0answers
129 views

can (pdf)LaTeX change the font in a figure at compilation time [duplicate]

Possible Duplicate: Set fonts in matplotlib graphs equal to tex document I create figures using Python / Matplotlib and saved them in .pdf and .eps format. I'm writing a (long and complex) ...
1
vote
0answers
177 views

lingtrees on Miktex [closed]

I'm using MikTex 2.9 on Windows 7. I also have python 2.7 installed and added to my path. I'm trying to install and use lingtrees to draw syntax trees. Unfortunately it doesn't have a MikTex ...
13
votes
5answers
2k views

Using Python within LaTeX and accessing its variables

I have used the python package to include Python in my LaTeX document which works fine. I am trying to access the Python variables/calculations outside of \begin{python} ... \end{python}, without ...
1
vote
1answer
303 views

How do I embed Unicode G Cleff in a Verbatim environment?

I am writing a chapter on Unicode. I'm using LaTeX using the fancyvrb chapter and inputenc, which lets me type most unicode characters without problem. Problem: I want to include a character from the ...
9
votes
2answers
1k views

Set fonts in matplotlib graphs equal to tex document

I am writing my PhD in LaTeX and I am generating all my graphical content in Python with the matplotlib package. For my TeX document, I am using a math-supported font -- e.g. Kurier Light Condensed -- ...
3
votes
2answers
858 views

Macro that inserts arguments into an environment

I'm having a bit of an issue trying to get a piece of code up and running. I'm working on extending python.sty file for embedding python into a LaTex document (adding persistent data and the ability ...