The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [python]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
61 views

how to display negative limits for an integral in latex?

I am having issues displaying negative limits for an integral my code is in python: f"Use substitution to evaluate the definite integral $_\\displaystyle\\int_{stra}^{strb} {latex(f)}\\,dx$_." it ...
1
vote
1answer
33 views

PythonTeX connecting to .accdb with python module and making adjustment to the output

I am working on connecting TeX with MS Access database. Great option for my workflow seems to be PythonTeX, since that for beginner in TeX and Python, like me, it is pretty easy to use and work with (...
1
vote
1answer
44 views

Text in image scaled to same size as body text

I am working on a research submission and my supervisor requires that any text on my graphs (e.g. axis labels, tick marks etc) are the same size as text in the main body of my report (including ...
1
vote
2answers
52 views

Best matplotlitb to Tikz conversion tool

What are some good, well-maintained packages for converting matplotlib plots to Tikz files for inclusion in latex documents?
1
vote
2answers
34 views

How can I put a pyblock in a box?

I'm learning using PythonTeX and I have a problem. I would like to put a pyblock inside a box on my document, I tried this two things, but TeXMaker never ends compiling Option 1: \documentclass{...
1
vote
1answer
35 views

Pandas to_latex Encoding Issues

I'm using python and pandas to run a script and generate a latex table from a couple files I have. I'm doing this by importing a java .properties file (encoded in ISO-8859-1 with special unicode-...
0
votes
1answer
32 views

setting different margins for Pylatex sections

I would like to set different margins for different sections of a Pylatex document (incl header, sections and subsections). I'm new to latex I am currently setting my geometry options as follows, ...
0
votes
0answers
47 views

Package polyglossia not working

I am using a linux system. By mistake I issued a command - sudo apt-get purge python (I know I've committed a very big mistake :( but now I want everything back to normal.) As soon as I issued this ...
0
votes
0answers
29 views

Python equivalent of matlabfrag

I have been a regular user of matlab for plotting. I use matlabfrag to save as eps for the plot along with a tex file containing labels. This can be rendered with Latex fonts after including them in ...
1
vote
0answers
80 views

Latex issue with python on mac

I was trying to run matplotlib.rcParams['text.usetex'] = True matplotlib.rcParams['font.family'] = 'serif' on python, but I received the following error FileNotFoundError: [Errno 2] No such file ...
1
vote
0answers
54 views

How to add copyright symbol in pyLaTeX? [closed]

I'd like to use the copyright symbol in PyLaTeX. I tried using "\textcopyright" but the \t is being interpreted as a tab, resulting in a .tex file which contains only extcopyright. Is there a way to ...
0
votes
0answers
75 views

Display content in two-column layout in PyLaTeX?

How to use \usepackage{multicol} in PyLaTex? What to write in python? \begin{multicols}{2} Column 1 \columnbreak Column 2 \end{multicols} I have found a way to display content in two-columns using ...
0
votes
0answers
98 views

Pythontex couldnt find engine

I tried to use pythontex in my LaTeX Program. Therefore i installed MikTex an working with Texmaker. There i installed the pythontex-package (by installing it via usepackage). After running the ...
0
votes
0answers
25 views

How can I see the command that TeXworks is using and emulate this using pdflatex on the command line

I've written a program to automate generation of pdf files. In my python script I use pdflatex and call this with a command line package: command: pdflatex --interaction=batchmode my_file.tex | ...
2
votes
2answers
66 views

Definition-time expansiton of command line input

I'm trying to make the following code work correctly. I'm using command line call to python to check whether a number is in a list (no clue how to do this in pure LaTeX(?)). I then want to check ...
0
votes
0answers
31 views

newline lost with python code generated with minted in a pdf

I'm trying to insert python3 code in a Latex document with `Texstudio`` I have the following code: % !TeX TXS-program:compile = txs:///pdflatex/[--shell-escape] \documentclass[a4paper, 12pt]{book} \...
0
votes
1answer
85 views

Extract entry keys from bib file and create a file for each entry key

In the context of ideas mentioned at How to embed a review in biblatex? one should create a file for each entry key in the bib file. These files will be named to refer to each entry key, names will be ...
1
vote
1answer
483 views

TexStudio doesn't find the package “Pygments” although it is installed [duplicate]

I'm try to use the minted package in latex to display code in latex document. From Texstudio, I get an error message you must have pygmentize installed to use this package. If I type pip3 install ...
0
votes
0answers
186 views

Python code environment with input and output

I am trying to set up a simple environment for displaying Python code and output. I want the output to be bold font. I have written the following \newenvironment{code}[2]{ \begin{shaded} \...
0
votes
0answers
94 views

PyLatex : how to use a tikz generated figure as a latex command with parameters?

I have to create a gallery of images with contacts of personalities in LaTex. For that purpose I'm using a mysql database so I need to use PyLatex to generate my latex file. But there is the issue : I'...
1
vote
1answer
360 views

where is the Python icon in fontawesome

I'm trying to add the python icon It appears to be in the font awesome font https://fontawesome.com/icons/python?style=brands to my document. however it seems that there is no \faPython in the ...
1
vote
1answer
74 views

Minted changes text position in slides

I am making a beamer presentation. I have this slide: The code is \begin{frame} Il problema viene affrontato utilizzando il metodo degli elementi finiti che spesso però pone numerose restrizioni ...
0
votes
0answers
29 views

Minted snippet with single quotes [duplicate]

I want to create a Python's code snippet which includes single quotes using minted package. I've put it altogether like this: \begin{minted}[ autogobble, frame=lines, framesep=4mm, ...
3
votes
1answer
113 views

mistake when exporting numpy data to csv to pgfplots

I have to plot data from a numerical simulation. I perform my simulations with python and numpy. But now I want to plot the result in a LaTeX file. Since I want to be able to modify the layout without ...
0
votes
0answers
185 views

Python and TeX, pythontex or hybrid-latex recommended?

Hi I am looking into starting to use Pyhton and (La)TeX together. Now I see two packages on ctan, pythontex and hybrid-latex. What are pros and cons? What is the better developed solution (with ...
0
votes
0answers
52 views

Texmaker - Python - Configuration

LaTex friends, I need your help configuring MacTeX, Texmaker (pdfLatex) and Python on a Mac. I have received a file where a *.tex uses a Python and I just have no idea how to make this file work. I ...
1
vote
2answers
817 views

how to present python snippet code efficiently in latex

I am quiet new to Latex and do not know how to present a simple python code like this in Latex in a professional way.. having your solutions and examples will help me a lot to learn and progress. ...
1
vote
0answers
2k views

Matplotlib error: No such file or directory: 'latex': 'latex'

I am running a public code downloaded from Github, but I have a problem when it gets to the end and it has to plot the results using latex. I get the following error:FileNotFoundError: [Errno 2] No ...
0
votes
0answers
39 views

Reference in latex document to Matplotlib(pgf) generated figure

I have a python script which draws a plot similar to this: fig = plt.figure() ax = plt.axes() x = np.linspace(-2,2,10) y = x**2 ax.plot(x, y, label='$x^2$', color="#07529a", linewidth=2.0) # <--...
3
votes
1answer
279 views

How to configure tcblisting with minted to allow copy/paste from listing with whitespace characters?

This answer from a similar question gets very close to a final copy/paste solution, but does not work for me as it does not select whitespace. I am asking a new question as the linked one is several ...
0
votes
0answers
90 views

Converting Tab-delimited reference list into a bibtex format (using R?)

I need to export search results from Web of Science (i.e. all the results of a query, 100s of entries) and import them in Mendeley with their abstract. while I usually can export a citation in a .bib ...
1
vote
1answer
121 views

matplotlib2tikz date data error

So I'm trying to convert a plot from python to Tikz with hour data in the x axis. This is the image in python: But when I use the tikz_save I got this error: TypeError: a float is required I'm ...
0
votes
0answers
56 views

How can I run an .exe in the .tex file?

I'm writing a scientific proposal and I have a .exe Python script to copy, timestamp and put into a directory. I want to use this .exe whenever I compile. From a logic point of view, this would be ...
2
votes
1answer
357 views

Setting conda environment for pythontex in TexStudio

I am using Texstudio with a build configuration based on this question in order to run PythonTex and embed python code into my documents. This worked and I was able to use the \begin{pycode} and \end{...
1
vote
0answers
121 views

How convert a .bib file to web of science or scopus fomart? [closed]

I have a list of paper in .bib format which can be open by mendeley. I want to make them readable for metaknowledge package which is a python library for creating and analyzing scientific metadata. ...
0
votes
0answers
229 views

pygments error Texstudio in Windows 10

I want to use minted package to highlighted my code block which is written in TexStudio. I installed minted package. Secondly I got error shell-escape-flag which is solved after research How-to-invoke-...
4
votes
1answer
597 views

3D matrix visualization, like in Python

I want to create something like the following, however I can’t add red brackets and the commas. This is my code: \[ \left[\left[ \begin{array}{ccc} 0 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & ...
2
votes
1answer
109 views

\input{} File does not exist [duplicate]

I have written a template for a personal diary. The main tex file \input a file called entries.tex, which will \input all the diary entries, which are in a subdirectory, as well as write the title of ...
1
vote
1answer
103 views

How to use previously downloaded fonts with lualatex engine and python to create pdf file

How and where to install .ttf fonts which I've already downloaded from web. I've created latex file using online overleaf. Inside same directory I put all my .ttf fonts and LuaLaTeX engine and ...
0
votes
2answers
330 views

Python cannot compile LaTeX file

I am using a Conda Python installation and Jupyter to work with a script producing a LaTeX file I want to compile. These are the relevant code lines: import subprocess xelatex= "/usr/local/texlive/...
1
vote
1answer
483 views

How can i write my python code in LaTeX document?

Hope you are fine! in this opportunity I'd like to ask you how can I put in my LaTeX document a python code, I was using, lsting, and anothers but I have an error, I appreciate your helping. My error ...
3
votes
0answers
99 views

Compile multiple Latex files in parallel

I have around 100000 Latex scripts, each of which generates a document upon compilation, and they share same packages being included. I tried compiling 10 scripts in a sequential fashion using Python ...
1
vote
1answer
623 views

Listing jupyter notebook code in pdf from .ipynb file

I am doing my programs in jupyter notebooks and I want to list it into my pdf using listings package or some other. I don't want to insert images of my notebook. How can I do it? I can able to insert ...
1
vote
1answer
548 views

Multiple Page PDF Export Issue With pylatex

Multiple page issue: I am trying to export a multiple page pdf and there seems to be an error. I cannot find the source... I suppose that it is because of the text " âchemical exchangeâ " where non ...
1
vote
1answer
303 views

Form Fill Rest of the Page pylatex

I have the following pylatex cod: import pylatex as pl from pylatex.utils import NoEscape from pylatex import Command from pylatex import Package from pylatex import Figure import os videoNumber = 1 ...
3
votes
1answer
557 views

pylatex Change Font

How do I change the font to "helvetica" in pylatex ? I tried it, but this does not worK: doc = pylatex.Document(fontenc = 'helvet')
2
votes
1answer
257 views

Latex and SymPy error

I try to make some calculations inside LaTeX. Therefore I want to use Sympy. So I put \usepackage{sympytex} to the header and compile wit pdflatex. After compiling there occurs a .sympy file. The ...
1
vote
1answer
761 views

Convert LaTex accented characters to UTF8 equivalent with Python

I think this should be something standard, but I'm having hard finding anything that works. Given a plain string containing LaTeX accented characters, does anyone know of a python library which can ...
0
votes
1answer
129 views

Escaping HEX-characters source code in \lstinputlisting

I am currently writing a paper where I need to put full Python source code files into the appendix. Since I do not want to bloat my TeX file, I include source code with \lstinputlisting. The source ...
1
vote
0answers
317 views

Interactive Plot with controls in the frame [closed]

I would like to know if there is any way to include a plot which can interactively change using slider controls in a Beamer presentation. For example, I would like to show the following ipython ...