From 2ff595b586679beca488fe3e2e57024ecb3ef178 Mon Sep 17 00:00:00 2001
From: Luke Naylor <l.naylor@sms.ed.ac.uk>
Date: Mon, 26 Feb 2024 23:36:59 +0000
Subject: [PATCH] Complete transition away from minted

Note, there should now be no need to toggle the appendix
---
 .devcontainer/devcontainer.json |  5 ++-
 Makefile                        | 56 +++++++++++++++------------------
 main.tex                        | 29 ++++++++++++-----
 max-destabilizer-rank           |  2 +-
 4 files changed, 50 insertions(+), 42 deletions(-)

diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index 2b5fd14..d716dae 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -1,8 +1,7 @@
 // .devcontainer/devcontainer.json
 {
-    "name": "LaTeX&SageTex Devcontainer",
-    "image": "registry.gitlab.com/lukenaylor/latex/sagetex-image:latest",
-    "postCreateCommand": "sage -pip install pseudowalls --extra-index-url https://gitlab.com/api/v4/projects/43962374/packages/pypi/simple",
+    "name": "LaTeX&SageTex&Chromacode Devcontainer",
+    "dockerFile": "./Dockerfile",
     "customizations": {
         "vscode": {
             "settings": {
diff --git a/Makefile b/Makefile
index fd522ba..28af021 100644
--- a/Makefile
+++ b/Makefile
@@ -1,45 +1,43 @@
 # Requires GNU sed, a latex distribution, sage
 # and sagetex.sty visible in TEXINPUTS
 
-MAINTEXFILE = main.tex
+#MAINTEXFILE = main.tex
 PREAMBLEFILES = newcommands.tex packages.tex theoremstyles.tex dependency-packages.tex
 CHAPTERDIRS = general-semi-homog-presentation max-destabilizer-rank
-TEXFILES = main.tex ${PREAMBLEFILES} $(addsuffix /content.tex, ${CHAPTERDIRS})
-BIBFILES = $(addsuffix /references.bib, ${CHAPTERDIRS})
+#TEXFILES = main.tex ${PREAMBLEFILES} $(addsuffix /content.tex, ${CHAPTERDIRS})
+#BIBFILES = $(addsuffix /references.bib, ${CHAPTERDIRS})
 
 SAGESCRIPT = main.sagetex.sage
 
 SAGEARTIFACT = main.sagetex.sout
 
-main.pdf: ${TEXFILES} ${BIBFILES} ${PREAMBLEFILES} ${SAGEARTIFACT} tilt.rs notebook_tex
-	latexmk || echo this fails but seems to produce pdf correctly
-
-${SAGEARTIFACT}: ${SAGESCRIPT} chapter_py_libs
+${SAGEARTIFACT}: ${SAGESCRIPT} chapter_deps
 	PYTHONPATH=`echo $(CHAPTERDIRS) | sed 's/ \+/:/g'` sage ${SAGESCRIPT}
 
-${SAGESCRIPT}: ${TEXFILES}
-	latexmk || echo this is meant to fail
+#${SAGESCRIPT}: ${TEXFILES}
+	#latexmk || echo this is meant to fail
 	# seems to be a bug with sagetex, only works if patched:
-	sed -i -e 's;version_check=)$$;version_check=True);' $@
+	#sed -i -e 's;version_check=)$$;version_check=True);' $@
 
 CHAPTERPACKAGES = $(addsuffix /packages.tex , ${CHAPTERDIRS})
-CHAPTERNEWCOMMANDS = $(addsuffix /newcommands.tex , ${CHAPTERDIRS})
-
 dependency-packages.tex: ${CHAPTERPACKAGES}
 	( \
 		echo "% Package list generated from chapters:"; \
 		cat $^ | sed -e '/^%/d' -e '/^$$/d' | sort | uniq \
 	) > $@
+packages.tex: dependency-packages.tex
 
+CHAPTERNEWCOMMANDS = $(addsuffix /newcommands.tex , ${CHAPTERDIRS})
 dependency-newcommands.tex: ${CHAPTERNEWCOMMANDS}
 	( \
 		echo "% newcommands generated from chapters:"; \
 		cat $^ | sed -e '/^%/d' -e '/^$$/d' | sort | uniq \
 	) > $@
+newcommands.tex:  dependency-newcommands.tex
 
-chapter_py_libs:
+chapter_deps:
 	for dir in $(CHAPTERDIRS); do \
-		$(MAKE) -C $$dir notebook_py_libs; \
+		$(MAKE) -C $$dir pretex; \
 	done
 
 # SYMBOLIC LINKS
@@ -63,7 +61,6 @@ $(1).tex: $(1).ipynb
 	sed -e '/\\documentclass/,/\\maketitle/d' -e '/\\end{document}/d' -i  $(1).tex
 endef
 
-
 NOTEBOOKBASENAMES=$(basename $(wildcard **/*.ipynb))
 #plots_and_expressions examples characteristic_curves rank_zero_case other_P_choice
 
@@ -71,21 +68,20 @@ $(foreach _base, $(NOTEBOOKBASENAMES), $(eval $(call NOTEBOOK_TO_TEX_RULE, $(_ba
 
 notebook_tex: $(addsuffix .tex, $(NOTEBOOKBASENAMES))	
 
-# TEX FILES FROM RUST
-
-define RUST_TO_TEX_RULE
-$(1).tex: $(1).rs
-	chromacode -r -i $(1).rs -o $(1).tex
-endef
-
-RUSTBASENAMES=$(basename $(wildcard tilt.rs/src/**/*.rs))
-
-$(foreach _base, $(RUSTBASENAMES), $(eval $(call RUST_TO_TEX_RULE, $(_base))))
-
-rust_tex: $(addsuffix .tex, $(RUSTBASENAMES))	
-
-newcommands.tex:  dependency-newcommands.tex
-packages.tex: dependency-packages.tex
+## TEX FILES FROM RUST
+#
+#define RUST_TO_TEX_RULE
+#$(1).tex: $(1).rs
+#	chromacode -r -i $(1).rs -o $(1).tex
+#endef
+#
+#RUSTBASENAMES=$(basename $(wildcard tilt.rs/src/**/*.rs))
+#
+#$(foreach _base, $(RUSTBASENAMES), $(eval $(call RUST_TO_TEX_RULE, $(_base))))
+#
+#rust_tex: $(addsuffix .tex, $(RUSTBASENAMES))	
+
+pretex: chapter_deps ${PREAMBLEFILES} tilt.rs nb-appendix notebook_tex
 
 .PHONY: clean
 clean:
diff --git a/main.tex b/main.tex
index 77a3bdf..84388a7 100644
--- a/main.tex
+++ b/main.tex
@@ -5,6 +5,26 @@
 \input{newcommands.tex}
 \input{max-destabilizer-rank/newunicodes.tex}
 \input{notebook-preamble.tex}
+\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
+\lstset{
+  escapeinside={<@}{@>},
+  inputencoding=utf8,
+  extendedchars=true,
+  basicstyle={\linespread{1.1}\scriptsize\ttfamily},
+  breaklines=true,
+  showstringspaces=false,
+  showspaces=false,
+  numbers=left,
+  numberstyle={\scriptsize\ttfamily\color{black!60}},
+  %numbersep=9pt,
+  backgroundcolor=\color{backcolour},
+  aboveskip=5mm,
+  tabsize=2,
+  breaklines=true,
+  showtabs=false,
+  captionpos=b,
+  literate={β}{{\beta}}1 {μ}{{\mu}}1 {ü}{{\"u}}1 {°}{\dg}1 {ᵇ}{{b}}1 {ₙ}{{n}}1
+}
 
 \usepackage[
 style=alphabetic,
@@ -41,14 +61,7 @@ sorting=ynt
 	\chapter{Computing Pseudowalls Program}
 
 	\lstinputlisting[
-	escapeinside={<@}{@>},
-	caption=aou,
-	captionpos=b,
-	frame=single,
-	numbers=left,
-	numberstyle={\scriptsize\ttfamily\color{black!60}},
-	basicstyle={\linespread{0.9}\scriptsize\ttfamily},
-	aboveskip=5mm
+	caption={aou}
 	]{tilt.rs/src/main.tex}
 
 
diff --git a/max-destabilizer-rank b/max-destabilizer-rank
index 4f760f5..548d72e 160000
--- a/max-destabilizer-rank
+++ b/max-destabilizer-rank
@@ -1 +1 @@
-Subproject commit 4f760f58da7bb150f93ae6dbd5d25c8204e4c276
+Subproject commit 548d72e2c693373576571bc18e24325e0ff6a527
-- 
GitLab