diff options
author | Harald Welte <laforge@gnumonks.org> | 2015-10-25 21:00:20 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2015-10-25 21:00:20 +0100 |
commit | fca59bea770346cf1c1f9b0e00cb48a61b44a8f3 (patch) | |
tree | a2011270df48d3501892ac1a56015c8be57e8a7d /2005/flow-accounting-ols2005/OLS2005/Texmf/make-toc |
import of old now defunct presentation slides svn repo
Diffstat (limited to '2005/flow-accounting-ols2005/OLS2005/Texmf/make-toc')
-rwxr-xr-x | 2005/flow-accounting-ols2005/OLS2005/Texmf/make-toc | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/2005/flow-accounting-ols2005/OLS2005/Texmf/make-toc b/2005/flow-accounting-ols2005/OLS2005/Texmf/make-toc new file mode 100755 index 0000000..3998ea1 --- /dev/null +++ b/2005/flow-accounting-ols2005/OLS2005/Texmf/make-toc @@ -0,0 +1,38 @@ +#! /bin/sh + +# Generate a table of contents for the proceedings, listing all of the +# papers with their short authors. Each entry in the table of contents +# is a line like this: +# +# \item \textbf{Name of paper\hspace{\fill}pageno}\\ +# \textit{A.N. Author} +# +# The data comes from two lines in each .aux file, which look like this: +# +# \@writefile{toc}{\contentsline {toctitle}{Name of Paper}{pageno}} +# \@writefile{toc}{\contentsline {tocauthor}{A.N. Author}{pageno}} + + +if [ $# -lt 2 ]; then + echo "usage: $0 output inputs..." >&2 + exit 2 +fi + +output="$1" +shift + +for auxfile in "$@"; do + titleline=$(sed -ne 's|\\@writefile{toc}{\\contentsline {toctitle}{||p' \ + "$auxfile" | sed -e 's/}}$//') + author=$(sed -ne 's|\\@writefile{toc}{\\contentsline {tocauthor}{||p' \ + "$auxfile" | sed -e 's/}{[0-9][0-9]*}}$//') + + title=$(printf '%s\n' "$titleline" | sed -e 's/}{.*$//') + pageno=$(printf '%s\n' "$titleline" | sed -e 's/.*}{//') + + printf '\\item \\textbf{%s\\hspace{\\fill}%s}\\\\\n' "$title" "$pageno" + printf ' \\textit{%s}\n' "$author" + +done > "$output"T + +./Texmf/move-if-change "$output"T "$output" |