diff --git a/.gitignore b/.gitignore index 7f68c7a..221f878 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ /*.pdf +.version_local + .DS_Store .vscode* diff --git a/.latexmkrc b/.latexmkrc index 93e3097..67742d6 100644 --- a/.latexmkrc +++ b/.latexmkrc @@ -1,3 +1,5 @@ +print("Using the local .latexmkrc\n"); + # overleaf template # Settings diff --git a/.version_repo b/.version_repo new file mode 100644 index 0000000..b22a6ad --- /dev/null +++ b/.version_repo @@ -0,0 +1,3 @@ +Using the local .latexmkrc +Latexmk, John Collins, 17 Mar. 2022. Version 4.77 +XeTeX 3.141592653-2.6-0.999994 (TeX Live 2022) diff --git a/Makefile b/Makefile index 45f95f3..4ae2491 100644 --- a/Makefile +++ b/Makefile @@ -1,34 +1,47 @@ -.PHONY: main.pdf clean redo test_git versioned +.PHONY: install_docker main.pdf clean redo test_git test_version versioned check-common-typos +DOCKER_VERSION=latest + +DOCKER=docker run -i --rm --name latex -v "$$PWD":/usr/src/app -w /usr/src/app texlive/texlive +LATEXMK=$(DOCKER) latexmk +XETEX=$(DOCKER) xetex +LATEXDIFFVC=$(DOCKER) latexdiff-vc + +# keep as first command to build stuff main.pdf: main.tex main.bib - latexmk -pdfxe main.tex # use xelatex to build pdf + $(LATEXMK) -pdfxe main.tex # use xelatex to build pdf + +install_docker: + docker pull texlive/texlive:$(DOCKER_VERSION) clean: - latexmk -c + $(LATEXMK) -c x=`biber --cache` && if [ -d "$x" ]; then $(RM) $x; fi - $(RM) *.out *.aux *.log *.bbl *.blg *~ *.toc *.idx *.eps dummy *.fls *.fdb_latexmk *.bcf *.run.xml *.xdv - $(RM) $(patsubst %.tex, %.ps, $(wildcard *.tex)) - $(RM) $(patsubst %.tex, %.dvi, $(wildcard *.tex)) - $(RM) $(patsubst %.tex, %.pdf, $(wildcard *.tex)) + #$(RM) *.out *.aux *.log *.bbl *.blg *~ *.toc *.idx *.eps dummy *.fls *.fdb_latexmk *.bcf *.run.xml *.xdv + #$(RM) $(patsubst %.tex, %.ps, $(wildcard *.tex)) + #$(RM) $(patsubst %.tex, %.dvi, $(wildcard *.tex)) + #$(RM) $(patsubst %.tex, %.pdf, $(wildcard *.tex)) redo: clean main.pdf test_git: if [ -z "$$(git status --untracked-files=no --porcelain)" ]; then exit 0; else echo -e "\nERROR: working directory not clean. commit changes before running versioned build"; exit 1; fi -# TODO check if we are also synced to at least one remote + # TODO check if we are also synced to at least one remote -versioned: test_git clean main.pdf +test_version: + rm -f .version_local + $(LATEXMK) --version > .version_local + $(XETEX) --version | head -1 >> .version_local + @if ! diff -b .version_local .version_repo; then echo -e "\nWARNING! local versions and remote versions do not match! (above is local, below is repo)"; else echo "versions match!"; fi + +versioned: test_git clean main.pdf test_version cp main.pdf "main-$$(date -u +'%Y-%m-%dT%H:%M:%SZ')-$$(git rev-parse --short HEAD).pdf" -# TODO latexdiff -# latexdiff-vc --pdf main.tex -r 123456 -r abcdef +# latexdiff: # TODO + # latexdiff-vc --pdf main.tex -r 123456 -r abcdef # common typos check. find words, but ignore latex comment and macros -CT=grep -inr --include \*.tex "$${TYPO}" | grep -v ":%" | grep -v "newacronym" | grep -i --color=always "$${TYPO}"; exit 0 check-common-typos: - TYPO="application" && ${CT} - TYPO="run-time" && ${CT} - TYPO="behaviour" && ${CT} - TYPO="ground-truth" && ${CT} - TYPO="groundtruth" && ${CT} - TYPO="seperator" && ${CT} + ./typos.sh + + diff --git a/README.md b/README.md index fa35c40..9ace093 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,23 @@ ## usage The makefile contains build- and clean-instructions. Additionally, it contains a command to first check if everything is committed, then build and tag the pdf with the current datetime and git commit hash. + +## setup + +- ubuntu 22.04 + - Recent releases are needed, for latexmk on ubuntu this can be found at https://launchpad.net/ubuntu/+source/latexmk/1:4.77-1/+build/23584396 + - texlive + +## other notes +- latexmk 4.77 is only available in ubuntu 22.10 +- texlive doesn't have recent deb files +- dockers + - arkark/latexmk is outdatad + - latexmk 4.74b + - last commit 2021-05 https://github.com/arkark/latexmk-docker + - nopreserveroot/texlive-full + - unknown repo + - texlive/texlive + - weekly updates + - https://gitlab.com/islandoftex/images/texlive +- usenix template uses microtype, but the latter requires pdftex and doesn't work with xelatex :sob: diff --git a/main.tex b/main.tex index 2a2ce38..afd282c 100644 --- a/main.tex +++ b/main.tex @@ -1,8 +1,8 @@ % IEEE Template: -\documentclass[conference]{templates/IEEEtran} +%\documentclass[conference]{templates/IEEEtran} % USENIX Template: -%\documentclass[letterpaper,twocolumn,10pt]{article} -%\usepackage{usenix-2020-09} +\documentclass[letterpaper,twocolumn,10pt]{article} +\usepackage{templates/usenix-2020-09} % STANDALONE TEMPLATE %\documentclass{article} %\usepackage[letterpaper,top=2cm,bottom=2cm,left=3cm,right=3cm,marginparwidth=1.75cm]{geometry} @@ -10,8 +10,9 @@ % Packages -\usepackage[T1]{fontenc} -\usepackage[utf8]{inputenc} +%\usepackage[T1]{fontenc} +%\usepackage[utf8]{inputenc} +\usepackage{csquotes} \usepackage[english]{babel} \usepackage{tikz} \usepackage{subfig} @@ -24,7 +25,7 @@ \usepackage[labelfont=bf]{caption} \usepackage{comment} \usepackage{xcolor} -\usepackage[nospread,keeplastbox]{flushend} +%\usepackage[nospread,keeplastbox]{flushend} \usepackage{tcolorbox} \usepackage{listings} %\usepackage{cite} diff --git a/typos.sh b/typos.sh new file mode 100755 index 0000000..a275286 --- /dev/null +++ b/typos.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +check_typo () { + grep -nri --include \*.tex "${1}" | grep -v ":%" | grep -v "newacronym" | grep -i --color=always "${1}" +} + +check_typo "application" +check_typo "run-time" +check_typo "behaviour" +check_typo "ground-truth" +check_typo "groundtruth" +check_typo "seperator" + +exit 0