added Makefile

This commit is contained in:
janscience 2023-03-25 18:09:12 +01:00
parent a9e17a7537
commit a87cf28aa8
2 changed files with 101 additions and 18 deletions

View File

@ -1,19 +1,21 @@
\documentclass[11pt,a4paper]{article}
%%%%% packages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[english]{babel}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{pslatex} % nice font for pdf file
\usepackage[right]{eurosym}
\usepackage{pgfgantt}
\usepackage{SIunits}
\usepackage{enumitem}
%%%%% colors %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{xcolor}
\definecolor{dfgblue}{cmyk}{1,0.7,0,0}
%%%%% hyperref %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[breaklinks=true,colorlinks=true,citecolor=blue!30!black,urlcolor=blue!30!black,linkcolor=blue!30!black]{hyperref}
\usepackage[breaklinks=true,colorlinks=true,citecolor=dfgblue,urlcolor=dfgblue,linkcolor=dfgblue]{hyperref}
\newcommand{\email}[1]{\href{mailto:#1}{#1}}
\definecolor{dfgblau}{cmyk}{1,0.7,0,0}
%%%%% page layout %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[left=25mm, right=25mm, top=25mm, bottom=25mm]{geometry}
\usepackage{lastpage}
@ -23,7 +25,7 @@
\fancyhead[RO, LE]{\footnotesize{page \thepage\ of \pageref{LastPage}}}
\fancyhead[LO, RE]{\footnotesize{DFG form 53.01 09/22}}
\fancyfoot[LO, RE]{\begin{minipage}[c]{0.7\textwidth}
\footnotesize{\textcolor{dfgblau}{Deutsche Forschungsgemeinschaft}\\
\footnotesize{\textcolor{dfgblue}{Deutsche Forschungsgemeinschaft}\\
Kennedyallee 40 $\cdot$ 53175 Bonn $\cdot$ postal address: 53170 Bonn\\
phone: + 49 228 885-1 $\cdot$ fax: + 49 228 885-2777 $\cdot$ \email{postmaster@dfg.de} $\cdot$ \url{www.dfg.de}}
\end{minipage}
@ -105,18 +107,6 @@
\newcommand{\note}[2][]{{\textcolor{blue}{\itshape[\ifthenelse{\equal{#1}{}}{}{#1: }#2]}}}
\newcommand{\notejb}[1]{\note[JB]{#1}}
\newcommand{\notejg}[1]{\note[JG]{#1}}
\newcommand{\notebl}[1]{\note[BL]{\color{purple}#1}}
\newcommand{\red}[1]{\textcolor{red}{#1}}
%%%%% math %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{amsmath}
\newcommand{\e}[1]{eq.~(\ref{eq:#1})}
\newcommand{\link}[1]{\ref{eq:#1}}
\newcommand{\half}{\frac{1}{2}}
\renewcommand{\refname}{\vspace*{-3em}}
\newcommand{\be}{\begin{equation}} \newcommand{\ee}{\end{equation}}
\newcommand{\ba}{\begin{eqnarray}} \newcommand{\ea}{\end{eqnarray}}
\newcommand{\lr}[1]{\left\langle #1 \right\rangle}
%%%%% fish species %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\Albi}{\textit{Apteronotus albifrons}}
@ -141,7 +131,6 @@
\begin{tabular}{@{}llll}
\textbf{\large Jan Benda} & T\"ubingen & Prof. Dr. & permanent position \\[0.5ex]
\textbf{\large Jan Grewe} & T\"ubingen & Dr. & permanent position \\[0.5ex]
\textbf{\large Benjamin Lindner} & Berlin & Prof. Dr. & permanent position
\end{tabular}
\section*{Project title}

94
Makefile Normal file
View File

@ -0,0 +1,94 @@
BASENAME=Beschreibung_des_Vorhabens
TEXFILE=$(BASENAME).tex
PDFFILE=$(BASENAME).pdf
REVISION=349ccea82eb50cd94e2aa9e518aa00d97e9957a4
SUMMARY=summary
all: bib summary clean
bib :
-pdflatex $(TEXFILE)
-bibtex $(BASENAME)
-sed -i 's/{Ben.*da}/{\\bibemph{Benda}}/' $(BASENAME).bbl
-pdflatex $(TEXFILE)
-pdflatex $(TEXFILE)
-pdflatex $(TEXFILE)
@echo
@echo "BibTeX log:"
@sed -n -e '1,/You.ve used/p' $(BASENAME).blg
pdf: $(PDFFILE)
$(PDFFILE) : $(TEXFILE)
pdflatex -interaction=scrollmode $< | tee /dev/stderr | fgrep -q "Rerun to get" && pdflatex -interaction=scrollmode $< || true
again :
pdflatex $(TEXFILE)
diff :
#latexdiff-git -r $(REVISION) --pdf $(TEXFILE)
latexdiff-git -r $(REVISION) $(TEXFILE)
-pdflatex $(BASENAME)-diff$(REVISION)
-bibtex $(BASENAME)-diff$(REVISION)
-sed -i 's/{Benda}/{\\bibemph{Benda}}/' $(BASENAME)-diff$(REVISION).bbl
-pdflatex $(BASENAME)-diff$(REVISION)
-pdflatex $(BASENAME)-diff$(REVISION)
-pdflatex $(BASENAME)-diff$(REVISION)
mv $(BASENAME)-diff$(REVISION).pdf $(BASENAME)-diff.pdf
rm $(BASENAME)-diff$(REVISION).* $(BASENAME)-diff$(REVISION)-blx.*
# watch files ###############################################
watchpdf :
while true; do ! make -q pdf && make pdf; sleep 0.5; done
# statistics #########################################################
stats: $(PDFFILE)
# use \pagestyle{empty} and don't include any pictures!
@pdftotext -nopgbrk $(PDFFILE) - | fold -s > tmp.txt
@echo " words: " `wc -w tmp.txt 2> /dev/null | cut -d ' ' -f 1`
@echo "characters: " `wc -c tmp.txt 2> /dev/null | cut -d ' ' -f 1`
@rm tmp.txt
# summary #########################################################
summary: $(SUMMARY).pdf
$(SUMMARY).pdf : $(SUMMARY).tex
pdflatex -interaction=scrollmode $< | tee /dev/stderr | fgrep -q "Rerun to get" && pdflatex -interaction=scrollmode $< || true
# watch summary ###############################################
watchsummary :
while true; do ! make -q summary && make summary; sleep 0.5; done
summaryrtf: $(SUMMARY).pdf
latex2rtf $(SUMMARY).tex
# clean up ############################################################
clean :
rm -f *~ $(BASENAME).aux $(BASENAME).bbl $(BASENAME).blg $(BASENAME).bcf $(BASENAME).log $(BASENAME).out $(BASENAME)-blx.bib $(BASENAME).aux.blg $(BASENAME).run.xml $(BASENAME).rtf $(SUMMARY).aux $(SUMMARY).log $(SUMMARY).rtf
cleanall: clean
rm -f $(PDFFILE) $(BASENAME)-diff.pdf $(SUMMARY).pdf
# help ################################################################
help :
@echo \
"make pdf: make the pdf file of the proposal.\n"\
"make bib: run bibtex and make the pdf file of the proposal.\n"\
"make again: run latex and make the pdf file of the proposal,\n"\
" no matter whether you changed the .tex file or not.\n"\
"make watchpdf: make the pdf file of the paper\n"\
" whenever the tex file is modified.\n"\
"make diff: make a diff file since REVISION.\n"\
"make stats: print number of words and characters.\n"\
"make summary: make the pdf file of the summary.\n"\
"make watchsummary: make the pdf file of the summary\n"\
" whenever the tex file is modified.\n"\
"make summaryrtf: make a rtf file of the summary.\n"\
"make clean: remove all intermediate files,\n"\
" just leave the source files and the final .pdf files.\n"\
"make cleanall: clean and remove the final .pdf files."