From 51d0903d18b87562d1291d56fd833914bce1fdb0 Mon Sep 17 00:00:00 2001 From: Jan Benda Date: Sun, 1 Dec 2019 18:00:12 +0100 Subject: [PATCH] exercises end of chapter with chapter names --- bootstrap/lecture/bootstrap.tex | 3 ++- header.tex | 17 ++++++++++------- likelihood/lecture/likelihood.tex | 3 ++- pointprocesses/lecture/pointprocesses.tex | 1 + programming/lecture/programming.tex | 1 + regression/lecture/regression.tex | 3 ++- statistics/lecture/statistics.tex | 1 + 7 files changed, 19 insertions(+), 10 deletions(-) diff --git a/bootstrap/lecture/bootstrap.tex b/bootstrap/lecture/bootstrap.tex index eba1aac..28dbec0 100644 --- a/bootstrap/lecture/bootstrap.tex +++ b/bootstrap/lecture/bootstrap.tex @@ -1,7 +1,8 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\chapter{\tr{Bootstrap methods}{Bootstrap Methoden}} +\chapter{Bootstrap methods} \label{bootstrapchapter} +\exercisechapter{Bootstrap methods} Bootstrapping methods are applied to create distributions of statistical measures via resampling of a sample. Bootstrapping offers several diff --git a/header.tex b/header.tex index e78eb5d..a016de6 100644 --- a/header.tex +++ b/header.tex @@ -290,14 +290,13 @@ % \newboolean{showexercisesolutions} \setboolean{showexercisesolutions}{true} -\newcommand{\exercisesolutions}{chapter} % 0: here, 1: chapter, 2: end +\newcommand{\exercisesolutions}{end} % 0: here, 1: chapter, 2: end % we need this also as numbers: \ifthenelse{\equal{\exercisesolutions}{end}}{\newcommand{\exercisesolutionsnum}{2}}{% \ifthenelse{\equal{\exercisesolutions}{chapter}}{\newcommand{\exercisesolutionsnum}{1}}{% \newcommand{\exercisesolutionsnum}{0}}} \newcommand{\codepath}{} \newcommand{\setcodepath}[1]{\ifthenelse{\not\equal{\exercisesolutions}{here}}{\renewcommand{\codepath}{#1/}}{}\lstset{inputpath=#1}} -\newcommand{\exercisesection}[1]{} \usepackage{mdframed} \usepackage{xstring} \newlistof{exercisef}{loe}{\tr{Exercises}{\"Ubungen}} @@ -316,7 +315,11 @@ \xpretocmd{\include}{\def\currentjobname{#1}\immediate\openout\solutions=\currentjobname-solutions}{}{}\fi% \ifnum\exercisesolutionsnum=2 \def\currentjobname{\jobname} - \immediate\openout\solutions=\currentjobname-solutions\fi + \immediate\openout\solutions=\currentjobname-solutions + \def\exercisechapter#1{\immediate\write\solutions{\unexpanded{\section}{\thechapter. #1}}} +\else + \def\exercisechapter#1{} +\fi \newenvironment{exercise}[2]% { \setlength{\fboxsep}{2mm}% \newcommand{\saveenumi}{\theenumi}\renewcommand{\labelenumi}{(\alph{enumi})}% @@ -330,7 +333,7 @@ \newcommand{\exercisefile}{\protect\StrSubstitute{#1}{_}{\_}}% \newcommand{\exerciseoutput}{#2}% }{% - \immediate\write\solutions{\unexpanded{\exercisesection}{Exercise \thechapter.\arabic{exercisef}}}% + \immediate\write\solutions{\unexpanded{\subsection}{Exercise \thechapter.\arabic{exercisef}}}% \immediate\write\solutions{\unexpanded{\label}{solution\arabic{chapter}-\arabic{exercisef}}}% \immediate\write\solutions{\unexpanded{\lstinputlisting[belowskip=0ex,aboveskip=0ex,% nolol=true, title={\textbf{Source code:} \protect\StrSubstitute{#1}{_}{\_}}]}{\codepath#1}}% @@ -367,8 +370,9 @@ \or\(\equal{\exercisesolutions}{end}\and\not\isundefined{\chapternumber}\)}{% \immediate\closeout\solutions% \ifthenelse{\boolean{showexercisesolutions}}{% - \clearpage\section{Solutions to the exercises}% - \renewcommand{\exercisesection}[1]{\subsection{#1}}% + \clearpage\ifthenelse{\equal{\exercisesolutions}{chapter}}% + {\section{Solutions to the exercises}}% + {\chapter{Solutions to the exercises}}% \ifthenelse{\isundefined{\chapternumber}}{\lstset{inputpath=}}{}% \input{\currentjobname-solutions} }{}}{}} \newcommand{\printallsolutions}{\ifthenelse{\equal{\exercisesolutions}{end}}{% @@ -376,7 +380,6 @@ \ifthenelse{\boolean{showexercisesolutions}}{% \setcounter{secnumdepth}{0}\lstset{inputpath=}% \clearpage\chapter{Solutions to the exercises}% - \renewcommand{\exercisesection}[1]{\section{#1}}% \input{\currentjobname-solutions} }{}}{}} \setlength{\cftexercisefindent}{1.2em} \setlength{\cftexercisefnumwidth}{2.6em} diff --git a/likelihood/lecture/likelihood.tex b/likelihood/lecture/likelihood.tex index a5c87a7..492beb0 100644 --- a/likelihood/lecture/likelihood.tex +++ b/likelihood/lecture/likelihood.tex @@ -1,7 +1,8 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\chapter{\tr{Maximum likelihood estimation}{Maximum-Likelihood-Sch\"atzer}} +\chapter{Maximum likelihood estimation} \label{maximumlikelihoodchapter} +\exercisechapter{Maximum likelihood estimation} A common problem in statistics is to estimate from a probability distribution one or more parameters $\theta$ that best describe the diff --git a/pointprocesses/lecture/pointprocesses.tex b/pointprocesses/lecture/pointprocesses.tex index a03f5a8..1659f2f 100644 --- a/pointprocesses/lecture/pointprocesses.tex +++ b/pointprocesses/lecture/pointprocesses.tex @@ -1,6 +1,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Spiketrain analysis} +\exercisechapter{Spiketrain analysis} \enterm[Action potentials]{action potentials} (\enterm{spikes}) are the carriers of information in the nervous system. Thereby it is the diff --git a/programming/lecture/programming.tex b/programming/lecture/programming.tex index 417b92e..3e27b35 100644 --- a/programming/lecture/programming.tex +++ b/programming/lecture/programming.tex @@ -1,6 +1,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Programming in \matlab} \label{programming} +\exercisechapter{Programming in MATLAB} In this chapter we will cover the basics of programming in \matlab{}. Starting with the concept of simple variables and data diff --git a/regression/lecture/regression.tex b/regression/lecture/regression.tex index 762e432..71d415f 100644 --- a/regression/lecture/regression.tex +++ b/regression/lecture/regression.tex @@ -1,4 +1,5 @@ -\chapter{\tr{Optimization and gradient descent}{Optimierung und Gradientenabstieg}} +\chapter{Optimization and gradient descent} +\exercisechapter{Optimization and gradient descent} To understand the behaviour of a given system sciences often probe the system with input signals and then try to explain the responses diff --git a/statistics/lecture/statistics.tex b/statistics/lecture/statistics.tex index 319cec3..3f59d46 100644 --- a/statistics/lecture/statistics.tex +++ b/statistics/lecture/statistics.tex @@ -1,6 +1,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Descriptive statistics} +\exercisechapter{Descriptive statistics} Descriptive statistics characterizes data sets by means of a few measures. In addition to histograms that estimate the full distribution of the data,