summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/snotez
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/snotez
Initial commit
Diffstat (limited to 'macros/latex/contrib/snotez')
-rw-r--r--macros/latex/contrib/snotez/README30
-rw-r--r--macros/latex/contrib/snotez/snotez.sty299
-rw-r--r--macros/latex/contrib/snotez/snotez_en.pdfbin0 -> 457084 bytes
-rw-r--r--macros/latex/contrib/snotez/snotez_en.tex412
4 files changed, 741 insertions, 0 deletions
diff --git a/macros/latex/contrib/snotez/README b/macros/latex/contrib/snotez/README
new file mode 100644
index 0000000000..7e380fb034
--- /dev/null
+++ b/macros/latex/contrib/snotez/README
@@ -0,0 +1,30 @@
+--------------------------------------------------------------------------
+the SNOTEZ package v0.3 2013/04/21
+
+ Sidenotes for LaTeX2e
+
+--------------------------------------------------------------------------
+Clemens Niederberger
+Web: https://bitbucket.org/cgnieder/snotez/
+E-Mail: contact@mychemistry.eu
+--------------------------------------------------------------------------
+Copyright 2012--2013 Clemens Niederberger
+
+This work may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2005/12/01 or later.
+
+This work has the LPPL maintenance status `maintained'.
+
+The Current Maintainer of this work is Clemens Niederberger.
+--------------------------------------------------------------------------
+The snotez package consists of the files
+ - snotez.sty, snotez_en.tex, snotez_en.pdf, README
+--------------------------------------------------------------------------
+If you have any ideas, questions, suggestions or bugs to report, please
+feel free to contact me.
+-------------------------------------------------------------------------- \ No newline at end of file
diff --git a/macros/latex/contrib/snotez/snotez.sty b/macros/latex/contrib/snotez/snotez.sty
new file mode 100644
index 0000000000..62c0c2d53a
--- /dev/null
+++ b/macros/latex/contrib/snotez/snotez.sty
@@ -0,0 +1,299 @@
+% --------------------------------------------------------------------------
+% the SNOTEZ package
+%
+% Sidenotes for LaTeX2e
+%
+% --------------------------------------------------------------------------
+% Clemens Niederberger
+% Web: https://bitbucket.org/cgnieder/enotez/
+% E-Mail: contact@mychemistry.eu
+% --------------------------------------------------------------------------
+% Copyright 2012--2013 Clemens Niederberger
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Clemens Niederberger.
+% --------------------------------------------------------------------------
+% The snotez package consists of the files
+% - snotez.sty, snotez_en.tex, snotez_en.pdf, README
+% --------------------------------------------------------------------------
+% If you have any ideas, questions, suggestions or bugs to report, please
+% feel free to contact me.
+% --------------------------------------------------------------------------
+\def\snotez@date{2013/04/21}
+\def\snotez@version{v0.3}
+\def\snotez@description{sidenote support for LaTeX 2e (CN)}
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{snotez}[\snotez@date\space \snotez@version\space \snotez@description]
+
+\RequirePackage{etoolbox,pgfopts,marginnote}
+\@ifpackageloaded{zref-abspage}
+ {\RequirePackage{perpage}}
+ {\AtEndPreamble{\RequirePackage{perpage}}}
+
+% --------------------------------------------------------------------------
+% message handling
+\def\snotez@create@message#1{%
+ \ifstrequal{#1}{Error}
+ {%
+ \lowercase{\csdef{snotez@#1}}##1##2{%
+ \csuse{Package#1}{snotez}{##1}{##2}}%
+ }{%
+ \lowercase{\csdef{snotez@#1}}##1{%
+ \csuse{Package#1}{snotez}{##1}}%
+ }}
+\snotez@create@message{Error}
+\snotez@create@message{Warning}
+\snotez@create@message{WarningNoLine}
+\snotez@create@message{Info}
+
+% --------------------------------------------------------------------------
+% package options:
+\newbool{snotez@marginnote}
+\newbool{snotez@perpage}
+\newbool{snotez@footnote}
+\newbool{snotez@dblarg}
+\booltrue{snotez@dblarg}
+
+\def\snotez@note@mark@sep{\space}
+\def\snotez@note@mark@format#1{\@textsuperscript{\normalfont#1}}
+\def\snotez@format{\footnotesize}
+\def\snotez@text@mark@format#1{\@textsuperscript{\normalfont#1}}
+
+\pgfkeys{
+ snotez/.cd,
+ % all sidenotes use \marginnote:
+ marginnote/.is if = snotez@marginnote ,
+ text-format/.code = \def\snotez@format{#1} ,
+ text-format+/.code =
+ \expandafter\def\expandafter\snotez@format\expandafter{\snotez@format#1} ,
+ % make sidenotes counted per page:
+ perpage/.is if = snotez@perpage ,
+ note-mark-sep/.code = \def\snotez@note@mark@sep{#1} ,
+ note-mark-format/.code = \def\snotez@note@mark@format##1{#1} ,
+ text-mark-format/.code = \def\snotez@text@mark@format##1{#1} ,
+ % make all footnotes sidenotes:
+ footnote/.is if = snotez@footnote ,
+ dblarg/.is if = snotez@dblarg
+}
+
+\ProcessPgfOptions*
+
+\newrobustcmd\setsidenotes[1]{\pgfqkeys{/snotez}{#1}}
+
+% --------------------------------------------------------------------------
+% the \sidenote command
+\ifbool{snotez@dblarg}{
+ % syntax:
+ % - \sidenote{text}
+ % - \sidenote[mark]{text}
+ % - \sidenote[offset][mark]{text}
+ \newrobustcmd*\sidenote{%
+ \@ifnextchar[%
+ {\snotez@sidenote@aux@i}
+ {\snotez@sidenote@aux@ii{}[]}% no option
+ }
+
+ \def\snotez@sidenote@aux@i[#1]{%
+ \@ifnextchar[%
+ {\snotez@sidenote@aux@ii{#1}}% two options
+ {\snotez@sidenote@aux@ii{}[{#1}]}% one option
+ }
+}{
+ % syntax:
+ % - \sidenote{text}
+ % - \sidenote[mark]{text}
+ % - \sidenote(offset){text}
+ % - \sidenote(offset)[mark]{text}
+ \newrobustcmd*\sidenote{%
+ \@ifnextchar(%
+ {\snotez@sidenote@aux@i}% offset
+ {%
+ \@ifnextchar[
+ {\snotez@sidenote@aux@ii{}}% no offset nut mark
+ {\snotez@sidenote@aux@ii{}[]}% no offset and no mark
+ }%
+ }
+
+ \def\snotez@sidenote@aux@i(#1){%
+ \@ifnextchar[%
+ {\snotez@sidenote@aux@ii{#1}}% mark
+ {\snotez@sidenote@aux@ii{#1}[]}% no mark
+ }
+}
+
+% #1: offset
+% #2: mark
+% #3: text
+\long\def\snotez@sidenote@aux@ii#1[#2]#3{%
+ \snotez@mark{#2}%
+ \snotez@text{#1}{#3}%
+}
+
+% this one is very much \@footnotemark from latex.ltx:
+\def\snotez@write@mark#1{%
+ \leavevmode
+ \ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi
+ #1%
+ \ifhmode\spacefactor\@x@sf\fi
+ \relax
+}
+
+\def\snotez@mark#1{%
+ \ifblank{#1}% or \ifstrempty?
+ {\refstepcounter{sidenote}\protected@xdef\@the@snotez@mark{\thesidenote}}
+ {\protected@edef\@currentlabel{#1}\protected@xdef\@the@snotez@mark{#1}}%
+ \snotez@write@mark{\hbox{\snotez@text@mark@format{\@the@snotez@mark}}}%
+}
+
+\ifcsdef{c@chapter}
+ {\newcounter{sidenote}[chapter]}
+ {\newcounter{sidenote}%
+}
+
+% --------------------------------------------------------------------------
+% the \sidenotemark command
+\newrobustcmd*\sidenotemark[1][]{\snotez@mark{#1}}
+
+% --------------------------------------------------------------------------
+% the \sidenotetext command
+\ifbool{snotez@dblarg}{
+ % syntax:
+ % - \sidenotetext{text}
+ % - \sidenotetext[mark]{text}
+ % - \sidenotetext[offset][mark]{text}
+ \newrobustcmd*\sidenotetext{%
+ \@ifnextchar[%
+ {\snotez@sidenotetext@aux@i}
+ {\snotez@sidenotetext@aux@ii{}[]}% no option
+ }
+
+ \def\snotez@sidenotetext@aux@i[#1]{%
+ \@ifnextchar[%
+ {\snotez@sidenotetext@aux@ii{#1}}% two options
+ {\snotez@sidenotetext@aux@ii{}[{#1}]}% one option
+ }
+}{
+ % syntax:
+ % - \sidenotetext{text}
+ % - \sidenotetext[mark]{text}
+ % - \sidenotetext(offset){text}
+ % - \sidenotetext(offset)[mark]{text}
+ \newrobustcmd*\sidenotetext{%
+ \@ifnextchar(%
+ {\snotez@sidenotetext@aux@i}% offset
+ {%
+ \@ifnextchar[
+ {\snotez@sidenotetext@aux@ii{}}% no offset nut mark
+ {\snotez@sidenotetext@aux@ii{}[]}% no offset and no mark
+ }%
+ }
+
+ \def\snotez@sidenotetext@aux@i(#1){%
+ \@ifnextchar[%
+ {\snotez@sidenotetext@aux@ii{#1}}% mark
+ {\snotez@sidenotetext@aux@ii{#1}[]}% no mark
+ }
+}
+
+% #1: offset
+% #2: mark
+% #3: text
+\long\def\snotez@sidenotetext@aux@ii#1[#2]#3{%
+ \ifblank{#2}{}{\protected@xdef\@the@snotez@mark{#2}}%
+ \snotez@text{#1}{#3}%
+}
+
+% #1: offset
+% #2: text
+\def\snotez@text#1#2{%
+ \ifblank{#1}
+ {%
+ \snotez@marginpar{%
+ \snotez@format
+ \snotez@write@mark{\snotez@note@mark@format{\@the@snotez@mark}}%
+ \snotez@note@mark@sep#2}%
+ }
+ {%
+ \snotez@marginnote{%
+ \snotez@format
+ \snotez@write@mark{\snotez@note@mark@format{\@the@snotez@mark}}%
+ \snotez@note@mark@sep#2%
+ }[\snotez@if@nblskip{#1}{\@cdr#1\@nil\baselineskip}{#1}]%
+ }%
+}
+
+\def\snotez@if@nblskip#1{%
+ \expandafter\ifx\@car#1\@nil*%
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+}
+
+\let\snotez@marginpar\marginpar
+\let\snotez@marginnote\marginnote
+
+% --------------------------------------------------------------------------
+% process preamble options:
+\AtBeginDocument{
+ % if option `footnote=true' let \footnote to \sidenote:
+ \ifbool{snotez@footnote}
+ {
+ \let\footnote\sidenote
+ \let\footnotemark\sidenotemark
+ \let\footnotetext\sidenotetext
+ }{}
+ % if option `marginnote=true' use \marginnote for all notes:
+ \ifbool{snotez@marginnote}
+ {%
+ \let\snotez@marginpar\marginnote
+ \snotez@info{All sidenotes are now using \string\marginnote^^J
+ instead of \string\marginpar}%
+ }%
+ {}
+}
+
+\AtEndPreamble{%
+ % if option `perpage=true' count notes per page:
+ \ifbool{snotez@perpage}
+ {\MakeSortedPerPage{sidenote}}
+ {\MakeSorted{sidenote}}%
+ \@ifpackageloaded{fnpct}
+ {%
+ \ifbool{snotez@dblarg}
+ {}
+ {%
+ \snotez@error
+ {When you're using the `fnpct' package together with^^J
+ `snotez' you need to enable the `dblarg' option!}
+ {When you're using the `fnpct' package together with^^J
+ `snotez' you need to enable the `dblarg' option!}%
+ }%
+ }
+ {}%
+}
+
+\endinput
+
+% --------------------------------------------------------------------------
+% HISTORY:
+2012/11/15 v0.1 - first version
+2013/04/03 v0.2 - documentation, removed erroneous `fnpct' adaption, other
+ minor changes
+ - added update of \@currentlabel when a custom mark is used
+2013/04/21 v0.3 - try to avoid conflict with package loading order of
+ `perpage' and `zref-abspage'
+ - allow `*' syntax for offsets that are multiples of
+ \baselineskip
+ - syntax change in optional arguments; option `dblarg'
+ provides previous syntax
diff --git a/macros/latex/contrib/snotez/snotez_en.pdf b/macros/latex/contrib/snotez/snotez_en.pdf
new file mode 100644
index 0000000000..99a82c7f66
--- /dev/null
+++ b/macros/latex/contrib/snotez/snotez_en.pdf
Binary files differ
diff --git a/macros/latex/contrib/snotez/snotez_en.tex b/macros/latex/contrib/snotez/snotez_en.tex
new file mode 100644
index 0000000000..5859ff025f
--- /dev/null
+++ b/macros/latex/contrib/snotez/snotez_en.tex
@@ -0,0 +1,412 @@
+% arara: pdflatex
+% arara: biber
+% arara: pdflatex
+% arara: pdflatex
+% --------------------------------------------------------------------------
+% the SNOTEZ package
+%
+% Sidenotes for LaTeX2e
+%
+% --------------------------------------------------------------------------
+% Clemens Niederberger
+% Web: https://bitbucket.org/cgnieder/snotez/
+% E-Mail: contact@mychemistry.eu
+% --------------------------------------------------------------------------
+% Copyright 2012--2013 Clemens Niederberger
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Clemens Niederberger.
+% --------------------------------------------------------------------------
+% The snotez package consists of the files
+% - snotez.sty, snotez_en.tex, snotez_en.pdf, README
+% --------------------------------------------------------------------------
+% If you have any ideas, questions, suggestions or bugs to report, please
+% feel free to contact me.
+% --------------------------------------------------------------------------
+% in order to compile this documentation you need the document class
+% `cnpkgdoc' which you can get here:
+% https://bitbucket.org/cgnieder/cnpkgdoc/
+%
+\PassOptionsToPackage{supstfm=libertinesups}{superiors}
+\documentclass[toc=index,toc=bib,mpinclude]{cnpkgdoc}
+\setlength{\marginparwidth}{2\marginparwidth}
+\docsetup{
+ pkg={[footnote,perpage,dblarg]snotez},
+ subtitle=sidenote support for \LaTeXe
+}
+\addcmds{
+ RaggedRight,
+ sidenote,setsidenotes,superiors@spaced,
+ textsu
+}
+% Layout:
+\cnpkgusecolorscheme{friendly}
+\renewcommand*\othersectionlevelsformat[3]{%
+ \textcolor{main}{#3\autodot}\enskip}
+\renewcommand*\partformat{%
+ \textcolor{main}{\partname~\thepart\autodot}}
+\usepackage{fnpct}
+\AdaptNoteOpt\sidenote\multsidenote
+\pagestyle{headings}
+
+\usepackage[biblatex]{embrac}[2013/03/22]
+\ChangeEmph{[}[,.02em]{]}[.055em,-.08em]
+\ChangeEmph{(}[-.01em,.04em]{)}[.04em,-.05em]
+
+\robustify\snotez
+
+\usepackage{libertinehologopatch}
+\usepackage{ragged2e}
+
+\normalmarginpar
+
+% Index:
+\usepackage{imakeidx}
+\usepackage{filecontents}
+\begin{filecontents*}{\jobname.ist}
+ heading_prefix "{\\bfseries "
+ heading_suffix "\\hfil}\\nopagebreak\n"
+ headings_flag 1
+ delim_0 "\\dotfill\\hyperpage{"
+ delim_1 "\\dotfill\\hyperpage{"
+ delim_2 "\\dotfill\\hyperpage{"
+ delim_r "}\\textendash\\hyperpage{"
+ delim_t "}"
+ suffix_2p "\\nohyperpage{\\,f.}"
+ suffix_3p "\\nohyperpage{\\,ff.}"
+\end{filecontents*}
+\indexsetup{othercode=\footnotesize}
+\makeindex[options={-s \jobname.ist},intoc,columns=3]
+
+\usepackage[backend=biber,style=alphabetic]{biblatex}
+\addbibresource{\jobname.bib}
+\begin{filecontents}{\jobname.bib}
+@package{pkg:chngcntr,
+ title = {\paket*{chngcntr}},
+ author = {Peter Wilson and Will Robertson},
+ date = {2009-09-02},
+ version = {1.0a},
+ url = {http://mirror.ctan.org/macros/latex/contrib/chngcntr}
+}
+@package{pkg:etoolbox,
+ title = {\paket*{etoolbox}},
+ author = {Philipp Lehman},
+ date = {2011-01-21},
+ version = {2.1},
+ url = {http://mirror.ctan.org/macros/latex/contrib/etoolbox}
+}
+@package{pkg:fnpct,
+ title = {\paket*{fnpct}},
+ author = {Clemens Niederberger},
+ date = {2013-04-07},
+ version = {0.2k},
+ url = {http://mirror.ctan.org/macros/latex/contrib/fnpct}
+}
+@package{pkg:marginnote,
+ title = {\paket*{marginnote}},
+ author = {Markus Kohm},
+ date = {2012-03-29},
+ version = {1.1i},
+ url = {http://mirror.ctan.org/macros/latex/contrib/marginnote}
+}
+@package{cls:memoir,
+ title = {\klasse{memoir}},
+ author = {Lars Madsen and Peter Wilson},
+ date = {2011-03-06},
+ version = {3.6j patch 6.0g},
+ url = {http://mirror.ctan.org/macros/latex/contrib/memoir}
+}
+@package{pkg:perpage,
+ title = {\paket*{perpage}},
+ author = {David Kastrup},
+ date = {2006-07-15},
+ version = {1.12},
+ url = {http://mirror.ctan.org/macros/latex/contrib/perpage}
+}
+@package{pkg:pgfopts,
+ title = {\paket*{pgfopts}},
+ author = {Joseph Wright},
+ date = {2011-06-02},
+ version = {2.1},
+ url = {http://mirror.ctan.org/macros/latex/contrib/pgfopts}
+}
+@package{pkg:ragged2e,
+ title = {\paket*{ragged2e}},
+ author = {Martin Schröder},
+ date = {2009-05-21},
+ version = {2.1},
+ url = {http://mirror.ctan.org/macros/latex/contrib/ragged2e}
+}
+@package{pkg:sidenotes,
+ title = {\paket*{sidenotes}},
+ author = {Andy Thomas and Oliver Schebaum},
+ date = {2012-11-09},
+ version = {0.92},
+ url = {http://mirror.ctan.org/macros/latex/contrib/sidenotes}
+}
+@package{pkg:superiors,
+ title = {\paket*{superiors}},
+ author = {Michael Sharpe},
+ date = {2012-08-13},
+ version = {1.02},
+ url = {http://mirror.ctan.org/macros/latex/contrib/superiors}
+}
+@package{cls:tufte,
+ title = {\klasse{tufte-latex}},
+ author = {Kevin Godby and Bil Kleb and Bill Wood},
+ date = {2009-12-11},
+ version = {3.5.0},
+ url = {http://mirror.ctan.org/macros/latex/contrib/sidenotes}
+}
+\end{filecontents}
+
+\newcommand*\Default[1]{%
+ \hfill\llap{%
+ \ifblank{#1}
+ {(initially~empty)}
+ {Default:~\code{#1}}%
+ }\newline
+}
+
+\makeatletter
+\providecommand*\sinceversion[1]{%
+ \@bsphack
+ \marginnote{%
+ \footnotesize\sffamily\RaggedRight
+ \textcolor{black!75}{Introduced in version~#1}}%
+ \@esphack}
+\providecommand*\changedversion[1]{%
+ \@bsphack
+ \marginnote{%
+ \footnotesize\sffamily\RaggedRight
+ \textcolor{black!75}{Changed in version~#1}}%
+ \@esphack}
+
+\newcommand*\defaultsidenotes{%
+ \setsidenotes{
+ note-mark-format = \@textsuperscript{\normalfont##1},
+ text-format = \footnotesize
+ }}
+\setsidenotes{
+ note-mark-format=#1.,
+ text-mark-format=\textsu{\hspace*{\superiors@spaced}#1},
+ text-format+=\RaggedRight
+}
+\makeatother
+
+\begin{document}
+
+\section{License and Requirements}\label{sec:license}\secidx{License}
+\snotez is placed under the terms of the \LaTeX{} Project Public License,
+version 1.3 or later (\url{http://www.latex-project.org/lppl.txt}). It has the
+status ``maintained.''
+
+\snotez needs and loads the packages
+\paket*{etoolbox}\sidenote[*-2][]{\textcite{pkg:etoolbox}},
+\paket*{pgfopts}\sidenote[*-][]{\textcite{pkg:pgfopts}},
+\paket*{marginnote}\sidenote{\textcite{pkg:marginnote}} and
+\paket*{perpage}\sidenote{\textcite{pkg:perpage}}.
+\secidx*{License}
+
+\section{Motivation}
+This has just been an exercise on a lazy
+afternoon\sidenote[*-2][]{\url{http://www.youtube.com/watch?v=PPRiaYH1iTk}}.
+Well, more or less at least. Since there already is Andy Thomas' \paket*{sidenotes}
+package\sidenote[*-][]{\textcite{pkg:sidenotes}} there is probably
+no real need for \snotez. Moreover, the tufte classes\sidenote{\textcite{cls:tufte}}
+as well as \klasse{memoir}\sidenote{\textcite{cls:memoir}} also provide corresponding
+mechanisms. Besides the fun I had my motivation was also based on the fact that
+I didn't like some smaller things (\emph{not} bugs) done by the \paket{sidenotes}
+package such as inserting kerns and superscripted commas for multiple marks. I
+prefer to let my \paket*{fnpct}\sidenote{\textcite{pkg:fnpct}} package handle
+these things. Anyways, here it is and it seems to be working as intended so I
+don't see a reason why it shouldn't be available for use.
+
+By the way: the \paket*{fnpct} package v0.2k and later knows about \snotez and
+automatically adapts the note commands. Please note that you need to enable
+the \key{dblarg} option (see page~\pageref{key:dblarg}) when you're using
+\paket*{fnpct} together with \snotez!
+
+\section{Introduction}\secidx{Introduction}
+The \snotez Package introduces a \cmd{sidenote} command%
+\begingroup\defaultsidenotes
+\sidenote{This is an example demonstrating the default appearance.}
+\endgroup
+that typesets sidenotes the
+same way \cmd{footnote} typesets footnotes. It provides some options that allow
+formatting the appearance of the sidenotes\sidenote[*][]{In all sidenotes in this
+document the mark is typeset on the baseline and the text is set ragged right.}.
+As a default sidenotes are typeset in a \cmd{marginpar} but there are possibilities
+using Markus Kohm's \paket{marginnote}~\cite{pkg:marginnote} package as well.
+
+As with footnotes it is possible to set mark and text separately using the
+equivalent commands \cmd{sidenotemark} and \cmd{sidenotetext}, respectively.
+Instead of lots of code examples this documentation will use the \cmd{sidenote}
+macro itself extensively. It is assumend you know how to use \cmd{footnote} and
+are able to transfer your knowledge.
+\secidx*{Introduction}
+
+\section{Usage}\secidx{Usage}
+The basic usage is the very same as with \LaTeX's \cmd{footnote}, \cmd{footnotemark}
+and \cmd{footnotetext}. Unsurprisingly the presented commands are these:
+\begin{beschreibung}
+ \Befehl{sidenote}\oa{<mark>}\ma{<text>}\newline
+ The basic command. The syntax is the very same as for \cmd{footnote}.
+ \Befehl{sidenote}\oa{<offset>}\oa{<mark>}\ma{<text>}\newline
+ Actually I lied: \cmd{sidenote} has a second option that smuggles itself
+ before the \oa{<mark>} option if you use it: an argument for a vertical offset
+ that takes a length. An empty second option assumes you want the automatic
+ mark. If you use this argument the note is set with the \cmd{marginnote}
+ command\sidenote[*-3][]{From the \paket{marginnote} package}.
+ Please see its documentation\sidenote[*-2][]{For example with \texttt{texdoc
+ marginnote} on your command line.}~\cite{pkg:marginnote} for the \da{<offset>}
+ argument. \snotez only passes the value on.\par
+ \sinceversion{0.3} Actually, this is only part of the truth: while typing this
+ documentation I repeatedly found myself shifting notes by multiples of
+ \cmd{baselineskip} so the argument accepts a shortcut for this. A star \code{*}
+ followed by a (positive or negative) number denotes a multiple of \cmd{baselineskip}.
+ By the way: a positive value shifts the note \emph{down}.\par
+ When you're using the \key{dblarg}{false} option this second optional argument
+ has parentheses instead of square brackets!
+ \Befehl{sidenotemark}\oa{<text>}\newline
+ This command has the same purpose as \cmd{footnotemark} but for sidenotes.
+ \Befehl{sidenotetext}\oa{<mark>}\ma{<text>}\newline
+ The same as \cmd{footnotetext} but for sidenotes. Beware where you place it:
+ it calls \cmd{marginpar} or \cmd{marginnote} and thus determines where the
+ actual note is placed.
+ \Befehl{sidenotetext}\oa{<offset>}\oa{<mark>}\ma{<text>}\newline
+ I lied again: \cmd{sidenotetext} also has the second optional argument
+ \oa{<offset>} that again smuggles itself before the \oa{<mark>} option if you
+ use it. For details see the second description of the \cmd{sidenote} command.
+\end{beschreibung}
+
+Here is one short example of the usage.
+
+\begin{beispiel}[code only]
+ % produces a sidenote with automatic number in a
+ % \marginpar:
+ \sidenote{A note}
+
+ % produces a sidenote with mark `a' in a
+ % \marginpar:
+ \sidenote[a]{A note}
+
+ % produces a sidenote with automatic number in a
+ % \marginnote:
+ \sidenote[][]{A note}
+ % alternative syntax (dblarg=false):
+ \sidenote(){A note}
+
+ % produces a sidenote with automatic number in a
+ % \marginnote shifted down by \baselineskip:
+ \sidenote[*][]{A note}
+ % alternative syntax (dblarg=false):
+ \sidenote(*){A note}
+
+ % produces a sidenote with automatic number in a
+ % \marginnote shifted up by 2ex:
+ \sidenote[-2ex][]{A note}
+ % alternative syntax (dblarg=false):
+ \sidenote(-2ex){A note}
+
+ % produces a sidenote with mark `a' in a
+ % \marginnote shifted down by 2\baselineskip:
+ \sidenote[*2][a]{A note}
+ % alternative syntax (dblarg=false):
+ \sidenote(*2)[a]{A note}
+\end{beispiel}
+\secidx*{Usage}
+
+\section{Options}\secidx{Options}
+Although all options can be used as package option you can also set all options
+(locally) with a setup command:
+\begin{beschreibung}
+ \Befehl{setsidenotes}{<options>}
+\end{beschreibung}
+Available options are these:
+\begin{beschreibung}
+ \Option{dblarg}{\default{true}|false}\Default{true}
+ \sinceversion{0.3}\emph{This option can only be used as a package option!}
+ Prior to version~0.3 \snotez' \cmd{sidenote} and \cmd{sidenotetext} had both
+ their optional arguments with square brackets where the use of one argument
+ referred to the mark but when both were used the first argument referred to
+ the offset and the second to the mark. This syntax is kept with this option.
+ Setting it to \code{false} changes the \oa{<offset>} argument syntax into
+ \da{<offset>}.\par
+ \emph{If you're using \snotez together with the \paket*{fnpct} package~\cite{pkg:fnpct}
+ you cannot set \key{dblarg} to \code{false}. Otherwise the \da{<offset>}
+ argument get's lost!}
+ \Option{marginnote}{\default{true}|false}\Default{false}
+ Use \paket{marginnote}'s \cmd{marginnote}~\cite{pkg:marginnote} for all
+ \cmd{sidenote}s. In the default setting \cmd{sidenote} uses \cmd{marginpar}s
+ to set the sidenote unless you use the \oa{<offset>} argument. If you use
+ this option \emph{all} sidenotes are set with \cmd{marginnote}. \emph{This
+ option can only be used in the preamble}.
+ \Option{text-format}{<code>}\Default{\cmd*{footnotesize}}
+ The format of the sidenote text.
+ \Option{text-format+}{<code>}\Default{}
+ Code to be appended to the format set with \key{text-format}\sidenote{This
+ document, for example, appends \paket*{ragged2e}'s \cmd*{RaggedRight}~\cite{pkg:ragged2e}
+ to the sidenote's format.}.
+ \Option{perpage}{\default{true}|false}\Default{false}
+ Make sidenotes counter per page. \emph{This option can only be set in the
+ preamble}. It uses package \paket{perpage}'s~\cite{pkg:perpage}
+ \cmd{MakeSortedPerPage} macro for the task. Otherwise the macro
+ \cmd{MakeSorted} is used. In the default setting sidenotes are counted per
+ chapter. If you want sidenotes counted document-wise together with a class
+ that defines a counter \code{chapter} then use for example the package
+ \paket*{chngcntr}~\cite{pkg:chngcntr} and issue
+ \cmd*{counterwithout}{sidenote}\ma{chapter} after loading \snotez.
+ This documentation is an example for the use of the option.
+ \Option{note-mark-sep}{<code>}\Default{\cmd*{space}}
+ The separator between sidenote mark and sidenote text in the sidenote.
+ \Option{note-mark-format}{<code>}\Default{\cmd*{@textsuperscript}\{\cmd*{normalfont}\#1\}}
+ The format of the sidenote mark in the sidenote. Please refer to the actual
+ mark with \code{\#1}.
+ \Option{text-mark-format}{<code>}\Default{\cmd*{@textsuperscript}\{\cmd*{normalfont}\#1\}}
+ The format of the sidenote mark in the text\sidenote[*-][]{This document uses
+ Michael Sharpe's \paket*{superiors} package~\cite{pkg:superiors} and redefines
+ the mark formats to use its \cmd*{textsu} command.}. Please refer to the actual
+ mark with \code{\#1}.
+ \Option{footnote}{\default{true}|false}\Default{false}
+ Let\sidenote[*][]{In the sense of \cmd*{let}} \cmd{footnote} to be \cmd{sidenote},
+ \cmd{footnotemark} to be \cmd{sidenotemark} and \cmd{footnotetext} to be
+ \cmd{sidenotetext}. \emph{This option can only be used in the preamble}.
+\end{beschreibung}
+
+As a short example this is how the sidenotes for this document are formatted:
+\begin{beispiel}[code only]
+\setsidenotes{
+ note-mark-format=#1.,
+ text-mark-format=\textsu{\hspace*{\superiors@spaced}#1},
+ text-format+=\RaggedRight,
+ perpage=true
+}
+\end{beispiel}
+\secidx*{Options}
+
+\setlength{\linewidth}{\dimexpr\textwidth+.5\marginparwidth}
+\printbibliography
+
+\section{Implementation}
+In the following code the lines 1--30 have been omitted. They only repeat the
+license statement which has already been mentioned in section~\ref{sec:license}.
+
+\implementation[linerange={31-1000},firstnumber=31]
+
+\indexprologue{\noindent Section titles are indicated \textbf{bold}, packages
+\textsf{sans serif}, commands \code{\textbackslash\textcolor{code}{brown}}
+ and options \textcolor{key}{\code{yellow}}.\par\bigskip}
+
+\printindex
+
+\end{document} \ No newline at end of file