From a03a536dd5e54f75dfbaed9e54a2cb16d5bf29f7 Mon Sep 17 00:00:00 2001 From: Luke Naylor <l.naylor@sms.ed.ac.uk> Date: Tue, 2 May 2023 20:52:05 +0100 Subject: [PATCH] Switch from lstlisting to minted for code block --- .gitignore | 1 + Makefile | 1 - latexmkrc | 2 +- main.tex | 31 ++++--------------------------- 4 files changed, 6 insertions(+), 29 deletions(-) diff --git a/.gitignore b/.gitignore index 15ff3a1..623e9a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ main.* !main.tex filtered_sage.txt +_minted-main/* diff --git a/Makefile b/Makefile index f98ca33..d67f986 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,6 @@ TEXFILES = ${MAINTEXFILE} SAGETEXSCRIPT = main.sagetex.sage main.pdf: ${TEXFILES} main.sagetex.sout.tmp filtered_sage.txt - lualatex ${MAINTEXFILE} latexmk main.sagetex.sout.tmp: ${SAGETEXSCRIPT} ${PYPLOTFILES} diff --git a/latexmkrc b/latexmkrc index b9169e4..9ea77ca 100644 --- a/latexmkrc +++ b/latexmkrc @@ -1,4 +1,4 @@ @default_files = ('main.tex'); $pdf_mode = 1; -$pdflatex = 'lualatex -synctex=1 -interaction=nonstopmode'; +$pdflatex = 'lualatex -shell-escape -synctex=1 -interaction=nonstopmode'; @generated_exts = (@generated_exts, 'synctex.gz'); diff --git a/main.tex b/main.tex index 8ec7884..7788fd6 100644 --- a/main.tex +++ b/main.tex @@ -8,6 +8,7 @@ \usepackage{hyperref} \usepackage{color} \usepackage{sagetex} +\usepackage{minted} \usepackage[]{breqn} \newcommand{\QQ}{\mathbb{Q}} @@ -494,32 +495,8 @@ linear terms match those of the other bounds in the previous subsections. \newpage \section{Appendix - SageMath code} -\definecolor{codegreen}{rgb}{0,0.6,0} -\definecolor{codegray}{rgb}{0.5,0.5,0.5} -\definecolor{codepurple}{rgb}{0.58,0,0.82} -%\definecolor{backcolour}{rgb}{0.95,0.95,0.92} - -\lstdefinestyle{mystyle}{ - %backgroundcolor=\color{backcolour}, - commentstyle=\color{codegreen}, - keywordstyle=\color{magenta}, - numberstyle=\tiny\color{codegray}, - stringstyle=\color{codepurple}, - basicstyle=\ttfamily\footnotesize, - breakatwhitespace=false, - breaklines=true, - captionpos=b, - keepspaces=true, - numbers=left, - numbersep=5pt, - showspaces=false, - showstringspaces=false, - showtabs=false, - tabsize=2 -} - -\lstset{style=mystyle} - -\lstinputlisting[language=python]{filtered_sage.txt} +\usemintedstyle{tango} + +\inputminted[obeytabs=true,tabsize=2]{python}{filtered_sage.txt} \end{document} -- GitLab