Skip to content

Commit

Permalink
update service files
Browse files Browse the repository at this point in the history
  • Loading branch information
jemus42 committed Nov 11, 2024
1 parent 2ebbbf2 commit 07d9ed9
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 9 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@
nospeakermargin.tex
speakermargin.tex

# latex-math subcomponents we don't need here
latex-math/latex-math.pdf
latex-math/latex-math.Rmd
latex-math/.github

#--------------------------------------------#
# Intermediate output (slides, exercises) #
#--------------------------------------------#

# The only slide PDF output in this repo should be in slides-pdf
# include both slides-xyz (i2ml) and slideXY- / tXY- (iml) formats
slides/*/*slides*.pdf
slides/*/slides*.pdf
slides/*/t*.pdf

Expand Down
32 changes: 31 additions & 1 deletion scripts/check_files_used.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
#!/bin/bash
set -eo pipefail
# This script checks which files are present in a given folder that were not used by a given set of tex-files.
# It does this by relying on *.fls-files, that are generated when tex is run with the 'record' option.
# The Makefile should do this when 'make most' is run.
#
# When a tex-file imports another file (e.g. a figure), the generated fls-file contains a line 'IMPORT <filename>'.
# This script compares the files listed in the given fls-files with the files that are present in a given folder.

# ------

# parse the 2nd command line argument first:
# if it is 'used', we list all the files that are used by tex files
# if it is 'unused', we list all files that are not used by tex files
# if is is 'missing', we list all files that the tex file wants to use but did not find.
case "$2" in
"used")
commarg=-12
Expand All @@ -13,14 +25,23 @@ case "$2" in
;;
esac

# check command line arguments:
# $1 must be a directory
# $2 must have been parsed successfully above
# $3 must be given (as far as this check is concerned)
if [ -z "$commarg" ] || [ ! -d "$1" ] || [ -z "$3" ] ; then
echo "USAGE: $0 <folder> {used|unused|missing} file1.tex [file2.tex ...]" >&2
exit 1
fi

# normalize the path given to '$1' to be relative to the pwd
folderpath="$(realpath --relative-to=. -- "$1")"/

# drop the first two arguments:
# from here on, $1 will be the 3rd given argument, $2 will be the 4th given argument etc.
shift 2

# check if the fls-file for each given tex-file is present.
flsfiles=()
for f in $@ ; do
ff="${f%.tex}.fls"
Expand All @@ -31,7 +52,16 @@ for f in $@ ; do
flsfiles+=("$ff")
done


# here we use 'comm' to make a set-intersection:
# the options argument (commarg) tells us what we list:
# '-12' would be set intersection
# '-23' lists lines only in the content of 'FILE1' (i.e. files found in 'folderpath' but not in any fls-file
# '-13' lists lines only in the content of 'FILE2'
# 'FILE1' (1st non-option argument) is the content of 'folderpath', normalized to be relative to pwd
# 'FILE2' (2nd non-option argument) is each line of the fls-files that starts with 'INPUT ', with the 'INPUT ' part removed.
#
# The 'awk' makes sure we only print lines that start with the 'folderpath' part.
# It is equivalent to `grep '^$folderpath'`, except that 'folderpath' could also contain regex special chars, so grep would not work.
comm $commarg \
<(find ./"$folderpath" -type f | xargs realpath --relative-to=. -- | sort -u ) \
<(perl -nle'print $& while m{(?<=^INPUT ).*}g' ${flsfiles[@]} | xargs realpath --relative-to=. -- | sort -u ) | \
Expand Down
Empty file modified scripts/update-service.sh
100644 → 100755
Empty file.
12 changes: 9 additions & 3 deletions slides/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,28 @@
slides/<topic>/<slide-name>.tex
```

where `<slide-name>` starts with `slide-` or `slide01`
where `<slide-name>` starts with `slide-` or `slide01-`

**Figures** are created either manually and live in

```
slides/<topic>/figure_man/
```

or created with an R script, with the outputs located in
or created with an R script in

```
slides/<topic>/rsrc/
```

with the outputs located in

```
slides/<topic>/figure/
```

respectively.
The script filename should make it obvious which figure it creates, and similarly the filename of the figure should match the script.
The figures should be saved by the script (using e.g. `ggsave()`).

### Important files:

Expand Down
2 changes: 2 additions & 0 deletions style/common.tex
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
% Spacing helpers, used often (mostly in exercises for \dlz)
\newcommand{\lz}{\vspace{0.5cm}} % vertical space (used often in slides)
\newcommand{\dlz}{\vspace{1cm}} % double vertical space (used often in exercises, never in slides)
\newcommand{\oneliner}[1] % Oneliner for important statements, used e.g. in iml, algods
{\begin{block}{}\begin{center}\begin{Large}#1\end{Large}\end{center}\end{block}}

% Don't know if this is used or needed, remove?
% textcolor that works in mathmode
Expand Down
3 changes: 3 additions & 0 deletions style/lmu-lecture.sty
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@
%-------------------------------------------------------------------%

% Frame with breaks and verbatim // this is used very often
% Should not use 'containsverbatim', see https://tex.stackexchange.com/questions/69191/can-a-beamer-frame-have-both-containsverbatim-and-hidden-shown-block-options
% Should use 'fragile' instead, but everything breaks if fragile is used all the time
% See https://tug.ctan.org/macros/latex/contrib/beamer/doc/beameruserguide.pdf for details
\newenvironment{vbframe}
{
\begin{frame}[containsverbatim,allowframebreaks]
Expand Down
4 changes: 3 additions & 1 deletion style/preamble.tex
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
% \usepackage{bbm}

% bm – Access bold symbols in maths mode - https://ctan.org/pkg/bm
% Required for latex-math
% Required for latex-math, preferred over \boldsymbol
% https://tex.stackexchange.com/questions/3238/bm-package-versus-boldsymbol
\usepackage{bm}

Expand Down Expand Up @@ -92,6 +92,8 @@
% Note this requires biber to be in $PATH when running,
% telltale error in log would be e.g. Package biblatex Info: ... file 'authoryear.dbx' not found
% aside from obvious "biber: command not found" or similar.
% Tried moving this to lmu-lecture.sty but had issues I didn't quite understood,
% so it's here for now.

\usepackage{textcase} % for \NoCaseChange
\usepackage{hyperref}
Expand Down
7 changes: 5 additions & 2 deletions style/preamble_ueb.Rnw
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,18 @@
\usepackage{algorithm}
\usepackage{algpseudocode}


\input{../../style/common}

% Include latex-math here once such that it does not need to be included in each exercise
% which may fail as it needs to be included as part of the preamble
\input{../../latex-math/basic-math.tex}
\input{../../latex-math/basic-ml.tex}
\input{../../latex-math/ml-ensembles.tex}
\input{../../latex-math/ml-trees.tex}
\input{../../latex-math/ml-svm.tex}
\input{../../latex-math/ml-gp.tex}

\input{../../style/common}

\tcbset{enhanced}

\DeclareRobustCommand{\mybox}[2][gray!20]{%
Expand Down
7 changes: 5 additions & 2 deletions style/preamble_ueb_coll.Rnw
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@
\usepackage{cancel}
\usepackage{bm}

\input{../../style/common}

% Include latex-math here once such that it does not need to be included in each exercise
% which may fail as it needs to be included as part of the preamble
\input{../../latex-math/basic-math.tex}
\input{../../latex-math/basic-ml.tex}
\input{../../latex-math/ml-ensembles.tex}
\input{../../latex-math/ml-trees.tex}
\input{../../latex-math/ml-svm.tex}
\input{../../latex-math/ml-gp.tex}

\input{../../style/common}

\tcbset{enhanced}

Expand Down Expand Up @@ -95,4 +98,4 @@
\begin{document}
\SweaveOpts{concordance=TRUE}

\end{document}
\end{document}

0 comments on commit 07d9ed9

Please sign in to comment.