Skip to content
Snippets Groups Projects
Commit 2ff595b5 authored by Luke Naylor's avatar Luke Naylor
Browse files

Complete transition away from minted

Note, there should now be no need to toggle the appendix
parent b0995d71
No related branches found
No related tags found
No related merge requests found
// .devcontainer/devcontainer.json // .devcontainer/devcontainer.json
{ {
"name": "LaTeX&SageTex Devcontainer", "name": "LaTeX&SageTex&Chromacode Devcontainer",
"image": "registry.gitlab.com/lukenaylor/latex/sagetex-image:latest", "dockerFile": "./Dockerfile",
"postCreateCommand": "sage -pip install pseudowalls --extra-index-url https://gitlab.com/api/v4/projects/43962374/packages/pypi/simple",
"customizations": { "customizations": {
"vscode": { "vscode": {
"settings": { "settings": {
......
# Requires GNU sed, a latex distribution, sage # Requires GNU sed, a latex distribution, sage
# and sagetex.sty visible in TEXINPUTS # and sagetex.sty visible in TEXINPUTS
MAINTEXFILE = main.tex #MAINTEXFILE = main.tex
PREAMBLEFILES = newcommands.tex packages.tex theoremstyles.tex dependency-packages.tex PREAMBLEFILES = newcommands.tex packages.tex theoremstyles.tex dependency-packages.tex
CHAPTERDIRS = general-semi-homog-presentation max-destabilizer-rank CHAPTERDIRS = general-semi-homog-presentation max-destabilizer-rank
TEXFILES = main.tex ${PREAMBLEFILES} $(addsuffix /content.tex, ${CHAPTERDIRS}) #TEXFILES = main.tex ${PREAMBLEFILES} $(addsuffix /content.tex, ${CHAPTERDIRS})
BIBFILES = $(addsuffix /references.bib, ${CHAPTERDIRS}) #BIBFILES = $(addsuffix /references.bib, ${CHAPTERDIRS})
SAGESCRIPT = main.sagetex.sage SAGESCRIPT = main.sagetex.sage
SAGEARTIFACT = main.sagetex.sout SAGEARTIFACT = main.sagetex.sout
main.pdf: ${TEXFILES} ${BIBFILES} ${PREAMBLEFILES} ${SAGEARTIFACT} tilt.rs notebook_tex ${SAGEARTIFACT}: ${SAGESCRIPT} chapter_deps
latexmk || echo this fails but seems to produce pdf correctly
${SAGEARTIFACT}: ${SAGESCRIPT} chapter_py_libs
PYTHONPATH=`echo $(CHAPTERDIRS) | sed 's/ \+/:/g'` sage ${SAGESCRIPT} PYTHONPATH=`echo $(CHAPTERDIRS) | sed 's/ \+/:/g'` sage ${SAGESCRIPT}
${SAGESCRIPT}: ${TEXFILES} #${SAGESCRIPT}: ${TEXFILES}
latexmk || echo this is meant to fail #latexmk || echo this is meant to fail
# seems to be a bug with sagetex, only works if patched: # 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}) CHAPTERPACKAGES = $(addsuffix /packages.tex , ${CHAPTERDIRS})
CHAPTERNEWCOMMANDS = $(addsuffix /newcommands.tex , ${CHAPTERDIRS})
dependency-packages.tex: ${CHAPTERPACKAGES} dependency-packages.tex: ${CHAPTERPACKAGES}
( \ ( \
echo "% Package list generated from chapters:"; \ echo "% Package list generated from chapters:"; \
cat $^ | sed -e '/^%/d' -e '/^$$/d' | sort | uniq \ cat $^ | sed -e '/^%/d' -e '/^$$/d' | sort | uniq \
) > $@ ) > $@
packages.tex: dependency-packages.tex
CHAPTERNEWCOMMANDS = $(addsuffix /newcommands.tex , ${CHAPTERDIRS})
dependency-newcommands.tex: ${CHAPTERNEWCOMMANDS} dependency-newcommands.tex: ${CHAPTERNEWCOMMANDS}
( \ ( \
echo "% newcommands generated from chapters:"; \ echo "% newcommands generated from chapters:"; \
cat $^ | sed -e '/^%/d' -e '/^$$/d' | sort | uniq \ cat $^ | sed -e '/^%/d' -e '/^$$/d' | sort | uniq \
) > $@ ) > $@
newcommands.tex: dependency-newcommands.tex
chapter_py_libs: chapter_deps:
for dir in $(CHAPTERDIRS); do \ for dir in $(CHAPTERDIRS); do \
$(MAKE) -C $$dir notebook_py_libs; \ $(MAKE) -C $$dir pretex; \
done done
# SYMBOLIC LINKS # SYMBOLIC LINKS
...@@ -63,7 +61,6 @@ $(1).tex: $(1).ipynb ...@@ -63,7 +61,6 @@ $(1).tex: $(1).ipynb
sed -e '/\\documentclass/,/\\maketitle/d' -e '/\\end{document}/d' -i $(1).tex sed -e '/\\documentclass/,/\\maketitle/d' -e '/\\end{document}/d' -i $(1).tex
endef endef
NOTEBOOKBASENAMES=$(basename $(wildcard **/*.ipynb)) NOTEBOOKBASENAMES=$(basename $(wildcard **/*.ipynb))
#plots_and_expressions examples characteristic_curves rank_zero_case other_P_choice #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 ...@@ -71,21 +68,20 @@ $(foreach _base, $(NOTEBOOKBASENAMES), $(eval $(call NOTEBOOK_TO_TEX_RULE, $(_ba
notebook_tex: $(addsuffix .tex, $(NOTEBOOKBASENAMES)) notebook_tex: $(addsuffix .tex, $(NOTEBOOKBASENAMES))
# TEX FILES FROM RUST ## TEX FILES FROM RUST
#
define RUST_TO_TEX_RULE #define RUST_TO_TEX_RULE
$(1).tex: $(1).rs #$(1).tex: $(1).rs
chromacode -r -i $(1).rs -o $(1).tex # chromacode -r -i $(1).rs -o $(1).tex
endef #endef
#
RUSTBASENAMES=$(basename $(wildcard tilt.rs/src/**/*.rs)) #RUSTBASENAMES=$(basename $(wildcard tilt.rs/src/**/*.rs))
#
$(foreach _base, $(RUSTBASENAMES), $(eval $(call RUST_TO_TEX_RULE, $(_base)))) #$(foreach _base, $(RUSTBASENAMES), $(eval $(call RUST_TO_TEX_RULE, $(_base))))
#
rust_tex: $(addsuffix .tex, $(RUSTBASENAMES)) #rust_tex: $(addsuffix .tex, $(RUSTBASENAMES))
newcommands.tex: dependency-newcommands.tex pretex: chapter_deps ${PREAMBLEFILES} tilt.rs nb-appendix notebook_tex
packages.tex: dependency-packages.tex
.PHONY: clean .PHONY: clean
clean: clean:
......
...@@ -5,6 +5,26 @@ ...@@ -5,6 +5,26 @@
\input{newcommands.tex} \input{newcommands.tex}
\input{max-destabilizer-rank/newunicodes.tex} \input{max-destabilizer-rank/newunicodes.tex}
\input{notebook-preamble.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[ \usepackage[
style=alphabetic, style=alphabetic,
...@@ -41,14 +61,7 @@ sorting=ynt ...@@ -41,14 +61,7 @@ sorting=ynt
\chapter{Computing Pseudowalls Program} \chapter{Computing Pseudowalls Program}
\lstinputlisting[ \lstinputlisting[
escapeinside={<@}{@>}, caption={aou}
caption=aou,
captionpos=b,
frame=single,
numbers=left,
numberstyle={\scriptsize\ttfamily\color{black!60}},
basicstyle={\linespread{0.9}\scriptsize\ttfamily},
aboveskip=5mm
]{tilt.rs/src/main.tex} ]{tilt.rs/src/main.tex}
......
Subproject commit 4f760f58da7bb150f93ae6dbd5d25c8204e4c276 Subproject commit 548d72e2c693373576571bc18e24325e0ff6a527
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment