Tagged Questions

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

learn more… | top users | synonyms

5
votes
1answer
479 views

Python code in LaTeX not running

The Latex/Python Project: Create in Latex a songbook from pdf files in a folder and make a toc. Problem: The code below is not running in Latex. Thanks to G.Poore I added the \verb command to ...
4
votes
1answer
321 views

Latex-Python combination not running on a mac

I am a beginner in Latex/Python and try to run the file below on my Mac (10.8.4 - latest MacTex). This is just a test file and it is not running. Python is running in the console and I have copied ...
4
votes
0answers
3k views

Programmatically generating LaTeX with Python [closed]

I'm fairly new to LaTeX and I want to generate some reports using Python. Here is some code that creates a simple table. After coding this up I began to wonder if there isn't a better way to do ...
2
votes
1answer
215 views

Logbook for daily activity with automatic hour count [closed]

I am writing a logbook at work in which I note down when I started, left and how much of a break I took in between. I do this for every day, but I would like to use the result to display it in a table ...
4
votes
1answer
506 views

Preventing Ångström symbol being italicised in pythontex

I'm trying to make a plot in a tex document within pythontex and I set the label within pycode tags to be self.label = r'A: {0} B: {1:.0f}$\AA$'.format(self.aaa,self.bbb) I don't want the Ångström ...
1
vote
0answers
221 views

Font size change in svg included in pdflatex beamer document

I include an svg I created with matplotlib (see here how - at the bottom) using pyplot.savefig("test.svg") in my latex document. \documentclass{beamer} \usepackage{graphicx} \usepackage{svg} ...
3
votes
0answers
38 views

Matching cmyk colors in plot to LaTeX [duplicate]

I'm plotting something using the Python package matplotlib and I'm using the matplotlib.cm.rainbow colormap. I need to match the same colors in my LaTeX document, but I'm having a difficult time ...
5
votes
1answer
442 views

How to match cmyk colors between matplotlib and LaTeX

I'm plotting something using matplotlib and I'm using the matplotlib.cm.rainbow colormap. I need to match the same colors in my LaTeX document, but I'm having a difficult time making the colors match ...
5
votes
1answer
215 views

pythontex - reading data from a file

This is about a file location problem while using pythontex (which works great!) I have some python code within \begin{pylabblock} \end{pylabblock} where I am reading in data from a file in the ...
1
vote
1answer
139 views

Turn off syntax highlighting in minted?

How do I turn off syntax highlighting in minted? Defining my DSL with a CFG and then a PEG; and the syntax highlighting is getting in the way.
8
votes
1answer
391 views

PythonTeX: importing python files

I'm trying to import a personal python module using python tex, but pythontex doesn't find the module. My attempt: The LaTeX File: % !TEX TS-program = pythontex \documentclass[11pt]{article} ...
2
votes
1answer
162 views

LaTeX suddenly not working

I'm submitting my Ph.D. thesis in 2 days - everything has been working fine for the last 3 years...now I get this: Typesetting “Montgomery_MM_India_v21.tex”… Traceback (most recent call last): File ...
3
votes
0answers
143 views

minted creating garbage output on PDF file [closed]

Good Day, I'm using texlive 2013 which I updated today 20JULY13. When I attempt to compile my LaTeX file using only the most basic minted statements \begin{minted}{c} Test \end{minted} results in ...
6
votes
1answer
415 views

Running a simple example with PythonTeX fails

Using the v 0.12 beta of PythonTeX I am trying to compile the following example: \documentclass[12pt]{scrartcl} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{pythontex} ...
2
votes
1answer
161 views

PythonTeX - duplicate entry in .pytxcode file

I have started using pythontex with latex and have run into a situation where it appears that when the code is stripped out of the tex document there is some sort of numbering issue. Here is a ...
21
votes
3answers
573 views

Best way to illustrate Keplers 2nd law with tikz

I am trying to visualize Keplers second law of planetary motion with tikz. I managed to do the following: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} ...
3
votes
1answer
283 views

Is there a PythonTex equivalent to \Sexpr{} in R?

I started to use the excellent PythonTex package to write reproducible reports but can't seem to get it to evaluate Python code inside a LaTeX command. R has Sweave & knitr which provide the ...
15
votes
1answer
890 views

Embedding Python in LaTeX - Hello example?

I found example of the using Python in LaTex, but unfortunately I have problem with it. Microsoft Windows [Version 6.2.9200] This is XeTeX, Version 3.1415926-2.5-0.9999.3 (MiKTeX 2.9 32 bit) ...
0
votes
1answer
209 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
249 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 ...
17
votes
4answers
727 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
279 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 ...
9
votes
2answers
870 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
265 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
1k 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
511 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
215 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
784 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
4k 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
227 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 ...
19
votes
2answers
9k 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, ...
4
votes
1answer
494 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
817 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
860 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
280 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
2k 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
179 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
892 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 ...
32
votes
7answers
3k 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 ...
15
votes
3answers
963 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
842 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 ...
37
votes
3answers
993 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
147 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 ...