diff --git a/bootstrap/exercises/Makefile b/bootstrap/exercises/Makefile index 27691d9..3f8d7db 100644 --- a/bootstrap/exercises/Makefile +++ b/bootstrap/exercises/Makefile @@ -1,34 +1,4 @@ -TEXFILES=$(wildcard exercises??.tex) -EXERCISES=$(TEXFILES:.tex=.pdf) -SOLUTIONS=$(EXERCISES:exercises%=solutions%) +TEXFILES=resampling-1.tex +# resampling2.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/bootstrap/exercises/exercises01.tex b/bootstrap/exercises/resampling-1.tex similarity index 77% rename from bootstrap/exercises/exercises01.tex rename to bootstrap/exercises/resampling-1.tex index 12ffb94..326fbc6 100644 --- a/bootstrap/exercises/exercises01.tex +++ b/bootstrap/exercises/resampling-1.tex @@ -1,88 +1,17 @@ \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 8\stitle}}{{\bfseries\large Resampling}}{{\bfseries\large December 14th, 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} - -%%%%% new commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\newcommand{\qt}[1]{\textbf{#1}\\} -\newcommand{\pref}[1]{(\ref{#1})} -\newcommand{\extra}{--- Zusatzaufgabe ---\ \mbox{}} -\newcommand{\code}[1]{\texttt{#1}} +\newcommand{\exercisetopic}{Resampling} +\newcommand{\exercisenum}{8} +\newcommand{\exercisedate}{December 14th, 2020} +\input{../../exercisesheader} + +\firstpagefooter{Prof. Dr. Jan Benda}{}{jan.benda@uni-tuebingen.de} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} -\input{instructions} +\input{../../exercisestitle} \begin{questions} diff --git a/exercises.mk b/exercises.mk new file mode 100644 index 0000000..f9d9cd8 --- /dev/null +++ b/exercises.mk @@ -0,0 +1,33 @@ +EXERCISES=$(TEXFILES:.tex=.pdf) +SOLUTIONS=$(EXERCISES:%.pdf=%-solutions.pdf) + +.PHONY: pdf exercises solutions watch watchexercises watchsolutions clean + +pdf : $(SOLUTIONS) $(EXERCISES) + +exercises : $(EXERCISES) + +solutions : $(SOLUTIONS) + +$(SOLUTIONS) : %-solutions.pdf : %.tex ../../exercisesheader.tex ../../exercisestitle.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 ../../exercisesheader.tex ../../exercisestitle.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) diff --git a/exercisesheader.tex b/exercisesheader.tex new file mode 100644 index 0000000..321d22c --- /dev/null +++ b/exercisesheader.tex @@ -0,0 +1,108 @@ +\usepackage[english]{babel} +\usepackage{pslatex} +\usepackage{graphicx} +\usepackage{tikz} +\usepackage{xcolor} +\usepackage{amsmath} +\usepackage{amssymb} + +%%%%% 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=1.5em, + xrightmargin=1em, + aboveskip=10pt +} + +%%%%% page style %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\usepackage[left=20mm,right=20mm,top=25mm,bottom=19mm,headsep=2ex,headheight=3ex,footskip=3.5ex]{geometry} +\pagestyle{headandfoot} +\ifprintanswers +\newcommand{\stitle}{Solutions} +\else +\newcommand{\stitle}{} +\fi +\header{{\bfseries\large \exercisenum. \exercisetopic}}{{\bfseries\large\stitle}}{{\bfseries\large\exercisedate}} +\firstpagefooter{Prof. Dr. Jan Benda}{}{jan.benda@uni-tuebingen.de} +\runningfooter{}{\thepage}{} + +\shadedsolutions +\definecolor{SolutionColor}{gray}{0.9} + +\setlength{\baselineskip}{15pt} +\setlength{\parindent}{0.0cm} +\setlength{\parskip}{0.3cm} + +\usepackage{multicol} + +%%%%% units %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\usepackage[mediumspace,mediumqspace,Gray,squaren]{SIunits} % \ohm, \micro + +%%%%% new commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\newcommand{\cin}[1]{[{\rm #1}]_{\text{in}}} +\newcommand{\cout}[1]{[{\rm #1}]_{\text{out}}} +\newcommand{\units}[1]{\text{#1}} +\newcommand{\K}{\text{K$^+$}} +\newcommand{\Na}{\text{Na$^+$}} +\newcommand{\Cl}{\text{Cl$^-$}} +\newcommand{\Ca}{\text{Ca$^{2+}$}} +\newcommand{\water}{$\text{H}_2\text{O}$} + +\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}} +\newcommand{\RT}{{\rm Re\!\ }} +\newcommand{\IT}{{\rm Im\!\ }} +\newcommand{\arccot}{{\rm arccot}} +\newcommand{\sgn}{{\rm sgn}} +\newcommand{\im}{{\rm i}} +\newcommand{\drv}{\mathrm{d}} +\newcommand{\divis}[2]{$^{#1}\!\!/\!_{#2}$} +\newcommand{\vect}[2]{\left( \!\! \begin{array}{c} #1 \\ #2 \end{array} \!\! \right)} +\newcommand{\matt}[2]{\left( \!\! \begin{array}{cc} #1 \\ #2 \end{array} \!\! \right)} +\renewcommand{\Re}{\mathrm{Re}} +\renewcommand{\Im}{\mathrm{Im}} +\newcommand{\av}[1]{\left\langle #1 \right\rangle} + +\newcommand{\pref}[1]{(\ref{#1})} +\newcommand{\eqnref}[1]{(\ref{#1})} + +\newcommand{\hr}{\par\vspace{-5ex}\noindent\rule{\textwidth}{1pt}\par\vspace{-1ex}} + +\newcommand{\qt}[1]{\textbf{#1}\\} + +\newcommand{\code}[1]{\texttt{#1}} + +%%%%% 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} + +%%%%% hyperref %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\usepackage[breaklinks=true,bookmarks=true,bookmarksopen=true,pdfpagemode=UseNone,pdfstartview=FitH,colorlinks=true,citecolor=blue!50!black,linkcolor=blue!50!black,urlcolor=blue!50!black]{hyperref} diff --git a/bootstrap/exercises/instructions.tex b/exercisestitle.tex similarity index 100% rename from bootstrap/exercises/instructions.tex rename to exercisestitle.tex