Skip to main content

Questions tagged [python]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
65 views

using pylatex but it says no compiler found

So, I'm trying to use python to compile some latex. For this very basic pylatex code: from pylatex import Document, Section, Subsection, Command from pylatex.utils import NoEscape # Create a new ...
SupersonicMan12's user avatar
0 votes
0 answers
38 views

PDF file generated by Latex, how to extract (matlab/python) source code (verbatim/listings)

This is a bit bizarre. I have to review a bunch of PDF files, generated by Latex (but I don't have access to the source files) and that includes matlab or python code, that was included with listings ...
Uwe Brauer's user avatar
0 votes
0 answers
32 views

Can you use latexmk on Overleaf to generate multiple latex files?

I'm trying to shuffle multiple choice exams and choices. I've got python code but want to be able to run it on Overleaf.com. Tried with latexmkrc file below but couldn't generate multiple outputs. You ...
Gokce Mehmet AY's user avatar
0 votes
0 answers
25 views

package pythonhighlight isnt rendering in LyX 2.3.7

when I use this package in LyX it doesn't render at all without raising any errors. the same code on overleaf works completely fine and as intended. here's a picture from lyx of the code itself and ...
Nate3384's user avatar
  • 197
1 vote
1 answer
86 views

pgf import in LaTeX not working due to matplotlib axes font

I was plotting as usual and then after saving one of my plots as a pgf and then compiling LaTeX it didn't work anymore. As far as I'm aware of, I didn't change anything it just so happen to top ...
L_physics's user avatar
0 votes
2 answers
44 views

Multi-colored and multi-bar grouped charts [duplicate]

I have a Python script that automatically generates LaTeX codes that plot bar charts. An example of the generated code looks like: \documentclass[border=10pt]{standalone} \usepackage{pgfplots} \...
Sirjon's user avatar
  • 111
0 votes
1 answer
60 views

Reproducing Python/Programming Code Blocks with modification

I want to be able to reproduce this environment within the context of exam correction. One clue I found is the usage of the bclogo package. https://ctan.org/pkg/bclogo Howerver, I would like to ...
Mouadh Ben Salah's user avatar
0 votes
0 answers
189 views

Manim Latex error converting to dvi

I'm not able to use Latex on Manim due to an error converting dvi. I saw other post about this and I change my code but it still does not work. Here is my code : from manim import * class dvi_error(...
Paine Pice's user avatar
0 votes
0 answers
62 views

Rendering jupyter notebooks to PDF using LaTex generates unwanted characters?

Cross-posting on SO: https://stackoverflow.com/questions/78337970/fix-rendering-issue-when-converting-jupyter-notebooks-to-pdf. I bring this question over TeX sub as it may be also relevant and ...
NonSleeper's user avatar
0 votes
0 answers
34 views

Matplotlib - Latex Premable Package not loading

I want to use LaTeX in the x-label of a plot. I need the label to be \varepsilon with a subscript that is a smaller version of the \parallel symbol. This is what I have tried but it does not work, I ...
Euler_Salter's user avatar
1 vote
2 answers
82 views

How to avoid code block splitting over 2 pages with Minted

I was wondering if there is a simple way to insert a page break when a too long Python code has a function splited over 2 pages and won't fit inside current page? The page break should be placed just ...
Nexus1138's user avatar
0 votes
0 answers
37 views

Link on pdf triggers .sh/.py/.bat

I have been looking for a while for a solution in LaTex. My intention is to create a link inside a PDF generated with LaTex that triggers a .sh/.py/.bat by clicking in the link. Not like \write18, ...
picgon's user avatar
  • 1
2 votes
1 answer
104 views

Hiding python comments with Listings

I want to include Python code to be formatted with listings but I just want the code neat and compact. No comments shall be printed at all, as well as no empty lines. The easy way would be to strip ...
Kyordhel's user avatar
  • 127
0 votes
1 answer
41 views

Unable to write a fraction in JupyterLab

I am trying to write a fraction inside the superscript of a variable (in my case $frac{1}{3}$. I get a long error: plt.ylabel('$\\frac{\delta T}{\delta t}$ $[^oR/min]$')
remusconnor's user avatar
0 votes
0 answers
40 views

Rubber: Cannot Find Bibliography Files When Building LaTeX Documents in a Separate Build Folder

I recently installed Rubber, a building system for LaTeX documents, using the command: pip install latex-rubber After installation, the Rubber Python scripts were placed in: C:\Users\<userName>\...
Foad's user avatar
  • 983
0 votes
5 answers
289 views

How to include result values in a LaTeX document?

We are often in the following situation: a lengthy (data analysis) computation spits out a bunch of result values. Imagine a Python or script or an R script doing some resource intensive calculations. ...
lumbric's user avatar
  • 4,279
0 votes
1 answer
87 views

Automatically creating a grid of images

I have several pdf images that I have generated with matplotlib. I want to be able to arrange them in an arbitrary grid. For this purpose I have written a python script that in turn writes and runs ...
operator's user avatar
2 votes
1 answer
107 views

Piton and Pyluatex environments : write the content to an external file

I have a few environments for Python created from piton package on the one hand, and Pyluatex on the other. Sometimes I'd like to copy their contents into an external python file (which is then ...
jowe_19's user avatar
  • 1,011
0 votes
0 answers
36 views

Customize minted environment w.r.t IDLE

I'm writing a document using Python code and I want to make it like IDLE style. With minted, we can custom the environment so that each line of code starts with >>>, however, I want >>&...
trequartista's user avatar
  • 1,900
0 votes
1 answer
96 views

Customizations of minted environment in LaTeX [closed]

I'm using minted to write Python code in my document. I have two question as follows: Can we reduce \begin{minted}{python} \end{minted} into simpler command like \begin{mtpt} \end{mtpt}? In fact I ...
trequartista's user avatar
  • 1,900
0 votes
0 answers
388 views

error to convert .ipynb and save it as pdf

I have converted many times the .ipynb jupyter notebook into pdf but now suddenly I'm facing the error as below, any hints how to fix it are welcome. Jupyter Notebook 500 : Internal Server Error The ...
user2925716's user avatar
  • 1,960
0 votes
0 answers
35 views

Adding JQuery icon sets to LaTeX documents

I have found multiple references to adding TeX to JQuery-enabled things, and a simple search found plug-ins for inserting LaTeX equation builders into JQuery but I don't think I've seen questions in ...
Sebastien's user avatar
1 vote
1 answer
232 views

Custom language lexer alias not found by pygments for minted

Problem I've made a custom lexer for a pseudocode language in Python (3.11). The file is saved in the same directory as my TeX project. I am using pdflatex to compile my project, and it has the --...
BrightBulb123's user avatar
0 votes
2 answers
205 views

Executing python script or code using \input not working

Im trying to execute a python script from within LaTeX by means of using the \input command, however I get a strange error that I can't really understand. Im following the working example taken from ...
Charlie's user avatar
  • 1,135
1 vote
0 answers
94 views

Packages ucs and hyperref don't get along under xelatex

I'm getting an "undefined control sequence" error for \UTFviii@loop whenever I use both the ucs package and the hyperref package under XeLaTeX (and LuaLaTeX). (I understand \UTFviii@loop has ...
Stuart's user avatar
  • 105
0 votes
0 answers
127 views

Python from LaTeX: Strange Networkx/Graphviz error

It is hard to give a minimal example, because Python3 with some packages is needed. I want to call Python from LaTeX, here is an example how I want to do it (--shell-escape is needed): \documentclass[]...
Titanlord's user avatar
  • 541
0 votes
1 answer
191 views

How to configure the Python library latexmake to run with luaLaTeX?

I am working on automated templates, and I want to use latexmake with luaLaTeX, as suggested in a comment on this question, where I attempted a similar setup with XeLaTeX. However, I am facing ...
Balansoire's user avatar
0 votes
0 answers
29 views

SageTeX does not work when TABs are used as indents

I wrote two practically identical files that use SageTeX to determine whether a positive integer is odd or even. The first example uses tabs for indentation. \documentclass{article} \usepackage{...
vp2523's user avatar
  • 1
1 vote
1 answer
241 views

Error With LaTeX (TeXStudio) Package "Pygmentize"

After downloading the Minted and Pygmentize packages for TeXstudio, I am experiencing an error: File 'pygmentize.sty' not found. \begin. Here is the code for my document so far: \documentclass{...
mandjelo's user avatar
0 votes
1 answer
127 views

Remove extra spaces and curly braces latex code in string Python (normalize string in python)

I want to normalize string in python. For example, I have a LaTeX code str='{{{ \\dfrac{{3}}{{4}} + \\sqrt{3} }}}' I want to get the string str='{\\dfrac{3}{4}+\\sqrt{3}}' Remove extra ...
ducanh2021's user avatar
0 votes
1 answer
482 views

Markdown using LaTeX: Quotation marks in PyCharm vs. Github

I'm used to typing typographically correct English quotation marks as follows: ``text goes here" In usual LaTeX documents this will work, no questions asked. When I use Markdown in Jupyter ...
TiMauzi's user avatar
  • 851
2 votes
0 answers
51 views

Set Python's decorators in some colour but keep @ as an operator unchanged

I am using listings for code formatting and colouring in a document I'm working on, including a lot of Python code. I would like for decorators to be displayed in a specific colour but for the @ ...
Bermudes's user avatar
  • 121
1 vote
0 answers
50 views

tcolorbox minted doesnot break python docstring

I try to produce boxed minted code in Python, and it does not break Python docstring. I have tried different break... options, unsuccessfully. MVE as follows: \documentclass{article} \usepackage{...
Moshe Gueta's user avatar
2 votes
1 answer
194 views

Ticks scaling - How to change the common factor multiplier to an offset value?

I am plotting the following figure using Python and I obtain this render: Here, Python is automatically adding an constant value offset (+9.192682e9) on the y axis to read more easily the data. Now, ...
Clement's user avatar
  • 21
1 vote
0 answers
283 views

LaTex Jupyter Notebook "Undefined Control Sequence"

I am attempting to save down a Jupyter notebook to a PDF using LaTex. I just installed the latest version of LaTex through Jupyter terminal but when I run jupyter nbconvert --to pdf mynotebook.ipynb ...
coder_bob's user avatar
0 votes
1 answer
243 views

How can I export a txt table to latex? [duplicate]

I have txt file with table format, I did it in python but now I have to export this table to Latex but I don't know how. I'm not good at all in latex so I'll appreciate if you help me. Thank you!
Hache 99's user avatar
0 votes
0 answers
269 views

Modifying existing Latex code to put Python codes in the Cheatsheet

I want to make a cheatsheet for Pandas which has Python codes. I googled and tried to find a free online site that help to get built easily. I'm unable to find except overleaf which uses Latex codes ...
Mithlesh Upadhyay's user avatar
2 votes
1 answer
101 views

`pythontex` and `\subfigure`

pythontex causing error with \subfigure environment. I have to rewrite my dissertation with many figures and subfigures, of which some are plotted with python inside LaTeX (I had to give up the python ...
khaz's user avatar
  • 155
2 votes
2 answers
218 views

mwrep and pythontex -- is it possible to use

The question: possibility of using of working python scripts embedded in LaTeX. When I was using \usepackage{python}, it did wonders to my dissertation (although I am very new to LaTeX, but some ...
khaz's user avatar
  • 155
5 votes
3 answers
11k views

Package minted Error: You must have `pygmentize' installed to use this package, while Pygments is already installed?

Installed MacTex2023 on a new Mac and all is well except for a nagging issue with "pygmentize" that I've already installed. I cannot find how to adjust system to recognise the installed &...
RosesBouquet's user avatar
2 votes
1 answer
394 views

LaTeX is not letting me add spaces in strings in lstlistings

I am trying to add some code to my document, but whenever there is a space inside a string in the code, it shows up with a bucket(?) thing. I have provided the code and the output below: \...
mudders's user avatar
  • 23
1 vote
1 answer
166 views

Change font in minted Python

I'm using minted to include Python code in my document, but I want to change the font of the letters only in the annotations and make it look more like what is portrayed in Jupyter Notebook. This is ...
felipe's user avatar
  • 13
1 vote
1 answer
164 views

How to add tikz images to a latex document created via sphinx

What is the best way of adding tikz images to a latex document created via sphinx. Is there some kind of specific library
fhaller's user avatar
  • 51
4 votes
1 answer
107 views

noweave not respecting indentation

In the past, I have often used noweb for Python projects, but this time I get strange behavior: indentation is not respected in the weaved file. Here is a minimal example, using noweb 2 (version ...
yannis's user avatar
  • 2,013
0 votes
1 answer
132 views

Package pythonimmediate

I'm trying to load and use the package pythonimmediate but I'm facing difficulties in identifying what's going wrong. I had python 3.7 installed through Anaconda distribution. It seems that the ...
Damien Gredat's user avatar
1 vote
1 answer
149 views

Unicode characters and subscripts in minted python

using Sympy and print I get the Unicode characters shown below. I am trying to display them in minted. I tried to create the individual characters using newunicodechar. This seem to work for π but the ...
ensue's user avatar
  • 11
0 votes
0 answers
50 views

Sagetex ignores indents if they are done in tabs insteads of spaces - how to make it recognize tabs?

The following examples are visually identical code. The only difference is that the indents were done differently. Four spaces were used in the first and a tab was used in the second. 1. \...
uate2934's user avatar
3 votes
1 answer
166 views

Sage is unable to process .sagetex.sage file created from sagetex

This is a simple .tex file that defines a sage function p(n) that returns 2 raised to the power of n. \documentclass{article} \usepackage{sagetex} \begin{document} \begin{sagesilent} def p(n): ...
brae37432's user avatar
0 votes
0 answers
47 views

How to run other programming languages within LaTeX? [duplicate]

Sometimes I want to use LaTeX for typesetting but leave complex calculations to another language, where LaTeX receives strings and numbers to print. Is it possible to insert code for other languages ...
itood9896's user avatar
1 vote
2 answers
66 views

Import Information into Several Documents from a Master Document

Context: I'm a university lecturer and therefore facing the same tasks whenever I prepare for a new semester. One of them is creating course material with LaTeX which includes a syllabus, slides for ...
macright's user avatar

1
2 3 4 5
10