Skip to main content

Questions tagged [python]

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

Filter by
Sorted by
Tagged with
7 votes
1 answer
169 views

I’d like to have a solution environment that does the following: It writes the contents of the environment to an external file \jobname.py. All the solutions should be in the same file \jobname.py. ...
Colas's user avatar
  • 7,654
0 votes
0 answers
86 views

I am starting to use Pygments, via the LaTeX minted package. My goal is to typeset Python code using the highlighting scheme used in JupyterLab, or something close to that. Starting with the default ...
dpgoldenberg's user avatar
3 votes
1 answer
180 views

I have a question . When I use pygments dark style material , I notice that many words are invisible when displaying LaTeX/text source code , since the key/value pairs are all black . These dark ...
YCH817's user avatar
  • 331
1 vote
2 answers
133 views

I'm looking to write some Python code (just for the look, no need to run it), I want it to have the distinct color palette that most Python 3 IDEs use. (in dark mode specifically) I understand it's ...
Nate3384's user avatar
  • 381
0 votes
1 answer
80 views

For some reason, in the code below, LaTeX is overwriting my .py file although I am just trying to call the .py file. Here is the contents of the pycode_batch_noreg.py file: import network3 from ...
Joe's user avatar
  • 9,152
2 votes
0 answers
69 views

Short version: Some characters in images generated using Matplotlib in Python with Times fonts do not appear in LaTeX file under some conditions. With details: I observed this behavior by chance. I ...
Gautam Sreekumar's user avatar
0 votes
0 answers
54 views

I wrote an introduction note about python, which included something like the following ... \usepackage{pythonhighlight} ... the following indentation works in python \begin{python} a=5 if a==4: ...
William Wang's user avatar
0 votes
0 answers
185 views

As far as I know, the information is scattered, and there isn't a straightforward tutorial that makes this easy to accomplish. The only question that specifically addressed this has been closed and ...
Emanuele Nardi's user avatar
3 votes
4 answers
245 views

I’m looking forward to running the memoize package to reduce my compile time, but after several days of research, I’m clueless. This is my first Python rodeo, so I may be missing something that to ...
RosesBouquet's user avatar
1 vote
0 answers
130 views

I'm using Python scripts to dynamically generate LaTeX PDFs based on a template that includes several user-provided fields such as: username error type input description error message The content ...
mcExchange's user avatar
2 votes
1 answer
234 views

I have this two simple lines of python code (test.py): ################################################# # col.set_ and this is my latex code: \documentclass[letterpaper,12pt]{report} \usepackage[...
Eric Sánchez's user avatar
1 vote
1 answer
88 views

So I have some code blocks like the followings \begin{lstlisting}[language=Python, caption={Ejecución de prueba}] altura_lista = altura.tolist() peso_lista = peso.tolist() w, b = train(altura_lista, ...
6Cript's user avatar
  • 11
0 votes
1 answer
99 views

I'm working on visualizing a neural network architecture using LaTeX with TikZ, specifically using the PlotNeuralNet library. I am encountering an error related to node referencing. The latex code is ...
Melissa's user avatar
0 votes
0 answers
382 views

An associated PostScript font (required by Matplotlib) could not be found for TeX font 'zptmcm7y' in 'C:/Users/Admin/AppData/Local/MiKTeX/fonts/map/pdftex/pdftex.map'; this problem can often be ...
astra inclinant's user avatar
1 vote
0 answers
1k views

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
124 views

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
1 vote
0 answers
149 views

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
48 views

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
  • 381
1 vote
1 answer
491 views

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
86 views

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
178 views

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
823 views

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
1 vote
2 answers
325 views

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
71 views

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
218 views

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
  • 129
0 votes
1 answer
139 views

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
5 answers
884 views

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,379
0 votes
1 answer
129 views

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
184 views

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,263
0 votes
0 answers
85 views

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,930
0 votes
1 answer
127 views

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,930
2 votes
1 answer
877 views

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
560 views

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,155
1 vote
0 answers
163 views

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
176 views

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
  • 561
0 votes
1 answer
363 views

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
50 views

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
452 views

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
182 views

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
781 views

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
  • 879
2 votes
1 answer
115 views

It is needed to insert a Minted inside xsim environment. The basic code is as follow: \documentclass{book} \usepackage{xcolor} \usepackage{minted} \usepackage[verbose]{xsim}%paquete de ejercicios ...
ABV's user avatar
  • 199
2 votes
0 answers
101 views

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
107 views

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
312 views

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
415 views

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
537 views

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
370 views

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 ...
hululu's user avatar
  • 101
2 votes
1 answer
134 views

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
275 views

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
7 votes
4 answers
20k views

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

1
2 3 4 5
10