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 |
import of old now defunct presentation slides svn repo
Diffstat (limited to '2005/flow-accounting-ols2005/OLS2005/Texmf')
11 files changed, 1507 insertions, 0 deletions
diff --git a/2005/flow-accounting-ols2005/OLS2005/Texmf/addAuthor.sh b/2005/flow-accounting-ols2005/OLS2005/Texmf/addAuthor.sh new file mode 100755 index 0000000..0bdec4f --- /dev/null +++ b/2005/flow-accounting-ols2005/OLS2005/Texmf/addAuthor.sh @@ -0,0 +1,104 @@ +#!/bin/bash + +# This script should be called from the top OLS/GCC directory +# (eg the one that contains the Texmf directory) + +# gccsummit or linuxsymposium ... +export WEBSITE=linuxsymposium + +# Handle fatal errors +function die { + echo $* + exit 1 +} + +# Prepare new paper/author +function do_paper { + paper="$1" + author="$2" + bio="$3" + key="$4" + title="$5" + + Dir=$(echo "$author" | tr '[:upper:]' '[:lower:]' | awk '{ print $NF }') + echo Dir is $Dir + echo Paper is $paper + echo Author is $author + echo bio is $bio and key is $key + echo Title is "$title" + echo " " + Start=$PWD + MakeAdd="${Dir}/${Dir}-abstract.tex" + if [ ! -d $Dir ] ; then mkdir $Dir || die "cannot mkdir $Dir" ; fi + cd $Dir || die "cannot cd $Dir" + + if [ ! -r ${Dir}-abstract.tex ] ; then + ### CREATE ABSTRACT (pull from $WEBSITE if available) + if [ $key -ne 0 ] ; then + links -dump 'http://www.'${WEBSITE}'.org/2005/view_abstract.php?content_key='$key > ${Dir}-abstract.tex + else + echo " " > ${Dir}-abstract.tex + fi + fi + + if [ ! -r Makefile.inc ] ; then + ### CREATE Makefile.inc + cat > Makefile.inc <<EOF +PAPERS += ${Dir}/${Dir}.dvi + +## Add any additional .tex or .eps files below: +${Dir}/${Dir}.dvi ${Dir}/${Dir}-proc.dvi: \\ + ${Dir}/${Dir}.tex \\ + ${Dir}/${Dir}-abstract.tex + +EOF + fi + if [ ! -r ${Dir}.tex ] ; then + ### CREATE BLANK PAPER + ## __TITLE__ __SUBTITLE__ __AUTHOR__ __ABSTRACT__ + echo 'title : "'${title}'"' + echo 'author : "'${author}'"' + addMake=$(basename $MakeAdd) + echo 'addMake: "'${addMake}'"' + cat $Start/TEMPLATES/autoauthor.tex | \ + sed -e "s|__TITLE__|${title}|g" | \ + sed -e 's|__SUBTITLE__| |g' | \ + sed -e "s|__AUTHOR__|${author}|g" | \ + sed -e 's|__ABSTRACT__|'${addMake}'|g' > ${Dir}.tex + fi + + cd $Start +} + +### Example usage... +## PAPER_ID=1 +## AUTHOR="Andrey Belevantsev" +## BIO_ID=0 +## CONTENT_KEY=11 +## TITLE="Improving GCC instruction scheduling for Itanium" + +## do_paper $PAPER_ID "$AUTHOR" $BIO_ID $CONTENT_KEY "$TITLE" +function do_help { + echo "Usage: $0 PAPER AUTHOR BIO_ID CONTENT_KEY TITLE" + echo "Paper = integer greater than last-used one for papers" + echo "Author = full author name, quoted" + echo "Bio_ID = number from conference website or 0 for not available" + echo "Content_Key = number for abstract from conference website, 0 for not available" + echo "Title = title of paper, quoted" +} + +if [ -z "$*" ] ; then + do_help + exit 0 +fi +if [[ "$1" = *help* ]] ; then + do_help + exit 0 +fi +if [[ "$1" = *-h* ]] ; then + do_help + exit 0 +fi + +do_paper ${@} + diff --git a/2005/flow-accounting-ols2005/OLS2005/Texmf/cprog.sty b/2005/flow-accounting-ols2005/OLS2005/Texmf/cprog.sty new file mode 100644 index 0000000..a336397 --- /dev/null +++ b/2005/flow-accounting-ols2005/OLS2005/Texmf/cprog.sty @@ -0,0 +1,249 @@ +% This is CSTY.STY as received by email at december 1990 +% +% The cprog macros allow programs in C, C++, Pascal, and Modula-2 to be +% included directly into TeX documents. Program text is set in a Roman +% font, comments in slanted, and strings in typewriter. Operators such as +% <= are optionally combined into single symbols like $\le$. Keywords are +% *not* emphasised---I find this ugly and distracting. (By purest +% coincidence it would also be very hard to do.) +% +% These macros can be \input in plain TeX or used as a style file in LaTeX. +% They provide a convenient alternative to tgrind, particularly for program +% fragments embedded in documents. Full instructions for use appear in the +% macro package itself. +% +% +% \'Eamonn McManus <emcmanus@cs.tcd.ie> <emcmanus%cs.tcd.ie@cunyvm.cuny.edu> +% +% ASCII: !"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~ +% + +% BEGIN: cprog.tex (or cprog.sty) - formatting of C programs +% By \'Eamonn McManus <emcmanus@cs.tcd.ie>. This file is not copyrighted. +% $Id: cprog.tex,v 1.4 90/09/12 23:21:26 emcmanus Exp $ + +% This allows C programs to be formatted directly by TeX. It can be +% invoked by \cprogfile{filename} or (in LaTeX) \begin{cprog} ... +% \end{cprog} or (in plain TeX) \cprog ... \end{cprog}. In LaTeX, the +% alternative form \begin{cprog*} is allowed, where spaces in C strings +% are printed using the `square u' character (like LaTeX {verbatim*}). +% In plain TeX, you have to use \csname cprog*\endcsname for this (sorry). +% If you are using \cprogfile, say \cprogttspacetrue beforehand if you +% want this effect. + +% The formatting is (necessarily) simple. C text is set in a normal Roman +% font, comments in a slanted font, and strings in a typewriter font, with +% spaces optionally made visible as the `square u' symbol. Tabs are +% expanded to four spaces (this does not look good when comments are +% aligned to the right of program text). Some pairs of input characters +% appear as single output characters: << <= >> >= != -> are respectively +% TeX's \ll \le \gg \ge \ne \rightarrow. Say \cprogpairsfalse to disable +% this. + +% You can escape to TeX within cprog text by defining an escape character. +% The character @ is suitable for C and Pascal. I have not tested other +% characters so they may interact badly with their existing definitions here. +% To define @ as the escape character, do \cprogescape@. Then within text +% you can do @ followed by TeX commands. These commands will be in a TeX +% group with the \catcodes of \{}% as normal. The commands are terminated +% by a newline, which is not considered part of the program text. + +% The fonts below can be changed to alter the setting of the various parts +% of the program. The \cprogbaselineskip parameter can be altered to +% change the line spacing. LaTeX's \baselinestretch is taken into account +% too. The indentation applied to the whole program is \cprogindent, +% initially 0. Before and after the program there are skips of +% \beforecprogskip and \aftercprogskip; the default values are \parskip +% and 0 respectively (since there will often be a \parskip after the +% program anyway). + +% If the source text is Pascal or Modula-2, say \pascaltrue or \modulatrue +% (respectively) before formatting it. This makes (* *) be recognised for +% comments instead of /* */. Braces {} are also recognised for Pascal. +% \pascalfalse or \modulafalse as appropriate restores the default of C. + +% This package works by making a large number of characters active. Since +% even spaces are active, it is possible to examine the next character in +% a macro by making it a parameter, rather than using \futurelet as one +% would normally do. This is more convenient, but the coding does mean +% that if the next character itself wants to examine a character it may +% look at a token from the macro rather than the input text. I think that +% all cases that occur in practice have been looked after. + +% The macros could still do with some work. For example, the big macro +% defined with [] taking the place of {} could be recoded to use {} and so +% be more legible. The internal macros etc should have @ in their names, +% and should be checked against LaTeX macros for clashes. + +% Allow multiple inclusion to go faster. + +\ifx\undefined\cprogsetup % The whole file. + +% Define the fonts used for program text, comments, and strings. +% Note that if \it is used for \ccommentfont, something will need to +% be done about $ signs, which come out as pounds sterling. +\let\ctextfont=\tt \let\ccommentfont=\sl \let\cstringfont=\tt + +% Parameters. Unfortunately \newdimen is \outer (\outerness is a mistake) +% so we need a subterfuge in case we are skipping the file. +\csname newdimen\endcsname\cprogbaselineskip \cprogbaselineskip=\baselineskip +\csname newdimen\endcsname\cprogindent \cprogindent=0pt +\csname newdimen\endcsname\cprogwidth % Gets default=\hsize when cprog invoked. +\csname newskip\endcsname\beforecprogskip \beforecprogskip=\parskip +\csname newskip\endcsname\aftercprogskip \aftercprogskip=0pt +\csname newif\endcsname\ifcprogttspace +\csname newif\endcsname\ifcprogpairs \cprogpairstrue +\csname newif\endcsname\ifpascal +\csname newif\endcsname\ifmodula % Same as Pascal but no {comments}. +{\def\junk{\fi\fi\fi\fi}} % If skipping. + +\let\cprogesc\relax +\begingroup \catcode`~=\active +\gdef\cprogescape#1{% + {\catcode`~=\active \uccode`~=`#1 \aftergroup\cprogescont + \uppercase{\aftergroup~}}} +\gdef\cprogescont#1{% + \def\cprogesc{% + \makeactive#1\def#1{% + \begingroup \catcode`\\0 \catcode`{1 \catcode`}2 \catcode`\%14 + \catcode` 10 \clinegroup{}}}} +\endgroup + +\def\makeactive#1{\catcode`#1=\active} \def\makeother#1{\catcode`#1=12} +{\obeyspaces\gdef\activespace{ } \obeylines\gdef\activecr{^^M}} +{\catcode`|=\catcode`\\ \makeactive\\ |gdef|activebackslash{\}} +{\catcode9=\active \gdef\activetab{^^I}} + +% The following group makes many characters active, so that their catcodes +% in the \cprogchars macro are active, allowing them to be defined. We +% could alternatively define more stuff like \activebackslash and use +% \expandafter or (carefully) \edef to expand these in the macro. +\begingroup +\catcode`[=\catcode`{ \catcode`]=\catcode`} +\makeactive! \makeactive" \makeactive' \makeactive( \makeactive* \makeactive- +\makeactive/ \makeactive< \makeactive> \makeactive? \makeactive^ \makeactive_ +\makeactive\{ \makeactive| \makeactive\} +\gdef\activestar[*] +\gdef\cprogchars[% + \makeother##\makeother$\makeother&\makeother\%\makeother^% + \makeactive"\makeactive'\makeactive*\makeactive?\makeactive{\makeactive}% + \makeactive}\makeactive\\\makeactive_\expandafter\makeactive\activetab% + \makeactive!\makeactive<\makeactive>\makeactive-\makeactive|% + \ifcprogpairs + \def!##1[\ifx=##1$\ne$\else\string!\null##1\fi]% + \def-##1[\ifx>##1$\rightarrow$\else$\string-$##1\fi]% + % We use \aftergroup in < and > to deal with the fact that #1 might + % itself examine the following character. + \def<##1[[$\ifx<##1\ll$\else\ifx=##1\le$\else + \ifx>##1\ifpascal\ne$\else\string<$\aftergroup>\fi + \else \string<$\aftergroup##1\fi\fi\fi]]% + \def>##1[[$\ifx>##1\gg$\else\ifx=##1\ge$\else + \string>$\aftergroup##1\fi\fi]]% + \else \def![\string!\null]% Avoid !` ligature. + \def-[$\string-$]\def<[$\string<$]\def>[$\string>$]% + \fi + \def?[\string?\null]% Avoid ?` ligature. + \def"[\cquote"[\tt\string"]]\def'[\cquote'[\tt\ttquote]]\def*[$\string*$]% + \ifmodula \pascaltrue \fi % Except that {...} is used for sets. + \ifpascal + \ifmodula \dulllbrace \else + \def{[\begingroup \dulllbrace{\ccommentsetup\def}[\/\endgroup }]]% + \fi \makeactive(\let(=\pascalcomment \makeactive^\def^[$\uparrow$]% + \else \dulllbrace\makeactive/\let/=\ccomment + \fi + \def}[$\}$]\def|[$\string|$]\def~[$\sim$]\let_\_% + \expandafter\def\activebackslash[$\backslash$]% + \obeyspaces \expandafter\def\activespace[\leavevmode\space]% + \expandafter\def\activetab[\ \ \ \ ]% + \obeylines \expandafter\def\activecr[\strut\par]] +\gdef\cprogarg[\expandafter\def\activebackslash##1[\ifx##1e\let\next\cprogend + \else$\backslash$\let\next##1\fi\next]\eatcr] +\gdef\cprogend nd#1{cprog#2}[\endcprogarg] % #1 can be space, #2 *. +\gdef\dulllbrace[\def{[$\{$]] +\endgroup + +\chardef\ttquote=13 % Undirected single quote. +\begingroup \makeactive" \makeactive' \makeactive! +\gdef\cquote#1#2{% #1 is the quote, " or ', #2 how to set it. + \begingroup #2\cstringfont \makeactive\\% + \ifpascal \makeother\\\makeother^% + \else \expandafter\let\activebackslash\quotebackslash + \fi + \expandafter\edef\activespace{\ifcprogttspace\char`\ \else\ \fi}% + \expandafter\let\activecr=\unclosedstring + \def!{\string!\null}% No !` ligature. + \makeother*\makeother-\makeother/\makeother<\makeother>% + \makeother_\makeother\{\makeother\}\makeother|\makeother~% + \ifx"#1\let'\ttquote \else \makeother"\fi + \def#1{#2\endgroup}} +\endgroup +\csname newhelp\endcsname\cprogunclosedstr{% +A string or character constant earlier in the line was unclosed.^^JSo +I'm closing it now.} +\def\unclosedstring{% + \escapechar-1% + \errhelp\cprogunclosedstr + \errmessage{Unclosed string}% + \endgroup} +\newlinechar=`^^J +\def\quotebackslash#1{\char`\\% + \expandafter\ifx\activecr#1\strut\par + \else\if'\noexpand#1\ttquote\else\string#1\fi\fi} + +% In a comment, we shrink the width of the opening / to that of a space so +% that the stars in multiline comments will line up. We also shrink the +% closing * for symmetry, but not in Pascal where it looks nasty. +% Note that \end{cprog} is not recognised in strings or comments. +\def\spacebox#1{\leavevmode \hbox to \spaceskip{#1\hss}} + +\begingroup \makeactive* \makeactive! \makeother/ +\gdef\ccommentsetup{\ccommentfont \makeother-\makeother'\makeother"\makeother/% + \def!{\string!\null}\expandafter\def\activebackslash{$\backslash$}} +\gdef\ccomment#1{% + \let\next\relax + \ifx#1*\bgroup \ccommentsetup + \spacebox{\ctextfont\string/}*% + \makeactive*\def*{\commentstar/}% + \else\if\noexpand#1/\begingroup //\ccommentsetup \clinegroup\activecr + \else \string/\let\next#1% + \fi\fi\next} +\gdef\pascalcomment#1{% + \ifx#1*\bgroup \ccommentsetup \let\next\dulllbrace \makeother(% + \spacebox{\ctextfont\string(}*\makeactive*\def*{\commentstar)}% + \else (\let\next#1\fi \next} +\obeylines \long\gdef\clinegroup#1#2^^M{#2\endgroup#1}% +\endgroup +\def\commentstar#1#2{% + {\if#1\noexpand#2\egroup \ifpascal\else\aftergroup\spacebox\fi\fi}{$*$}#2} + +% We usually have an active ^^M after \cprog or \begin{cprog}. +\def\eatcr#1{{\expandafter\ifx\activecr#1\else\aftergroup#1\fi}} + +% Expand to stretch and shrink (plus and minus) of parameter #1. +\def\stretchshrink#1{\expandafter\eatdimenpart\the#1 \end} +\def\eatdimenpart#1 #2\end{#2} + +\ifx\undefined\baselinestretch \def\baselinestretch{1}\fi + +\def\cprogsetup{\ctextfont \cprogchars \parskip=0pt\stretchshrink\parskip + \ifdim \cprogwidth=0pt \else \hsize\cprogwidth \fi + \cprogesc \spaceskip\fontdimen2\font \xspaceskip\spaceskip + \baselineskip=\baselinestretch\cprogbaselineskip \parindent=\cprogindent + \vskip\beforecprogskip} +\def\endcprog{\endgroup \vskip\aftercprogskip} +\def\cprogfile#1{\begingroup \cprogsetup \input#1\endcprog} +\def\cprog{\begingroup \cprogttspacefalse \cprogsetup \cprogarg} +% Like {verbatim*}, {cprog*} uses `square u' for spaces in quoted strings. +\expandafter\def\csname cprog*\endcsname{% + \begingroup \cprogttspacetrue \cprogsetup \cprogarg} +\expandafter\let\csname endcprog*\endcsname=\endcprog +% In LaTeX we need to call \end{cprog} properly to close the environment, +% whereas in plain TeX this will end the job. The test for LaTeX is not +% bulletproof, but most plain TeX documents don't refer to the LaTeX logo. +\ifx\undefined\LaTeX \let\endcprogarg=\endcprog +\else \def\endcprogarg{\ifcprogttspace\end{cprog*}\else\end{cprog}\fi} +\fi + +\fi % \ifx\undefined\cprogsetup + +\endinput diff --git a/2005/flow-accounting-ols2005/OLS2005/Texmf/createLocalInclude b/2005/flow-accounting-ols2005/OLS2005/Texmf/createLocalInclude new file mode 100755 index 0000000..728df1e --- /dev/null +++ b/2005/flow-accounting-ols2005/OLS2005/Texmf/createLocalInclude @@ -0,0 +1,6 @@ +#!/bin/bash + +au=$(basename $PWD)/; + +cat Makefile.inc | sed -e 's|'$au'||g' > Makefile.inc.local + diff --git a/2005/flow-accounting-ols2005/OLS2005/Texmf/individualMakefile b/2005/flow-accounting-ols2005/OLS2005/Texmf/individualMakefile new file mode 100644 index 0000000..0b82f8d --- /dev/null +++ b/2005/flow-accounting-ols2005/OLS2005/Texmf/individualMakefile @@ -0,0 +1,78 @@ +# Makefile for individual papers. Very ugly hack; you may wish +# to create something based on the Protomake file if you're not +# well versed in GNU Make. + +# Instructions: edit Makefile.inc to list your targets, as usual. +# This file should Just Work with it. + +# Tools - some of the dvi programs are from dviutils-1.0-9.rpm +# pdftk is from the identically named package, pdftk. +# You should not need either package for an individual paper. +LATEX = latex +BIBTEX = bibtex +DVIPS = dvips +DVIPDF = dvipdfm +DVICONCAT = dviconcat +# EXTRATEX = /usr/share/texmf: + + +# Set DIRS to be the current directory only. +ifeq ($(DIRS),) +DIRS := . +endif +## proceedings ProcSeq.mk + +# This creates a version of Makefile.inc that is suitable +# for use in the current directory. Kludgy but effective. +SUBMAKES := $(DIRS:=/Makefile.inc.local) +$(shell ../Texmf/createLocalInclude) +include $(SUBMAKES) + +all: $(PAPERS) + +# $(space) expands to a single space. +space := $(empty) $(empty) +SEARCHPATH := $(subst $(space),:,$(DIRS)): # intentional trailing colon + +# Render PDF and PostScript for each individual paper. +PS = $(PAPERS:.dvi=.ps) +PDF = $(PAPERS:.dvi=.pdf) + +papers: $(PS) $(PDF) +# proceedings: Proceedings.ps Proceedings.pdf + +clean: + rm -f $(PAPERS) $(PS) $(PDF) + rm -f $(PAPERS:.dvi=.aux) $(PAPERS:.dvi=.oaux) $(PAPERS:.dvi=.log) + rm -f $(PAPERS:.dvi=.bbl) $(PAPERS:.dvi=.blg) + rm -f $(PAPERS:.dvi=-proc.tex) $(PAPERS:.dvi=-proc.stmp) + rm -f $(PAPERS:.dvi=-proc.dvi) $(PAPERS:.dvi=-proc.log) + rm -f $(PAPERS:.dvi=-proc.aux) $(PAPERS:.dvi=-proc.oaux) + rm -f $(PAPERS:.dvi=-proc.bbl) $(PAPERS:.dvi=-proc.blg) + + +# Pattern rules. Generation of PDF/PS from DVI is straightforward. +%.pdf: %.dvi + cd $(@D) && $(DVIPDF) -o $(@F) $(<F) + +%.ps: %.dvi + cd $(@D) && $(DVIPS) -q -o $(@F) $(<F) + +.fig.eps: + fig2dev -L eps $< >$@ + +.fig.pdf: + fig2dev -L pdf $< >$@ + + +# Properly regenerating a .dvi file from the corresponding .tex file +# requires running LaTeX (and possibly BibTeX) in a loop. GNU make +# cannot be coded to do this, so we have a helper script to do it. +# We read the .aux files for nefarious purposes, so make needs to be +# aware that this operation generates them too. +%.dvi %.aux: %.tex + cd $(@D) && TEXINPUTS=../Texmf:$$TEXINPUTS ../Texmf/latex2dvi $(*F) + +.PHONY: all papers proceedings clean +.SECONDARY: # Never delete intermediate files. + diff --git a/2005/flow-accounting-ols2005/OLS2005/Texmf/latex2dvi b/2005/flow-accounting-ols2005/OLS2005/Texmf/latex2dvi new file mode 100755 index 0000000..8def593 --- /dev/null +++ b/2005/flow-accounting-ols2005/OLS2005/Texmf/latex2dvi @@ -0,0 +1,50 @@ +#! /bin/sh + +# This helper script runs pdflatex, LaTeX, and/or BibTeX in a loop until the output file +# (DVI/PDF) stabilizes. + +if [ $# -ne 1 ]; then + echo "usage: $0 TEX-FILE" >&2 + exit 2 +fi + + +input="${1%.tex}" +aux="$1".aux +oaux="$1".oaux + +# Go through the procedure twice; once for LaTeX to +# generate a stable DVI file, then once with pdflatex +# to generate a stable PDF file. We really do want both... + +for LATEX in latex pdflatex ; do + rm -f "$aux" "$oaux" + + # Run LATEX once. The output file we get from this is probably junk, but + # what we're interested in is the .aux file. If it fails, abort. + echo "+ $LATEX -interaction=nonstopmode \"$input\"" + $LATEX -interaction=nonstopmode "$input" || exit 1 + + # Determine whether we need to run BibTeX. This (should) only ever have + # to be done once. Again, if BibTeX fails, abort. + if grep -q bibdata "$aux"; then + echo "+ bibtex \"$input\"" + bibtex "$input" || exit 1 + fi + + # Save the old .aux file. + cp "$aux" "$oaux" + + # Now run LaTeX over and over again until the .aux file stops changing. + # We use \batchmode for these cycles - the user has already seen any + # diagnostics of interest. + while :; do + echo "+ $LATEX -interaction=batchmode \"$input\"" + $LATEX -interaction=batchmode "$input" || exit 1 + if cmp -s "$aux" "$oaux"; then + break + fi + cp "$aux" "$oaux" + done + +done 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" diff --git a/2005/flow-accounting-ols2005/OLS2005/Texmf/make-wrapper b/2005/flow-accounting-ols2005/OLS2005/Texmf/make-wrapper new file mode 100755 index 0000000..820bb83 --- /dev/null +++ b/2005/flow-accounting-ols2005/OLS2005/Texmf/make-wrapper @@ -0,0 +1,24 @@ +#! /bin/sh + +if [ $# -eq 2 ]; then + output="${2%.stmp}.tex" + page=1 +elif [ $# -eq 3 ]; then + output="${3%.stmp}.tex" + page=$(sed -ne 's:^\\newlabel{NextPage}{{}{\([0-9][0-9]*\)}}$:\1:p' "$2") +else + echo "usage: $0 defs-file [prior-aux-file] output" >&2 + exit 2 +fi + +defs="$1" +wrapped="${output%-proc.tex}.tex" +wrapped="${wrapped#*/}" +{ + cat "$defs" + echo '\def\ProcPage{'$page'}' + echo '\input' "$wrapped" +} > "${output}T" + +./Texmf/move-if-change "${output}T" "$output" +exit 0 diff --git a/2005/flow-accounting-ols2005/OLS2005/Texmf/move-if-change b/2005/flow-accounting-ols2005/OLS2005/Texmf/move-if-change new file mode 100755 index 0000000..ee1b348 --- /dev/null +++ b/2005/flow-accounting-ols2005/OLS2005/Texmf/move-if-change @@ -0,0 +1,32 @@ +#!/bin/sh + +# Copyright (C) 1996 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +if +test -r $2 +then +if +cmp $1 $2 > /dev/null +then +echo $2 is unchanged +rm -f $1 +else +mv -f $1 $2 +fi +else +mv -f $1 $2 +fi diff --git a/2005/flow-accounting-ols2005/OLS2005/Texmf/ols.cls b/2005/flow-accounting-ols2005/OLS2005/Texmf/ols.cls new file mode 100644 index 0000000..bfa1a60 --- /dev/null +++ b/2005/flow-accounting-ols2005/OLS2005/Texmf/ols.cls @@ -0,0 +1,248 @@ +%% +%% 'ols.cls': Ottawa Linux Symposium house style. +%% +%% Based on Usenix/IEEE style file by Matthew Ward, David Beazley, +%% De Clarke, et al. Revised for OLS by John Lockhart. Rewritten as +%% a class file, and 'proceedings' mode added, by Zack Weinberg. +%% +%% +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesClass{ols}[2005/01/31 v1.1 Ottawa Linux Symposium house style] + +% This class faces a dilemma. On the one hand, article.cls does a lot +% of work which we would prefer not to duplicate. On the other hand, +% a surprisingly large amount of that work is wrong for OLS style, +% particularly in proceedings mode, and has to be overridden. +% Presently I think the tradeoff is in favor of reading article.cls +% and then overriding big chunks of it. + +% Options: formatting mode. +% Galley mode suppresses everything that gets in the way of +% composition: page numbers, references, and as many 'this doesn't +% fit' type diagnostics as possible. +\newif\if@galley % checked by \ref wrapper +\newif\if@proceedings % checked by \maketitle etc. + +\DeclareOption{galley} + {\@galleytrue\@proceedingsfalse% + \setlength{\overfullrule}{0pt}% + \hbadness10000\vbadness10000\tolerance10000\let\@largefloatcheck\@empty% + \AtBeginDocument{\pagestyle{empty}}} +% Proof mode corresponds to standard article.cls' ``draft'' mode. +\DeclareOption{proof} + {\@galleyfalse\@proceedingsfalse% + \setlength{\overfullrule}{5pt}} +% Final mode corresponds to standard article.cls' ``final'' mode. +% This is the default. +\DeclareOption{final} + {\@galleyfalse\@proceedingsfalse% + \setlength{\overfullrule}{0pt}} +% Proceedings mode is used when formatting the entire proceedings as +% one volume. In this mode, we use fancy page headings, leave a +% gutter for binding, inject a blank page at the end of the document +% if it ends on a right-hand page, and write out some extra +% information for use by the scripts that glue all the .dvi files +% together. +\DeclareOption{proceedings} + {\@galleyfalse\@proceedingstrue + \setlength{\overfullrule}{0pt}% + \PassOptionsToPackage{twoside}{geometry}% + \PassOptionsToClass{twoside}{article}% + \AtBeginDocument{\pagestyle{proceedings}}} + +% Enable use of article.cls leqno,fleqn,openbib options. +\DeclareOption{leqno}{\PassOptionsToClass{leqno}{article}} +\DeclareOption{fleqn}{\PassOptionsToClass{fleqn}{article}} +\DeclareOption{openbib}{\PassOptionsToClass{openbib}{article}} + +\ExecuteOptions{final} +\ProcessOptions\relax + +\LoadClass[12pt,twocolumn]{article} + +% Global page layout. The author does not get a choice: 12 point +% text, two columns, US letter paper, no marginal notes. The geometry +% package does most of the work. +% If your version of the geometry package is too old, +% please get a new one from http://www.ctan.org, or ask "papers" for help. +\RequirePackage[paper=letterpaper,textheight=9in,textwidth=6.5in,% + heightrounded,twocolumn,columnsep=0.25in]{geometry}[2002/07/08] % >= v3.2 +\setlength\columnseprule{0pt} + +% Blank-line-between-paragraphs style. +\setlength\parindent{\z@} +\setlength\parskip{12\p@ \@plus3\p@ \@minus3\p@} + +% Section titles are bold and 18 point, 2 blank lines before, 1 after. +\renewcommand\section% + {\@startsection {section}{1}{\z@}% + {24\p@ \@plus6\p@ \@minus6\p@}% + {12\p@ \@plus3\p@ \@minus3\p@}% + {\large\bfseries}} + +% Subsection titles are bold and 12 point, 1 blank line before, 1 after. +\renewcommand\subsection% + {\@startsection {subsection}{2}{\z@}% + {12\p@ \@plus3\p@ \@minus3\p@}% + {12\p@ \@plus3\p@ \@minus3\p@}% + {\normalsize\bfseries}} + +% Font and encoding choice. To consider: a different choice of fonts +% might be more pleasant. +\RequirePackage[T1]{fontenc} +\RequirePackage{mathptmx} +%% times and mathptmx both set up tt/sans +% \RequirePackage[scaled=.92]{helvet} +% \RequirePackage{courier} +\RequirePackage{times} + + + +% Title handling. The article.cls definition of \maketitle and +% \@maketitle must be completely overridden. For \maketitle, the +% principal differences are the removal of the undesirable +% \thispagestyle, the removal of the unnecessary single-column logic, +% and the added logic to handle proceedings mode. For \@maketitle, +% the principal change is the addition of \subtitle. + +% Define \shortauthor along the lines of \author; the \author value +% tends to contain stuff that cannot be safely written to a toc file +% (and to be too long, to boot). Same same \subtitle. +\def\shortauthor#1{\gdef\@shortauthor{#1}} +\def\@shortauthor{\@latex@error{No \noexpand\shortauthor given}\@ehc} +\def\subtitle#1{\gdef\@subtitle{\\{\normalsize #1}}} +\def\@subtitle{} % You don't have to have a subtitle. + +\renewcommand\maketitle{\par + \if@proceedings + \date{}% Do not print a date in the proceedings. + % Write out a table-of-contents fragment giving the paper title and + % authors. + \addcontentsline{toc}{toctitle}{\@title}% + \addcontentsline{toc}{tocauthor}{\@shortauthor}% + \fi + \begingroup + \renewcommand\thefootnote{\@fnsymbol\c@footnote}% + \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}% + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \ifnum \col@number=\@ne + \@maketitle + \else + \twocolumn[\@maketitle]% + \fi + \endgroup + \setcounter{footnote}{0}% + \global\let\thanks\relax + \global\let\maketitle\relax + \global\let\@maketitle\relax + \global\let\@thanks\@empty + \global\let\@author\@empty + \global\let\@shortauthor\@empty + \global\let\@date\@empty + % In proceedings, \@title is preserved for use in left-hand-page headers. + \if@proceedings \else + \global\let\@title\@empty + \fi + \global\let\title\relax + \global\let\author\relax + \global\let\shortauthor\relax + \global\let\date\relax + \global\let\and\relax +} + +\renewcommand\@maketitle{% + \newpage + \null + \vskip 2em% + \begin{center}% + \let \footnote \thanks + {\LARGE \@title \@subtitle \par}% + \vskip 1.5em% + {\large + \lineskip .5em% + \begin{tabular}[t]{c}% + \@author + \end{tabular}\par}% + \vskip 1em% + {\large \@date}% + \end{center}% + \par + \vskip 1.5em} + +% Proceedings page style. +% The wrapper file is expected to define \ProcName. +\newcommand\ps@proceedings{% + % No footers. + \let\@oddfoot\@empty + \let\@evenfoot\@empty + % Odd header gives the page number and name of the proceedings volume. + \renewcommand\@oddhead{% + \leaders\hrule\hfil\kern0.25em\relax + {\slshape \ProcName}~~\textbullet~~\thepage} + % Even header gives the page number and title of the current + % article. + \renewcommand\@evenhead{% + \thepage~~\textbullet~~{\slshape \@title} \kern0.25em \leaders\hrule\hfil} +} + +% Special begin-document and end-document handling for proceedings +% mode. The wrapper file is expected to define \ProcPage. +\if@proceedings + \AtBeginDocument{\setcounter{page}{\ProcPage}\thispagestyle{empty}} + \AtEndDocument{\cleardoublepage + % This is sorta like lastpage.sty, and sorta not (it generates the + % page number of the first page of the next document, not the page + % number of the last page of this document). The \immediate is + % necessary because we just did \cleardoublepage, so there isn't + % going to be another invocation of the output routine. + \immediate\write\@auxout{\string\newlabel{NextPage}{{}{\thepage}}}} +\fi + +% In galley mode, cross-references are suppressed: \label is ignored, +% \ref, \pageref, \cite print ``[refname]'' in typewriter font. The +% point is mainly to make LaTeX shut up about undefined references +% while one is composing. (If you use varioref, we cannot help you.) +\if@galley + \renewcommand{\label}[1]{} + \renewcommand{\ref}[1]% + {{\footnotesize\ttfamily\bfseries [#1]}} + \let\pageref=\ref + \let\cite=\ref +\fi + +% Prevent the use of a number of commands whose functionality is +% incompatible with the paper-concatenation logic or the page layout. +\newcommand\@notproceedings[3]{% + \renewcommand{#1}[#2]{% + \ClassError{ols}{\string #1 not supported.}% + {Papers to be collected into proceedings may not have #3.% + \MessageBreak Press RETURN to ignore and continue.}}} + +\newcommand\@notlayout[3]{% + \renewcommand{#1}[#2]{% + \ClassError{ols}{\string #1 not supported.}% + {This page layout does not permit #3.% + \MessageBreak Press RETURN to ignore and continue.}}} + +\@notlayout{\marginpar}{1}{marginal notes} +% For now, allow \thispagestyle because FrontMatter needs it. +%\@notlayout{\thispagestyle}{1}{page style overrides} +\@notproceedings{\tableofcontents}{0}{tables of contents} +\@notproceedings{\listoffigures}{0}{lists of figures} +\@notproceedings{\listoftables}{0}{lists of tables} +\@notproceedings{\glossary}{1}{glossaries} +\@notproceedings{\index}{1}{indices} + +% Provide a means to tell if we're running under pdflatex +\newif\ifpdf +\ifx\pdfoutput\undefined +\pdffalse +\else +\pdfoutput=1 +\pdftrue +\fi + + +\endinput diff --git a/2005/flow-accounting-ols2005/OLS2005/Texmf/underscore.sty b/2005/flow-accounting-ols2005/OLS2005/Texmf/underscore.sty new file mode 100644 index 0000000..a274b39 --- /dev/null +++ b/2005/flow-accounting-ols2005/OLS2005/Texmf/underscore.sty @@ -0,0 +1,232 @@ +% underscore.sty 12-Oct-2001 Donald Arseneau asnd@triumf.ca +% Make the "_" character print as "\textunderscore" in text. +% Copyright 1998,2001 Donald Arseneau; Distribute freely if unchanged. +% Instructions follow after the definitions. + +\ProvidesPackage{underscore}[2001/10/12] + +\begingroup + \catcode`\_=\active + \gdef_{% \relax % No relax gives a small vulnerability in alignments + \ifx\if@safe@actives\iftrue % must be outermost test! + \string_% + \else + \ifx\protect\@typeset@protect + \ifmmode \sb \else \BreakableUnderscore \fi + \else + \ifx\protect\@unexpandable@protect \noexpand_% + \else \protect_% + \fi\fi + \fi} +\endgroup + +% At begin: set catcode; fix \long \ttdefault so I can use it in comparisons; +\AtBeginDocument{% + {\immediate\write\@auxout{\catcode\number\string`\_ \string\active}}% + \catcode\string`\_\string=\active + \edef\ttdefault{\ttdefault}% +} + +\newcommand{\BreakableUnderscore}{\leavevmode\nobreak\hskip\z@skip + \ifx\f@family\ttdefault \string_\else \textunderscore\fi + \usc@dischyph\nobreak\hskip\z@skip} + +\DeclareRobustCommand{\_}{% + \ifmmode \nfss@text{\textunderscore}\else \BreakableUnderscore \fi} + +\let\usc@dischyph\@dischyph +\DeclareOption{nohyphen}{\def\usc@dischyph{\discretionary{}{}{}}} +\DeclareOption{strings}{\catcode`\_=\active} + +\ProcessOptions +\ifnum\catcode`\_=\active\else \endinput \fi + +%%%%%%%% Redefine commands that use character strings %%%%%%%% + +\@ifundefined{UnderscoreCommands}{\let\UnderscoreCommands\@empty}{} +\expandafter\def\expandafter\UnderscoreCommands\expandafter{% + \UnderscoreCommands + \do\include \do\includeonly + \do\@input \do\@iinput \do\InputIfFileExists + \do\ref \do\pageref \do\newlabel + \do\bibitem \do\@bibitem \do\cite \do\nocite \do\bibcite +} + +% Macro to redefine a macro to pre-process its string argument +% with \protect -> \string. +\def\do#1{% Avoid double processing if user includes command twice! + \@ifundefined{US\string_\expandafter\@gobble\string#1}{% + \edef\@tempb{\meaning#1}% Check if macro is just a protection shell... + \def\@tempc{\protect}% + \edef\@tempc{\meaning\@tempc\string#1\space\space}% + \ifx\@tempb\@tempc % just a shell: hook into the protected inner command + \expandafter\do + \csname \expandafter\@gobble\string#1 \expandafter\endcsname + \else % Check if macro takes an optional argument + \def\@tempc{\@ifnextchar[}% + \edef\@tempa{\def\noexpand\@tempa####1\meaning\@tempc}% + \@tempa##2##3\@tempa{##2\relax}% + \edef\@tempb{\meaning#1\meaning\@tempc}% + \edef\@tempc{\noexpand\@tempd \csname + US\string_\expandafter\@gobble\string#1\endcsname}% + \if \expandafter\@tempa\@tempb \relax 12\@tempa % then no optional arg + \@tempc #1\US@prot + \else % There is optional arg + \@tempc #1\US@protopt + \fi + \fi + }{}} + +\def\@tempd#1#2#3{\let#1#2\def#2{#3#1}} + +\def\US@prot#1#2{\let\@@protect\protect \let\protect\string + \edef\US@temp##1{##1{#2}}\restore@protect\US@temp#1} +\def\US@protopt#1{\@ifnextchar[{\US@protarg#1}{\US@prot#1}} +\def\US@protarg #1[#2]{\US@prot{{#1[#2]}}} + +\UnderscoreCommands +\let\do\relax \let\@tempd\relax % un-do + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\endinput + +underscore.sty 12-Oct-2001 Donald Arseneau + +Features: +~~~~~~~~~ +\_ prints an underscore so that the hyphenation of constituent words +is not affected and hyphenation is permitted after the underscore. +For example, "compound\_fracture" hyphenates as com- pound_- frac- ture. +If you prefer the underscore to break without a hyphen (but still with +the same rules for explicit hyphen-breaks) then use the [nohyphen] +package option. + +A simple _ acts just like \_ in text mode, but makes a subscript in +math mode: activation_energy $E_a$ + +Both forms use an underscore character if the font encoding contains +one (e.g., "\usepackage[T1]{fontenc}" or typewriter fonts in any encoding), +but they use a rule if the there is no proper character. + +Deficiencies: +~~~~~~~~~~~~~ +The skips and penalties ruin any kerning with the underscore character +(when a character is used). However, there doesn't seem to be much, if +any, such kerning in the ec fonts, and there is never any kerning with +a rule. + +You must avoid "_" in file names and in cite or ref tags, or you must use +the babel package, with its active-character controls, or you must give +the [strings] option, which attempts to redefine several commands (and +may not work perfectly). Even without the [strings] option or babel, you +can use occasional underscores like: "\include{file\string_name}". + +Option: [strings] +~~~~~~~~~~~~~~~~~ +The default operation is quite simple and needs no customization; but +you must avoid using "_" in any place where LaTeX uses an argument as +a string of characters for some control function or as a name. These +include the tags for \cite and \ref, file names for \input, \include, +and \includegraphics, environment names, counter names, and placement +parameters (like "[t]"). The problem with these contexts is that they +are `moving arguments' but LaTeX does not `switch on' the \protect +mechanism for them. + +If you need to use the underscore character in these places, the package +option [strings] is provided to redefine commands taking a string argument +so that the argument is protected (with \protect -> \string). The list +of commands is given in "\UnderscoreCommands", with "\do" before each, +covering \cite, \ref, \input, and their variants. Not included are many +commands regarding font names, everything with counter names, environment +names, page styles, and versions of \ref and \cite defined by external +packages (e.g. \vref and \citeyear). + +You can add to the list of supported commands by defining \UnderscoreCommands +before loading this package; e.g. + + \usepackage{chicago} + \newcommand{\UnderscoreCommands}{% (\cite already done) + \do\citeNP \do\citeA \do\citeANP \do\citeN \do\shortcite + \do\shortciteNP \do\shortciteA \do\shortciteANP \do\shortciteN + \do\citeyear \do\citeyearNP + } + \usepackage[strings]{underscore} + +Not all commands can be supported this way! Only commands that take a +string argument *first* can be protected. One optional argument before +the string argument is also permitted, as exemplified by \cite: both +\cite{tags} and \cite[text]{tags} are allowed. A command like +\@addtoreset which takes two counter names as arguments could not +be protected by adding it to \UnderscoreCommands. + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! When you use the [strings] option, you must load this package !! +!! last (or nearly last). !! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +There are two reasons: 1) The redefinitions done for protection must come +after other packages define their customized versions of those commands. +2) The [strings] option requires the _ character to be activated immediately +in order for the cite and ref tags to be read properly from the .aux file +as plain strings, and this catcode setting might disrupt other packages. + +The babel package implements a protection mechanism for many commands, +and will be a complete fix for most documents without the [strings] option. +Many add-on packages are compatible with babel, so they will get the +strings protection also. However, there are several commands that are +not covered by babel, but can easily be supported by the [strings] and +\UnderscoreCommands mechanism. Beware that using both [strings] and babel +may lead to conflicts, but does appear to work (load babel last). + +Implementation Notes: +~~~~~~~~~~~~~~~~~~~~~ +The first setting of "_" to be an active character is performed in a local +group so as to not interfere with other packages. The catcode setting +is repeated with \AtBeginDocument so the definition is in effect for the +text. However, the catcode setting is repeated immediately when the +[strings] option is detected. + +The definition of the active "_" is essentially: + \ifmmode \sb \else \BreakableUnderscore \fi +where "\sb" retains the normal subscript meaning of "_" and where +"\BreakableUnderscore" is essentially "\_". The rest of the definition +handles the "\protect"ion without causing \relax to be inserted before +the character. + +\BreakableUnderscore uses "\nobreak\hskip\z@skip" to separate the +underscore from surrounding words, thus allowing TeX to hyphenate them, +but preventing free breaks around the underscore. Next, it checks the +current font family, and uses the underscore character from tt fonts or +otherwise \textunderscore (which is a character or rule depending on +the font encoding). After the underscore, it inserts a discretionary +hyphenation point as "\usc@dischyph", which is usually just "\-" +except that it still works in the tabbing environment, although it +will give "\discretionary{}{}{}" under the [nohyphen] option. After +that, another piece of non-breaking interword glue is inserted. +Ordinarily, the comparison "\ifx\f@family\ttdefault" will always fail +because \ttdefault is `long' where \f@family is not (boooo hisss), but +\ttdefault is redefined to be non-long by "\AtBeginDocument". + +The "\_" command is then defined to use "\BreakableUnderscore". + +If the [strings] option is not given, then that is all! + +Under the [strings] option, the list of special commands is processed to: +- retain the original command as \US_command (\US_ref) +- redefine the command as \US@prot\US_command for ordinary commands + (\ref -> \US@prot\US_ref) or as \US@protopt\US_command when an optional + argument is possible (\bibitem -> \US@protopt\US_bibitem). +- self-protecting commands (\cite) retain their self-protection. +Diagnosing the state of the pre-existing command is done by painful +contortions involving \meaning. + +\US@prot and \US@protopt read the argument, process it with \protect +enabled, then invoke the saved \US_command. + +Modifications: +~~~~~~~~~~~~~~ +12-Oct-2001 Babel (safe@actives) compatibility and [nohyphen] option. + +Test file integrity: ASCII 32-57, 58-126: !"#$%&'()*+,-./0123456789 +:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ diff --git a/2005/flow-accounting-ols2005/OLS2005/Texmf/zrl.sty b/2005/flow-accounting-ols2005/OLS2005/Texmf/zrl.sty new file mode 100644 index 0000000..7b21d18 --- /dev/null +++ b/2005/flow-accounting-ols2005/OLS2005/Texmf/zrl.sty @@ -0,0 +1,446 @@ + +%%%%% This file is a kludge until such time as I learn to do it elegantly. Sorry. +%% url - external. Intended for items which do not contain spaces, and +%% containing global options for obeying & breaking at spaces. But +%% we need to do change those things on the fly, so we're making a copy +%% of url.sty and defining two extra groups, zrl and xrl, that +%% permit handling these options on the fly. + +%% Thus you can mix url without obeyspaces and/or spaces with the following: +%% zrl - url with obeyspaces,spaces turned on +%% xrl - url with obeyspaces turned on + +% zrl.sty ver 1.4 02-Mar-1999 Donald Arseneau asnd@triumf.ca +% Copyright 1996-1999 Donald Arseneau, Vancouver, Canada. +% This program can be used, distributed, and modified under the terms +% of the LaTeX Project Public License. +% +% A form of \verb that allows linebreaks at certain characters or +% combinations of characters, accepts reconfiguration, and can usually +% be used in the argument to another command. It is intended for email +% addresses, hypertext links, directories/paths, etc., which normally +% have no spaces. The font may be selected using the \zrlstyle command, +% and new zrl-like commands can be defined using \zrldef. +% +% Usage: Conditions: +% \zrl{ } If the argument contains any "%", "#", or "^^", or ends with +% "\", it can't be used in the argument to another command. +% The argument must not contain unbalanced braces. +% \zrl| | ...where "|" is any character not used in the argument and not +% "{" or a space. The same restrictions as above except that the +% argument may contain unbalanced braces. +% \xyz for "\xyz" a defined-zrl; this can be used anywhere, no matter +% what characters it contains. +% +% See further instructions after "\endinput" +% +\def\Zrl@ttdo{% style assignments for tt fonts or T1 encoding +\def\ZrlBreaks{\do\.\do\@\do\\\do\/\do\!\do\_\do\|\do\%\do\;\do\>\do\]% + \do\)\do\,\do\?\do\'\do\+\do\=}% +\def\ZrlBigBreaks{\do\:\do@zrl@hyp}% +\def\ZrlNoBreaks{\do\(\do\[\do\{\do\<}% (unnecessary) +\def\ZrlSpecials{\do\ {\ }}% +\def\ZrlOrds{\do\*\do\-\do\~}% any ordinary characters that aren't usually +} + +\def\Xrl@ttdo{% style assignments for tt fonts or T1 encoding +\def\XrlBreaks{\do\.\do\@\do\\\do\/\do\!\do\_\do\|\do\%\do\;\do\>\do\]% + \do\)\do\,\do\?\do\'\do\+\do\=}% +\def\XrlBigBreaks{\do\:\do@xrl@hyp}% +\def\XrlNoBreaks{\do\(\do\[\do\{\do\<}% (unnecessary) +\def\XrlSpecials{\do\ {\ }}% +\def\XrlOrds{\do\*\do\-\do\~}% any ordinary characters that aren't usually +} + +\def\Zrl@do{% style assignments for OT1 fonts except tt +\def\ZrlBreaks{\do\.\do\@\do\/\do\!\do\%\do\;\do\]\do\)\do\,\do\?\do\+\do\=}% +\def\ZrlBigBreaks{\do\:\do@zrl@hyp}% +\def\ZrlNoBreaks{\do\(\do\[\do\{}% prevents breaks after *next* character +\def\ZrlSpecials{\do\<{\langle}\do\>{\mathbin{\rangle}}\do\_{\_% + \penalty\@m}\do\|{\mid}\do\{{\lbrace}\do\}{\mathbin{\rbrace}}\do + \\{\mathbin{\backslash}}\do\~{\raise.6ex\hbox{\m@th$\scriptstyle\sim$}}\do + \ {\ }}% +\def\ZrlOrds{\do\'\do\"\do\-}% +} +\def\Xrl@do{% style assignments for OT1 fonts except tt +\def\XrlBreaks{\do\.\do\@\do\/\do\!\do\%\do\;\do\]\do\)\do\,\do\?\do\+\do\=}% +\def\XrlBigBreaks{\do\:\do@xrl@hyp}% +\def\XrlNoBreaks{\do\(\do\[\do\{}% prevents breaks after *next* character +\def\XrlSpecials{\do\<{\langle}\do\>{\mathbin{\rangle}}\do\_{\_% + \penalty\@m}\do\|{\mid}\do\{{\lbrace}\do\}{\mathbin{\rbrace}}\do + \\{\mathbin{\backslash}}\do\~{\raise.6ex\hbox{\m@th$\scriptstyle\sim$}}\do + \ {\ }}% +\def\XrlOrds{\do\'\do\"\do\-}% +} + + +\def\zrl@ttstyle{% +\@ifundefined{selectfont}{\def\ZrlFont{\tt}}{\def\ZrlFont{\ttfamily}}\Zrl@ttdo +} +\def\xrl@ttstyle{% +\@ifundefined{selectfont}{\def\XrlFont{\tt}}{\def\XrlFont{\ttfamily}}\Xrl@ttdo +} + + +\def\zrl@rmstyle{% +\@ifundefined{selectfont}{\def\ZrlFont{\rm}}{\def\ZrlFont{\rmfamily}}\Zrl@do +} +\def\xrl@rmstyle{% +\@ifundefined{selectfont}{\def\XrlFont{\rm}}{\def\XrlFont{\rmfamily}}\Xrl@do +} + + +\def\zrl@sfstyle{% +\@ifundefined{selectfont}{\def\ZrlFont{\sf}}{\def\ZrlFont{\sffamily}}\Zrl@do +} +\def\xrl@sfstyle{% +\@ifundefined{selectfont}{\def\XrlFont{\sf}}{\def\XrlFont{\sffamily}}\Xrl@do +} + + +\def\zrl@samestyle{\ifdim\fontdimen\thr@@\font=\z@ \zrl@ttstyle \else + \zrl@rmstyle \fi \def\ZrlFont{}} +\def\xrl@samestyle{\ifdim\fontdimen\thr@@\font=\z@ \xrl@ttstyle \else + \xrl@rmstyle \fi \def\XrlFont{}} + +\@ifundefined{strip@prefix}{\def\strip@prefix#1>{}}{} +\@ifundefined{verbatim@nolig@list}{\def\verbatim@nolig@list{\do\`}}{} + +\def\Zrl{% + \begingroup \let\zrl@moving\relax\relax \endgroup + \ifmmode\@nomatherr$\fi + \ZrlFont $\fam\z@ \textfont\z@\font + \let\do\@makeother \dospecials % verbatim catcodes + \catcode`{\@ne \catcode`}\tw@ \catcode`\ 10 % except braces and spaces + \medmuskip0mu \thickmuskip\medmuskip \thinmuskip\medmuskip + \@tempcnta\fam\multiply\@tempcnta\@cclvi + \let\do\set@mathcode \ZrlOrds % ordinary characters that were special + \advance\@tempcnta 8192 \ZrlBreaks % bin + \advance\@tempcnta 4096 \ZrlBigBreaks % rel + \advance\@tempcnta 4096 \ZrlNoBreaks % open + \let\do\set@mathact \ZrlSpecials % active + \let\do\set@mathnolig \verbatim@nolig@list % prevent ligatures + \@ifnextchar\bgroup\Zrl@z\Zrl@y} + +\def\Zrl@y#1{\catcode`{11 \catcode`}11 + \def\@tempa##1#1{\Zrl@z{##1}}\@tempa} +\def\Zrl@z#1{\def\@tempa{#1}\expandafter\expandafter\expandafter\Zrl@Hook + \expandafter\strip@prefix\meaning\@tempa\ZrlRight\m@th$\endgroup} +\def\Zrl@Hook{\ZrlLeft} +\let\ZrlRight\@empty +\let\ZrlLeft\@empty + +\def\Xrl{% + \begingroup \let\xrl@moving\relax\relax \endgroup + \ifmmode\@nomatherr$\fi + \XrlFont $\fam\z@ \textfont\z@\font + \let\do\@makeother \dospecials % verbatim catcodes + \catcode`{\@ne \catcode`}\tw@ \catcode`\ 10 % except braces and spaces + \medmuskip0mu \thickmuskip\medmuskip \thinmuskip\medmuskip + \@tempcnta\fam\multiply\@tempcnta\@cclvi + \let\do\set@mathcode \XrlOrds % ordinary characters that were special + \advance\@tempcnta 8192 \XrlBreaks % bin + \advance\@tempcnta 4096 \XrlBigBreaks % rel + \advance\@tempcnta 4096 \XrlNoBreaks % open + \let\do\set@mathact \XrlSpecials % active + \let\do\set@mathnolig \verbatim@nolig@list % prevent ligatures + \@ifnextchar\bgroup\Xrl@z\Xrl@y} + +\def\Xrl@y#1{\catcode`{11 \catcode`}11 + \def\@tempa##1#1{\Xrl@z{##1}}\@tempa} +\def\Xrl@z#1{\def\@tempa{#1}\expandafter\expandafter\expandafter\Xrl@Hook + \expandafter\strip@prefix\meaning\@tempa\XrlRight\m@th$\endgroup} +\def\Xrl@Hook{\XrlLeft} +\let\XrlRight\@empty +\let\XrlLeft\@empty + + +\def\set@mathcode#1{\count@`#1\advance\count@\@tempcnta\mathcode`#1\count@} +\def\set@mathact#1#2{\mathcode`#132768 \lccode`\~`#1\lowercase{\def~{#2}}} +\def\set@mathnolig#1{\ifnum\mathcode`#1<32768 + \lccode`\~`#1\lowercase{\edef~{\mathchar\number\mathcode`#1_{\/}}}% + \mathcode`#132768 \fi} + +\def\zrldef#1#2{\begingroup \setbox\z@\hbox\bgroup + \def\Zrl@z{\Zrl@def{#1}{#2}}#2} +\expandafter\ifx\csname DeclareRobustCommand\endcsname\relax + \def\Zrl@def#1#2#3{\m@th$\endgroup\egroup\endgroup + \def#1{#2{#3}}} +\else + \def\Zrl@def#1#2#3{\m@th$\endgroup\egroup\endgroup + \DeclareRobustCommand{#1}{#2{#3}}} +\fi + +\def\xrldef#1#2{\begingroup \setbox\z@\hbox\bgroup + \def\Xrl@z{\Xrl@def{#1}{#2}}#2} +\expandafter\ifx\csname DeclareRobustCommand\endcsname\relax + \def\Xrl@def#1#2#3{\m@th$\endgroup\egroup\endgroup + \def#1{#2{#3}}} +\else + \def\Xrl@def#1#2#3{\m@th$\endgroup\egroup\endgroup + \DeclareRobustCommand{#1}{#2{#3}}} +\fi + +\def\zrlstyle#1{\csname zrl@#1style\endcsname} +\def\xrlstyle#1{\csname xrl@#1style\endcsname} + +% Sample (and default) configuration: +% +\newcommand\zrl{\begingroup \Zrl} +\newcommand\xrl{\begingroup \Xrl} +% +% picTeX defines \path, so declare it optionally: +\@ifundefined{path}{\newcommand\path{\begingroup \zrlstyle{tt}\Zrl}}{} +\@ifundefined{path}{\newcommand\path{\begingroup \xrlstyle{tt}\Xrl}}{} +% +% too many styles define \email like \address, so I will not define it. +% \newcommand\email{\begingroup \zrlstyle{rm}\Zrl} + +% Process LaTeX \package options +% +\zrlstyle{tt} +%\let\Zrl@sppen\@M +\def\do@zrl@hyp{}% by default, no breaks after hyphens +%%%%% +\let\Zrl@sppen\relpenalty +\let\Zrl@Hook\relax +\xrlstyle{tt} +\let\Xrl@sppen\@M +\def\do@xrl@hyp{}% by default, no breaks after hyphens +\let\Xrl@Hook\relax +%%%%% +\@ifundefined{ProvidesPackage}{}{ + \ProvidesPackage{zrl}[1999/03/02 \space ver 1.4 \space + Verb mode for zrls, email addresses, and file names] + \DeclareOption{hyphens}{\def\do@zrl@hyp{\do\-}\def\do@xrl@hyp{\do\-}}% allow breaks after hyphens + \DeclareOption{obeyspaces}{\let\Zrl@Hook\relax\let\Xrl@Hook\relax}% a flag for later + \DeclareOption{spaces}{\let\Zrl@sppen\relpenalty} + \DeclareOption{T1}{\let\Zrl@do\Zrl@ttdo\let\Xrl@do\Xrl@ttdo} + \ProcessOptions +\ifx\Zrl@Hook\relax % [obeyspaces] was declared + \def\Zrl@Hook#1\ZrlRight\m@th{\edef\@tempa{\noexpand\ZrlLeft + \Zrl@retain#1\Zrl@nosp\, }\@tempa\ZrlRight\m@th} + \def\Zrl@retain#1 {#1\penalty\Zrl@sppen\ \Zrl@retain} + \def\Zrl@nosp\,#1\Zrl@retain{} +\fi +\ifx\Xrl@Hook\relax % [obeyspaces] was declared + \def\Xrl@Hook#1\XrlRight\m@th{\edef\@tempa{\noexpand\XrlLeft + \Xrl@retain#1\Xrl@nosp\, }\@tempa\XrlRight\m@th} + \def\Xrl@retain#1 {#1\penalty\Xrl@sppen\ \Xrl@retain} + \def\Xrl@nosp\,#1\Xrl@retain{} +\fi +} + +\edef\zrl@moving{\csname Zrl Error\endcsname} +\expandafter\edef\zrl@moving + {\csname zrl used in a moving argument.\endcsname} +\expandafter\expandafter\expandafter \let \zrl@moving\undefined + +\edef\xrl@moving{\csname Xrl Error\endcsname} +\expandafter\edef\xrl@moving + {\csname xrl used in a moving argument.\endcsname} +\expandafter\expandafter\expandafter \let \xrl@moving\undefined + +% "verbatim" with line breaks, obeying spaces +\providecommand\code{\begingroup \xrlstyle{tt}\Xrl} +% as above, but okay to break lines at spaces +\providecommand\brcode{\begingroup \zrlstyle{tt}\Zrl} + +% Same as the pair above, but 'l' for long == small type +\providecommand\lcode{\begingroup \small\xrlstyle{tt}\Xrl} +\providecommand\lbrcode{\begingroup \small\zrlstyle{tt}\Zrl} + +% For identifiers - "verbatim" with line breaks at punctuation +\providecommand\ident{\begingroup \urlstyle{tt}\Url} +\providecommand\lident{\begingroup \small\urlstyle{tt}\Url} + + +\endinput +% +% zrl.sty ver 1.4 02-Mar-1999 Donald Arseneau asnd@reg.triumf.ca +% +% This package defines "\zrl", a form of "\verb" that allows linebreaks, +% and can often be used in the argument to another command. It can be +% configured to print in different formats, and is particularly useful for +% hypertext links, email addresses, directories/paths, etc. The font may +% be selected using the "\zrlstyle" command and pre-defined text can be +% stored with the "\zrldef" command. New zrl-like commands can be defined, +% and a "\path" command is provided this way. +% +% Usage: Conditions: +% \zrl{ } If the argument contains any "%", "#", or "^^", or ends with +% "\", it can't be used in the argument to another command. +% The argument must not contain unbalanced braces. +% \zrl| | ...where "|" is any character not used in the argument and not +% "{" or a space. The same restrictions as above except that the +% argument may contain unbalanced braces. +% \xyz for "\xyz" a defined-zrl; this can be used anywhere, no matter +% what characters it contains. +% +% The "\zrl" command is fragile, and its argument is likely to be very +% fragile, but a defined-zrl is robust. +% +% Package Option: obeyspaces +% Ordinarily, all spaces are ignored in the zrl-text. The "[obeyspaces]" +% option allows spaces, but may introduce spurious spaces when a zrl +% containing "\" characters is given in the argument to another command. +% So if you need to obey spaces you can say "\usepackage[obeyspaces]{zrl}", +% and if you need both spaces and backslashes, use a `defined-zrl' for +% anything with "\". +% +% Package Option: hyphens +% Ordinarily, breaks are not allowed after "-" characters because this +% leads to confusion. (Is the "-" part of the address or just a hyphen?) +% The package option "[hyphens]" allows breaks after explicit hyphen +% characters. The "\zrl" command will *never ever* hyphenate words. +% +% Package Option: spaces +% Likewise, breaks are not usually allowed after spaces under the +% "[obeyspaces]" option, but giving the options "[obeyspaces,spaces]" +% will allow breaks at those spaces. +% +% Package Option: T1 +% This signifies that you will be using T1-encoded fonts which contain +% some characters missing from most older (OT1) encoded TeX fonts. This +% changes the default definition for "\zrlstyle{rm}". +% +% Defining a defined-zrl: +% Take for example the email address "myself%node@gateway.net" which could +% not be given (using "\zrl" or "\verb") in a caption or parbox due to the +% percent sign. This address can be predefined with +% \zrldef{\myself}\zrl{myself%node@gateway.net} or +% \zrldef{\myself}\zrl|myself%node@gateway.net| +% and then you may use "\myself" instead of "\zrl{myself%node@gateway.net}" +% in an argument, and even in a moving argument like a caption because a +% defined-zrl is robust. +% +% Style: +% You can switch the style of printing using "\zrlstyle{tt}", where "tt" +% can be any defined style. The pre-defined styles are "tt", "rm", "sf", +% and "same" which all allow the same linebreaks but different fonts -- +% the first three select a specific font and the "same" style uses the +% current text font. You can define your own styles with different fonts +% and/or line-breaking by following the explanations below. The "\zrl" +% command follows whatever the currently-set style dictates. +% +% Alternate commands: +% It may be desireable to have different things treated differently, each +% in a predefined style; e.g., if you want directory paths to always be +% in tt and email addresses to be rm, then you would define new zrl-like +% commands as follows: +% +% \newcommand\email{\begingroup \zrlstyle{rm}\Zrl} +% \newcommand\directory{\begingroup \zrlstyle{tt}\Zrl} +% +% You must follow this format closely, and NOTE that the final command is +% "\Zrl", not "\zrl". In fact, the "\directory" example is exactly the +% "\path" definition which is pre-defined in the package. If you look +% above, you will see that "\zrl" is defined with +% \newcommand\zrl{\begingroup \Zrl} +% I.e., using whatever zrl-style has been selected. +% +% You can make a defined-zrl for these other styles, using the usual +% "\zrldef" command as in this example: +% +% \zrldef{\myself}{\email}{myself%node.domain@gateway.net} +% +% which makes "\myself" act like "\email{myself%node.domain@gateway.net}", +% if the "\email" command is defined as above. The "\myself" command +% would then be robust. +% +% Defining styles: +% Before describing how to customize the printing style, it is best to +% mention something about the unusual implementation of "\zrl". Although +% the material is textual in nature, and the font specification required +% is a text-font command, the text is actually typeset in *math* mode. +% This allows the context-sensitive linebreaking, but also accounts for +% the default behavior of ignoring spaces. Now on to defining styles. +% +% To change the font or the list of characters that allow linebreaks, you +% could redefine the commands "\ZrlFont", "\ZrlBreaks", "\ZrlSpecials" etc. +% directly in the document, but it is better to define a new `zrl-style' +% (following the example of "\zrl@ttstyle" and "\zrl@rmstyle") which defines +% all of "\ZrlBigbreaks", "\ZrlNoBreaks", "\ZrlBreaks", "\ZrlSpecials", and +% "\ZrlFont". +% +% Changing font: +% The "\ZrlFont" command selects the font. The definition of "\ZrlFont" +% done by the pre-defined styles varies to cope with a variety of LaTeX +% font selection schemes, but it could be as simple as "\def\ZrlFont{\tt}". +% Depending on the font selected, some characters may need to be defined +% in the "\ZrlSpecials" list because many fonts don't contain all the +% standard input characters. +% +% Changing linebreaks: +% The list of characters that allow line-breaks is given by "\ZrlBreaks" +% and "\ZrlBigBreaks", which have the format "\do\c" for character "c". +% The differences are that `BigBreaks' have a lower penalty and have +% different breakpoints when in sequence (as in "http://"): `BigBreaks' +% are treated as mathrels while `Breaks' are mathbins (see The TeXbook, +% p.170). In particular, a series of `BigBreak' characters will break at +% the end and only at the end; a series of `Break' characters will break +% after the first and after every following *pair*; there will be no +% break after a `Break' character if a `BigBreak' follows. In the case +% of "http://" it doesn't matter whether ":" is a `Break' or `BigBreak' -- +% the breaks are the same in either case; but for DECnet nodes with "::" +% it is important to prevent breaks *between* the colons, and that is why +% colons are `BigBreaks'. +% +% It is possible for characters to prevent breaks after the next following +% character (I use this for parentheses). Specify these in "\ZrlNoBreaks". +% +% You can do arbitrarily complex things with characters by making them +% active in math mode (mathcode hex-8000) and specifying the definition(s) +% in "\ZrlSpecials". This is used in the rm and sf styles for OT1 font +% encoding to handle several characters that are not present in those +% computer-modern style fonts. See the definition of "\Zrl@do", which +% is used by both "\zrl@rmstyle" and "\zrl@sfstyle"; it handles missing +% characters via "\ZrlSpecials". The nominal format for setting each +% special character "c" is: "\do\c{<definition>}", but you can include +% other definitions too. +% +% +% If all this sounds confusing ... well, it is! But I hope you won't need +% to redefine breakpoints -- the default assignments seem to work well for +% a wide variety of applications. If you do need to make changes, you can +% test for breakpoints using regular math mode and the characters "+=(a". +% +% Yet more flexibility: +% You can also customize the verbatim text by defining "\ZrlRight" and/or +% "\ZrlLeft", e.g., for ISO formatting of zrls surrounded by "< >", define +% +% \renewcommand\zrl{\begingroup \def\ZrlLeft{<zrl: }\def\ZrlRight{>}% +% \zrlstyle{tt}\Zrl} +% +% The meanings of "\ZrlLeft" and "\ZrlRight" are *not* reproduced verbatim. +% This lets you use formatting commands there, but you must be careful not +% to use TeX's special characters ("\^_%~#$&{}" etc.) improperly. +% You can also define "\ZrlLeft" to reprocess the verbatim text, but the +% format of the definition is special: +% +% \def\ZrlLeft#1\ZrlRight{ ... do things with #1 ... } +% +% Yes, that is "#1" followed by "\ZrlRight" then the definition. For +% example, to put a hyperTeX hypertext link in the DVI file: +% +% \def\ZrlLeft#1\ZrlRight{\special{html:<a href="#1">}#1\special{html:</a>}} +% +% Using this technique, zrl.sty can provide a convenient interface for +% performing various operations on verbatim text. You don't even need +% to print out the argument! For greatest efficiency in such obscure +% applications, you can define a null zrl-style where all the lists like +% "\ZrlBreaks" are empty. +% +% Revision History: +% ver 1.1 6-Feb-1996: +% Fix hyphens that wouldn't break and ligatures that weren't suppressed. +% ver 1.2 19-Oct-1996: +% Package option for T1 encoding; Hooks: "\ZrlLeft" and "\ZrlRight". +% ver 1.3 21-Jul-1997: +% Prohibit spaces as delimiter characters; change ascii tilde in OT1. +% ver 1.4 02-Mar-1999 +% LaTeX license; moving-argument-error +% The End + +Test file integrity: ASCII 32-57, 58-126: !"#$%&'()*+,-./0123456789 +:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ |