version checking and such works but xelatex error with usenix template

This commit is contained in:
Jakob 2022-08-22 11:56:53 +02:00
parent 83cedb9d27
commit 635d49b75b
7 changed files with 79 additions and 24 deletions

2
.gitignore vendored
View File

@ -1,5 +1,7 @@
/*.pdf
.version_local
.DS_Store
.vscode*

View File

@ -1,3 +1,5 @@
print("Using the local .latexmkrc\n");
# overleaf template
# Settings

3
.version_repo Normal file
View File

@ -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)

View File

@ -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

View File

@ -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:

View File

@ -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}

14
typos.sh Executable file
View File

@ -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