diff options
author | Karl Berry <karl@freefriends.org> | 2013-12-22 23:28:49 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-12-22 23:28:49 +0000 |
commit | 541b13645841c0d69202a8dadf94be7e76d715f9 (patch) | |
tree | 27916a5452ba02b3770acae1bac5d7891b7bb02a /Master/texmf-dist | |
parent | 705fdcdde3444e6e989be1f898ed8b33ceadb223 (diff) |
fnpct (22dec13)
git-svn-id: svn://tug.org/texlive/trunk@32468 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/fnpct/README | 9 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/fnpct/bigfoot_ex.tex | 48 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/fnpct/fixfoot_ex.tex | 48 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/fnpct/fnpct_en.pdf | bin | 583301 -> 590357 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/fnpct/fnpct_en.tex | 1916 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/fnpct/nested_ex.tex | 47 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/fnpct/nested_ex_a.tex | 47 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/fnpct/nested_ex_b.tex | 47 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/fnpct/nested_ex_c.tex | 47 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/fnpct/normal_ex.tex | 45 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/fnpct/pagenote_ex.tex | 48 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/fnpct/sepfootnotes_ex.tex | 50 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/fnpct/tufte_ex.tex | 36 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/fnpct/fnpct.sty | 695 |
14 files changed, 1276 insertions, 1807 deletions
diff --git a/Master/texmf-dist/doc/latex/fnpct/README b/Master/texmf-dist/doc/latex/fnpct/README index 14da7a6a9e8..3f8eb4c9f43 100644 --- a/Master/texmf-dist/doc/latex/fnpct/README +++ b/Master/texmf-dist/doc/latex/fnpct/README @@ -1,9 +1,9 @@ -------------------------------------------------------------------------- -the FNPCT package v0.2k +the FNPCT package v0.4 footnote kerning -2013/04/07 +2013/12/22 -------------------------------------------------------------------------- Clemens Niederberger Web: https://bitbucket.org/cgnieder/fnpct/ @@ -26,9 +26,6 @@ The Current Maintainer of this work is Clemens Niederberger. The fnpct package consists of the files - fnpct.sty, - fnpct_en.tex and fnpct_en.pdf - - bigfoot_ex.tex, fixfoot_ex.tex, normal_ex.tex, pagenote_ex.tex, - sepfootnotes_ex.tex, tufte_ex.tex - - nested_ex.tex, nested_ex_a.tex, nested_ex_b.tex, nested_ex_c.tex - README -------------------------------------------------------------------------- the package is inspired by the following question on TeX.SE: @@ -36,4 +33,4 @@ the package is inspired by the following question on TeX.SE: -------------------------------------------------------------------------- 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/Master/texmf-dist/doc/latex/fnpct/bigfoot_ex.tex b/Master/texmf-dist/doc/latex/fnpct/bigfoot_ex.tex deleted file mode 100644 index cb982aa2f29..00000000000 --- a/Master/texmf-dist/doc/latex/fnpct/bigfoot_ex.tex +++ /dev/null @@ -1,48 +0,0 @@ -% -------------------------------------------------------------------------- -% the FNPCT package -% -% footnote kerning -% -% 2012/05/22 -% -------------------------------------------------------------------------- -% Clemens Niederberger -% Web: https://bitbucket.org/cgnieder/fnpct/ -% E-Mail: contact@mychemistry.eu -% -------------------------------------------------------------------------- -% Copyright 2012 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. -% -------------------------------------------------------------------------- -% If you have any ideas, questions, suggestions or bugs to report, please -% feel free to contact me. -% -------------------------------------------------------------------------- -\documentclass{article} -\usepackage[ - paperwidth=.5\textwidth, - paperheight=12\baselineskip, - margin=5pt, - bottom=1.5cm]{geometry} - -\usepackage[bigfoot-default-top,multiple]{fnpct} -\usepackage{bigfoot} -\DeclareNewFootnote[para]{B}[alph] - -\begin{document} - -\noindent The three little pigs built their houses -out of straw\footnote*{not to be confused with hay% -\footnoteB{let alone grass}}, sticks\footnote{or -lumber according to some sources} and bricks% -\footnote{probably fired clay bricks;or something}. - -\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/fnpct/fixfoot_ex.tex b/Master/texmf-dist/doc/latex/fnpct/fixfoot_ex.tex deleted file mode 100644 index 628e3b41a31..00000000000 --- a/Master/texmf-dist/doc/latex/fnpct/fixfoot_ex.tex +++ /dev/null @@ -1,48 +0,0 @@ -% -------------------------------------------------------------------------- -% the FNPCT package -% -% footnote kerning -% -% 2012/05/22 -% -------------------------------------------------------------------------- -% Clemens Niederberger -% Web: https://bitbucket.org/cgnieder/fnpct/ -% E-Mail: contact@mychemistry.eu -% -------------------------------------------------------------------------- -% Copyright 2012 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. -% -------------------------------------------------------------------------- -% If you have any ideas, questions, suggestions or bugs to report, please -% feel free to contact me. -% -------------------------------------------------------------------------- -\documentclass{article} -\usepackage[ - paperwidth=.55\textwidth, - paperheight=12\baselineskip, - margin=5pt, - bottom=1.5cm]{geometry} - -\usepackage{fixfoot} -\usepackage{fnpct} - -\DeclareFixedFootnote\myfn{I'm confused: what do I want to say?} - -\begin{document} - -\noindent The three little pigs\myfn\ built their houses -out of straw\myfn*, sticks\footnote{or lumber according -to some sources} and bricks\footnote{probably fired clay -bricks}. - -\end{document} diff --git a/Master/texmf-dist/doc/latex/fnpct/fnpct_en.pdf b/Master/texmf-dist/doc/latex/fnpct/fnpct_en.pdf Binary files differindex 056a319a47c..9f9153837d6 100644 --- a/Master/texmf-dist/doc/latex/fnpct/fnpct_en.pdf +++ b/Master/texmf-dist/doc/latex/fnpct/fnpct_en.pdf diff --git a/Master/texmf-dist/doc/latex/fnpct/fnpct_en.tex b/Master/texmf-dist/doc/latex/fnpct/fnpct_en.tex index b3c55a192b5..2a403f925e5 100644 --- a/Master/texmf-dist/doc/latex/fnpct/fnpct_en.tex +++ b/Master/texmf-dist/doc/latex/fnpct/fnpct_en.tex @@ -1,7 +1,8 @@ -% arara: pdflatex +% arara: pdflatex: { shell: on } % arara: biber % arara: pdflatex % arara: pdflatex +% !arara: remove: { items: [ aux ] } % -------------------------------------------------------------------------- % the FNPCT package % @@ -36,67 +37,57 @@ % `cnpkgdoc' which you can get here: % https://bitbucket.org/cgnieder/cnpkgdoc/ % the class is licensed LPPL 1.3 or later -\RequirePackage{sepfootnotes} -\documentclass[toc=index,toc=bib]{cnpkgdoc} -\docsetup{ - pkg = fnpct , - code-box = { - backgroundcolor = gray!3!white , - skipbelow = .5\baselineskip , - skipabove = .5\baselineskip , - roundcorner = 3pt - } +\documentclass[load-preamble+]{cnltx-doc} +\usepackage{sepfootnotes,fnpct} +\setcnltx{ + package = fnpct , + authors = Clemens Niederberger , + email = contact@mychemistry.eu , + url = https://bitbucket.org/cgnieder/fnpct/ , + abstract = {The \fnpct package basically does two things to footnotes: if + footnote marks are followed by a punctuation mark the order of footnote + and punctuation mark is reversed and the kerning gets adjusted. As a side + effect a new method of creating multiple footnotes and some other features + are provided.}, + add-cmds = { + AdaptNote, + AdaptNoteMark, + innernote, + kfc, + kfp, + multfootnote, + setfnpct, + writeinnernotes + } , + add-silent-cmds = { + anote, + anotecontent, + arabic, + DeclareNewFootnote, + endnote, + footnoteB, + multendnote, + multfootcite, + multparnote, + multsidenote, + myfn, + newfootnotes, + parnote, + parnotes, + sidenote, + theendnotes, + thempfootnote, + }, + makeindex-setup = {options={-s cnltx.ist},columns=3,columnsep=1em} , + index-setup = {othercode=\footnotesize,level=\addsec} } -\usepackage[biblatex]{embrac}[2012/06/29] % v0.1a -\ChangeEmph{[}[,.02em]{]}[.055em,-.08em] -\ChangeEmph{(}[-.01em,.04em]{)}[.04em,-.05em] -\usepackage{libertinehologopatch} +\defbibheading{bibliography}[\bibname]{\addsec{#1}} \usepackage{array,booktabs} -\cnpkgcolors{ - main => cnpkgred , - key => yellow!40!brown , - module => cnpkgblue , - link => black!90 -} - -\renewcommand*\othersectionlevelsformat[3]{% - \textcolor{main}{#3\autodot}\enskip} -\renewcommand*\partformat{% - \textcolor{main}{\partname~\thepart\autodot}} - -\setkomafont{caption}{\normalfont\footnotesize\sffamily} -\setkomafont{captionlabel}{\normalfont\footnotesize\sffamily\scshape} - -\addcmds{ - AdaptNote, - AdaptNoteMark, - anote, - anotecontent, - arabic, - DeclareNewFootnote, - endnote, - footnoteB, - kfc, - kfp, - multendnote, - multfootcite, - multfootnote, - multparnote, - multsidenote, - myfn, - newfootnotes, - parnote, - parnotes, - setfnpct, - sidenote, - theendnotes, - thempfootnote, - writeinnernotes -} \setfnpct{multiple,add-punct-marks=:[0pt][-.05em]} + \usepackage{endnotes} \usepackage{parnotes} @@ -104,27 +95,10 @@ \renewcommand\thempfootnote{\arabic{mpfootnote}} -\usepackage[backend=biber,style=alphabetic]{biblatex} -\addbibresource{/data/texlive/2012/texmf-dist/doc/latex/biblatex/examples/biblatex-examples.bib} \addbibresource{\jobname.bib} - -% rudimentary solution for a `maintainer' field: -\DeclareFieldFormat{authortype}{\mkbibparens{#1}} -\renewbibmacro*{author}{% - \ifboolexpr{ - test \ifuseauthor - and - not test {\ifnameundef{author}} - } - {\printnames{author}% - \iffieldundef{authortype} - {} - {\setunit{\space}% - \usebibmacro{authorstrg}}} - {}} - +\addbibresource{biblatex-examples.bib} \usepackage{filecontents} -\begin{filecontents}{\jobname.bib} +\begin{filecontents*}{\jobname.bib} @book{bringhurst04, title = {The Elements of Typographic Style}, author = {Robert Bringhurst}, @@ -133,1064 +107,918 @@ isbn = {978-0-88179-205-5}, publisher = {Hartley \&\ Marks, Canada} } -@package{bigfoot, - title = {bigfoot}, - author = {David Kastrup}, - date = {2006-07-15}, - version = {1.25}, - url = {http://mirror.ctan.org/macros/latex/contrib/bigfoot} -} -@package{endnotes, - title = {endnotes}, - author = {Robin Fairbairns}, - authortype = {current maintainer}, - date = {2012-01-15}, - url = {http://mirror.ctan.org/macros/latex/contrib/endnotes} -} -@package{enotez, - title = {enotez}, - author = {Clemens Niederberger}, - version = {0.4}, - date = {2012-12-30}, - url = {http://mirror.ctan.org/macros/latex/contrib/enotez} -} -@package{fixfoot, - title = {fixfoot}, - author = {Robin Fairbairns}, - date = {2007-12-12}, - version = {0.3a} , - url = {http://mirror.ctan.org/macros/latex/contrib/fixfoot} -} -@package{footmisc, - title = {footmisc}, - author = {Robin Fairbairns}, - date = {2011-06-06}, - version = {5.5b}, - url = {http://mirror.ctan.org/macros/latex/contrib/footmisc} -} -@package{footnote, - title = {footnote}, - author = {Mark Wooding}, - date = {1997-01-28}, - version = {1.13}, - url = {http://mirror.ctan.org/macros/latex/contrib/footnote} -} -@package{manyfoot, - title = {manyfoot}, - author = {Alexander I. Rozhenko}, - date = {2005-09-11}, - version = {1.10}, - url = {http://mirror.ctan.org/macros/latex/contrib/manyfoot} -} -@package{parnotes, - title = {parnotes}, - author = {Micheal Hughes}, - date = {2012-03-01}, - version = {1}, - url = {http://mirror.ctan.org/macros/latex/contrib/parnotes} -} -@package{pagenote, - title = {pagenote}, - author = {Will Robertson}, - authortype = {current maintainer}, - date = {2009-09-03}, - version = {1.1a}, - url = {http://mirror.ctan.org/macros/latex/contrib/pagenote} -} -@package{sepfootnotes, - title = {sepfootnotes}, - author = {Eduardo C. Louren\c{c}o de Lima}, - date = {2013-01-17}, - version = {0.2}, - url = {http://mirror.ctan.org/macros/latex/contrib/sepfootnotes} -} -@package{sidenotes, - title = {sidenotes}, - author = {Andy Thomas}, - date = {2011-11-10}, - version = {0.80}, - url = {http://mirror.ctan.org/macros/latex/contrib/sidenotes} -} -@package{snotez, - title = {snotez}, - author = {Clemens Niederberger}, - version = {0.2}, - date = {2013-04-04}, - url = {https://www.bitbucket.org/cgnieder/snotez} -} -@package{tablefootnote, - title = {tablefootnote}, - author = {H.-Martin M\"{u}nch}, - date = {2012-01-14}, - version = {1.0g}, - url = {http://mirror.ctan.org/macros/latex/contrib/tablefootnote} -} -@package{yafoot, - title = {yafoot}, - author = {Hiroshi Nakashima}, - date = {1999-07-14}, - version = {1.0}, - url = {http://mirror.ctan.org/macros/latex/contrib/yafoot} -} -\end{filecontents} +\end{filecontents*} \AdaptNoteOpt\footcite\multfootcite -\usepackage{imakeidx} -\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] - -\newcommand\setapart[1]{% - \begin{quote} - #1 - \end{quote}} -\let\verb\lstinline - -\TitlePicture{\parbox{.75\textwidth}{The \fnpct package basically does two things -to footnotes: if footnote marks are followed by a punctuation mark the order -of footnote and punctuation mark is reversed and the kerning gets adjusted. As a -side effect a new method of creating multiple footnotes and some other features are -provided.}} - -\newcommand*\Default[1]{% - \hfill\llap - {% - \ifblank{#1}% - {(initially~empty)}% - {Default:~\code{#1}}% - }% - \newline -} +\newname\bringhurst{Robert}{Bringhurst} +\newname\lefloch{Bruno}{Le Floch} \begin{document} \section{License and Requirements} -Permission is granted to copy, distribute and/or modify this software under the -terms of the \LaTeX\ Project Public License, version 1.3 or later -(\url{http://www.latex-project.org/lppl.txt}). The package has the status -``maintained.'' +\license\ -\fnpct depends on the packages \paket*{l3kernel}, \paket*{xparse}, \paket*{l3keys2e} -and \paket*{scrlfile}. +\fnpct\ depends on the packages \bnd{l3kernel}~\cite{bnd:l3kernel}, +\pkg{xparse} and \pkg{l3keys2e} from the \bnd{l3packages} +bundle~\cite{bnd:l3packages}, \pkg{scrlfile} from the \KOMAScript\ +bundle~\cite{bnd:koma-script}, and \pkg{translations}~\cite{pkg:translations}. \section{What's it all about?} \subsection{Introduction} -The purpose of this package is to offer kerning for footnote marks, \ie the -superscripts. This is not appropriate for all superscripts. Symbols must be -handled differently than numbers. And of course the amount depends on the chosen -font. Robert Bringhurst says in \citetitle{bringhurst04}: - -\begin{zitat}[\emph{\citetitle{bringhurst04}} \cite{bringhurst04}] - Superscripts frequently come at the ends of phrases or sentences. If they are - high above the line, they can be kerned over a comma or period, but this may - endanger readability, especially if the text is set in a modest size. -\end{zitat} - -\fnpct can not make this decisions for you. It sets some initial values for the -comma and the full stop which looked good to me with the tested fonts. -Additionally it kerns the superscripts away from words when it follows directly. -The amounts of the kerning can be changed using an option. - -As a side effect \fnpct switches the order of the superscript and the following -comma or full stop. Additional punctuation marks can be added to the switching -behaviour and the amount of kerning can be set for each punctuation mark individually. - -\subsection{Basics}\secidx{basics} -The \fnpct package basically does two things to footnotes: if footnote marks are -followed by a comma or a full stop\footnote{More punctuation marks can be added -through a package option.} the order of footnote and punctuation mark is -reversed and the kerning gets adjusted. As a side effect a new method of creating -multiple footnotes\footnote{like;this} is provided, see section~\ref{sec:multiple} -for details. - -In what way is the kerning adjusted? After being placed behind the punctuation -mark the footnote mark is moved a little bit back, namely by the amount specified -with the option \key{after-punct-space} (see section~\ref{sec:options}). If the -footnote mark follows a word \emph{without} being followed by a punctuation% -\footnote{Well, it does not necessarily have to follow a \emph{word}. The important -point is \emph{not being followed} by a punctuation mark.}, there (obviously) is -no order switching and a little space is inserted before the footnote mark, namely -the amount specified by the option \key{before-footnote-space} (see section~\ref{sec:options}). - -All examples in this documentation use - -\setapart{\cmd{renewcommand}\cmd{thempfootnote}{\cmd{arabic}{mpfootnote}}.} +The purpose of this package is to offer kerning for footnote marks, \ie\ the +superscripts. This is not appropriate for all superscripts. Symbols must be +handled differently than numbers. And of course the amount depends on the +chosen font. \bringhurst\ says in \citetitle{bringhurst04}: + +\begin{cnltxquote}[\emph{\citetitle{bringhurst04}} \cite{bringhurst04}] + Superscripts frequently come at the ends of phrases or sentences. If they + are high above the line, they can be kerned over a comma or period, but this + may endanger readability, especially if the text is set in a modest size. +\end{cnltxquote} + +\fnpct\ can not make these decisions for you. It sets some initial values for +the comma and the full stop which looked good to me with the tested fonts. +Additionally it kerns the superscripts away from words when it follows +directly. The amounts of the kerning can be changed using an option. + +As a side effect \fnpct\ switches the order of the superscript and the +following comma or full stop. Additional punctuation marks can be added to +the switching behaviour and the amount of kerning can be set for each +punctuation mark individually. + +\subsection{Basics} +The \fnpct\ package basically does two things to footnotes: if footnote marks +are followed by a comma or a full stop\footnote{More punctuation marks can be + added through a package option.} the order of footnote and punctuation mark +is reversed and the kerning gets adjusted. As a side effect a new method of +creating multiple footnotes\footnote{like;this} is provided, see +section~\ref{sec:multiple} for details. + +In what way is the kerning adjusted? After being placed behind the +punctuation mark the footnote mark is moved a little bit back, namely by the +amount specified with the option \option{after-punct-space} (see +section~\ref{sec:options}). If the footnote mark follows a word +\emph{without} being followed by a punctuation\footnote{Well, it does not + necessarily have to follow a \emph{word}. The important point is \emph{not + being followed} by a punctuation mark.}, there (obviously) is no order +switching and a little space is inserted before the footnote mark, namely the +amount specified by the option \option{before-footnote-space} (see +section~\ref{sec:options}). + +\begin{sourcecode} + \renewcommand\thempfootnote{\arabic{mpfootnote}} +\end{sourcecode} Now, let's see some action: -\begin{beispiel} - \begin{minipage}{.4\linewidth} - \noindent The three little pigs built their houses - out of straw\footnote{not to be confused with hay}, - sticks\footnote{or lumber according to some sources} - and bricks\footnote{probably fired clay bricks}. - \end{minipage} -\end{beispiel} - -To ensure that the kerning is set the right way the footnote \emph{must} be placed -\emph{before} the full stop or the comma. \emph{The command can look ahead but not look back}. -This means if you place the \cmd{footnote} command after a full stop or a comma it is -treated as if following a word, \ie a thin space is inserted: effectively the opposite -of the desired behaviour. - -The order-switching can be prevented using a package option since not all countries -and languages have the same typographic conventions. In this case the full stop -and the comma are moved a bit back. +\begin{example} + \begin{minipage}{.4\linewidth} + \noindent The three little pigs built their houses + out of straw\footnote{not to be confused with hay}, + sticks\footnote{or lumber according to some sources} + and bricks\footnote{probably fired clay bricks}. + \end{minipage} +\end{example} + +To ensure that the kerning is set the right way the footnote \emph{must} be +placed \emph{before} the full stop or the comma. \emph{The command can look + ahead but not look back}. This means if you place the \cs{footnote} command +after a full stop or a comma it is treated as if following a word, \ie\ a thin +space is inserted: effectively the opposite of the desired behaviour. + +The order-switching can be prevented using a package option since not all +countries and languages have the same typographic conventions. In this case +the full stop and the comma are moved a bit back. \begin{figure}[ht] - \centering - \begin{tabular}{>{\setfnpct{dont-mess-around}}ll} - without \fnpct & with \fnpct \\ - \strut\quad text.\footnotemark[1] & \strut\quad text\footnotemark[1]. \\ - \strut\quad text\footnotemark[1]. & \setfnpct{punct-after}\strut\quad text\footnotemark[1]. - \end{tabular} - \caption{The effect of \fnpct.} + \centering + \begin{tabular}{>{\setfnpct{dont-mess-around}}ll} + without \fnpct & + with \fnpct \\ + \strut\quad text.\footnotemark[1] & + \strut\quad text\footnotemark[1]. \\ + \strut\quad text\footnotemark[1]. & + \setfnpct{punct-after}\strut\quad text\footnotemark[1]. + \end{tabular} + \caption{The effect of \fnpct.} \end{figure} -\begin{beschreibung} - \Option{punct-after}{\default{true}|false}\Default{false} - When \code{true} the punctuation sign will be placed \emph{after} the footnote. -\end{beschreibung} +\begin{options} + \keybool{punct-after}\Default{false} + When \code{true} the punctuation sign will be placed \emph{after} the + footnote. +\end{options} Like all options it can also be set using the setup command. -\begin{beschreibung} - \Befehl{setfnpct}{<options>} - Set up options. Can be used anywhere in the document. Some options can only - be set in the preamble, though. -\end{beschreibung} -\begin{beispiel} - \setfnpct{punct-after} - \begin{minipage}{.4\linewidth} - \noindent The three little pigs built their houses - out of straw\footnote{not to be confused with hay}, - sticks\footnote{or lumber according to some sources} - and bricks\footnote{probably fired clay bricks}. - \end{minipage} -\end{beispiel} -\secidx*{basics} - -\subsection{Temporarily disable or enable switching}\secidx{disable switching} -One maybe want to put some footnote marks \emph{before} the punctuation and some -after, for example because the first one describes a single word but the second -one a whole sentence. For this purpose \fnpct adds a \code{*} argument to \cmd{footnote} -and \cmd{footnotemark}. The complete new syntax now is as follows: -\begin{beschreibung} - \Befehl{footnote}*[<num>]{<footnote text>}\code{<tpunct>}\newline - new \code{*} argument added. \code{<tpunct>} is the optional trailing - punctuation mark. - \Befehl{footnotemark}*[<num>]\code{<tpunct>}\newline - new \code{*} argument added. \code{<tpunct>} is the optional trailing - punctuation mark. -\end{beschreibung} -The \code{*} argument temporarily turns off the punctuation/footnote switching. -In case you set \key{punct-after}{true} the \code{*} argument temporarily +\begin{commands} + \command{setfnpct}[\marg{options}] + Set up options. Can be used anywhere in the document. Some options can + only be set in the preamble, though. +\end{commands} +\begin{example} + \setfnpct{punct-after} + \begin{minipage}{\linewidth} + \noindent The three little pigs built + their houses out of straw\footnote{not + to be confused with hay}, sticks% + \footnote{or lumber according to some + sources} and bricks\footnote{probably + fired clay bricks}. + \end{minipage} +\end{example} + +\subsection{Temporarily disable or enable switching} +One maybe want to put some footnote marks \emph{before} the punctuation and +some after, for example because the first one describes a single word but the +second one a whole sentence. For this purpose \fnpct\ adds a \sarg\ argument +to \cs{footnote} and \cs{footnotemark}. The complete new syntax now is as +follows: +\begin{commands} + \command{footnote}[\sarg\oarg{num>}\marg{footnote text}\meta{tpunct}] + new \sarg\ argument added. \meta{tpunct} is the optional trailing + punctuation mark. + \command{footnotemark}[\sarg\oarg{num>}\meta{tpunct}] + new \sarg\ argument added. \meta{tpunct} is the optional trailing + punctuation mark. +\end{commands} +The \sarg\ argument temporarily turns off the punctuation/footnote switching. +In case you set \keyis{punct-after}{true} the \sarg\ argument temporarily \emph{enables} the switching. -\begin{beispiel} - \begin{minipage}{.4\linewidth} - \noindent The three little pigs built their houses - out of straw\footnote*{not to be confused with hay}, - sticks\footnote{or lumber according to some sources} - and bricks\footnote{probably fired clay bricks}. - \end{minipage}\hfil - \setfnpct{punct-after} - \begin{minipage}{.4\linewidth} - \noindent The three little pigs built their houses - out of straw\footnote*{not to be confused with hay}, - sticks\footnote{or lumber according to some sources} - and bricks\footnote{probably fired clay bricks}. - \end{minipage} -\end{beispiel} -\secidx*{disable switching} - -\section{Options}\secidx{options}\label{sec:options} -Most package options are listed below. They all can be set as a package option or -with the \cmd{setfnpct} command. Most of them are for adjusting the kerning. +\begin{example} + \begin{minipage}{.4\linewidth} + \noindent The three little pigs built their houses + out of straw\footnote*{not to be confused with hay}, + sticks\footnote{or lumber according to some sources} + and bricks\footnote{probably fired clay bricks}. + \end{minipage}\hfil + \setfnpct{punct-after} + \begin{minipage}{.4\linewidth} + \noindent The three little pigs built their houses + out of straw\footnote*{not to be confused with hay}, + sticks\footnote{or lumber according to some sources} + and bricks\footnote{probably fired clay bricks}. + \end{minipage} +\end{example} + +\subsection{Language Specific Settings} +Package \pkg{babel}'s~\cite{pkg:babel} French settings redefine +\cs*{@footnotemark}. \fnpct\ resets this redefinition but sets the +\option{before-footnote-space} equal to a thin space (\code{.16667em}). + +\section{Options}\label{sec:options} +Most package options are listed below. They all can be set as a package +option or with the \cs{setfnpct} command. Most of them are for adjusting the +kerning. \default{Underlined} values are set if the option is used without value. -\begin{beschreibung} - \Option{add-punct-marks}{<mark>[<space after>][<space before>]}\newline - add another punctuation mark for the position switching and spacify kerning - if necessary. An existing entry will be overwritten. This option accepts a - list of marks. - % - \Option{remove-punct-marks}{<mark>}\newline - remove punctuation mark from the kerning/position switching behaviour. This - option accepts a list of marks. - % - \Option{after-dot-space}{<dim>}\Default{-.06em} - space to be inserted after a footnote mark and before the full stop - (``footnote \emph{after} dot''). A negative space will move the full stop - further to the footnote mark. - % - \Option{after-comma-space}{<dim>}\Default{-.06em} - space to be inserted after a footnote mark and before the comma - (``footnote \emph{after} comma''). A negative space will move the comma further - to the footnote mark. - % - \Option{after-punct-space}{<dim>}\newline - set \emph{all} spaces, \ie also the ones for marks you've added with - \key{add-punct-marks}. - % - \Option{punct-after}{\default{true}|false}\Default{false} - when \code{true} the punctuation sign will be placed \emph{after} the footnote. - % - \Option{before-dot-space}{<dim>}\Default{-.16em} - space to be inserted after a footnote mark and before the full stop (``footnote - \emph{before} dot''), \ie with \key{punct-after}{true}. - % - \Option{before-comma-space}{<dim>}\Default{-.16em} - space to be inserted after a footnote mark and before the comma (``footnote - \emph{before} comma''), \ie with \key{punct-after}{true}. - % - \Option{before-punct-space}{<dim>}\newline - set \emph{all} spaces, \ie also the ones for marks you've added with - \key{add-punct-marks}. - % - \Option{before-footnote-space}{<dim>}\Default{.06em} - space to be inserted between a word and the following footnote mark. - % - \Option{dont-mess-around}{\default{true}|false}\Default{false} - sets all mentioned lengths to \code{0pt} and \key{punct-after}{true}. Basically - this seems as if you hadn't loaded \fnpct except the multiple footnote commands - and \cmd{innernote} are still available, see sections~\ref{sec:multiple} - and~\ref{sec:nested}, respectively. - % - \Option{multiple}{\default{true}|false}\Default{false} - lets \cmd{footnote} be equal to \cmd{multfootnote}. - % - \Option{mult-fn-delim}{<delimiter>}\Default{;} - sets the delimiter for the \cmd{multfootnote} command. - % - \Option{mult-fn-sep}{<separator>}\Default{,} - sets the separator between multiple footnote marks. - % - \Option{normal-marks}{\default{true}|false}\Default{false} - sets the footnote marks in the foot not as superscripts but as normal font. If - you're not using a \paket[koma-script]{KOMA-Script} class this option will load - the package \paket*{scrextend}. See section~\ref{sec:normal} for more information. - \emph{This option can only be set in the preamble}. -\end{beschreibung} +\begin{options} + \keychoice{add-punct-marks}{\meta{mark}\oarg{space after}\oarg{space before}} + Add another punctuation mark for the position switching and spacify + kerning if necessary. An existing entry will be overwritten. This option + accepts a list of marks. + % + \keyval{remove-punct-marks}{mark} + Remove punctuation mark from the kerning/position switching behaviour. + This option accepts a list of marks. + % + \keyval{after-dot-space}{dim}\Default{-.06em} + Space to be inserted after a footnote mark and before the full stop + (``footnote \emph{after} dot''). A negative space will move the full stop + further to the footnote mark. + % + \keyval{after-comma-space}{dim}\Default{-.06em} + Space to be inserted after a footnote mark and before the comma + (``footnote \emph{after} comma''). A negative space will move the comma + further to the footnote mark. + % + \keyval{after-punct-space}{dim} + Set \emph{all} spaces, \ie\ also the ones for marks you've added with + \option{add-punct-marks}. + % + \keybool{punct-after}\Default{false} + When \code{true} the punctuation sign will be placed \emph{after} the + footnote. + % + \keyval{before-dot-space}{dim}\Default{-.16em} + Space to be inserted after a footnote mark and before the full stop + (``footnote \emph{before} dot''), \ie\ with \keyis{punct-after}{true}. + % + \keyval{before-comma-space}{dim}\Default{-.16em} + space to be inserted after a footnote mark and before the comma + (``footnote \emph{before} comma''), \ie\ with \keyis{punct-after}{true}. + % + \keyval{before-punct-space}{dim} + Set \emph{all} spaces, \ie\ also the ones for marks you've added with + \option{add-punct-marks}. + % + \keyval{before-footnote-space}{dim}\Default{.06em} + Space to be inserted between a word and the following footnote mark. + % + \keybool{dont-mess-around}\Default{false} + Sets all mentioned lengths to \code{0pt} and \keyis{punct-after}{true}. + Basically this should look like as if you hadn't loaded \fnpct\ except the + multiple footnote commands and \cs{innernote} are still available, see + sections~\ref{sec:multiple} and~\ref{sec:nested}, respectively. + % + \keybool{multiple}\Default{false} + Lets \cs{footnote} be equal to \cs{multfootnote}. + % + \keyval{mult-fn-delim}{delimiter}\Default{;} + Aets the delimiter for the \cs{multfootnote} command. + % + \keyval{mult-fn-sep}{separator}\Default{,} + Sets the separator between multiple footnote marks. + % + \keybool{normal-marks}\Default{false} + Sets the footnote marks in the foot not as superscripts but as normal + font. If you're not using a \KOMAScript\ class this option will load + the package \pkg{scrextend}. See section~\ref{sec:normal} for more + information. \emph{This option can only be set in the preamble}. +\end{options} So if you want to extend the punctuation switching and kerning to other punctuation marks you can do something like this: -\begin{beispiel} - \setfnpct{add-punct-marks=!?} - \begin{minipage}{.4\linewidth} - \noindent The three little pigs built their houses - out of straw\footnote{not to be confused with hay}? - Sticks\footnote{or lumber according to some sources} - and bricks\footnote{probably fired clay bricks}! - \end{minipage} -\end{beispiel} +\begin{example} + \setfnpct{add-punct-marks=!?} + \begin{minipage}{.4\linewidth} + \noindent The three little pigs built their houses + out of straw\footnote{not to be confused with hay}? + Sticks\footnote{or lumber according to some sources} + and bricks\footnote{probably fired clay bricks}! + \end{minipage} +\end{example} Or with some additional spacing: -\begin{beispiel} - \setfnpct{add-punct-marks=![.03em]?[.03em]} - \begin{minipage}{.4\linewidth} - \noindent The three little pigs built their houses - out of straw\footnote{not to be confused with hay}? - Sticks\footnote{or lumber according to some sources} - and bricks\footnote{probably fired clay bricks}! - \end{minipage} -\end{beispiel} +\begin{example} + \setfnpct{add-punct-marks=![.03em]?[.03em]} + \begin{minipage}{.4\linewidth} + \noindent The three little pigs built their houses + out of straw\footnote{not to be confused with hay}? + Sticks\footnote{or lumber according to some sources} + and bricks\footnote{probably fired clay bricks}! + \end{minipage} +\end{example} Let's take a look at an example with some ridiculous settings: -\begin{beispiel} - % some ridiculous settings: - \setfnpct{after-punct-space=2pt,before-footnote-space=2pt} - \begin{minipage}{.4\linewidth} - \noindent The three little pigs built their houses - out of straw\footnote{not to be confused with hay}, - sticks\footnote{or lumber according to some sources} - and bricks\footnote{probably fired clay bricks}. - \end{minipage} -\end{beispiel} +\begin{example} + % some ridiculous settings: + \setfnpct{after-punct-space=2pt,before-footnote-space=2pt} + \begin{minipage}{.4\linewidth} + \noindent The three little pigs built their houses + out of straw\footnote{not to be confused with hay}, + sticks\footnote{or lumber according to some sources} + and bricks\footnote{probably fired clay bricks}. + \end{minipage} +\end{example} And now the same with switched order: -\begin{beispiel} - % some ridiculous settings: - \setfnpct{punct-after,before-punct-space=2pt,before-footnote-space=2pt} - \begin{minipage}{.4\linewidth} - \noindent The three little pigs built their houses - out of straw\footnote{not to be confused with hay}, - sticks\footnote{or lumber according to some sources} - and bricks\footnote{probably fired clay bricks}. - \end{minipage} -\end{beispiel} +\begin{example} + % some ridiculous settings: + \setfnpct{punct-after,before-punct-space=2pt,before-footnote-space=2pt} + \begin{minipage}{.4\linewidth} + \noindent The three little pigs built their houses + out of straw\footnote{not to be confused with hay}, + sticks\footnote{or lumber according to some sources} + and bricks\footnote{probably fired clay bricks}. + \end{minipage} +\end{example} In case the automatic kerning doesn't work for whatever reason the spaces are available as user commands as well: -\begin{beschreibung} - \Befehl{kfp}\newline - insert the \key{after-dot-space} or (if \key{punct-after}{true}) the - \key{before-dot-space}. - \Befehl{kfc}\newline - insert the \key{after-comma-space} or (if \key{punct-after}{true}) the - \key{before-comma-space}. -\end{beschreibung} +\begin{commands} + \command{kfp} + Insert \option{after-dot-space} or (if \keyis{punct-after}{true}) + \option{before-dot-space}. + \command{kfc} + Insert \option{after-comma-space} or (if \keyis{punct-after}{true}) + \option{before-comma-space}. +\end{commands} Some of the options are explained in a bit more detail in the next sections. -\secidx*{options} - -\section{Multiple footnotes}\secidx{multiple footnotes}\label{sec:multiple} -\subsection{Basics}\secidx[basics]{multiple footnotes} -Since multiple footnotes have to be treated differently\footnote{see these footnotes;% -for an example}, \fnpct provides an extra command for that: -\begin{beschreibung} - \Befehl{multfootnote}*{<list>;<of>;<footnotes>}\code{<tpunct>}\newline - different footnotes are separated with a semicolon. The \code{*} turns the - footnote/punctuation switching temporarily off. -\end{beschreibung} -\begin{beispiel} - \begin{minipage}{.4\linewidth} - \noindent The three little pigs built their houses - out of straw\footnote{not to be confused with hay}, - sticks\footnote{or lumber according to some sources} - and bricks\multfootnote{probably fired clay bricks;or - something else}. - \end{minipage} -\end{beispiel} - -Every of the items of the list has an optional argument equivalent to the optional -argument of \cmd{footnotetext}: -\begin{beschreibung} - \Befehl{multfootnote}{*[<mark>]<footnote text>;...} -\end{beschreibung} -\begin{beispiel} - \begin{minipage}{.4\linewidth} - \noindent The three little pigs built their houses - out of straw\footnote{not to be confused with hay}, - sticks\footnote{or lumber according to some sources} - and bricks\multfootnote{probably fired clay bricks;[5]or - something else}. - \end{minipage} -\end{beispiel} - -Additionally every item has an optional \code{*} which only invokes \cmd{footnotetext}. -This enables for example to set nested footnotes\secidx[nested footnotes]{multiple footnotes} -without disrupting the multiple setting. The following example is shown in -figure~\ref{fig:nested:mult}: -\begin{beispiel}[code only] -\documentclass{article} -\usepackage[ - paperwidth=.5\textwidth, - paperheight=12\baselineskip, - margin=5pt, - bottom=1.5cm]{geometry} -\usepackage{fnpct} - -\begin{document} +\section{Multiple footnotes}\label{sec:multiple} +\subsection{Basics} +Since multiple footnotes have to be treated differently\footnote{see these + footnotes;for an example}, \fnpct\ provides an extra command for that: +\begin{commands} + \command{multfootnote}[\sarg\Marg{\meta{list};\meta{of};\meta{footnotes}}\meta{tpunct}] + Different footnotes are separated with a semicolon. The \sarg\ turns the + footnote/punctuation switching temporarily off. +\end{commands} +\begin{example} + \begin{minipage}{.4\linewidth} + \noindent The three little pigs built their houses + out of straw\footnote{not to be confused with hay}, + sticks\footnote{or lumber according to some sources} + and bricks\multfootnote{probably fired clay bricks;or + something else}. + \end{minipage} +\end{example} + +Every of the items of the list has an optional argument equivalent to the +optional argument of \cs{footnotetext}: +\begin{commands} + \command{multfootnote}[\Marg{\sarg\oarg{mark}\meta{footnote text};\ldots}] + The syntax of \cs{multfootnote}'s footnote text argument. +\end{commands} +\begin{example} + \begin{minipage}{.4\linewidth} + \noindent The three little pigs built their houses + out of straw\footnote{not to be confused with hay}, + sticks\footnote{or lumber according to some sources} + and bricks\multfootnote{probably fired clay bricks;[5]or + something else}. + \end{minipage} +\end{example} + +Additionally every item has an optional \sarg\ which only invokes +\cs{footnotetext}. This enables for example to set nested footnotes without +disrupting the multiple setting. The following example is shown in +figure~\ref{fig:nested:mult}: +\begin{example}[compile,float,caption={Nested footnotes.\label{fig:nested:mult}}] + \documentclass{article} + \usepackage[ + paperwidth=.5\textwidth, + paperheight=12\baselineskip, + margin=5pt, + bottom=1.5cm]{geometry} + + \usepackage{fnpct} + + \begin{document} \noindent The three little pigs built their houses out of straw\footnote{not to be confused with hay}, sticks\footnote{or lumber according to some sources} and bricks\multfootnote{probably fired clay bricks% \footnotemark;*or something else;what do I know}. -\end{document} -\end{beispiel} - -\begin{figure}[h] - \centering - \fbox{\includegraphics{nested_ex.pdf}} - \caption{nested footnotes}\label{fig:nested:mult} -\end{figure} - -\subsection{The delimiter and separator}\secidx[delimiter]{multiple footnotes}\secidx[separator]{multiple footnotes} -Since the semicolon might be part of the footnote text you might have some trouble. -But there are ways around. Maybe try enclosing it in braces: -\begin{beispiel} - \begin{minipage}{.4\linewidth} - \noindent The three little pigs built their houses - out of straw\footnote{not to be confused with hay}, - sticks\footnote{or lumber according to some sources} - and bricks\multfootnote{probably fired clay bricks{;} - or something else;what do I know}. - \end{minipage} -\end{beispiel} + \end{document} +\end{example} + +\subsection{The delimiter and separator} +Since the semicolon might be part of the footnote text you might have some +trouble. But there are ways around. Maybe try enclosing it in braces: +\begin{example} + \begin{minipage}{.4\linewidth} + \noindent The three little pigs built their houses + out of straw\footnote{not to be confused with hay}, + sticks\footnote{or lumber according to some sources} + and bricks\multfootnote{probably fired clay bricks{;} + or something else;what do I know}. + \end{minipage} +\end{example} There also are options which lets you choose the (input) delimiter and the (output) separator: -\begin{beschreibung} - \Option{mult-fn-delim}{<delimiter>}\Default{;} - choose delimiter for the \cmd{multfootnote}. - \Option{mult-fn-sep}{<separator>}\Default{,} - choose the separator that is put between footnote marks. -\end{beschreibung} -\begin{beispiel} - \setfnpct{mult-fn-delim=//,mult-fn-sep=;} - \begin{minipage}[t]{.4\linewidth} - \noindent The three little pigs built their houses - out of straw\footnote{not to be confused with hay}, - sticks\footnote{or lumber according to some sources} - and bricks\multfootnote{probably fired clay bricks; - or something else//what do I know}. - \end{minipage}\hfil - \setfnpct{mult-fn-delim=;,mult-fn-sep=} - \renewcommand*\thempfootnote{\fnsymbol{mpfootnote}} - \begin{minipage}[t]{.4\linewidth} - \noindent The three little pigs built their houses - out of straw\footnote{not to be confused with hay}, - sticks\footnote{or lumber according to some sources} - and bricks\multfootnote{probably fired clay bricks; - or something else}. - \end{minipage} -\end{beispiel} - -\subsection{Automagic}\secidx[automagic]{multiple footnotes} -If you want you can turn all footnotes into \cmd{multfootnote}s. -\begin{beschreibung} - \Option{multiple}{\default{true}|false}\Default{false} - let \cmd{footnote} behave like \cmd{multfootnote}. \emph{This option can only - be set in the preamble}. -\end{beschreibung} -\begin{beispiel} - % in preamble: \setfnpct{multiple} - % or \usepackage[multiple]{fnpct} - \begin{minipage}{.4\linewidth} - \noindent The three little pigs built their houses - out of straw\footnote{not to be confused with hay}, - sticks\footnote{or lumber according to some sources} - and bricks\footnote{probably fired clay bricks;or - something else}. - \end{minipage} -\end{beispiel} -\secidx*{multiple footnotes} - -\section{Nested Footnotes}\secidx{nested footnotes}\label{sec:nested} -\fnpct provides preliminary support for nested footnotes. There are some restrictions, -though. The command below can be used inside \cmd{footnote} and \cmd{multfootnote}, -but not inside another \cmd{innernote}. \cmd{innernote} really is a ``inner -footnote'', it doesn't work with endnotes, for example. -\begin{beschreibung} - \Befehl{innernote}*[<mark>]{<text>}\code{<tpunct>}\newline - a nested footnote. -\end{beschreibung} -The inner node uses a \cmd{footnotemark} internally and the mark will be set with -the definition it has at begin document. +\begin{options} + \keyval{mult-fn-delim}{delimiter}\Default{;} + Choose delimiter for the \cs{multfootnote}. + \keyval{mult-fn-sep}{separator}\Default{,} + Choose the separator that is put between footnote marks. +\end{options} +\begin{example} + \setfnpct{mult-fn-delim=//,mult-fn-sep=;} + \begin{minipage}[t]{.4\linewidth} + \noindent The three little pigs built their houses + out of straw\footnote{not to be confused with hay}, + sticks\footnote{or lumber according to some sources} + and bricks\multfootnote{probably fired clay bricks; + or something else//what do I know}. + \end{minipage}\hfil + \setfnpct{mult-fn-delim=;,mult-fn-sep=} + \renewcommand*\thempfootnote{\fnsymbol{mpfootnote}} + \begin{minipage}[t]{.4\linewidth} + \noindent The three little pigs built their houses + out of straw\footnote{not to be confused with hay}, + sticks\footnote{or lumber according to some sources} + and bricks\multfootnote{probably fired clay bricks; + or something else}. + \end{minipage} +\end{example} + +\subsection{Automagic} +If you want you can turn all footnotes into \cs{multfootnote}s. +\begin{options} + \keybool{multiple}\Default{false} + Let \cs{footnote} behave like \cs{multfootnote}. \emph{This option can + only be set in the preamble}. +\end{options} +\begin{example} + % in preamble: \setfnpct{multiple} + % or \usepackage[multiple]{fnpct} + \begin{minipage}{.4\linewidth} + \noindent The three little pigs built their houses + out of straw\footnote{not to be confused with hay}, + sticks\footnote{or lumber according to some sources} + and bricks\footnote{probably fired clay bricks;or + something else}. + \end{minipage} +\end{example} + +\section{Nested Footnotes}\label{sec:nested} +\fnpct\ provides preliminary support for nested footnotes. There are some +restrictions, though. The command below can be used inside \cs{footnote} and +\cs{multfootnote}, but not inside another \cs{innernote}. \cs{innernote} +really is a ``inner footnote'', it doesn't work with endnotes, for example. +\begin{commands} + \command{innernote}[\sarg\oarg{mark}\marg{text}\meta{tpunct}] + A nested footnote. +\end{commands} +The inner node uses a \cs{footnotemark} internally and the mark will be set +with the definition it has at begin document. The output of the following code can be seen in figure~\ref{fig:nested:a}. -\begin{beispiel}[code only] -\documentclass{article} -\usepackage[ - paperwidth=.5\textwidth, - paperheight=12\baselineskip, - margin=5pt, - bottom=1.5cm]{geometry} - -\usepackage{fnpct} - -\begin{document} +\begin{example}[compile,float,caption={\cs*{innernote} example (a)\label{fig:nested:a}}] + \documentclass{article} + \usepackage[ + paperwidth=.5\textwidth, + paperheight=12\baselineskip, + margin=5pt, + bottom=1.5cm]{geometry} + + \usepackage{fnpct} + + \begin{document} \noindent The three little pigs built their houses out of straw\footnote{not to be confused with hay}, sticks\footnote{or lumber according to some sources} and bricks\footnote{probably fired clay bricks% - \innernote{or not}}. -\end{document} -\end{beispiel} - -\begin{figure}[h] - \centering - \fbox{\includegraphics{nested_ex_a.pdf}} - \caption{\cmd{innernote} example (a)} - \label{fig:nested:a} -\end{figure} - -This is especially useful if you have more than one additional footnote inside a -footnote, a case that can't be solved in a satisfying (\ie automatic) way with the -method mentioned in section~\ref{sec:multiple}. See figure~\ref{fig:nested:b} for -the output of this code: -\begin{beispiel}[code only] -\documentclass{article} -\usepackage[ - paperwidth=.5\textwidth, - paperheight=12\baselineskip, - margin=5pt, - bottom=1.5cm]{geometry} - -\usepackage{fnpct} - -\begin{document} + \innernote{or not}}. + \end{document} +\end{example} + +This is especially useful if you have more than one additional footnote inside +a footnote, a case that can't be solved in a satisfying (\ie\ automatic) way +with the method mentioned in section~\ref{sec:multiple}. See +figure~\ref{fig:nested:b} for the output of this code: +\begin{example}[compile,float,caption={\cs*{innernote} example (b)\label{fig:nested:b}}] + \documentclass{article} + \usepackage[ + paperwidth=.5\textwidth, + paperheight=12\baselineskip, + margin=5pt, + bottom=1.5cm]{geometry} + + \usepackage{fnpct} + + \begin{document} \noindent The three little pigs built their houses out of straw\footnote{not to be confused with hay}, sticks\footnote{or lumber according to some sources} and bricks\footnote{probably\innernote{just guessing} - fired clay bricks\innernote{or not}}. -\end{document} -\end{beispiel} - -\begin{figure}[h] - \centering - \fbox{\includegraphics{nested_ex_b.pdf}} - \caption{\cmd{innernote} example (b)} - \label{fig:nested:b} -\end{figure} - -\cmd{innernote} can also be used to escape minipages. In this case use -\cmd{innernote} as a replacement for \cmd{footnote} and call this command -later: -\begin{beschreibung} - \Befehl{writeinnernotes}\newline - writes all \cmd{footnotetext}s to the inner footnotes when invoked. This is - usually done automatically by the \cmd{footnote} command but there are - possible needs for it. -\end{beschreibung} + fired clay bricks\innernote{or not}}. + \end{document} +\end{example} + +\cs{innernote} can also be used to escape minipages. In this case use +\cs{innernote} as a replacement for \cs{footnote} and call this command later: +\begin{commands} + \command{writeinnernotes} + Writes all \cs{footnotetext}s to the inner footnotes when invoked. This + is usually done automatically by the \cs{footnote} command but there are + possible needs for it. +\end{commands} See figure~\ref{fig:nested:c} for the output of the following code: -\begin{beispiel}[code only] -\documentclass{article} -\usepackage[ - paperwidth=.5\textwidth, - paperheight=12\baselineskip, - margin=5pt, - bottom=1.5cm]{geometry} - -\usepackage{fnpct} - -\begin{document} -\noindent\fbox{% -\begin{minipage}{.9\linewidth} - The three little pigs built their houses - out of straw\innernote{not to be confused with hay}, - sticks\innernote{or lumber according to some sources} - and bricks\innernote{probably}. -\end{minipage}}\writeinnernotes - -\end{document} -\end{beispiel} -\begin{figure}[h] - \centering - \fbox{\includegraphics{nested_ex_c.pdf}} - \caption{\cmd{innernote} example (c)} - \label{fig:nested:c} -\end{figure} -\secidx*{nested footnotes} - -\section{Normal notes}\secidx{normal notes}\label{sec:normal} -The package option \key{normal-marks} (see p.\,\pageref{key:normal-marks}) changes -the layout of the footnote marks in the foot by using \paket[koma-script]{KOMA-Script}'s - -\setapart{\cmd{deffootnote}[<mark indent>]{<indent>}\ma{<par indent>}\ma{<format code>}.} +\begin{example}[compile,float,caption={\cs*{innernote} example (c)\label{fig:nested:c}}] + \documentclass{article} + \usepackage[ + paperwidth=.5\textwidth, + paperheight=12\baselineskip, + margin=5pt, + bottom=1.5cm]{geometry} + + \usepackage{fnpct} + + \begin{document} + \noindent\fbox{% + \begin{minipage}{.9\linewidth} + The three little pigs built their houses + out of straw\innernote{not to be confused with hay}, + sticks\innernote{or lumber according to some sources} + and bricks\innernote{probably}. + \end{minipage}}\writeinnernotes + \end{document} +\end{example} + +\section{Normal notes}\label{sec:normal} +The package option \option{normal-marks} (see p.\,\pageref{key:normal-marks}) +changes the layout of the footnote marks in the foot by using \KOMAScript's +\cs{deffootnote} command: +\begin{commands} + \command{deffootnote}[\oarg{mark indent}\marg{indent}\marg{par + indent}\marg{format code}] + \KOMAScript's command to define the output of the footnote text in the + foot. +\end{commands} The following code is shown in figure~\ref{fig:normal}. -\begin{beispiel}[code only] -\documentclass{article} -\usepackage[ - paperwidth=.5\textwidth, - paperheight=12\baselineskip, - margin=5pt, - bottom=1.5cm]{geometry} - -\usepackage[normal-marks]{fnpct} - -\begin{document} - -\noindent The three little pigs built their houses -out of straw\footnote{not to be confused with hay}, -sticks\footnote{or lumber according to some sources} -and bricks\footnote{probably fired clay bricks}. - -\end{document} -\end{beispiel} - -\begin{figure}[h] - \centering - \fbox{\includegraphics{normal_ex.pdf}} - \caption{Demonstration of the \key{normal-marks} option.} - \label{fig:normal} -\end{figure} - -The three indent values used by \fnpct can be changed with the following options: -\begin{beschreibung} - \Option{normal-mark-width}{<dim>}\Default{1em} - The width of the box within which the marks are set. - \Option{normal-indent}{<dim>}\Default{1.5em} - The indent of each footnote line \emph{except} the first. - \Option{normal-par-indent}{<dim>}\Default{1em} - Additional indent of a new paragraph inside the footnote text. -\end{beschreibung} -\secidx*{normal notes} - -\section{Other packages}\secidx{other packages}\label{sec:other:packages} -\fnpct tries its best to support other footnote and related packages\footnote{If -you find some package missing please let me know.}. Each of the following subsections -is dedicated to one of these packages and if and how they work together with \fnpct. -Fortunately most of them do quite well. - -\subsection{bigfoot}\label{ssec:bigfoot}\secidx[bigfoot]{other packages} -The \paket{bigfoot}~\cite{bigfoot} package extends the possibilities of the -\paket{manyfoot} package~\cite{manyfoot} (see section~\ref{ssec:manyfoot}). The -main visible feature is to use different classes of footnotes which are typeset -in different apparatus on the bottom of the page. - -\fnpct is compatible with \paket{bigfoot}. You need to be a bit cautious, though. -You need to - -\setapart{declare footnotes with \cmd{DeclareNewFootnote} \emph{after} loading \fnpct - but in the document \emph{preamble}.} - -\emph{Also verbatim material won't work inside footnotes anymore}. But you can of -course use Bruno Le Floch's \paket{cprotect} if you really need verbatim material -in footnotes \emph{and} want to use \fnpct. Since \fnpct does not redefine any -\cmd{footnotetext} like command it will still work inside one of them. - -For every footnote class defined with \cmd{DeclareNewFootnote} the commands -\cmd{footnote<class>} and \cmd{footnotemark<class>} are redefined with the starred -variant and a \cmd{multfootnote<class>} is defined. The \key{multiple} option -will turn all \cmd{footnote<class>} commands into the corresponding -\cmd{multfootnote<class>}. - -\fnpct has an additional package option which \emph{cannot} be set with \cmd{setfnpct} -and only has any effects if \paket{bigfoot} has been loaded: -\begin{beschreibung} - \option{bigfoot-default-top}{\default{true}|false} sets the \code{default} footnote - class as top layer. Default = \code{false} -\end{beschreibung} - -Since this document cannot easily combine \emph{every} footnote package at the same -time for demonstration purposes the following code is shown in figure~\ref{fig:bigfoot}: -\begin{beispiel}[code only] -\documentclass{article} -\usepackage[ - paperwidth=.5\textwidth, - paperheight=12\baselineskip, - margin=5pt, - bottom=1.5cm]{geometry} - -\usepackage{bigfoot} -\usepackage[bigfoot-default-top]{fnpct} -\setfnpct{multiple} -\DeclareNewFootnote[para]{B}[alph] - -\begin{document} - -\noindent The three little pigs built their houses -out of straw\footnote*{not to be confused with hay% -\footnoteB{let alone grass}}, sticks\footnote{or -lumber according to some sources} and bricks% -\footnote{probably fired clay bricks;or something}. - -\end{document} -\end{beispiel} - -\begin{figure}[h] - \centering - \fbox{\includegraphics{bigfoot_ex.pdf}} - \caption{\paket*{bigfoot} example} - \label{fig:bigfoot} -\end{figure} - -\subsection{endnotes}\secidx[endnotes]{other packages} -The \paket{endnotes}~\cite{endnotes} package povides the commands \cmd{endnote} -and \cmd{endnotemark} which can be used to output all notes at the end of a chapter, -say. - -If the package is loaded both commands are adapted\footnote*{see section~\ref{sec:adapt} -on manual adaption}: -\begin{beispiel}[code only] - % `fnpct' does this for you: - \AdaptNote\endnote\multendnote - \AdaptNoteMark\endnotemark -\end{beispiel} - -Everything else stays the same: -\begin{beispiel} - \begin{minipage}[t]{.4\linewidth} +\begin{example}[compile,float,caption={Demonstration of the + \option*{normal-marks} option.\label{fig:normal}}] + \documentclass{article} + \usepackage[ + paperwidth=.5\textwidth, + paperheight=12\baselineskip, + margin=5pt, + bottom=1.5cm]{geometry} + + \usepackage[normal-marks]{fnpct} + + \begin{document} + \noindent The three little pigs built their houses - out of straw\endnote{not to be confused with hay}, - sticks\endnote{or lumber according to some sources} - and bricks\endnote{probably fired clay bricks}. + out of straw\footnote{not to be confused with hay}, + sticks\footnote{or lumber according to some sources} + and bricks\footnote{probably fired clay bricks}. + + \end{document} +\end{example} + +The three indent values used by \fnpct\ can be changed with the following +options: +\begin{options} + \keyval{normal-mark-width}{dim}\Default{1em} + The width of the box within which the marks are set. + \keyval{normal-indent}{dim}\Default{1.5em} + The indent of each footnote line \emph{except} the first. + \keyval{normal-par-indent}{dim}\Default{1em} + Additional indent of a new paragraph inside the footnote text. +\end{options} + +\section{Other packages}\label{sec:other:packages} +\fnpct\ tries its best to support other footnote and related +packages\footnote{If you find some package missing please let me know.}. Each +of the following subsections is dedicated to one of these packages and if and +how they work together with \fnpct. Fortunately most of them do quite well. + +\subsection{bigfoot}\label{ssec:bigfoot} +The \pkg{bigfoot}~\cite{pkg:bigfoot} package extends the possibilities of the +\pkg{manyfoot} package~\cite{pkg:manyfoot} (see section~\ref{ssec:manyfoot}). +The main visible feature is to use different classes of footnotes which are +typeset in different apparatus on the bottom of the page. + +\fnpct\ is compatible with \pkg{bigfoot}. You need to be a bit cautious, +though. You need to \emph{declare footnotes with \cs*{DeclareNewFootnote} + \emph{after} loading \fnpct\ but in the document \emph{preamble}.} + +\emph{Also verbatim material won't work inside footnotes anymore}. But you +can of course use \lefloch's \pkg{cprotect}~\cite{pkg:cprotect} if you really +need verbatim material in footnotes \emph{and} want to use \fnpct. Since +\fnpct\ does not redefine any \cs{footnotetext} like command it will still +work inside one of them. + +For every footnote class defined with \cs*{DeclareNewFootnote} the commands +\cs*{footnote\meta{class}} and \cs*{footnotemark\meta{class}} are redefined +with the starred variant and a \cs*{multfootnote\meta{class}} is defined. The +\option{multiple} option will turn all \cs*{footnote\meta{class}} commands +into the corresponding \cs*{multfootnote\meta{class}}. + +\fnpct\ has an additional package option which \emph{cannot} be set with +\cs{setfnpct} and only has any effects if \pkg{bigfoot} has been loaded: +\begin{options} + \keybool{bigfoot-default-top}\Default{false} + Sets the \code{default} footnote class as top layer. +\end{options} + +Since this document cannot easily combine \emph{every} footnote package at the +same time for demonstration purposes the following code is shown in +figure~\ref{fig:bigfoot}: +\begin{example}[compile,float,caption={\pkg*{bigfoot} example\label{fig:bigfoot}}] + \documentclass{article} + \usepackage[ + paperwidth=.5\textwidth, + paperheight=12\baselineskip, + margin=5pt, + bottom=1.5cm]{geometry} + + \usepackage{bigfoot} + \usepackage[bigfoot-default-top]{fnpct} + \setfnpct{multiple} + \DeclareNewFootnote[para]{B}[alph] + + \begin{document} - \theendnotes - \end{minipage}\hfil - \begin{minipage}[t]{.4\linewidth} \noindent The three little pigs built their houses - out of straw\endnote*{not to be confused with hay}, - sticks\endnote{or lumber according to some sources} - and bricks\multendnote{probably fired clay bricks;or - something else}. + out of straw\footnote*{not to be confused with hay% + \footnoteB{let alone grass}}, sticks\footnote{or + lumber according to some sources} and bricks% + \footnote{probably fired clay bricks;or something}. - \theendnotes - \end{minipage} -\end{beispiel} + \end{document} +\end{example} + +\subsection{endnotes} +The \pkg{endnotes}~\cite{pkg:endnotes} package povides the commands +\cs{endnote} and \cs{endnotemark} which can be used to output all notes at the +end of a chapter, say. + +If the package is loaded both commands are adapted\footnote*{see + section~\ref{sec:adapt} on manual adaption}: +\begin{sourcecode} + % `fnpct' does this for you: + \AdaptNote\endnote\multendnote + \AdaptNoteMark\endnotemark +\end{sourcecode} -\subsection{enotez}\secidx[enotez]{other packages} -The \paket{enotez}~\cite{enotez} package povides the command \cmd{endnote} +Everything else stays the same: +\begin{example} + \begin{minipage}[t]{.4\linewidth} + \noindent The three little pigs built their houses + out of straw\endnote{not to be confused with hay}, + sticks\endnote{or lumber according to some sources} + and bricks\endnote{probably fired clay bricks}. + + \theendnotes + \end{minipage}\hfil + \begin{minipage}[t]{.4\linewidth} + \noindent The three little pigs built their houses + out of straw\endnote*{not to be confused with hay}, + sticks\endnote{or lumber according to some sources} + and bricks\multendnote{probably fired clay bricks;or + something else}. + + \theendnotes + \end{minipage} +\end{example} + +\subsection{enotez} +The \pkg{enotez}~\cite{pkg:enotez} package povides the command \cs{endnote} which can be used to output all notes at the end of a chapter, say. -If the package is loaded the command is adapted\footnote*{see section~\ref{sec:adapt} -on manual adaption}: -\begin{beispiel}[code only] - % `fnpct' does this for you: - \AdaptNote\endnote\multendnote -\end{beispiel} - -\subsection{fixfoot}\secidx[fixfoot]{other packages} -The \paket{fixfoot}~\cite{fixfoot} package provides a possibility to create repeating -footnotes. \fnpct supports this package provided you take care of the following: - -\setapart{Use \cmd{DeclareFixedFootnote} only in the preamble but \emph{after} loading - \fnpct.} - -\cmd{DeclareFixedFootnote}{\cmd{cs}}\ma{<footnote text>} is used to store the -\ma{<footnote text>} in \cmd{cs} which in turn creates a footnote mark for it but -doesn't repeat the footnote text on the same page in the bottom. The document needs -several runs to get all the numbers and footnotes right. - -Every fixed footnote declared with \cmd{DeclareFixedFootnote} gets an optional -\code{*} to prevent the punctuation switching. \emph{There is \emph{no} mult-variant -of the fixed notes!} - -Since this document cannot easily combine \emph{every} footnote package at the same -time for demonstration purposes the following code is shown in figure~\ref{fig:fixfoot}: -\begin{beispiel}[code only] -\documentclass{article} -\usepackage[ - paperwidth=.55\textwidth, - paperheight=12\baselineskip, - margin=5pt, - bottom=1.5cm]{geometry} +If the package is loaded the command is adapted\footnote*{see + section~\ref{sec:adapt} on manual adaption}: +\begin{sourcecode} + % `fnpct' does this for you: + \AdaptNote\endnote\multendnote +\end{sourcecode} + +\subsection{fixfoot} +The \pkg{fixfoot}~\cite{pkg:fixfoot} package provides a possibility to create +repeating footnotes. \fnpct\ supports this package provided you take care of +the following: + +\emph{Use \cs{DeclareFixedFootnote} only in the preamble but \emph{after} + loading \fnpct.} + +\cs*{DeclareFixedFootnote}\Marg{\cs*{cs}}\marg{footnote text} is used to store +the \meta{footnote text} in \cs*{cs} which in turn creates a footnote mark for +it but doesn't repeat the footnote text on the same page in the bottom. The +document needs several runs to get all the numbers and footnotes right. + +Every fixed footnote declared with \cs{DeclareFixedFootnote} gets an optional +\sarg\ to prevent the punctuation switching. \emph{There is \emph{no} + mult-variant of the fixed notes!} + +Since this document cannot easily combine \emph{every} footnote package at the +same time for demonstration purposes the following code is shown in +figure~\ref{fig:fixfoot}: +\begin{example}[compile,float,caption={\pkg*{fixfoot} + example\label{fig:fixfoot}}] + \documentclass{article} + \usepackage[ + paperwidth=.55\textwidth, + paperheight=12\baselineskip, + margin=5pt, + bottom=1.5cm]{geometry} + + \usepackage{fixfoot} + \usepackage{fnpct} -\usepackage{fixfoot} -\usepackage{fnpct} - -\DeclareFixedFootnote{\myfn}{I'm confused: what do I want to say?} - -\begin{document} - -\noindent The three little pigs\myfn\ built their houses -out of straw\myfn*, sticks\footnote{or lumber according -to some sources} and bricks\footnote{probably fired clay -bricks}. - -\end{document} -\end{beispiel} - -\begin{figure}[h] - \centering - \fbox{\includegraphics{fixfoot_ex.pdf}} - \caption{\paket*{fixfoot} example} - \label{fig:fixfoot} -\end{figure} - -\subsection{footmisc}\label{ssec:manyfoot}\secidx[footmisc]{other packages} -The \paket{footmisc} package~\cite{footmisc} provides a range of options to customize -footnotes, for example output them as margin notes or count footnotes per page. - -Testing showed no incompatibilities with \paket{footmisc}. The only thing is that -you won't have to (and shouldn't) use its \code{multiple} option. - -\subsection{footnote}\secidx[footnote]{other packages} -Unfortunately \fnpct is not compatible with the \paket{footnote} package~\cite{footnote}. -Or more precisely it is not compatible if the command pair \cmd{savenotes}/\cmd{spewnotes} -is invoked. This disables \paket{footnote}'s environments as well as its environment -escaping mechanism through \cmd{makesavenoteenv}. - -\subsection{manyfoot}\secidx[manyfoot]{other packages} -The \paket{manyfoot} package~\cite{manyfoot} is not and will not directly be -supported. It is loaded by \paket{bigfoot} (see section~\ref{ssec:bigfoot}), anyway. + \DeclareFixedFootnote{\myfn}{I'm confused: what do I want to say?} + + \begin{document} + + \noindent The three little pigs\myfn\ built their houses + out of straw\myfn*, sticks\footnote{or lumber according + to some sources} and bricks\footnote{probably fired clay + bricks}. + + \end{document} +\end{example} + +\subsection{footmisc}\label{ssec:manyfoot} +The \pkg{footmisc} package~\cite{pkg:footmisc} provides a range of options to +customize footnotes, for example output them as margin notes or count +footnotes per page. + +Testing showed no incompatibilities with \pkg{footmisc}. The only thing is +that you won't have to (and shouldn't) use its \option{multiple} option. + +\subsection{footnote} +Unfortunately \fnpct\ is not compatible with the \pkg{footnote} +package~\cite{pkg:footnote}. Or more precisely it is not compatible if the +command pair \cs*{savenotes}/\cs*{spewnotes} is invoked. This disables +\pkg{footnote}'s environments as well as its environment escaping mechanism +through \cs{makesavenoteenv}. + +\subsection{manyfoot} +The \pkg{manyfoot} package~\cite{pkg:manyfoot} is not and will not directly be +supported. It is loaded by \pkg{bigfoot} (see section~\ref{ssec:bigfoot}), anyway. And since the latter states in its documentation -\begin{zitat}[David Kastrup~\textup{\cite{bigfoot}}] - Purpose of this package is to provide a one-stop solution to almost all problems - related to footnotes. You can use it as a drop-in replacement of the `\paket{manyfoot}' - package, but without many of its shortcomings, and quite a few features of its - own. -\end{zitat} +\begin{cnltxquote}[David Kastrup~\textup{\cite{pkg:bigfoot}}] + Purpose of this package is to provide a one-stop solution to almost all + problems related to footnotes. You can use it as a drop-in replacement of + the `\pkg{manyfoot}' package, but without many of its shortcomings, and + quite a few features of its own. +\end{cnltxquote} you should probably prefer it anyway. If it is \emph{really} wanted by users I might change my opinion, though \ldots -\subsection{pagenote}\secidx[pagenote]{other packages} -The package \paket{pagenote}~\cite{pagenote} is supported and its \cmd{pagenote} -command is treated the same way as all other note commands: it got an optional -\code{*} argument and an additional \cmd{multpagenote} is defined. - -\subsection{parnotes}\secidx[parnotes]{other packages} -The function of the package \paket{parnotes}~\cite{parnotes} is similar to the -\paket{endnotes} package. basically it allows to output the footnote text after -a paragraph, either by using a special environment or by invoking \cmd{parnotes}. - -If \paket{parnotes} is loaded \fnpct extends its functionality analogous -to the one of \paket{endnotes}. - -Again the \key{multiple} option turns all \cmd{parnote}s into \cmd{multparnote}s. -\begin{beispiel} - \begin{minipage}[t]{.4\linewidth} - \noindent The three little pigs built their houses - out of straw\parnote{not to be confused with hay}, - sticks\parnote{or lumber according to some sources} - and bricks\parnote{probably fired clay bricks}. - - \parnotes - \end{minipage}\hfil - \begin{minipage}[t]{.4\linewidth} - \noindent The three little pigs built their houses - out of straw\parnote*{not to be confused with hay}, - sticks\parnote{or lumber according to some sources} - and bricks\multparnote{probably fired clay bricks;or - something else}. - - \parnotes - \end{minipage} -\end{beispiel} - -\subsection{sepfootnotes}\secidx[sepfootnotes]{other packages} -\fnpct supports the \paket{sepfootnotes} package~\cite{sepfootnotes}. Each note -type you have created with with one of the commands +\subsection{pagenote} +The package \pkg{pagenote}~\cite{pkg:pagenote} is supported and its +\cs*{pagenote} command is treated the same way as all other note commands: it +got an optional \sarg\ argument and an additional \cs*{multpagenote} is +defined. + +\subsection{parnotes} +The function of the package \pkg{parnotes}~\cite{pkg:parnotes} is similar to the +\pkg{endnotes} package. basically it allows to output the footnote text after +a paragraph, either by using a special environment or by invoking +\cs*{parnotes}. + +If \pkg{parnotes} is loaded \fnpct\ extends its functionality analogous to the +one of \pkg{endnotes}. + +Again the \option{multiple} option turns all \cs*{parnote}s into +\cs*{multparnote}s. +\begin{example} + \begin{minipage}[t]{.4\linewidth} + \noindent The three little pigs built their houses + out of straw\parnote{not to be confused with hay}, + sticks\parnote{or lumber according to some sources} + and bricks\parnote{probably fired clay bricks}. + + \parnotes + \end{minipage}\hfil + \begin{minipage}[t]{.4\linewidth} + \noindent The three little pigs built their houses + out of straw\parnote*{not to be confused with hay}, + sticks\parnote{or lumber according to some sources} + and bricks\multparnote{probably fired clay bricks;or + something else}. + + \parnotes + \end{minipage} +\end{example} + +\subsection{sepfootnotes} +\fnpct\ supports the \pkg{sepfootnotes} package~\cite{pkg:sepfootnotes}. Each +note type you have created with with one of the commands \begin{description} - \item \cmd{newfootnotes}{<prefix>}, - \item \cmd{newendnotes}{<prefix>} or - \item \cmd{newsymbolfootnotes}{<prefix>} + \item \cs*{newfootnotes}\marg{prefix}, + \item \cs*{newendnotes}\marg{prefix} or + \item \cs*{newsymbolfootnotes}\marg{prefix} \end{description} -gets the additional optional \code{*} to prevent punctuation switching. Also the -corresponding mult-variant \cmd{<prefix>multnote} is defined. The option \key{multiple} -again turns all note commands into their mult-variant. +gets the additional optional \sarg\ to prevent punctuation switching. Also +the corresponding mult-variant \cs*{\meta{prefix}multnote} is defined. The +option \option{multiple} again turns all note commands into their +mult-variant. -You have to use the \cmd{newfootnotes} commands in the document preamble after +You have to use the \cs*{newfootnotes} commands in the document preamble after loading \fnpct. -\begin{beispiel} - % preamble \newfootnotes{a} - \anotecontent{first}{not to be confused with hay} - \anotecontent{second}{or lumber according to some sources} - \anotecontent{third}{probably fired clay bricks} - \begin{minipage}{.4\linewidth} - \noindent The three little pigs built their houses - out of straw\anote{first}, sticks\anote{second} and - bricks\anote{third}. - \end{minipage} -\end{beispiel} - -\subsection{sidenotes}\secidx[sidenotes]{other packages} -The package \paket{sidenotes}~\cite{sidenotes} is supported and its commands -\cmd{sidenote} and \cmd{sidenotemark} are treated the same way as footnotes: -they got an optional \code{*} argument and the additional \cmd{multsidenote} -is created. The option \key{multiple} turns all note commands into their +\begin{example} + % preamble \newfootnotes{a} + \anotecontent{first}{not to be confused with hay} + \anotecontent{second}{or lumber according to some sources} + \anotecontent{third}{probably fired clay bricks} + \begin{minipage}{.4\linewidth} + \noindent The three little pigs built their houses + out of straw\anote{first}, sticks\anote{second} and + bricks\anote{third}. + \end{minipage} +\end{example} + +\subsection{sidenotes} +The package \pkg{sidenotes}~\cite{pkg:sidenotes} is supported and its commands +\cs*{sidenote} and \cs*{sidenotemark} are treated the same way as footnotes: +they got an optional \sarg\ argument and the additional \cs*{multsidenote} is +created. The option \option{multiple} turns all note commands into their mult-variant. -\subsection{snotez}\secidx[snotez]{other packages} -The package \paket{snotez}~\cite{snotez} is supported and its commands -\cmd{sidenote} and \cmd{sidenotemark} are treated the same way as footnotes: -they got an optional \code{*} argument and the additional \cmd{multsidenote} -is created. The option \key{multiple} turns all note commands into their +\subsection{snotez} +The package \pkg{snotez}~\cite{pkg:snotez} is supported and its commands +\cs*{sidenote} and \cs*{sidenotemark} are treated the same way as footnotes: +they got an optional \sarg\ argument and the additional \cs*{multsidenote} is +created. The option \option{multiple} turns all note commands into their mult-variant. -\subsection{tablefootnote}\secidx[tablefootnote]{other packages} -The package \paket{tablefootnote}~\cite{tablefootnote} is supported and its -\cmd{tablefootnote} command is treated the same way as all other note commands: -it got an optional \code{*} argument and an additional \cmd{multtablefootnote} -is defined. The option \key{multiple} turns all note commands into their mult-variant. +\subsection{tablefootnote} +The package \pkg{tablefootnote}~\cite{pkg:tablefootnote} is supported and its +\cs*{tablefootnote} command is treated the same way as all other note +commands: it got an optional \sarg\ argument and an additional +\cs*{multtablefootnote} is defined. The option \option{multiple} turns all +note commands into their mult-variant. -\subsection{yafoot}\secidx[yafoot bundle]{other packages} -Currently no issues are known when using \fnpct with one or all of the packages -of the \paket{yafoot}~\cite{yafoot} bundle. Just for reference: these packages are -\paket*{pfnote}, \paket*{fnpos} and \paket*{dblfnote}. -\secidx*{other packages} +\subsection{yafoot} +Currently no issues are known when using \fnpct\ with one or all of the +packages of the \bnd{yafoot}~\cite{bnd:yafoot} bundle. Just for reference: +these packages are \pkg*{pfnote}, \pkg*{fnpos} and \pkg*{dblfnote}. -\section{Adapting note commands}\secidx{adapting notes}\label{sec:adapt} +\section{Adapting note commands}\label{sec:adapt} If a package is not natively supported you can try and adapt commands yourself. You'll need to use one of the following commands. Please be aware that if the adapted command does not match the required syntax it will get the required syntax afterwards. This can result in dummy arguments or an overwritten \code{*} argument. -\begin{beschreibung} - % \AdaptNote - \Befehl{AdaptNote}{\cmd{cs}}\ma{\cmd{multcs}} \cnpkgdocarrow\ this lets \cmd{cs} adapt to - the kerning behaviour and adds an optional \code{*}. It also creates a - corresponding mult-variant. The package option \key{multiple} will now turn - \cmd{cs} into its mult-variant. Required syntax: \cmd{cs}[<oarg>]{<marg>} - % \AdaptNoteNoMult - \Befehl{AdaptNoteNoMult}{\cmd{cs}} \cnpkgdocarrow\ like \cmd{AdaptNote} but doesn't create a - mult-variant and thus there is no change in behaviour when the option \key{multiple} - is used. Required syntax: \cmd{cs}[<oarg>]{<marg>} - % \AdaptNoteOpt - \Befehl{AdaptNoteOpt}{\cmd{cs}}\ma{\cmd{multcs}} \cnpkgdocarrow\ this lets \cmd{cs} - adapt to the kerning behaviour and adds an optional \code{*}. It also creates a - corresponding mult-variant. The package option \key{multiple} will now turn - \cmd{cs} into its mult-variant. Required syntax: \cmd{cs}[<oarg>]\oa{<oarg>}\ma{<marg>} - % \AdaptNoteOptNoMult - \Befehl{AdaptNoteOptNoMult}{\cmd{cs}} \cnpkgdocarrow\ like \cmd{AdaptNoteOpt} but - doesn't create a mult-variant and thus there is no change in behaviour when the - option \key{multiple} is used. Required syntax: \cmd{cs}[<oarg>]\oa{<oarg>}\ma{<marg>} - % \AdaptNoteMark - \Befehl{AdaptNoteMark}{\cmd{cs}} \cnpkgdocarrow\ this lets \cmd{cs} adapt to the - kerning behaviour and adds an optional \code{*}. Required syntax: \cmd{cs}[<oarg>] - % strict - \option{strict}{\default{true}|false} when \code{true} \cmd{AdaptNote} (and the - others) will issue errors if the note command in question has already been - adapted. Default = \code{false} -\end{beschreibung} - -\subsection{tufte-latex's side notes}\secidx[tufte-latex]{adapting notes} -For example using the \cmd{sidenote} command from the \paket[tufte-latex]{tufte-handout} +\begin{commands} + % \AdaptNote + \command{AdaptNote}[\Marg{\cs*{cs}}\Marg{\cs*{multcs}}] + This lets \cs*{cs} adapt to the kerning behaviour and adds an optional + \sarg. It also creates a corresponding mult-variant. The package option + \option{multiple} will now turn \cs*{cs} into its mult-variant. Required + syntax: \cs*{cs}\oarg{oarg}\marg{marg} + % \AdaptNoteNoMult + \command{AdaptNoteNoMult}[\Marg{\cs*{cs}}] + Like \cs{AdaptNote} but doesn't create a mult-variant and thus there is no + change in behaviour when the option \option{multiple} is used. Required + syntax: \cs*{cs}\oarg{oarg}\marg{marg} + % \AdaptNoteOpt + \command{AdaptNoteOpt}[\Marg{\cs*{cs}}\Marg{\cs*{multcs}}] + This lets \cs*{cs} adapt to the kerning behaviour and adds an optional + \sarg. It also creates a corresponding mult-variant. The package option + \option{multiple} will now turn \cs*{cs} into its mult-variant. Required + syntax: \cs*{cs}\oarg{oarg}\oarg{oarg}\marg{marg} + % \AdaptNoteOptNoMult + \command{AdaptNoteOptNoMult}[\Marg{\cs*{cs}}] + Like \cs{AdaptNoteOpt} but doesn't create a mult-variant and thus there is + no change in behaviour when the option \option{multiple} is used. + Required syntax: \cs*{cs}\oarg{oarg}\oarg{oarg}\marg{marg} + % \AdaptNoteNoOpt + \command{AdaptNoteNoOpt}[\Marg{\cs*{cs}}\Marg{\cs*{multcs}}] + \sinceversion{0.3}Like \cs{AdaptNote} but requires \cs*{cs} not to have an + optional argument. If it had one it wouldn't have it any more after the + adaption. The package option \option{multiple} will now turn \cs*{cs} + into its mult-variant. Required syntax: \cs*{cs}\marg{marg} + % \AdaptNoteNoOptNoMult + \command{AdaptNoteNoOptNoMult}[\Marg{\cs*{cs}}] + \sinceversion{0.3}Like \cs{AdaptNoteNoOpt} but doesn't create a + mult-variant. Required syntax: \cs*{cs}\Marg{marg} + % \AdaptNoteMark + \command{AdaptNoteMark}[\Marg{\cs*{cs}}] + This lets \cs*{cs} adapt to the kerning behaviour and adds an optional + \sarg. Required syntax: \cs*{cs}\oarg{oarg} + % strict +\end{commands} +\begin{options} + \keybool{strict}\Default{false} When \code{true} + \cs{AdaptNote} (and the others) will issue errors if the note command in + question has already been adapted. +\end{options} + +\subsection{tufte-latex's side notes} +For example using the \cs{sidenote} command from the \cls*{tufte-handout} class is easily possible, see also figure~\ref{fig:tufte}: -\begin{beispiel}[code only] -\documentclass{tufte-handout} -\usepackage[multiple]{fnpct} -\AdaptNote\sidenote\multsidenote -\begin{document} -Some text in the document body\sidenote{Some -text in a sidenote.;A second sidenote.}. -\end{document} -\end{beispiel} +\begin{example}[compile,float,caption={Adapt + \bnd*{tufte-latex}.\label{fig:tufte}},graphics={trim=2.5cm 24.5cm 2cm + 1cm,scale=.65}] + \documentclass{tufte-handout} + \usepackage[multiple]{fnpct} + \AdaptNote\sidenote\multsidenote + \begin{document} + Some text in the document body\sidenote{Some + text in a sidenote.;A second sidenote.}. + \end{document} +\end{example} + +\subsection{Adapting \cs*{footcite} and siblings}\label{ssec:adapt:footcite} +If you're willing to sacrifice \cs*{footcite}'s \sarg\ argument (which it has +in some styles) you can adapt the commands provided by +\pkg{biblatex}~\cite{pkg:biblatex} as well: + +\begin{example} + % used in preamble: \AdaptNoteOpt\footcite\multfootcite + \begin{minipage}{.5\linewidth} + \noindent The three little pigs built their houses + out of straw\footnote{not to be confused with hay}, + sticks\footnote{or lumber according to some sources} + and bricks\footnote{probably fired clay bricks}. The + companion has nothing on this topic\multfootcite{[see] + [but there's nothing there]companion;[or see][but there's + also nothing]knuth:ct:a}. + \end{minipage} +\end{example} + +The option \option{multiple} turns all \cs*{footcite}s into +\cs*{multfootcite}s now. Remember that the optional arguments then are inside +the braces! + +\begin{example} + % used in preamble: \AdaptNoteOpt\footcite\multfootcite + % with option `multiple': + \begin{minipage}{.5\linewidth} + \noindent The three little pigs built their houses + out of straw\footnote{not to be confused with hay}, + sticks\footnote{or lumber according to some sources} + and bricks\footnote{probably fired clay bricks}. The + companion has nothing on this topic\footcite{[see][but + there's nothing there]companion;[or see][but there's also + nothing]knuth:ct:a}. + \end{minipage} +\end{example} -\begin{figure}[h] - \centering - \fbox{\includegraphics[trim=2.5cm 24.5cm 2cm 1cm,scale=.65]{tufte_ex.pdf}} - \caption{Adapt {tufte-latex}.} - \label{fig:tufte} -\end{figure} - -\subsection{Adapting \cmd*{footcite} and siblings} -\secidx[biblatex]{adapting notes}\label{ssec:adapt:footcite} -If you're willing to sacrifice \cmd{footcite}'s \code{*} argument (which it has -in some styles) you can adapt the commands provided by \paket{biblatex} as well: - -\begin{beispiel} - % used in preamble: \AdaptNoteOpt\footcite\multfootcite - \begin{minipage}{.5\linewidth} - \noindent The three little pigs built their houses - out of straw\footnote{not to be confused with hay}, - sticks\footnote{or lumber according to some sources} - and bricks\footnote{probably fired clay bricks}. The - companion has nothing on this topic\multfootcite{[see] - [but there's nothing there]companion;[or see][but there's - also nothing]knuth:ct:a}. - \end{minipage} -\end{beispiel} - -The option \key{multiple} turns all \cmd{footcite}s into \cmd{multfootcite}s now. -Remember that the optional arguments then are inside the braces! - -\begin{beispiel} - % used in preamble: \AdaptNoteOpt\footcite\multfootcite - % with option `multiple': - \begin{minipage}{.5\linewidth} - \noindent The three little pigs built their houses - out of straw\footnote{not to be confused with hay}, - sticks\footnote{or lumber according to some sources} - and bricks\footnote{probably fired clay bricks}. The - companion has nothing on this topic\footcite{[see][but - there's nothing there]companion;[or see][but there's also - nothing]knuth:ct:a}. - \end{minipage} -\end{beispiel} -\secidx*{adapting notes} \appendix -\printbibliography -\setindexpreamble{Section titles are indicated \textbf{bold}, packages -\textsf{sans serif}, commands \code{\textbackslash\textcolor{code}{brown}} - and options \textcolor{key}{\code{yellow}}.\par\bigskip} +\end{document} -\printindex -\end{document}
\ No newline at end of file +% TODO: update documentation and explain what happens when babel's french is +% used diff --git a/Master/texmf-dist/doc/latex/fnpct/nested_ex.tex b/Master/texmf-dist/doc/latex/fnpct/nested_ex.tex deleted file mode 100644 index 9d656d182ff..00000000000 --- a/Master/texmf-dist/doc/latex/fnpct/nested_ex.tex +++ /dev/null @@ -1,47 +0,0 @@ -% -------------------------------------------------------------------------- -% the FNPCT package -% -% footnote kerning -% -% 2012/05/22 -% -------------------------------------------------------------------------- -% Clemens Niederberger -% Web: https://bitbucket.org/cgnieder/fnpct/ -% E-Mail: contact@mychemistry.eu -% -------------------------------------------------------------------------- -% Copyright 2012 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. -% -------------------------------------------------------------------------- -% If you have any ideas, questions, suggestions or bugs to report, please -% feel free to contact me. -% -------------------------------------------------------------------------- -\documentclass{article} -\usepackage[ - paperwidth=.5\textwidth, - paperheight=12\baselineskip, - margin=5pt, - bottom=1.5cm]{geometry} - -\usepackage[multiple]{fnpct} - -\begin{document} - \noindent The three little pigs built their houses - out of straw\footnote{not to be confused with hay}, - sticks\footnote{or lumber according to some sources} - and bricks\multfootnote{probably fired clay bricks% - \footnotemark;*or something else;what do I know}. -\end{document} - - - diff --git a/Master/texmf-dist/doc/latex/fnpct/nested_ex_a.tex b/Master/texmf-dist/doc/latex/fnpct/nested_ex_a.tex deleted file mode 100644 index 6085527aa34..00000000000 --- a/Master/texmf-dist/doc/latex/fnpct/nested_ex_a.tex +++ /dev/null @@ -1,47 +0,0 @@ -% -------------------------------------------------------------------------- -% the FNPCT package -% -% footnote kerning -% -% 2012/05/22 -% -------------------------------------------------------------------------- -% Clemens Niederberger -% Web: https://bitbucket.org/cgnieder/fnpct/ -% E-Mail: contact@mychemistry.eu -% -------------------------------------------------------------------------- -% Copyright 2012 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. -% -------------------------------------------------------------------------- -% If you have any ideas, questions, suggestions or bugs to report, please -% feel free to contact me. -% -------------------------------------------------------------------------- -\documentclass{article} -\usepackage[ - paperwidth=.5\textwidth, - paperheight=12\baselineskip, - margin=5pt, - bottom=1.5cm]{geometry} - -\usepackage{fnpct} - -\begin{document} - \noindent The three little pigs built their houses - out of straw\footnote{not to be confused with hay}, - sticks\footnote{or lumber according to some sources} - and bricks\footnote{probably fired clay bricks% - \innernote{or not}}. -\end{document} - - - diff --git a/Master/texmf-dist/doc/latex/fnpct/nested_ex_b.tex b/Master/texmf-dist/doc/latex/fnpct/nested_ex_b.tex deleted file mode 100644 index 0349ddaa147..00000000000 --- a/Master/texmf-dist/doc/latex/fnpct/nested_ex_b.tex +++ /dev/null @@ -1,47 +0,0 @@ -% -------------------------------------------------------------------------- -% the FNPCT package -% -% footnote kerning -% -% 2012/05/22 -% -------------------------------------------------------------------------- -% Clemens Niederberger -% Web: https://bitbucket.org/cgnieder/fnpct/ -% E-Mail: contact@mychemistry.eu -% -------------------------------------------------------------------------- -% Copyright 2012 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. -% -------------------------------------------------------------------------- -% If you have any ideas, questions, suggestions or bugs to report, please -% feel free to contact me. -% -------------------------------------------------------------------------- -\documentclass{article} -\usepackage[ - paperwidth=.5\textwidth, - paperheight=12\baselineskip, - margin=5pt, - bottom=1.5cm]{geometry} - -\usepackage{fnpct} - -\begin{document} - \noindent The three little pigs built their houses - out of straw\footnote{not to be confused with hay}, - sticks\footnote{or lumber according to some sources} - and bricks\footnote{probably\innernote{just guessing} - fired clay bricks\innernote{or not}}. -\end{document} - - - diff --git a/Master/texmf-dist/doc/latex/fnpct/nested_ex_c.tex b/Master/texmf-dist/doc/latex/fnpct/nested_ex_c.tex deleted file mode 100644 index 1379fa6fae9..00000000000 --- a/Master/texmf-dist/doc/latex/fnpct/nested_ex_c.tex +++ /dev/null @@ -1,47 +0,0 @@ -% -------------------------------------------------------------------------- -% the FNPCT package -% -% footnote kerning -% -% 2012/05/22 -% -------------------------------------------------------------------------- -% Clemens Niederberger -% Web: https://bitbucket.org/cgnieder/fnpct/ -% E-Mail: contact@mychemistry.eu -% -------------------------------------------------------------------------- -% Copyright 2012 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. -% -------------------------------------------------------------------------- -% If you have any ideas, questions, suggestions or bugs to report, please -% feel free to contact me. -% -------------------------------------------------------------------------- -\documentclass{article} -\usepackage[ - paperwidth=.5\textwidth, - paperheight=12\baselineskip, - margin=5pt, - bottom=1.5cm]{geometry} - -\usepackage{fnpct} - -\begin{document} -\noindent\fbox{% -\begin{minipage}{.9\linewidth} - The three little pigs built their houses - out of straw\innernote{not to be confused with hay}, - sticks\innernote{or lumber according to some sources} - and bricks\innernote{probably}. -\end{minipage}}\writeinnernotes - -\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/fnpct/normal_ex.tex b/Master/texmf-dist/doc/latex/fnpct/normal_ex.tex deleted file mode 100644 index af02311ef34..00000000000 --- a/Master/texmf-dist/doc/latex/fnpct/normal_ex.tex +++ /dev/null @@ -1,45 +0,0 @@ -% -------------------------------------------------------------------------- -% the FNPCT package -% -% footnote kerning -% -% 2012/05/22 -% -------------------------------------------------------------------------- -% Clemens Niederberger -% Web: https://bitbucket.org/cgnieder/fnpct/ -% E-Mail: contact@mychemistry.eu -% -------------------------------------------------------------------------- -% Copyright 2012 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. -% -------------------------------------------------------------------------- -% If you have any ideas, questions, suggestions or bugs to report, please -% feel free to contact me. -% -------------------------------------------------------------------------- -\documentclass{article} -\usepackage[ - paperwidth=.5\textwidth, - paperheight=12\baselineskip, - margin=5pt, - bottom=1.5cm]{geometry} - -\usepackage[normal-marks]{fnpct} - -\begin{document} - -\noindent The three little pigs built their houses -out of straw\footnote{not to be confused with hay}, -sticks\footnote{or lumber according to some sources} -and bricks\footnote{probably fired clay bricks}. - -\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/fnpct/pagenote_ex.tex b/Master/texmf-dist/doc/latex/fnpct/pagenote_ex.tex deleted file mode 100644 index b3710fb9026..00000000000 --- a/Master/texmf-dist/doc/latex/fnpct/pagenote_ex.tex +++ /dev/null @@ -1,48 +0,0 @@ -% -------------------------------------------------------------------------- -% the FNPCT package -% -% footnote kerning -% -% 2012/05/22 -% -------------------------------------------------------------------------- -% Clemens Niederberger -% Web: https://bitbucket.org/cgnieder/fnpct/ -% E-Mail: contact@mychemistry.eu -% -------------------------------------------------------------------------- -% Copyright 2012 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. -% -------------------------------------------------------------------------- -% If you have any ideas, questions, suggestions or bugs to report, please -% feel free to contact me. -% -------------------------------------------------------------------------- -\documentclass{article} -\usepackage[ - paperwidth=.55\textwidth, - paperheight=12\baselineskip, - margin=5pt, - bottom=1.5cm]{geometry} - -\usepackage{pagenote} -\usepackage[multiple]{fnpct} - -\makepagenote -\begin{document} -\section{Text} -\noindent The three little pigs built their houses -out of straw\pagenote{not to be confused with hay}, -sticks\pagenote{or lumber according to some sources} -and bricks\pagenote{probably fired clay bricks;or whatever}. - -\printnotes -\end{document} diff --git a/Master/texmf-dist/doc/latex/fnpct/sepfootnotes_ex.tex b/Master/texmf-dist/doc/latex/fnpct/sepfootnotes_ex.tex deleted file mode 100644 index d45ff59330d..00000000000 --- a/Master/texmf-dist/doc/latex/fnpct/sepfootnotes_ex.tex +++ /dev/null @@ -1,50 +0,0 @@ -% -------------------------------------------------------------------------- -% the FNPCT package -% -% footnote kerning -% -% 2013/01/20 -% -------------------------------------------------------------------------- -% Clemens Niederberger -% Web: https://bitbucket.org/cgnieder/fnpct/ -% 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. -% -------------------------------------------------------------------------- -% If you have any ideas, questions, suggestions or bugs to report, please -% feel free to contact me. -% -------------------------------------------------------------------------- -\documentclass{article} -\usepackage[ - paperwidth=.55\textwidth, - paperheight=12\baselineskip, - margin=5pt, - bottom=1.5cm]{geometry} - -\usepackage[multiple]{fnpct} - -\usepackage{sepfootnotes} -\newfootnotes{a} -\anotecontent{first}{not to be confused with hay} -\anotecontent{second}{or lumber according to some sources} -\anotecontent{third}{probably fired clay bricks} - -\begin{document} - -\noindent The three little pigs built their houses -out of straw\anote{first}, sticks\anote{second} and -bricks\anote{third}. - -\end{document} diff --git a/Master/texmf-dist/doc/latex/fnpct/tufte_ex.tex b/Master/texmf-dist/doc/latex/fnpct/tufte_ex.tex deleted file mode 100644 index 9b48b87a7e1..00000000000 --- a/Master/texmf-dist/doc/latex/fnpct/tufte_ex.tex +++ /dev/null @@ -1,36 +0,0 @@ -% -------------------------------------------------------------------------- -% the FNPCT package -% -% footnote kerning -% -% 2012/05/22 -% -------------------------------------------------------------------------- -% Clemens Niederberger -% Web: https://bitbucket.org/cgnieder/fnpct/ -% E-Mail: contact@mychemistry.eu -% -------------------------------------------------------------------------- -% Copyright 2012 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. -% -------------------------------------------------------------------------- -% If you have any ideas, questions, suggestions or bugs to report, please -% feel free to contact me. -% -------------------------------------------------------------------------- -\documentclass{tufte-handout} -\usepackage[multiple]{fnpct} -\AdaptNote\sidenote\multsidenote -\begin{document} - -Some text in the document body\sidenote{Some text in a sidenote.;A second sidenote}. - -\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/fnpct/fnpct.sty b/Master/texmf-dist/tex/latex/fnpct/fnpct.sty index deb87fb109e..28e775bec85 100644 --- a/Master/texmf-dist/tex/latex/fnpct/fnpct.sty +++ b/Master/texmf-dist/tex/latex/fnpct/fnpct.sty @@ -31,17 +31,31 @@ \RequirePackage { xparse , l3keys2e , scrlfile } \ProvidesExplPackage {fnpct} - {2013/04/07} - {0.2k} + {2013/12/22} + {0.4} {footnote kerning} % -------------------------------------------------------------------------- +% check expl3 version: +\@ifpackagelater { expl3 } { 2012/11/21 } + { } + { + \PackageError { fnpct } { Support~package~expl3~too~old } + { + You~need~to~update~your~installation~of~the~bundles~'l3kernel'~and~ + 'l3packages'.\MessageBreak + Loading~fnpct~will~abort! + } + \tex_endinput:D + } + +% -------------------------------------------------------------------------- % SETTING THINGS UP: % this is plain's \nobreak: \cs_new:Npn \fnpct_no_break: { \tex_penalty:D \c_ten_thousand } % messages: -\cs_new:Npn \fnpct_dont_mess_around: +\cs_new_protected:Npn \fnpct_dont_mess_around: { \iow_log:n { ................................................. } \iow_log:n { . ~ fnpct~info: } @@ -58,127 +72,142 @@ I~will~do~nothing~instead. } -\bool_new:N \l_fnpct_strict_bool +\bool_new:N \l__fnpct_strict_bool -\cs_new:Npn \fnpct_message:nx #1#2 +\cs_new_protected:Npn \fnpct_message:nx #1#2 { - \bool_if:NTF \l_fnpct_strict_bool + \bool_if:NTF \l__fnpct_strict_bool { \msg_error:nnx { fnpct } { #1 } } { \msg_warning:nnx { fnpct } { #1 } } { #2 } } % scratch variables: -\tl_new:N \l_fnpct_tmpa_tl -\tl_new:N \l_fnpct_tmpb_tl -\dim_new:N \l_fnpct_tmpa_dim -\dim_new:N \l_fnpct_tmpb_dim -\int_new:N \l_fnpct_tmpa_int +\tl_new:N \l__fnpct_tmpa_tl +\tl_new:N \l__fnpct_tmpb_tl +\dim_new:N \l__fnpct_tmpa_dim +\dim_new:N \l__fnpct_tmpb_dim +\int_new:N \l__fnpct_tmpa_int % rigid lengths: -\dim_new:N \l_fnpct_after_comma_dim -\dim_set:Nn \l_fnpct_after_comma_dim { -.06em } -\dim_new:N \l_fnpct_after_dot_dim -\dim_set:Nn \l_fnpct_after_dot_dim { -.06em } -\dim_new:N \l_fnpct_before_comma_dim -\dim_set:Nn \l_fnpct_before_comma_dim { -.16em } -\dim_new:N \l_fnpct_before_dot_dim -\dim_set:Nn \l_fnpct_before_dot_dim { -.16em } -\dim_new:N \l_fnpct_before_footnote_dim -\dim_set:Nn \l_fnpct_before_footnote_dim { .06em } -\dim_new:N \l_fnpct_normal_mark_width_dim -\dim_set:Nn \l_fnpct_normal_mark_width_dim { 1em } -\dim_new:N \l_fnpct_normal_indent_dim -\dim_set:Nn \l_fnpct_normal_indent_dim { 1.5em } -\dim_new:N \l_fnpct_normal_parindent_dim -\dim_set:Nn \l_fnpct_normal_parindent_dim { 1em } +\dim_new:N \l__fnpct_after_comma_dim +\dim_set:Nn \l__fnpct_after_comma_dim { -.06em } +\dim_new:N \l__fnpct_after_dot_dim +\dim_set:Nn \l__fnpct_after_dot_dim { -.06em } +\dim_new:N \l__fnpct_before_comma_dim +\dim_set:Nn \l__fnpct_before_comma_dim { -.16em } +\dim_new:N \l__fnpct_before_dot_dim +\dim_set:Nn \l__fnpct_before_dot_dim { -.16em } +\dim_new:N \l__fnpct_before_footnote_dim +\dim_set:Nn \l__fnpct_before_footnote_dim { .06em } +\dim_new:N \l__fnpct_normal_mark_width_dim +\dim_set:Nn \l__fnpct_normal_mark_width_dim { 1em } +\dim_new:N \l__fnpct_normal_indent_dim +\dim_set:Nn \l__fnpct_normal_indent_dim { 1.5em } +\dim_new:N \l__fnpct_normal_parindent_dim +\dim_set:Nn \l__fnpct_normal_parindent_dim { 1em } % multiple footnote input and output variables: -\tl_new:N \l_fnpct_multiple_footnotes_delimiter_tl -\tl_set:Nn \l_fnpct_multiple_footnotes_delimiter_tl { ; } -\tl_new:N \l_fnpct_multiple_footnote_separator_tl +\tl_new:N \l__fnpct_multiple_footnotes_delimiter_tl +\tl_set:Nn \l__fnpct_multiple_footnotes_delimiter_tl { ; } +\tl_new:N \l__fnpct_multiple_footnote_separator_tl % check for KOMA-Script's \multfootsep: \cs_if_exist:NTF \KOMAClassName - { \tl_set:Nn \l_fnpct_multiple_footnote_separator_tl { \multfootsep } } - { \tl_set:Nn \l_fnpct_multiple_footnote_separator_tl { , } } + { \tl_set:Nn \l__fnpct_multiple_footnote_separator_tl { \multfootsep } } + { \tl_set:Nn \l__fnpct_multiple_footnote_separator_tl { , } } % basic booleans for punctuation order switch and multiple footnotes -\bool_new:N \l_fnpct_punct_after_bool -\bool_new:N \l_fnpct_dont_mess_around_bool -\bool_new:N \l_fnpct_multiple_default_bool -\bool_new:N \l_fnpct_multiple_footnotes_bool -\bool_new:N \l_fnpct_reverse_switch_bool -\bool_new:N \l_fnpct_bigfoot_default_top_bool -\bool_new:N \l_fnpct_normal_marks_bool +\bool_new:N \l__fnpct_punct_after_bool +\bool_new:N \l__fnpct_dont_mess_around_bool +\bool_new:N \l__fnpct_multiple_default_bool +\bool_new:N \l__fnpct_multiple_footnotes_bool +\bool_new:N \l__fnpct_reverse_switch_bool +\bool_new:N \l__fnpct_bigfoot_default_top_bool +\bool_new:N \l__fnpct_normal_marks_bool + +\bool_new:N \g__fnpct_after_punctuation_bool % default punctuation marks for switching: -\tl_new:N \l_fnpct_punctuation_marks_tl -\tl_set:Nn \l_fnpct_punctuation_marks_tl { ., } -\prop_new:N \l_fnpct_punctuation_marks_after_prop -\prop_new:N \l_fnpct_punctuation_marks_before_prop -\prop_put:Nnn \l_fnpct_punctuation_marks_after_prop { . } { \l_fnpct_after_dot_dim } -\prop_put:Nnn \l_fnpct_punctuation_marks_after_prop { , } { \l_fnpct_after_comma_dim } -\prop_put:Nnn \l_fnpct_punctuation_marks_before_prop { . } { \l_fnpct_before_dot_dim } -\prop_put:Nnn \l_fnpct_punctuation_marks_before_prop { , } { \l_fnpct_before_comma_dim } - -\cs_new:Npn \fnpct_rm_punctuation:n #1 +\tl_new:N \l__fnpct_punctuation_marks_tl +\tl_set:Nn \l__fnpct_punctuation_marks_tl { ., } +\prop_new:N \l__fnpct_punctuation_marks_after_prop +\prop_new:N \l__fnpct_punctuation_marks_before_prop + +% #1: before/after +% #2: punctuation mark +% #3: dimension +\cs_new_protected:Npn \fnpct_set_punctuation_dim:nnn #1#2#3 + { + \prop_put:cnx { l_fnpct_punctuation_marks_#1_prop } + { #2 } + { \dim_eval:n { #3 } } + } +\cs_generate_variant:Nn \fnpct_set_punctuation_dim:nnn { nV } + +\fnpct_set_punctuation_dim:nnn { after } { . } { \l__fnpct_after_dot_dim } +\fnpct_set_punctuation_dim:nnn { after } { , } { \l__fnpct_after_comma_dim } +\fnpct_set_punctuation_dim:nnn { before } { . } { \l__fnpct_before_dot_dim } +\fnpct_set_punctuation_dim:nnn { before } { , } { \l__fnpct_before_comma_dim } + +\cs_new_protected:Npn \fnpct_rm_punctuation:n #1 { - \tl_remove_all:Nn \l_fnpct_punctuation_marks_tl { #1 } - \prop_del:Nn \l_fnpct_punctuation_marks_after_prop { #1 } - \prop_del:Nn \l_fnpct_punctuation_marks_before_prop { #1 } + \tl_remove_all:Nn \l__fnpct_punctuation_marks_tl { #1 } + \prop_del:Nn \l__fnpct_punctuation_marks_after_prop { #1 } + \prop_del:Nn \l__fnpct_punctuation_marks_before_prop { #1 } } -\tl_new:N \l_fnpct_last_punct_mark_tl +\tl_new:N \l__fnpct_last_punct_mark_tl -\cs_new:Npn \fnpct_add_punctuation:n #1 - { \fnpct_add_punctuation_aux:w #1 [ \q_no_value ] \q_no_value \q_stop } +\cs_new_protected:Npn \fnpct_add_punctuation:n #1 + { \__fnpct_add_punctuation:w #1 [ \q_no_value ] \q_no_value \q_stop } \cs_generate_variant:Nn \fnpct_add_punctuation:n { V } -\cs_new:Npn \fnpct_add_punctuation_aux:w #1[#2]#3 \q_stop +\cs_new_protected:Npn \__fnpct_add_punctuation:w #1[#2]#3 \q_stop { \quark_if_no_value:nTF { #2 } { % there is no option at all \tl_map_inline:nn { #1 } { - \tl_put_right:Nn \l_fnpct_punctuation_marks_tl { ##1 } - \prop_put:Nnn \l_fnpct_punctuation_marks_after_prop { ##1 } { 0pt } - \prop_put:Nnn \l_fnpct_punctuation_marks_before_prop { ##1 } { 0pt } - \tl_set:No \l_fnpct_last_punct_mark_tl { ##1 } + \tl_put_right:Nn \l__fnpct_punctuation_marks_tl { ##1 } + \fnpct_set_punctuation_dim:nnn { after } { ##1 } { 0pt } + \fnpct_set_punctuation_dim:nnn { before } { ##1 } { 0pt } + \tl_set:No \l__fnpct_last_punct_mark_tl { ##1 } } } { \tl_if_blank:nTF { #1 } { % #2 is a second option (= before space) - \prop_put:NVn \l_fnpct_punctuation_marks_before_prop - \l_fnpct_last_punct_mark_tl { #2 } + \fnpct_set_punctuation_dim:nVn { before } + \l__fnpct_last_punct_mark_tl + { #2 } } { % #2 is a first option (= after space), #1 might be more than one token: \tl_if_single_token:nTF { #1 } { - \tl_put_right:Nn \l_fnpct_punctuation_marks_tl { #1 } - \prop_put:Nnn \l_fnpct_punctuation_marks_after_prop { #1 } { #2 } - \prop_put:Nnn \l_fnpct_punctuation_marks_before_prop { #1 } { 0pt } - \tl_set:No \l_fnpct_last_punct_mark_tl { #1 } + \tl_put_right:Nn \l__fnpct_punctuation_marks_tl { #1 } + \fnpct_set_punctuation_dim:nnn { after } { #1 } { #2 } + \fnpct_set_punctuation_dim:nnn { before } { #1 } { 0pt } + \tl_set:No \l__fnpct_last_punct_mark_tl { #1 } } { - \int_zero:N \l_fnpct_tmpa_int + \int_zero:N \l__fnpct_tmpa_int \tl_map_inline:nn { #1 } { - \tl_put_right:Nn \l_fnpct_punctuation_marks_tl { ##1 } - \int_compare:nTF { \l_fnpct_tmpa_int < ( \tl_count:n { #1 } - 1 ) } + \tl_put_right:Nn \l__fnpct_punctuation_marks_tl { ##1 } + \int_compare:nTF { \l__fnpct_tmpa_int < ( \tl_count:n { #1 } - 1 ) } { - \prop_put:Nnn \l_fnpct_punctuation_marks_after_prop { ##1 } { 0pt } - \prop_put:Nnn \l_fnpct_punctuation_marks_before_prop { ##1 } { 0pt } + \fnpct_set_punctuation_dim:nnn { after } { ##1 } { 0pt} + \fnpct_set_punctuation_dim:nnn { before } { ##1 } { 0pt } } { - \prop_put:Nnn \l_fnpct_punctuation_marks_after_prop { ##1 } { #2 } - \prop_put:Nnn \l_fnpct_punctuation_marks_before_prop { ##1 } { 0pt } + \fnpct_set_punctuation_dim:nnn { after } { ##1 } { #2 } + \fnpct_set_punctuation_dim:nnn { before } { ##1 } { 0pt } } - \tl_set:No \l_fnpct_last_punct_mark_tl { ##1 } - \int_incr:N \l_fnpct_tmpa_int + \tl_set:No \l__fnpct_last_punct_mark_tl { ##1 } + \int_incr:N \l__fnpct_tmpa_int } } } @@ -188,9 +217,9 @@ { \quark_if_no_value:nF { #3 } { - \tl_set:Nn \l_fnpct_tmpa_tl { #3 } - \tl_remove_all:Nn \l_fnpct_tmpa_tl { [\q_no_value]\q_no_value } - \fnpct_add_punctuation:V \l_fnpct_tmpa_tl + \tl_set:Nn \l__fnpct_tmpa_tl { #3 } + \tl_remove_all:Nn \l__fnpct_tmpa_tl { [\q_no_value]\q_no_value } + \fnpct_add_punctuation:V \l__fnpct_tmpa_tl } } } @@ -198,46 +227,46 @@ % options: \keys_define:nn { fnpct } { - strict .bool_set:N = \l_fnpct_strict_bool , + strict .bool_set:N = \l__fnpct_strict_bool , strict .default:n = true , after-comma-space .code:n = - \prop_put:Nnn \l_fnpct_punctuation_marks_after_prop { , } { #1 } , + \fnpct_set_punctuation_dim:nnn { after } { , } { #1 } , after-dot-space .code:n = - \prop_put:Nnn \l_fnpct_punctuation_marks_after_prop { . } { #1 } , + \fnpct_set_punctuation_dim:nnn { after } { . } { #1 } , before-comma-space .code:n = - \prop_put:Nnn \l_fnpct_punctuation_marks_before_prop { , } { #1 } , + \fnpct_set_punctuation_dim:nnn { before } { , } { #1 } , before-dot-space .code:n = - \prop_put:Nnn \l_fnpct_punctuation_marks_before_prop { , } { #1 } , + \fnpct_set_punctuation_dim:nnn { before } { , } { #1 } , after-punct-space .code:n = - \prop_map_inline:Nn \l_fnpct_punctuation_marks_after_prop - { \prop_put:Nnn \l_fnpct_punctuation_marks_after_prop { ##1 } { #1 } } , + \prop_map_inline:Nn \l__fnpct_punctuation_marks_after_prop + { \fnpct_set_punctuation_dim:nnn { after } { ##1 } { #1 } } , before-punct-space .code:n = - \prop_map_inline:Nn \l_fnpct_punctuation_marks_before_prop - { \prop_put:Nnn \l_fnpct_punctuation_marks_before_prop { ##1 } { #1 } } , - before-footnote-space .dim_set:N = \l_fnpct_before_footnote_dim , - punct-after .bool_set:N = \l_fnpct_punct_after_bool , + \prop_map_inline:Nn \l__fnpct_punctuation_marks_before_prop + { \fnpct_set_punctuation_dim:nnn { before } { ##1 } { #1 } } , + before-footnote-space .dim_set:N = \l__fnpct_before_footnote_dim , + punct-after .bool_set:N = \l__fnpct_punct_after_bool , punct-after .default:n = true , dont-mess-around .code:n = - \prop_map_inline:Nn \l_fnpct_punctuation_marks_after_prop - { \prop_put:Nnn \l_fnpct_punctuation_marks_after_prop { ##1 } { 0pt } } - \prop_map_inline:Nn \l_fnpct_punctuation_marks_before_prop - { \prop_put:Nnn \l_fnpct_punctuation_marks_before_prop { ##1 } { 0pt } } - \dim_zero:N \l_fnpct_before_footnote_dim - \bool_set_true:N \l_fnpct_punct_after_bool - \bool_set_true:N \l_fnpct_dont_mess_around_bool + \prop_map_inline:Nn \l__fnpct_punctuation_marks_after_prop + { \fnpct_set_punctuation_dim:nnn { after } { ##1 } { 0pt } } + \prop_map_inline:Nn \l__fnpct_punctuation_marks_before_prop + { \fnpct_set_punctuation_dim:nnn { before } { ##1 } { 0pt } } + \dim_zero:N \l__fnpct_before_footnote_dim + \bool_set_true:N \l__fnpct_punct_after_bool + \bool_set_true:N \l__fnpct_dont_mess_around_bool \fnpct_dont_mess_around: , - mult-fn-delim .tl_set:N = \l_fnpct_multiple_footnotes_delimiter_tl , - mult-fn-sep .tl_set:N = \l_fnpct_multiple_footnote_separator_tl , - multiple .bool_set:N = \l_fnpct_multiple_default_bool , + mult-fn-delim .tl_set:N = \l__fnpct_multiple_footnotes_delimiter_tl , + mult-fn-sep .tl_set:N = \l__fnpct_multiple_footnote_separator_tl , + multiple .bool_set:N = \l__fnpct_multiple_default_bool , multiple .default:n = true , - bigfoot-default-top .bool_set:N = \l_fnpct_bigfoot_default_top_bool , + bigfoot-default-top .bool_set:N = \l__fnpct_bigfoot_default_top_bool , bigfoot-default-top .default:n = true , - normal-marks .bool_set:N = \l_fnpct_normal_marks_bool , + normal-marks .bool_set:N = \l__fnpct_normal_marks_bool , normal-marks .default:n = true , - normal-mark-width .dim_set:N = \l_fnpct_normal_mark_width_dim , - normal-indent .dim_set:N = \l_fnpct_normal_indent_dim , - normal-parindent .dim_set:N = \l_fnpct_normal_parindent_dim , - verb-format .tl_set:N = \l_fnpct_verbatim_format_tl , + normal-mark-width .dim_set:N = \l__fnpct_normal_mark_width_dim , + normal-indent .dim_set:N = \l__fnpct_normal_indent_dim , + normal-parindent .dim_set:N = \l__fnpct_normal_parindent_dim , + verb-format .tl_set:N = \l__fnpct_verbatim_format_tl , add-punct-marks .code:n = \fnpct_add_punctuation:n { #1 } , remove-punct-marks .code:n = \tl_map_function:nN { #1 } \fnpct_rm_punctuation:n @@ -248,7 +277,7 @@ % -------------------------------------------------------------------------- % MAIN INTERNAL FOOTNOTE FUNCTION: % write the notes: -\cs_new:Npn \fnpct_no_value_or_quark_no_value:nTF #1#2#3 +\cs_new:Npn \__fnpct_no_value_or_quark_no_value:nTF #1#2#3 { \IfNoValueTF { #1 } { #2 } { \quark_if_no_value:nTF { #1 } { #2 } { #3 } } @@ -256,105 +285,96 @@ \cs_new:Npn \fnpct_write_note:Nnnn #1#2#3#4 { - \fnpct_no_value_or_quark_no_value:nTF { #2 } + \__fnpct_no_value_or_quark_no_value:nTF { #2 } { #1 { #4 } } { - \fnpct_no_value_or_quark_no_value:nTF { #3 } + \__fnpct_no_value_or_quark_no_value:nTF { #3 } { #1 [ #2 ] { #4 } } { #1 [ #2 ] [ #3 ] { #4 } } } } % check for punctuation: -\cs_new:Npn \fnpct_check_punctuation:TF #1#2 - { \fnpct_check_punctuation_auxi:nTF { 0 } { #1 } { #2 } } +\cs_new_protected:Npn \fnpct_check_punctuation:TF #1#2 + { \__fnpct_check_punctuation:nTF { 0 } { #1 } { #2 } } -\cs_new:Npn \fnpct_check_punctuation_auxi:nTF #1#2#3 +\cs_new_protected:Npn \__fnpct_check_punctuation:nTF #1#2#3 { - \fnpct_get_head:NN - \l_fnpct_current_punct_mark_tl - \l_fnpct_punctuation_marks_tl - \peek_meaning_remove:VTF \l_fnpct_current_punct_mark_tl + \__fnpct_get_head:NN + \l__fnpct_current_punct_mark_tl + \l__fnpct_punctuation_marks_tl + \peek_meaning_remove:VTF \l__fnpct_current_punct_mark_tl { #2 } { - \fnpct_check_punctuation_auxii:nnn { #1 } - { \fnpct_check_punctuation_auxi:VTF \l_fnpct_tmpa_int { #2 } { #3 } } + \__fnpct_check_punctuation_aux:nnn { #1 } + { \__fnpct_check_punctuation:VTF \l__fnpct_tmpa_int { #2 } { #3 } } { #3 } } } -\cs_new:Npn \fnpct_check_punctuation_auxii:nnn #1#2#3 +\cs_new_protected:Npn \__fnpct_check_punctuation_aux:nnn #1#2#3 { - \int_set:Nn \l_fnpct_tmpa_int { #1 } - \int_incr:N \l_fnpct_tmpa_int - \tl_set:Nx \l_fnpct_tmpb_tl { \int_to_arabic:n { \l_fnpct_tmpa_int } } - \tl_remove_all:NV \l_fnpct_punctuation_marks_tl - \l_fnpct_current_punct_mark_tl - \tl_put_right:NV \l_fnpct_punctuation_marks_tl - \l_fnpct_current_punct_mark_tl - \int_compare:nTF { \l_fnpct_tmpa_int < \tl_count:V \l_fnpct_punctuation_marks_tl } + \int_set:Nn \l__fnpct_tmpa_int { #1 } + \int_incr:N \l__fnpct_tmpa_int + \tl_set:Nx \l__fnpct_tmpb_tl { \int_to_arabic:n { \l__fnpct_tmpa_int } } + \tl_remove_all:NV \l__fnpct_punctuation_marks_tl + \l__fnpct_current_punct_mark_tl + \tl_put_right:NV \l__fnpct_punctuation_marks_tl + \l__fnpct_current_punct_mark_tl + \int_compare:nTF { \l__fnpct_tmpa_int < \tl_count:V \l__fnpct_punctuation_marks_tl } { #2 } { #3 } } -\cs_generate_variant:Nn \fnpct_check_punctuation_auxi:nTF { V } +\cs_generate_variant:Nn \__fnpct_check_punctuation:nTF { V } \cs_generate_variant:Nn \peek_meaning_remove:NTF { V } \cs_generate_variant:Nn \tl_remove_all:Nn { NV } \cs_generate_variant:Nn \tl_put_right:Nn { NV } -\cs_new:Npn \fnpct_get_head:NN #1#2 - { - \tl_if_blank:VTF #2 - { \tl_set:Nn #1 { #2 } } - { \exp_after:wN \fnpct_get_head_aux:Nw \exp_after:wN #1#2 \q_stop } - } -\cs_new:Npn \fnpct_get_head_aux:Nw #1#2#3 \q_stop - { \tl_set:Nn #1 { #2 } } +\cs_new_protected:Npn \__fnpct_get_head:NN #1#2 + { \tl_set:Nx #1 { \tl_head:V #2 } } % check for multiple notes: -\tl_new:N \l_fnpct_multiple_true_tl -\tl_new:N \l_fnpct_multiple_false_tl +\tl_new:N \l__fnpct_multiple_true_tl +\tl_new:N \l__fnpct_multiple_false_tl -\cs_new:Npn \fnpct_check_multiple:TF #1#2 +\cs_new_protected:Npn \fnpct_check_multiple:TF #1#2 { - \tl_set:Nn \l_fnpct_multiple_true_tl { #1 } - \tl_set:Nn \l_fnpct_multiple_false_tl { #2 } - \peek_after:Nw \fnpct_check_multiple_aux: + \tl_set:Nn \l__fnpct_multiple_true_tl { #1 } + \tl_set:Nn \l__fnpct_multiple_false_tl { #2 } + \peek_after:Nw \__fnpct_check_multiple: } -\cs_new:Npn \fnpct_check_multiple_aux: +\cs_new_protected:Npn \__fnpct_check_multiple: { - \prop_map_inline:Nn \g_fnpct_adapted_notes_prop + \prop_map_inline:Nn \g__fnpct_adapted_notes_prop { - \prop_get:NnN \g_fnpct_adapted_notes_prop { ##1 } \l_fnpct_tmpb_tl + \prop_get:NnN \g__fnpct_adapted_notes_prop { ##1 } \l__fnpct_tmpb_tl \exp_after:wN - \token_if_eq_meaning:NNTF \l_fnpct_tmpb_tl \l_peek_token + \token_if_eq_meaning:NNTF \l__fnpct_tmpb_tl \l_peek_token { - \bool_set_true:N \l_fnpct_multiple_footnotes_bool + \bool_set_true:N \l__fnpct_multiple_footnotes_bool \prop_map_break: } - { \bool_set_false:N \l_fnpct_multiple_footnotes_bool } + { \bool_set_false:N \l__fnpct_multiple_footnotes_bool } } - \bool_if:NTF \l_fnpct_multiple_footnotes_bool - { \tl_use:N \l_fnpct_multiple_true_tl } - { \tl_use:N \l_fnpct_multiple_false_tl } + \bool_if:NTF \l__fnpct_multiple_footnotes_bool + { \tl_use:N \l__fnpct_multiple_true_tl } + { \tl_use:N \l__fnpct_multiple_false_tl } } % check which mode is active: -\cs_new:Npn \fnpct_punct_if_after:TF #1#2 +\prg_new_conditional:Npnn \fnpct_punct_if_after: { T, TF } { \bool_if:nTF { \bool_xor_p:nn - { \l_fnpct_punct_after_bool } - { \l_fnpct_reverse_switch_bool } + { \l__fnpct_punct_after_bool } + { \l__fnpct_reverse_switch_bool } } - { #1 } - { #2 } + { \prg_return_true: } + { \prg_return_false: } } -\cs_new:Npn \fnpct_punct_if_after:T #1 - { \fnpct_punct_if_after:TF { #1 } {} } - % this is where the magic happens: % #1: original command % #2: optional argument of original command @@ -366,24 +386,32 @@ % if a punctuation mark follows remove it, insert dot, skip back % and then insert footnote \fnpct_no_break: - \bool_if:NF \l_fnpct_dont_mess_around_bool - { \IfBooleanT { #5 } { \bool_set_true:N \l_fnpct_reverse_switch_bool } } + \bool_if:NF \l__fnpct_dont_mess_around_bool + { \IfBooleanT { #5 } { \bool_set_true:N \l__fnpct_reverse_switch_bool } } \fnpct_check_punctuation:TF { + % this is need as some commands like biblatex's \autocite may in turn + % call \footnote. It then must not insert the pre-footnote-space: + \bool_gset_true:N \g__fnpct_after_punctuation_bool % A: after=1 && reverse=0 % after=0 && reverse=1 % B: after=1 && reverse=1 % after=0 && reverse=0 \fnpct_punct_if_after:TF - { \fnpct_no_break: \skip_horizontal:N \l_fnpct_before_footnote_dim } + { \fnpct_no_break: \skip_horizontal:N \l__fnpct_before_footnote_dim } { - \tl_use:N \l_fnpct_current_punct_mark_tl + \tl_use:N \l__fnpct_current_punct_mark_tl \fnpct_no_break: \prop_get:NVNT - \l_fnpct_punctuation_marks_after_prop - \l_fnpct_current_punct_mark_tl - \l_fnpct_tmpa_dim - { \skip_horizontal:N \l_fnpct_tmpa_dim } + \l__fnpct_punctuation_marks_after_prop + \l__fnpct_current_punct_mark_tl + \l__fnpct_tmpa_tl + { + \dim_set:Nn \l__fnpct_tmpa_dim { \l__fnpct_tmpa_tl } + \skip_horizontal:N \l__fnpct_tmpa_dim + \fnpct_no_break: + \skip_horizontal:N \c_zero_skip + } } \fnpct_write_note:Nnnn #1 { #2 } { #3 } { #4 } \fnpct_write_inner:N #1 @@ -391,14 +419,17 @@ { \fnpct_no_break: \prop_get:NVNT - \l_fnpct_punctuation_marks_before_prop - \l_fnpct_current_punct_mark_tl - \l_fnpct_tmpa_dim - { \skip_horizontal:N \l_fnpct_tmpa_dim } + \l__fnpct_punctuation_marks_before_prop + \l__fnpct_current_punct_mark_tl + \l__fnpct_tmpa_tl + { + \dim_set:Nn \l__fnpct_tmpa_dim { \l__fnpct_tmpa_tl } + \skip_horizontal:N \l__fnpct_tmpa_dim + } \fnpct_no_break: - \tl_use:N \l_fnpct_current_punct_mark_tl + \tl_use:N \l__fnpct_current_punct_mark_tl } - \bool_set_false:N \l_fnpct_reverse_switch_bool + \bool_set_false:N \l__fnpct_reverse_switch_bool } { % what about multiple footnotes? (their usage is discouraged with @@ -406,23 +437,31 @@ % this check should probably/maybe be removed (?!) \fnpct_check_multiple:TF { - \bool_set_true:N \l_fnpct_multiple_footnotes_bool + \bool_set_true:N \l__fnpct_multiple_footnotes_bool % else insert space and then note - \fnpct_no_break: \skip_horizontal:N \l_fnpct_before_footnote_dim + \fnpct_no_break: + \bool_if:NTF \g__fnpct_after_punctuation_bool + { \bool_gset_false:N \g__fnpct_after_punctuation_bool } + { \skip_horizontal:N \l__fnpct_before_footnote_dim } \fnpct_write_note:Nnnn #1 { #2 } { #3 } { #4 } \fnpct_write_inner:N #1 \fnpct_no_break: - \textsuperscript { \l_fnpct_multiple_footnote_separator_tl } - % \bool_set_false:N \l_fnpct_reverse_switch_bool + \textsuperscript { \l__fnpct_multiple_footnote_separator_tl } + % \bool_set_false:N \l__fnpct_reverse_switch_bool } { % else insert space and then note - \bool_if:NTF \l_fnpct_multiple_footnotes_bool - { \bool_set_false:N \l_fnpct_multiple_footnotes_bool } - { \fnpct_no_break: \skip_horizontal:N \l_fnpct_before_footnote_dim } + \bool_if:NTF \l__fnpct_multiple_footnotes_bool + { \bool_set_false:N \l__fnpct_multiple_footnotes_bool } + { + \fnpct_no_break: + \bool_if:NTF \g__fnpct_after_punctuation_bool + { \bool_gset_false:N \g__fnpct_after_punctuation_bool } + { \skip_horizontal:N \l__fnpct_before_footnote_dim } + } \fnpct_write_note:Nnnn #1 { #2 } { #3 } { #4 } \fnpct_write_inner:N #1 - \bool_set_false:N \l_fnpct_reverse_switch_bool + \bool_set_false:N \l__fnpct_reverse_switch_bool } } } @@ -430,74 +469,93 @@ % -------------------------------------------------------------------------- % MULTIPLE FOOTNOTES -\seq_new:N \l_fnpct_multiple_footnotes_seq +\seq_new:N \l__fnpct_multiple_footnotes_seq \cs_generate_variant:Nn \seq_set_split:Nnn { NVn } % #1: original note command % #2: star -% #3: multiple notes separated by \l_fnpct_multiple_footnotes_delimiter_tl +% #3: multiple notes separated by \l__fnpct_multiple_footnotes_delimiter_tl \cs_new_protected:Npn \fnpct_mult_note:Nnn #1#2#3 { - \bool_if:NF \l_fnpct_dont_mess_around_bool - { \IfBooleanT { #2 } { \bool_set_true:N \l_fnpct_reverse_switch_bool } } + \bool_if:NF \l__fnpct_dont_mess_around_bool + { \IfBooleanT { #2 } { \bool_set_true:N \l__fnpct_reverse_switch_bool } } % split input: - \seq_set_split:NVn \l_fnpct_multiple_footnotes_seq - \l_fnpct_multiple_footnotes_delimiter_tl + \seq_set_split:NVn \l__fnpct_multiple_footnotes_seq + \l__fnpct_multiple_footnotes_delimiter_tl { #3 } \fnpct_no_break: % look for punctuation mark and do magic: \fnpct_check_punctuation:TF { + \bool_gset_true:N \g__fnpct_after_punctuation_bool \fnpct_punct_if_after:TF - { \fnpct_no_break: \skip_horizontal:N \l_fnpct_before_footnote_dim } + { \fnpct_no_break: \skip_horizontal:N \l__fnpct_before_footnote_dim } { - \tl_use:N \l_fnpct_current_punct_mark_tl + \tl_use:N \l__fnpct_current_punct_mark_tl \fnpct_no_break: - \prop_get:NVNT \l_fnpct_punctuation_marks_after_prop - \l_fnpct_current_punct_mark_tl \l_fnpct_tmpa_dim - { \skip_horizontal:N \l_fnpct_tmpa_dim } + \prop_get:NVNT \l__fnpct_punctuation_marks_after_prop + \l__fnpct_current_punct_mark_tl + \l__fnpct_tmpa_tl + { + \dim_set:Nn \l__fnpct_tmpa_dim { \l__fnpct_tmpa_tl } + \skip_horizontal:N \l__fnpct_tmpa_dim + \fnpct_no_break: + \skip_horizontal:N \c_zero_skip + } } \fnpct_write_notes:N #1 \fnpct_punct_if_after:T { - \prop_get:NVNT \l_fnpct_punctuation_marks_before_prop - \l_fnpct_current_punct_mark_tl \l_fnpct_tmpa_dim - { \skip_horizontal:N \l_fnpct_tmpa_dim } + \prop_get:NVNT \l__fnpct_punctuation_marks_before_prop + \l__fnpct_current_punct_mark_tl + \l__fnpct_tmpa_tl + { + \dim_set:Nn \l__fnpct_tmpa_dim { \l__fnpct_tmpa_tl } + \skip_horizontal:N \l__fnpct_tmpa_dim + } \fnpct_no_break: - \tl_use:N \l_fnpct_current_punct_mark_tl + \tl_use:N \l__fnpct_current_punct_mark_tl } - \bool_set_false:N \l_fnpct_reverse_switch_bool + \bool_set_false:N \l__fnpct_reverse_switch_bool } { % else insert space and notes: \fnpct_check_multiple:TF { - \bool_set_true:N \l_fnpct_multiple_footnotes_bool - \fnpct_no_break: \skip_horizontal:N \l_fnpct_before_footnote_dim + \bool_set_true:N \l__fnpct_multiple_footnotes_bool + \fnpct_no_break: + \bool_if:NTF \g__fnpct_after_punctuation_bool + { \bool_gset_false:N \g__fnpct_after_punctuation_bool } + { \skip_horizontal:N \l__fnpct_before_footnote_dim } \fnpct_write_notes:N #1 - \bool_set_false:N \l_fnpct_reverse_switch_bool - \textsuperscript { \l_fnpct_multiple_footnote_separator_tl } + \bool_set_false:N \l__fnpct_reverse_switch_bool + \textsuperscript { \l__fnpct_multiple_footnote_separator_tl } } { - \bool_if:NTF \l_fnpct_multiple_footnotes_bool - { \bool_set_false:N \l_fnpct_multiple_footnotes_bool } - { \fnpct_no_break: \skip_horizontal:N \l_fnpct_before_footnote_dim } + \bool_if:NTF \l__fnpct_multiple_footnotes_bool + { \bool_set_false:N \l__fnpct_multiple_footnotes_bool } + { + \fnpct_no_break: + \bool_if:NTF \g__fnpct_after_punctuation_bool + { \bool_gset_false:N \g__fnpct_after_punctuation_bool } + { \skip_horizontal:N \l__fnpct_before_footnote_dim } + } \fnpct_write_notes:N #1 - \bool_set_false:N \l_fnpct_reverse_switch_bool + \bool_set_false:N \l__fnpct_reverse_switch_bool } } } \cs_generate_variant:Nn \fnpct_mult_note:Nnn { cnn } -\int_new:N \l_fnpct_multiple_notes_int +\int_new:N \l__fnpct_multiple_notes_int % #1: original note command \cs_new_protected:Npn \fnpct_write_notes:N #1 { - \int_zero:N \l_fnpct_multiple_notes_int - \seq_map_inline:Nn \l_fnpct_multiple_footnotes_seq + \int_zero:N \l__fnpct_multiple_notes_int + \seq_map_inline:Nn \l__fnpct_multiple_footnotes_seq { \fnpct_read_note_with_option:w ##1 \q_stop { #1 } - \int_incr:N \l_fnpct_multiple_notes_int + \int_incr:N \l__fnpct_multiple_notes_int } } @@ -508,30 +566,30 @@ % #3: second optional argument to original note command % #4: mandatory argument to original note command % #5: original note command -\bool_new:N \g_fnpct_only_text_bool +\bool_new:N \g__fnpct_only_text_bool \NewDocumentCommand \fnpct_read_note_with_option:w { soo+u{\q_stop}m } { \bool_if:nT { - \int_compare_p:n { \l_fnpct_multiple_notes_int > 0 } + \int_compare_p:n { \l__fnpct_multiple_notes_int > 0 } && \int_compare_p:n { - \l_fnpct_multiple_notes_int + \l__fnpct_multiple_notes_int < - \seq_count:N \l_fnpct_multiple_footnotes_seq + \seq_count:N \l__fnpct_multiple_footnotes_seq } } { \IfBooleanTF { #1 } { \tex_unskip:D } - { \textsuperscript { \l_fnpct_multiple_footnote_separator_tl } } + { \textsuperscript { \l__fnpct_multiple_footnote_separator_tl } } } \IfBooleanTF { #1 } { % TODO: maybe provide option to change \footnotetext? Or do it % automatically? - \bool_gset_true:N \g_fnpct_only_text_bool + \bool_gset_true:N \g__fnpct_only_text_bool \IfNoValueTF { #2 } { \footnotetext { #4 } } { \footnotetext [ #2 ] { #4 } } @@ -543,8 +601,8 @@ % -------------------------------------------------------------------------- % NESTED FOOTNOTES: % 1 layer of nesting... -\prop_new:N \g_fnpct_inner_footnote_prop -\prop_new:N \g_fnpct_inner_footnote_hyperref_prop +\prop_new:N \g__fnpct_inner_footnote_prop +\prop_new:N \g__fnpct_inner_footnote_hyperref_prop \cs_generate_variant:Nn \prop_gput:Nnn { Nxn , Nxo } % this shouldn't be a document command! But for the time being I'll stick to @@ -556,19 +614,19 @@ % TODO: maybe detect what type of note we're in and use the appropriate mark? % Or provide a user interface to choose the appropriate mark? \fnpct_orig_footnotemark:w - \prop_gput:Nxn \g_fnpct_inner_footnote_prop { \thefootnote } { #2 } - \bool_if:NT \l_fnpct_hyperref_bool + \prop_gput:Nxn \g__fnpct_inner_footnote_prop { \thefootnote } { #2 } + \bool_if:NT \l__fnpct_hyperref_bool { - \prop_gput:Nxo \g_fnpct_inner_footnote_hyperref_prop + \prop_gput:Nxo \g__fnpct_inner_footnote_hyperref_prop { \thefootnote } { \Hy@footnote@currentHref } } } { \fnpct_orig_footnotemark:w [ #1 ] - \prop_gput:Nnn \g_fnpct_inner_footnote_prop { #1 } { #2 } - \bool_if:NT \l_fnpct_hyperref_bool + \prop_gput:Nnn \g__fnpct_inner_footnote_prop { #1 } { #2 } + \bool_if:NT \l__fnpct_hyperref_bool { - \prop_gput:Nno \g_fnpct_inner_footnote_hyperref_prop + \prop_gput:Nno \g__fnpct_inner_footnote_hyperref_prop { #1 } { \Hy@footnote@currentHref } } } @@ -578,69 +636,73 @@ { \token_if_eq_meaning:NNF #1 \fnpct_inner_footnote:w { - \prop_map_inline:Nn \g_fnpct_inner_footnote_prop + \prop_map_inline:Nn \g__fnpct_inner_footnote_prop { \footnotetext [ ##1 ] { - \bool_if:NT \l_fnpct_hyperref_bool + \bool_if:NT \l__fnpct_hyperref_bool { - \prop_get:NnN \g_fnpct_inner_footnote_hyperref_prop - { ##1 } \l_fnpct_tmpa_tl + \prop_get:NnN \g__fnpct_inner_footnote_hyperref_prop + { ##1 } \l__fnpct_tmpa_tl \Hy@raisedlink - { \exp_args:No \hyper@@anchor { \l_fnpct_tmpa_tl } } + { \exp_args:NV \hyper@@anchor \l__fnpct_tmpa_tl } } ##2 } } - \prop_gclear:N \g_fnpct_inner_footnote_prop + \prop_gclear:N \g__fnpct_inner_footnote_prop } } -\cs_new:Npn \writeinnernotes +\NewDocumentCommand \writeinnernotes {} { \fnpct_write_inner:N X } % -------------------------------------------------------------------------- % MANUAL KERNING: -% TODO: add nobreak and ensure that \l_fnpct_after_comma_dim et.al match the current +% TODO: add nobreak and ensure that \l__fnpct_after_comma_dim et.al match the current % definition -\cs_new:Npn \kfp +\cs_new_protected:Npn \fnpct_kfp: { \fnpct_no_break: - \prop_get:NnN \l_fnpct_punctuation_marks_before_prop { . } \l_fnpct_tmpa_dim - \prop_get:NnN \l_fnpct_punctuation_marks_after_prop { . } \l_fnpct_tmpb_dim - \bool_if:NTF \l_fnpct_punct_after_bool - { \skip_horizontal:N \l_fnpct_tmpa_dim } - { \skip_horizontal:N \l_fnpct_tmpb_dim } + \prop_get:NnN \l__fnpct_punctuation_marks_before_prop { . } \l__fnpct_tmpa_dim + \prop_get:NnN \l__fnpct_punctuation_marks_after_prop { . } \l__fnpct_tmpb_dim + \bool_if:NTF \l__fnpct_punct_after_bool + { \skip_horizontal:N \l__fnpct_tmpa_dim } + { \skip_horizontal:N \l__fnpct_tmpb_dim } } -\cs_new:Npn \kfc + +\cs_new_protected:Npn \fnpct_kfc: { \fnpct_no_break: - \prop_get:NnN \l_fnpct_punctuation_marks_before_prop { , } \l_fnpct_tmpa_dim - \prop_get:NnN \l_fnpct_punctuation_marks_after_prop { , } \l_fnpct_tmpb_dim - \bool_if:NTF \l_fnpct_punct_after_bool - { \skip_horizontal:N \l_fnpct_tmpa_dim } - { \skip_horizontal:N \l_fnpct_tmpb_dim } + \prop_get:NnN \l__fnpct_punctuation_marks_before_prop { , } \l__fnpct_tmpa_dim + \prop_get:NnN \l__fnpct_punctuation_marks_after_prop { , } \l__fnpct_tmpb_dim + \bool_if:NTF \l__fnpct_punct_after_bool + { \skip_horizontal:N \l__fnpct_tmpa_dim } + { \skip_horizontal:N \l__fnpct_tmpb_dim } } +\NewDocumentCommand \kfp {} { \fnpct_kfp: } +\NewDocumentCommand \kfc {} { \fnpct_kfc: } + % -------------------------------------------------------------------------- % NORMAL MARKS: \AtBeginDocument { - \bool_if:NT \l_fnpct_normal_marks_bool + \bool_if:NT \l__fnpct_normal_marks_bool { \cs_if_exist:NF \KOMAoption { \RequirePackage { scrextend } } \deffootnote - [ \l_fnpct_normal_mark_width_dim ] - { \l_fnpct_normal_indent_dim } - { \l_fnpct_normal_parindent_dim } + [ \l__fnpct_normal_mark_width_dim ] + { \l__fnpct_normal_indent_dim } + { \l__fnpct_normal_parindent_dim } { \thefootnotemark . \enskip } } } % -------------------------------------------------------------------------- % LET'S MAKE IT EASIER TO ADAPT EXISTIUNG FUNCTIONS: -\prop_new:N \g_fnpct_adapted_notes_prop +\prop_new:N \g__fnpct_adapted_notes_prop \cs_generate_variant:Nn \prop_put:Nnn { Nxn } % COPY, RENEW AND CREATE MULT @@ -650,12 +712,12 @@ % #3: mult-variant % % \footnote[<mark>]{<text>} like: -\cs_new:Npn \fnpct_renew_and_mult:NNN #1#2#3 +\cs_new_protected:Npn \fnpct_renew_and_mult:NNN #1#2#3 { - \prop_gput:Nxn \g_fnpct_adapted_notes_prop { \cs_to_str:N #2 } { #1 } + \prop_gput:Nxn \g__fnpct_adapted_notes_prop { \cs_to_str:N #2 } { #1 } \cs_new_eq:NN #2 #1 \fnpct_create_mult_variant:NN #3 #2 - \bool_if:NTF \l_fnpct_multiple_default_bool + \bool_if:NTF \l__fnpct_multiple_default_bool { \cs_set_eq:NN #1 #3 } { \RenewDocumentCommand #1 { so+m } @@ -664,12 +726,12 @@ } \cs_generate_variant:Nn \fnpct_renew_and_mult:NNN { ccc , NcN } -\cs_new:Npn \fnpct_renew_and_mult_no_opt:NNN #1#2#3 +\cs_new_protected:Npn \fnpct_renew_and_mult_no_opt:NNN #1#2#3 { - \prop_gput:Nxn \g_fnpct_adapted_notes_prop { \cs_to_str:N #2 } { #1 } + \prop_gput:Nxn \g__fnpct_adapted_notes_prop { \cs_to_str:N #2 } { #1 } \cs_new_eq:NN #2 #1 \fnpct_create_mult_variant:NN #3 #2 - \bool_if:NTF \l_fnpct_multiple_default_bool + \bool_if:NTF \l__fnpct_multiple_default_bool { \cs_set_eq:NN #1 #3 } { \RenewDocumentCommand #1 { s+m } @@ -679,12 +741,12 @@ } } } -\cs_generate_variant:Nn \fnpct_renew_and_mult_no_opt:NNN { ccc } +\cs_generate_variant:Nn \fnpct_renew_and_mult_no_opt:NNN { Nc, ccc } % renew but don't create mult-variant: -\cs_new:Npn \fnpct_renew:NN #1#2 +\cs_new_protected:Npn \fnpct_renew:NN #1#2 { - \prop_gput:Nxn \g_fnpct_adapted_notes_prop { \cs_to_str:N #2 } { #1 } + \prop_gput:Nxn \g__fnpct_adapted_notes_prop { \cs_to_str:N #2 } { #1 } \cs_new_eq:NN #2 #1 \RenewDocumentCommand #1 { so+m } { \fnpct_handle_note:Nnnnn #2 { ##2 } { \q_no_value } { ##3 } { ##1 } } @@ -692,21 +754,21 @@ \cs_generate_variant:Nn \fnpct_renew:NN { cc ,Nc } % new -\cs_new:Npn \fnpct_new:NN #1#2 +\cs_new_protected:Npn \fnpct_new:NN #1#2 { - \prop_gput:Nxn \g_fnpct_adapted_notes_prop { \cs_to_str:N #2 } { #1 } + \prop_gput:Nxn \g__fnpct_adapted_notes_prop { \cs_to_str:N #2 } { #1 } \NewDocumentCommand #1 { so+m } { \fnpct_handle_note:Nnnnn #2 { ##2 } { \q_no_value } { ##3 } { ##1 } } } \cs_generate_variant:Nn \fnpct_new:NN { cc , Nc } % \note[<mark>][<oarg>]{<text>} like: -\cs_new:Npn \fnpct_renew_and_mult_opt:NNN #1#2#3 +\cs_new_protected:Npn \fnpct_renew_and_mult_opt:NNN #1#2#3 { - \prop_gput:Nxn \g_fnpct_adapted_notes_prop { \cs_to_str:N #2 } { #1 } + \prop_gput:Nxn \g__fnpct_adapted_notes_prop { \cs_to_str:N #2 } { #1 } \cs_new_eq:NN #2 #1 \fnpct_create_mult_variant:NN #3 #2 - \bool_if:NTF \l_fnpct_multiple_default_bool + \bool_if:NTF \l__fnpct_multiple_default_bool { \cs_set_eq:NN #1 #3 } { \RenewDocumentCommand #1 { soo+m } @@ -715,9 +777,9 @@ } \cs_generate_variant:Nn \fnpct_renew_and_mult_opt:NNN { ccc , NcN } -\cs_new:Npn \fnpct_renew_opt:NN #1#2 +\cs_new_protected:Npn \fnpct_renew_opt:NN #1#2 { - \prop_gput:Nxn \g_fnpct_adapted_notes_prop { \cs_to_str:N #2 } { #1 } + \prop_gput:Nxn \g__fnpct_adapted_notes_prop { \cs_to_str:N #2 } { #1 } \cs_new_eq:NN #2 #1 \RenewDocumentCommand #1 { soo+m } { \fnpct_handle_note:Nnnnn #2 { ##2 } { ##3 } { ##4 } { ##1 } } @@ -725,9 +787,9 @@ \cs_generate_variant:Nn \fnpct_renew_opt:NN { cc , Nc } % \note{<arg>} like -\cs_new:Npn \fnpct_renew_no_opt:NN #1#2 +\cs_new_protected:Npn \fnpct_renew_no_opt:NN #1#2 { - \prop_gput:Nxn \g_fnpct_adapted_notes_prop { \cs_to_str:N #2 } { #1 } + \prop_gput:Nxn \g__fnpct_adapted_notes_prop { \cs_to_str:N #2 } { #1 } \cs_new_eq:NN #2 #1 \RenewDocumentCommand #1 { s+m } { \fnpct_handle_note:Nnnnn #2 { \q_no_value } { \q_no_value } { ##2 } { ##1 } } @@ -735,9 +797,9 @@ \cs_generate_variant:Nn \fnpct_renew_no_opt:NN { cc ,Nc } % \note like -\cs_new:Npn \fnpct_renew_no_arg:NN #1#2 +\cs_new_protected:Npn \fnpct_renew_no_arg:NN #1#2 { - \prop_gput:Nxn \g_fnpct_adapted_notes_prop { \cs_to_str:N #2 } { #1 } + \prop_gput:Nxn \g__fnpct_adapted_notes_prop { \cs_to_str:N #2 } { #1 } \cs_new_eq:NN #2 #1 \RenewDocumentCommand #1 { s } { \fnpct_handle_note:Nnnnn #2 { \q_no_value } { \q_no_value } { } { ##1 } } @@ -745,16 +807,16 @@ \cs_generate_variant:Nn \fnpct_renew_no_arg:NN { cc } % create mult-variant -\cs_new:Npn \fnpct_create_mult_variant:NN #1#2 +\cs_new_protected:Npn \fnpct_create_mult_variant:NN #1#2 { \NewDocumentCommand #1 { s+m } { \fnpct_mult_note:Nnn #2 { ##1 } { ##2 } } } % \footnotemark[<mark>] like commands: -\cs_new:Npn \fnpct_renew_mark:NN #1#2 +\cs_new_protected:Npn \fnpct_renew_mark:NN #1#2 { - \prop_gput:Nxn \g_fnpct_adapted_notes_prop { \cs_to_str:N #2 } { #1 } + \prop_gput:Nxn \g__fnpct_adapted_notes_prop { \cs_to_str:N #2 } { #1 } \cs_new_eq:NN #2 #1 \RenewDocumentCommand #1 { so } { \fnpct_handle_note:Nnnnn #2 { ##2 } { \q_no_value } { } { ##1 } } @@ -790,6 +852,20 @@ { \fnpct_renew_opt:Nc #1 { fnpct_orig_ \cs_to_str:N #1 :w } } } +\NewDocumentCommand \AdaptNoteNoOpt { mm } + { + \cs_if_exist:cTF { fnpct_orig_ \cs_to_str:N #1 :w } + { \fnpct_message:nx { already-adapted } { #1 } } + { \fnpct_renew_and_mult_no_opt:NcN #1 { fnpct_orig_ \cs_to_str:N #1 :w } #2 } + } + +\NewDocumentCommand \AdaptNoteNoOptNoMult { m } + { + \cs_if_exist:cTF { fnpct_orig_ \cs_to_str:N #1:w } + { \fnpct_message:nx { already-adapted } { #1 } } + { \fnpct_renew_no_opt:Nc #1 { fnpct_orig_ \cs_to_str:N #1:w } } + } + \NewDocumentCommand \AdaptNoteMark { m } { \cs_if_exist:cTF { fnpct_orig_ \cs_to_str:N #1 :w } @@ -810,7 +886,7 @@ \AtBeginDocument { \@ifpackageloaded { hyperref } - { \bool_set_true:N \l_fnpct_hyperref_bool } + { \bool_set_true:N \l__fnpct_hyperref_bool } { \cs_if_exist:NF \AfterBeginDocument { \cs_new:Npn \AfterBeginDocument #1 { #1 } } @@ -819,6 +895,8 @@ { \AdaptNote \footnote \multfootnote \AdaptNoteMark \footnotemark + \cs_if_exist:NT \footref + { \AdaptNoteNoOptNoMult \footref } \fnpct_new:NN \innernote \fnpct_inner_footnote:w %% the `endnotes' package: \fnpct_treatment:nn { endnotes } @@ -840,7 +918,6 @@ { \AdaptNoteOpt \sidenote \multsidenote \AdaptNoteMark \sidenotemark -% \AdaptNoteOpt \sidecite \multsidecite } %% the `parnotes' package: \fnpct_treatment:nn { parnotes } @@ -848,7 +925,7 @@ %% the `pagenote' package: \fnpct_treatment:nn { pagenote } { - \bool_if:NT \l_fnpct_makepagenote_bool + \bool_if:NT \l__fnpct_makepagenote_bool { \AdaptNote \pagenote \multpagenote } } %% the `tablefootnote' package: @@ -860,13 +937,13 @@ %% the `bigfoot' package: \fnpct_treatment:nn { bigfoot } { - \prop_map_inline:Nn \l_fnpct_footnote_class_prop + \prop_map_inline:Nn \l__fnpct_footnote_class_prop { \fnpct_renew_and_mult:ccc { footnote#2 } { fnpct_orig_footnote#2:w } { multfootnote#2 } \fnpct_renew_mark:cc { footnotemark#2 } { fnpct_orig_footnotemark#2:w } } - \prop_if_in:NnT \l_fnpct_footnote_class_prop { default } + \prop_if_in:NnT \l__fnpct_footnote_class_prop { default } { % re-set basics: \cs_set_eq:NN \footnote \footnotedefault @@ -877,19 +954,19 @@ %% the `fixfoot' package: \fnpct_treatment:nn { fixfoot } { - \prop_map_inline:Nn \l_fnpct_footnote_fixfoot_prop + \prop_map_inline:Nn \l__fnpct_footnote_fixfoot_prop { \fnpct_renew_no_arg:cc { #2 } { fnpct_orig_fix_#2:w } } } %% the `sepfootnotes' package: \fnpct_treatment:nn { sepfootnotes } { - \prop_map_inline:Nn \l_fnpct_sepfootnote_foot_classes_prop + \prop_map_inline:Nn \l__fnpct_sepfootnote_foot_classes_prop { \fnpct_renew_and_mult_no_opt:ccc { #2note } { fnpct_orig_sep_#2:w } { #2multnote } \fnpct_renew_no_opt:cc { #2notemark } { fnpct_orig_sep_#2_mark:w } } - \prop_map_inline:Nn \l_fnpct_sepfootnote_end_classes_prop + \prop_map_inline:Nn \l__fnpct_sepfootnote_end_classes_prop { \fnpct_renew_and_mult_no_opt:ccc { #2note } { fnpct_orig_sep_#2:w } { #2multnote } @@ -900,7 +977,8 @@ } % the `bigfoot' package neads special treatment: -\prop_new:N \l_fnpct_footnote_class_prop +\prop_new:N \l__fnpct_footnote_class_prop + \fnpct_special_treatment:nn { bigfoot } { % hook into \DeclareNewFootnote so we can redefine all footnote @@ -908,7 +986,7 @@ \cs_new_eq:NN \fnpct_new_footnote:w \DeclareNewFootnote \RenewDocumentCommand \DeclareNewFootnote { omo } { - \prop_put:Nnn \l_fnpct_footnote_class_prop { #2 } { #2 } + \prop_put:Nnn \l__fnpct_footnote_class_prop { #2 } { #2 } \IfNoValueTF { #1 } { \IfNoValueTF { #3 } @@ -921,12 +999,13 @@ { \fnpct_new_footnote:w [ #1 ] { #2 } [ #3 ] } } } - \bool_if:NT \l_fnpct_bigfoot_default_top_bool + \bool_if:NT \l__fnpct_bigfoot_default_top_bool { \DeclareNewFootnote { default } } } % as does the `fixfoot' package -\prop_new:N \l_fnpct_footnote_fixfoot_prop +\prop_new:N \l__fnpct_footnote_fixfoot_prop + \fnpct_special_treatment:nn { fixfoot } { % hook into \DeclareFixedFootnote so we can redefine all footnote @@ -934,7 +1013,7 @@ \cs_new_eq:NN \fnpct_new_fixnote:w \DeclareFixedFootnote \RenewDocumentCommand \DeclareFixedFootnote { smm } { - \prop_put:Nnx \l_fnpct_footnote_fixfoot_prop { #2 } + \prop_put:Nnx \l__fnpct_footnote_fixfoot_prop { #2 } { \cs_to_str:N #2 } \IfBooleanTF { #1 } { \fnpct_new_fixnote:w * { #2 } { #3 } } @@ -943,17 +1022,19 @@ } % and the `pagenote' package: -\bool_new:N \l_fnpct_makepagenote_bool +\bool_new:N \l__fnpct_makepagenote_bool + \fnpct_special_treatment:nn { pagenote } { \tl_put_left:Nn \makepagenote - { \bool_set_true:N \l_fnpct_makepagenote_bool } + { \bool_set_true:N \l__fnpct_makepagenote_bool } } % aaand... the `sepfootnotes' package: -\prop_new:N \l_fnpct_sepfootnote_foot_classes_prop -\prop_new:N \l_fnpct_sepfootnote_end_classes_prop -\prop_new:N \l_fnpct_sepfootnote_symbol_classes_prop +\prop_new:N \l__fnpct_sepfootnote_foot_classes_prop +\prop_new:N \l__fnpct_sepfootnote_end_classes_prop +\prop_new:N \l__fnpct_sepfootnote_symbol_classes_prop + \fnpct_special_treatment:nn { sepfootnotes } { \cs_new_eq:NN \fnpct_orig_new_footnotes:w \newfootnotes @@ -961,19 +1042,19 @@ \cs_new_eq:NN \fnpct_orig_new_symbolnotes:w \newsymbolfootnotes \RenewDocumentCommand \newfootnotes { sm } { - \prop_put:Nnn \l_fnpct_sepfootnote_foot_classes_prop { #2 } { #2 } + \prop_put:Nnn \l__fnpct_sepfootnote_foot_classes_prop { #2 } { #2 } \IfBooleanTF { #1 } { \fnpct_orig_new_footnotes:w * { #2 } } { \fnpct_orig_new_footnotes:w { #2 } } } \RenewDocumentCommand \newendnotes { m } { - \prop_put:Nnn \l_fnpct_sepfootnote_end_classes_prop { #1 } { #1 } + \prop_put:Nnn \l__fnpct_sepfootnote_end_classes_prop { #1 } { #1 } \fnpct_orig_new_endnotes:n { #1 } } \RenewDocumentCommand \newsymbolfootnotes { om } { - \prop_put:Nnn \l_fnpct_sepfootnote_symbol_classes_prop { #2 } { #2 } + \prop_put:Nnn \l__fnpct_sepfootnote_symbol_classes_prop { #2 } { #2 } \IfNoValueTF { #1 } { \fnpct_orig_new_symbolnotes:w { #2 } } { \fnpct_orig_new_symbolnotes:w [ #1 ] { #2 } } @@ -981,6 +1062,20 @@ } % -------------------------------------------------------------------------- +\RequirePackage{translations} +\AtBeginDocument{ + \tl_set:Nx \l__fnpct_tmpa_tl { \baselanguage{French} } + \tl_set:Nx \l__fnpct_tmpb_tl { \baselanguage{\languagename} } + \tl_if_eq:NNT \l__fnpct_tmpa_tl \l__fnpct_tmpb_tl + { + \AfterBeginDocument{ + \let\@footnotemark\@footnotemarkORI + \setfnpct{ before-footnote-space = .16667em } + } + } +} + +% -------------------------------------------------------------------------- % SETUP COMMAND: \NewDocumentCommand \setfnpct { m } { \keys_set:nn { fnpct } { #1 } } @@ -1020,12 +1115,12 @@ breaks any more 2012/06/28 v0.2c - bugfix: works now flawless together with `bigfoot' 2012/07/07 v0.2d - check for all sorts of following footnotes to insert - \l_fnpct_multiple_footnote_separator_tl + \l__fnpct_multiple_footnote_separator_tl 2012/07/24 v0.2e - improved scanning ahead for punctuation marks, adapted to deprecated functions in l3kernel and l3packages 2012/08/27 v0.2f - switched to internal scratch variables 2012/11/14 v0.2g - adapt changes in `sidenotes' package -2013/01/18 v0.2h - bug fixed: \l_fnpct_multiple_footnote_separator_tl +2013/01/18 v0.2h - bug fixed: \l__fnpct_multiple_footnote_separator_tl should be { , } when `memoir' is loaded 2013/01/21 v0.2i - adapted to changes of sepfootnotes, bug fix in reading of multiple notes @@ -1033,6 +1128,16 @@ 2013/04/07 v0.2k - bug fix: suppress possible break point between footnote mark and punctuation mark if `punct-after=true' has been set + - new: \AdaptNoteNoOpt, \AdaptNoteNoOptNoMult +2013/04/16 v0.3 - adapt \footref if it exists +2013/06/14 v0.3a - various internal commands needed to be defined + protected +2013/12/22 v0.4 - when biblatex's \autocite is adapted a fix was needed: + it calls \footnote eventually which inserted + `before-footnote-space' when it shouldn't + - adapt to French language settings + - clearer distinction between internal commands and + document commands % -------------------------------------------------------------------------- % NOTES: @@ -1042,4 +1147,6 @@ % -------------------------------------------------------------------------- % TODO: - solve incompatibility with the `footnote' package -- get this working (??) => http://tex.stackexchange.com/questions/54288/nested-endnotes
\ No newline at end of file +- get this working (??) => http://tex.stackexchange.com/questions/54288/nested-endnotes +- the `bigfoot' package provides \footnote+ and \footnote- -- let's see if we + can add those functionalities again |