Skip to content

Instantly share code, notes, and snippets.

@vadimkantorov
Last active December 19, 2022 12:02
Show Gist options
  • Save vadimkantorov/27ee19d130c413073bedd627c1b6a41e to your computer and use it in GitHub Desktop.
Save vadimkantorov/27ee19d130c413073bedd627c1b6a41e to your computer and use it in GitHub Desktop.
Makefile and gitignore for papers and posters
# Download Makefile and .gitignore to a new project:
# wget -O Makefile -nv --no-check-certificate https://gist.githubusercontent.com/vadimkantorov/27ee19d130c413073bedd627c1b6a41e/raw/ && wget -O .gitignore -nv --no-check-certificate https://gist.github.com/vadimkantorov/27ee19d130c413073bedd627c1b6a41e/raw/.gitignore
# To install TexLive (including on WSLv1): sudo apt-get install -y texlive-latex-base texlive-latex-extra texlive-fonts-recommended make
# https://gist.github.com/vadimkantorov/27ee19d130c413073bedd627c1b6a41e
NAME = $(notdir ${CURDIR})# conferenceYEAR
$(NAME).pdf $(NAME).bbl: $(NAME).tex
-pdflatex $(basename $@)
-bibtex $(basename $@)
-pdflatex $(basename $@)
-pdflatex $(basename $@)
format:
find . -name '*.tex' | xargs fmt
arxiv: $(NAME).bbl
find . -name '*.tex' -exec sed -i'' 's/\([^\\]\|^\)\(\(\\\\\)*\)%.*/\1\2%/g' {} \;
tar -cf $(NAME).tar *.tex *.bib *.bbl *.sty *.bst *.cls figures/*.tex images/*.pdf
clean:
find . \( -name $(NAME).pdf -o -name $(NAME).tar -o -name '*.text.bak' -o -name '*.aux' -o -name '*.bbl' -o -name '*.blg' -o -name '*.brf' -o -name '*.log' -o -name '*.synctex.gz' -o -name '*.out' -o -name '*.snm' -o -name '*.nav' -o -name '*.vrb' -o -name '*.toc' -o -name '*~' \) -delete
view:
$(eval SUMATRA='/mnt/c/Users/vadim/AppData/Local/SumatraPDF/SumatraPDF.exe')
if [ -f $(SUMATRA) ]; then ($(SUMATRA) -reuse-instance $(NAME).pdf &); fi
*.text.bak
*.aux
*.bbl
*.blg
*.brf
*.log
*.synctex.gz
*.pdf
*.out
*~
*.snm
*.nav
*.vrb
*.toc
*.tar
\newcommand\vadimkantorov[1]{\textcolor{blue}{[VK: #1]}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment