From 4357939cdbaf43fb7453b5adfe5bb36cea4e3874 Mon Sep 17 00:00:00 2001 From: Jan Benda Date: Mon, 14 Dec 2020 00:17:32 +0100 Subject: [PATCH] [statistics] improved latex and Makefile file structure --- exercisesheader.tex | 2 + exercisestitle.tex | 1 + statistics/exercises/Makefile | 35 +------- statistics/exercises/instructions.tex | 6 -- .../{exercises01.tex => statistics-1.tex} | 84 ++---------------- .../{exercises02.tex => statistics-2.tex} | 87 ++----------------- .../{exercises03.tex => statistics-3.tex} | 87 ++----------------- 7 files changed, 29 insertions(+), 273 deletions(-) delete mode 100644 statistics/exercises/instructions.tex rename statistics/exercises/{exercises01.tex => statistics-1.tex} (74%) rename statistics/exercises/{exercises02.tex => statistics-2.tex} (69%) rename statistics/exercises/{exercises03.tex => statistics-3.tex} (56%) diff --git a/exercisesheader.tex b/exercisesheader.tex index 321d22c..51a6258 100644 --- a/exercisesheader.tex +++ b/exercisesheader.tex @@ -87,6 +87,8 @@ \newcommand{\qt}[1]{\textbf{#1}\\} +\newcommand{\extra}{--- Optional ---\ \mbox{}} + \newcommand{\code}[1]{\texttt{#1}} %%%%% page breaks %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/exercisestitle.tex b/exercisestitle.tex index 3041d3e..b97b56b 100644 --- a/exercisestitle.tex +++ b/exercisestitle.tex @@ -4,3 +4,4 @@ {\large Jan Grewe, Jan Benda}\\[-3ex] Neuroethology Lab \hfill --- \hfill Institute for Neurobiology \hfill --- \hfill \includegraphics[width=0.28\textwidth]{UT_WBMW_Black_RGB} \\ \end{center} +\hr diff --git a/statistics/exercises/Makefile b/statistics/exercises/Makefile index 27691d9..fd49c98 100644 --- a/statistics/exercises/Makefile +++ b/statistics/exercises/Makefile @@ -1,34 +1,3 @@ -TEXFILES=$(wildcard exercises??.tex) -EXERCISES=$(TEXFILES:.tex=.pdf) -SOLUTIONS=$(EXERCISES:exercises%=solutions%) +TEXFILES=$(wildcard statistics-?.tex) -.PHONY: pdf exercises solutions watch watchexercises watchsolutions clean - -pdf : $(SOLUTIONS) $(EXERCISES) - -exercises : $(EXERCISES) - -solutions : $(SOLUTIONS) - -$(SOLUTIONS) : solutions%.pdf : exercises%.tex instructions.tex - { echo "\\documentclass[answers,12pt,a4paper,pdftex]{exam}"; sed -e '1d' $<; } > $(patsubst %.pdf,%.tex,$@) - pdflatex -interaction=scrollmode $(patsubst %.pdf,%.tex,$@) | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $(patsubst %.pdf,%.tex,$@) || true - rm $(patsubst %.pdf,%,$@).[!p]* - -$(EXERCISES) : %.pdf : %.tex instructions.tex - pdflatex -interaction=scrollmode $< | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $< || true - -watch : - while true; do ! make -q pdf && make pdf; sleep 0.5; done - -watchexercises : - while true; do ! make -q exercises && make exercises; sleep 0.5; done - -watchsolutions : - while true; do ! make -q solutions && make solutions; sleep 0.5; done - -clean : - rm -f *~ *.aux *.log *.out - -cleanup : clean - rm -f $(SOLUTIONS) $(EXERCISES) +include ../../exercises.mk diff --git a/statistics/exercises/instructions.tex b/statistics/exercises/instructions.tex deleted file mode 100644 index 3041d3e..0000000 --- a/statistics/exercises/instructions.tex +++ /dev/null @@ -1,6 +0,0 @@ -\vspace*{-7.8ex} -\begin{center} -\textbf{\Large Introduction to Scientific Computing}\\[2.3ex] -{\large Jan Grewe, Jan Benda}\\[-3ex] -Neuroethology Lab \hfill --- \hfill Institute for Neurobiology \hfill --- \hfill \includegraphics[width=0.28\textwidth]{UT_WBMW_Black_RGB} \\ -\end{center} diff --git a/statistics/exercises/exercises01.tex b/statistics/exercises/statistics-1.tex similarity index 74% rename from statistics/exercises/exercises01.tex rename to statistics/exercises/statistics-1.tex index 22f1131..b7acb51 100644 --- a/statistics/exercises/exercises01.tex +++ b/statistics/exercises/statistics-1.tex @@ -1,88 +1,18 @@ \documentclass[12pt,a4paper,pdftex]{exam} -\usepackage[english]{babel} -\usepackage{pslatex} -\usepackage[mediumspace,mediumqspace,Gray]{SIunits} % \ohm, \micro -\usepackage{xcolor} -\usepackage{graphicx} -\usepackage[breaklinks=true,bookmarks=true,bookmarksopen=true,pdfpagemode=UseNone,pdfstartview=FitH,colorlinks=true,citecolor=blue]{hyperref} - -%%%%% layout %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\usepackage[left=20mm,right=20mm,top=25mm,bottom=25mm]{geometry} -\pagestyle{headandfoot} -\ifprintanswers -\newcommand{\stitle}{: Solutions} -\else -\newcommand{\stitle}{} -\fi -\header{{\bfseries\large Exercise 7\stitle}}{{\bfseries\large Statistics}}{{\bfseries\large December 8th, 2020}} -\firstpagefooter{Prof. Dr. Jan Benda}{Phone: 29 74573}{Email: -jan.benda@uni-tuebingen.de} -\runningfooter{}{\thepage}{} - -\setlength{\baselineskip}{15pt} -\setlength{\parindent}{0.0cm} -\setlength{\parskip}{0.3cm} -\renewcommand{\baselinestretch}{1.15} - -%%%%% listings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\usepackage{listings} -\lstset{ - language=Matlab, - basicstyle=\ttfamily\footnotesize, - numbers=left, - numberstyle=\tiny, - title=\lstname, - showstringspaces=false, - commentstyle=\itshape\color{darkgray}, - breaklines=true, - breakautoindent=true, - columns=flexible, - frame=single, - xleftmargin=1em, - xrightmargin=1em, - aboveskip=10pt -} - -%%%%% math stuff: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\usepackage{amsmath} -\usepackage{amssymb} -\usepackage{bm} -\usepackage{dsfont} -\newcommand{\naZ}{\mathds{N}} -\newcommand{\gaZ}{\mathds{Z}} -\newcommand{\raZ}{\mathds{Q}} -\newcommand{\reZ}{\mathds{R}} -\newcommand{\reZp}{\mathds{R^+}} -\newcommand{\reZpN}{\mathds{R^+_0}} -\newcommand{\koZ}{\mathds{C}} - -%%%%% page breaks %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\newcommand{\continue}{\ifprintanswers% -\else -\vfill\hspace*{\fill}$\rightarrow$\newpage% -\fi} -\newcommand{\continuepage}{\ifprintanswers% -\newpage -\else -\vfill\hspace*{\fill}$\rightarrow$\newpage% -\fi} -\newcommand{\newsolutionpage}{\ifprintanswers% -\newpage% -\else -\fi} +\newcommand{\exercisetopic}{Statistics} +\newcommand{\exercisenum}{7} +\newcommand{\exercisedate}{December 8th, 2020} + +\input{../../exercisesheader} -%%%%% new commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\newcommand{\qt}[1]{\textbf{#1}\\} -\newcommand{\pref}[1]{(\ref{#1})} -\newcommand{\extra}{--- bonus question ---\ \mbox{}} -\newcommand{\code}[1]{\texttt{#1}} +\firstpagefooter{Prof. Dr. Jan Benda}{}{jan.benda@uni-tuebingen.de} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} -\input{instructions} +\input{../../exercisestitle} \ifprintanswers% \else diff --git a/statistics/exercises/exercises02.tex b/statistics/exercises/statistics-2.tex similarity index 69% rename from statistics/exercises/exercises02.tex rename to statistics/exercises/statistics-2.tex index 4b1cc3c..e58f16b 100644 --- a/statistics/exercises/exercises02.tex +++ b/statistics/exercises/statistics-2.tex @@ -1,89 +1,18 @@ \documentclass[12pt,a4paper,pdftex]{exam} -\usepackage[german]{babel} -\usepackage{pslatex} -\usepackage[mediumspace,mediumqspace,Gray]{SIunits} % \ohm, \micro -\usepackage{xcolor} -\usepackage{graphicx} -\usepackage[breaklinks=true,bookmarks=true,bookmarksopen=true,pdfpagemode=UseNone,pdfstartview=FitH,colorlinks=true,citecolor=blue]{hyperref} - -%%%%% layout %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\usepackage[left=20mm,right=20mm,top=25mm,bottom=25mm]{geometry} -\pagestyle{headandfoot} -\ifprintanswers -\newcommand{\stitle}{: Solutions} -\else -\newcommand{\stitle}{} -\fi -\header{{\bfseries\large Exercise 7\stitle}}{{\bfseries\large Statistics}}{{\bfseries\large November 21st, 2017}} -\firstpagefooter{Prof. Dr. Jan Benda}{Phone: 29 74573}{Email: -jan.benda@uni-tuebingen.de} -\runningfooter{}{\thepage}{} - -\setlength{\baselineskip}{15pt} -\setlength{\parindent}{0.0cm} -\setlength{\parskip}{0.3cm} -\renewcommand{\baselinestretch}{1.15} - -%%%%% listings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\usepackage{listings} -\lstset{ - language=Matlab, - basicstyle=\ttfamily\footnotesize, - numbers=left, - numberstyle=\tiny, - title=\lstname, - showstringspaces=false, - commentstyle=\itshape\color{darkgray}, - breaklines=true, - breakautoindent=true, - columns=flexible, - frame=single, - xleftmargin=1em, - xrightmargin=1em, - aboveskip=10pt -} - -%%%%% math stuff: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\usepackage{amsmath} -\usepackage{amssymb} -\usepackage{bm} -\usepackage{dsfont} -\newcommand{\naZ}{\mathds{N}} -\newcommand{\gaZ}{\mathds{Z}} -\newcommand{\raZ}{\mathds{Q}} -\newcommand{\reZ}{\mathds{R}} -\newcommand{\reZp}{\mathds{R^+}} -\newcommand{\reZpN}{\mathds{R^+_0}} -\newcommand{\koZ}{\mathds{C}} - -%%%%% page breaks %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\newcommand{\continue}{\ifprintanswers% -\else -\vfill\hspace*{\fill}$\rightarrow$\newpage% -\fi} -\newcommand{\continuepage}{\ifprintanswers% -\newpage -\else -\vfill\hspace*{\fill}$\rightarrow$\newpage% -\fi} -\newcommand{\newsolutionpage}{\ifprintanswers% -\newpage% -\else -\fi} - -%%%%% new commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\newcommand{\qt}[1]{\textbf{#1}\\} -\newcommand{\pref}[1]{(\ref{#1})} -\newcommand{\extra}{--- bonus question ---\ \mbox{}} -\newcommand{\code}[1]{\texttt{#1}} +\newcommand{\exercisetopic}{Statistics} +\newcommand{\exercisenum}{X2} +\newcommand{\exercisedate}{XXX} + +\input{../../exercisesheader} + +\firstpagefooter{Prof. Dr. Jan Benda}{}{jan.benda@uni-tuebingen.de} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} -\input{instructions} - +\input{../../exercisestitle} \begin{questions} diff --git a/statistics/exercises/exercises03.tex b/statistics/exercises/statistics-3.tex similarity index 56% rename from statistics/exercises/exercises03.tex rename to statistics/exercises/statistics-3.tex index 11e4320..8456122 100644 --- a/statistics/exercises/exercises03.tex +++ b/statistics/exercises/statistics-3.tex @@ -1,89 +1,20 @@ \documentclass[12pt,a4paper,pdftex]{exam} +\newcommand{\exercisetopic}{Statistics -- Random Walk} +\newcommand{\exercisenum}{X3} +\newcommand{\exercisedate}{XXX} + +\input{../../exercisesheader} + +\firstpagefooter{Prof. Dr. Jan Benda}{}{jan.benda@uni-tuebingen.de} + \usepackage[german]{babel} -\usepackage{pslatex} -\usepackage[mediumspace,mediumqspace,Gray]{SIunits} % \ohm, \micro -\usepackage{xcolor} -\usepackage{graphicx} -\usepackage[breaklinks=true,bookmarks=true,bookmarksopen=true,pdfpagemode=UseNone,pdfstartview=FitH,colorlinks=true,citecolor=blue]{hyperref} - -%%%%% layout %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\usepackage[left=20mm,right=20mm,top=25mm,bottom=25mm]{geometry} -\pagestyle{headandfoot} -\ifprintanswers -\newcommand{\stitle}{: L\"osungen} -\else -\newcommand{\stitle}{} -\fi -\header{{\bfseries\large \"Ubung 8\stitle}}{{\bfseries\large Statistik}}{{\bfseries\large 29. November, 2016}} -\firstpagefooter{Prof. Dr. Jan Benda}{Phone: 29 74573}{Email: -jan.benda@uni-tuebingen.de} -\runningfooter{}{\thepage}{} - -\setlength{\baselineskip}{15pt} -\setlength{\parindent}{0.0cm} -\setlength{\parskip}{0.3cm} -\renewcommand{\baselinestretch}{1.15} - -%%%%% listings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\usepackage{listings} -\lstset{ - language=Matlab, - basicstyle=\ttfamily\footnotesize, - numbers=left, - numberstyle=\tiny, - title=\lstname, - showstringspaces=false, - commentstyle=\itshape\color{darkgray}, - breaklines=true, - breakautoindent=true, - columns=flexible, - frame=single, - xleftmargin=1em, - xrightmargin=1em, - aboveskip=10pt -} - -%%%%% math stuff: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\usepackage{amsmath} -\usepackage{amssymb} -\usepackage{bm} -\usepackage{dsfont} -\newcommand{\naZ}{\mathds{N}} -\newcommand{\gaZ}{\mathds{Z}} -\newcommand{\raZ}{\mathds{Q}} -\newcommand{\reZ}{\mathds{R}} -\newcommand{\reZp}{\mathds{R^+}} -\newcommand{\reZpN}{\mathds{R^+_0}} -\newcommand{\koZ}{\mathds{C}} - -%%%%% page breaks %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\newcommand{\continue}{\ifprintanswers% -\else -\vfill\hspace*{\fill}$\rightarrow$\newpage% -\fi} -\newcommand{\continuepage}{\ifprintanswers% -\newpage -\else -\vfill\hspace*{\fill}$\rightarrow$\newpage% -\fi} -\newcommand{\newsolutionpage}{\ifprintanswers% -\newpage% -\else -\fi} - -%%%%% new commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\newcommand{\qt}[1]{\textbf{#1}\\} -\newcommand{\pref}[1]{(\ref{#1})} -\newcommand{\extra}{--- Zusatzaufgabe ---\ \mbox{}} -\newcommand{\code}[1]{\texttt{#1}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} -\input{instructions} - +\input{../../exercisestitle} \begin{questions}