| 1 |
% arara: pdflatex: { shell: on , interaction: nonstopmode } |
| 2 |
% arara: biber |
| 3 |
% arara: pdflatex |
| 4 |
% arara: pdflatex |
| 5 |
% -------------------------------------------------------------------------- |
| 6 |
% the FNPCT package |
| 7 |
% |
| 8 |
% footnotes' interaction with punctuation |
| 9 |
% |
| 10 |
% -------------------------------------------------------------------------- |
| 11 |
% Clemens Niederberger |
| 12 |
% Web: https://github.com/cgnieder/fnpct/ |
| 13 |
% E-Mail: [email protected] |
| 14 |
% -------------------------------------------------------------------------- |
| 15 |
% Copyright 2012--2022 Clemens Niederberger |
| 16 |
% |
| 17 |
% This work may be distributed and/or modified under the |
| 18 |
% conditions of the LaTeX Project Public License, either version 1.3c |
| 19 |
% of this license or (at your option) any later version. |
| 20 |
% The latest version of this license is in |
| 21 |
% http://www.latex-project.org/lppl.txt |
| 22 |
% and version 1.3c or later is part of all distributions of LaTeX |
| 23 |
% version 2008/05/04 or later. |
| 24 |
% |
| 25 |
% This work has the LPPL maintenance status `maintained'. |
| 26 |
% |
| 27 |
% The Current Maintainer of this work is Clemens Niederberger. |
| 28 |
% -------------------------------------------------------------------------- |
| 29 |
\documentclass{fnpct-manual} |
| 30 |
|
| 31 |
\setfnpct{ |
| 32 |
add-trailing-token = [0pt]:[-.05em]{colon} , |
| 33 |
after-comma-space = -0.1em , |
| 34 |
after-dot-space = -0.1em , |
| 35 |
before-comma-space = -0.05em , |
| 36 |
before-dot-space = -0.05em , |
| 37 |
before-footnote-space = 0.05em |
| 38 |
} |
| 39 |
|
| 40 |
\usepackage[biblatex]{embrac} |
| 41 |
\ChangeEmph{[}[,.02em]{]}[.055em,-.08em] |
| 42 |
\ChangeEmph{(}[-.01em,.04em]{)}[.04em,-.05em] |
| 43 |
|
| 44 |
\addbibresource{cnltx.bib} |
| 45 |
\addbibresource{\jobname.bib} |
| 46 |
\addbibresource{biblatex-examples.bib} |
| 47 |
\begin{filecontents*}[overwrite]{\jobname.bib} |
| 48 |
@book{bringhurst04, |
| 49 |
title = {The Elements of Typographic Style}, |
| 50 |
author = {Robert Bringhurst}, |
| 51 |
year = {2004}, |
| 52 |
version = {3.2}, |
| 53 |
isbn = {978-0-88179-205-5}, |
| 54 |
publisher = {Hartley \&\ Marks, Canada} |
| 55 |
} |
| 56 |
@online{tex.sx:56094, |
| 57 |
title = {Is there a way to automatically change kerning between |
| 58 |
commas/full stops and footnote marks?} , |
| 59 |
author = {Christian} , |
| 60 |
date = {2012-05-16} , |
| 61 |
url = {https://tex.stackexchange.com/q/56094/5049} , |
| 62 |
visited = {2022-03-27} |
| 63 |
} |
| 64 |
\end{filecontents*} |
| 65 |
|
| 66 |
\AdaptNote\footcite{m}{#NOTE{#1}} |
| 67 |
|
| 68 |
\newname\bringhurst{Robert Bringhurst} |
| 69 |
\newname\lefloch{Bruno Le Floch} |
| 70 |
|
| 71 |
\setlength\parfillskip{0pt plus .8\textwidth} |
| 72 |
|
| 73 |
\begin{document} |
| 74 |
|
| 75 |
\section{Preface for those upgrading from version 0.x} |
| 76 |
|
| 77 |
\begin{bewareofthedog} |
| 78 |
For those upgrading from versions~0 to version~1: a number of options have |
| 79 |
been dropped or renamed. Please have a close look at your log file for |
| 80 |
warnings. Also, the way commands are adapted and hence the syntax of |
| 81 |
\cs{AdaptNote} has changed completely. In many if not all cases leaving them |
| 82 |
as they were will lead to errors. \par |
| 83 |
The \cs*{mult...} variants are not defined by default anymore. They can be |
| 84 |
retained through the load-time option \option{multiple} if needed. Letting |
| 85 |
the note commands behave as their \cs*{mult...} variants is not supported |
| 86 |
any more. \par |
| 87 |
\cs{innernote} is not provided anymore. Depending on user feedback I might |
| 88 |
try to add it again to \fnpct. \par |
| 89 |
Please read this manual carefully so you detect all changes. \par |
| 90 |
\emph{I am sorry for the inconvenience but I am convinced that the new |
| 91 |
syntax is more powerful and more flexible in the long run.} \par |
| 92 |
You can fall back to the last version~0 by saying |
| 93 |
\cs*{usepackage}\Marg{fnpct}\Oarg{=v0}. |
| 94 |
\end{bewareofthedog} |
| 95 |
|
| 96 |
\section{License} |
| 97 |
\license |
| 98 |
|
| 99 |
\section{What's it all about?} |
| 100 |
\subsection{Introduction} |
| 101 |
The purpose of this package is to offer kerning for footnote marks, \ie\ the |
| 102 |
superscripts. This is not appropriate for all superscripts. Symbols must be |
| 103 |
handled differently than numbers. And of course the amount depends on the |
| 104 |
chosen font. \bringhurst\ says in \citetitle{bringhurst04}: |
| 105 |
|
| 106 |
\begin{cnltxquote}[\citetitle{bringhurst04} \emph{\cite{bringhurst04}}] |
| 107 |
Superscripts frequently come at the ends of phrases or sentences. If they |
| 108 |
are high above the line, they can be kerned over a comma or period, but this |
| 109 |
may endanger readability, especially if the text is set in a modest size. |
| 110 |
\end{cnltxquote} |
| 111 |
|
| 112 |
\fnpct\ cannot make these decisions for you. It sets some initial values for |
| 113 |
the comma and the full stop which looked good to me with the tested fonts. |
| 114 |
Additionally it kerns the superscripts away from words when it follows |
| 115 |
directly. The amounts of the kerning can be changed using options. |
| 116 |
|
| 117 |
\fnpct\ also switches the order of the superscript and the following comma or |
| 118 |
full stop. Additional punctuation marks can be added to the switching |
| 119 |
behavior and the amount of kerning can be set for each punctuation mark |
| 120 |
individually. This behavior can be turned off. |
| 121 |
|
| 122 |
The package has been inspired by a question on the Q\&A site |
| 123 |
\url{tex.stackexchange.com}~\cite{tex.sx:56094}. |
| 124 |
|
| 125 |
\subsection{New Behavior of \cs*{footnote}} |
| 126 |
\subsubsection{Interaction With Punctuation} |
| 127 |
The \fnpct\ package basically does two things to footnotes: |
| 128 |
\begin{itemize} |
| 129 |
\item if footnote marks are followed by a comma or a full stop\footnote{More |
| 130 |
punctuation marks can be added through a package option.} the order of |
| 131 |
footnote and punctuation mark is reversed |
| 132 |
\item and the kerning gets adjusted. |
| 133 |
\end{itemize} |
| 134 |
As a side effect a new method of creating multiple |
| 135 |
footnotes\multfootnote{like;this} is provided. |
| 136 |
|
| 137 |
In what way is the kerning adjusted? After being placed behind the |
| 138 |
punctuation mark the footnote mark is moved a little bit back, namely by the |
| 139 |
amount specified with the option \option{after-punct-space}. If the footnote |
| 140 |
mark follows a word \emph{without} being followed by a |
| 141 |
punctuation\footnote{Well, it does not necessarily have to follow a |
| 142 |
\emph{word}. The important point is \emph{not being followed} by a |
| 143 |
punctuation mark.}, there (obviously) is no order switching and a little |
| 144 |
space is inserted before the footnote mark, namely the amount specified by the |
| 145 |
option \option{before-footnote-space}. |
| 146 |
|
| 147 |
Now, let's see some action: |
| 148 |
\begin{example} |
| 149 |
The three little pigs built their houses out of straw\footnote{not to be |
| 150 |
confused with hay}, sticks\footnote{or lumber according to some sources} |
| 151 |
and bricks\footnote{probably fired clay bricks}. |
| 152 |
\end{example} |
| 153 |
|
| 154 |
To ensure that the kerning is set the right way the footnote \emph{must} be |
| 155 |
placed \emph{before} the full stop or the comma. \emph{The command can look |
| 156 |
ahead but not look back}. This means if you place the \cs{footnote} command |
| 157 |
after a full stop or a comma it is treated as if following a word, \ie\ a thin |
| 158 |
space is inserted: effectively the opposite of the desired behavior. The |
| 159 |
effects are demonstrated in figure~\vref{fig:effects}. |
| 160 |
|
| 161 |
The order-switching can be prevented using the option \option{reverse} since |
| 162 |
not all countries and languages have the same typographic conventions. In |
| 163 |
this case the full stop and the comma are moved a bit back, namely by the |
| 164 |
amount specified with the option \option{before-punct-space}. |
| 165 |
|
| 166 |
\begin{figure} |
| 167 |
\centering |
| 168 |
\begin{tabular}{>{\setfnpct{dont-mess-around}}ll} |
| 169 |
\toprule |
| 170 |
without \fnpct & |
| 171 |
with \fnpct \\ |
| 172 |
\midrule |
| 173 |
\strut\quad text.\footnotemark[1] & |
| 174 |
\strut\quad text\footnotemark[1]. \\ |
| 175 |
\strut\quad text\footnotemark[1]. & |
| 176 |
\setfnpct{reverse}\strut\quad text\footnotemark[1]. \\ |
| 177 |
\strut\quad text\footnotemark[1] & |
| 178 |
\strut\quad text\footnotemark[1] \\ |
| 179 |
\bottomrule |
| 180 |
\end{tabular} |
| 181 |
\caption{The effect of \fnpct.}\label{fig:effects} |
| 182 |
\end{figure} |
| 183 |
|
| 184 |
\subsubsection{Space Before Footnotes}\label{sec:space-before} |
| 185 |
\fnpct\sinceversion{1.1} tries to help you in one more way: it removes a |
| 186 |
possible space before a footnote command: |
| 187 |
|
| 188 |
\begin{example} |
| 189 |
The three little pigs built their houses out of straw \footnote{not to be |
| 190 |
confused with hay}, sticks \footnote{or lumber according to some sources} |
| 191 |
and bricks \footnote{probably fired clay bricks}. |
| 192 |
\end{example} |
| 193 |
|
| 194 |
For this behavior it uses \pkg{biblatex}'s (or \pkg{csquotes}') command |
| 195 |
\cs{unspace} if available. Otherwise it defines the command for itself. This |
| 196 |
behavior can be turned off by an option. |
| 197 |
|
| 198 |
\subsection{Temporarily disable (or enable) switching -- new syntax of the |
| 199 |
\cs*{footnote} command} |
| 200 |
One maybe want to put some footnote marks \emph{before} the punctuation and |
| 201 |
some after, for example because the first one describes a single word but the |
| 202 |
second one a whole sentence. For this purpose \fnpct\ adds a \sarg\ argument |
| 203 |
to \cs{footnote} and \cs{footnotemark}. The complete new syntax now is as |
| 204 |
follows: |
| 205 |
\begin{commands} |
| 206 |
\command{footnote}[\sarg\oarg{num>}\marg{footnote text}\meta{tpunct}] |
| 207 |
new \sarg\ argument added. \meta{tpunct} is the optional trailing |
| 208 |
punctuation mark. |
| 209 |
\command{footnotemark}[\sarg\oarg{num>}\meta{tpunct}] |
| 210 |
new \sarg\ argument added. \meta{tpunct} is the optional trailing |
| 211 |
punctuation mark. |
| 212 |
\end{commands} |
| 213 |
The \sarg\ argument temporarily turns off the punctuation/footnote switching. |
| 214 |
In case you set \keyis{reverse}{true} the \sarg\ argument temporarily |
| 215 |
\emph{enables} the switching. |
| 216 |
|
| 217 |
\begin{example} |
| 218 |
\begin{minipage}{.4\linewidth} |
| 219 |
\noindent The three little pigs built their houses |
| 220 |
out of straw\footnote*{not to be confused with hay}, |
| 221 |
sticks\footnote{or lumber according to some sources} |
| 222 |
and bricks\footnote{probably fired clay bricks}. |
| 223 |
\end{minipage}\hfil |
| 224 |
\setfnpct{reverse} |
| 225 |
\begin{minipage}{.4\linewidth} |
| 226 |
\noindent The three little pigs built their houses |
| 227 |
out of straw\footnote*{not to be confused with hay}, |
| 228 |
sticks\footnote{or lumber according to some sources} |
| 229 |
and bricks\footnote{probably fired clay bricks}. |
| 230 |
\end{minipage} |
| 231 |
\end{example} |
| 232 |
|
| 233 |
\section{Options}\label{sec:options} |
| 234 |
\begin{commands} |
| 235 |
\command{setfnpct}[\marg{options}] |
| 236 |
All available options are listed below. They are set with \cs{setfnpct}. |
| 237 |
\default{Underlined} values are set if the option is used without value. |
| 238 |
\end{commands} |
| 239 |
\begin{options} |
| 240 |
\keybool{dont-mess-around}\Default{false} |
| 241 |
Switches of \fnpct's mechanism. |
| 242 |
\keybool{reverse}\Default{false} |
| 243 |
This option reverses the behavior of starred and un-starred footnotes. |
| 244 |
\keybool{unspace}\Default{true} |
| 245 |
\sinceversion{1.1}This option turns the behavior described in |
| 246 |
section~\ref{sec:space-before} off or on. |
| 247 |
\keybool{ranges}\Default{false} |
| 248 |
Activates ranges for multiple footnotes. This is not compatible with |
| 249 |
\pkg{hyperref} and does not work for the marks of some packages. |
| 250 |
\keylit{add-trailing-token}{\oarg{before}\meta{token}\oarg{after}\marg{name}} |
| 251 |
Adds \meta{token} to \fnpct's mechanism and activates it. \meta{before} |
| 252 |
sets the default value for the newly created option |
| 253 |
\option{before-\meta{name}-space}. \meta{after} sets the default value for |
| 254 |
the newly created option \option{after-\meta{name}-space}. |
| 255 |
Instead of the option you can also use the command \cs*{AddPunctuation}, |
| 256 |
see section~\ref{sec:adapt}. |
| 257 |
\keyval{activate-trailing-tokens}{tokenlist}\Default{.,} |
| 258 |
Activates tokens that have been added with \option{add-trailing-token}. |
| 259 |
\keyval{deactivate-trailing-tokens}{tokenlist} |
| 260 |
Deactivates tokens that have been added with \option{add-trailing-token}. |
| 261 |
\keyval{before-footnote-space}{dimension}\Default{.06em} |
| 262 |
Sets the space that is inserted before a footnote that \emph{does not |
| 263 |
follow a punctuation or other note} to \meta{dimension}. |
| 264 |
\keyval{before-dot-space}{dimension}\Default{-.16em} |
| 265 |
Sets the space that is inserted before a dot if the dot follows a footnote |
| 266 |
mark to \meta{dimension}. |
| 267 |
\keyval{before-comma-space}{dimension}\Default{-.16em} |
| 268 |
Sets the space that is inserted before a comma if the dot follows a footnote |
| 269 |
mark to \meta{dimension}. |
| 270 |
\keyval{before-punct-space}{dimension} |
| 271 |
Sets the space that is inserted before any punctuation mark known to |
| 272 |
\fnpct\ if the punctuation mark follows a footnote mark to |
| 273 |
\meta{dimension}. |
| 274 |
\keyval{after-dot-space}{dimension}\Default{-.06em} |
| 275 |
Sets the space that is inserted after a dot if the dot precedes a footnote |
| 276 |
mark to \meta{dimension}. |
| 277 |
\keyval{after-comma-space}{dimension}\Default{-.06em} |
| 278 |
Sets the space that is inserted after a comma if the dot precedes a |
| 279 |
footnote mark to \meta{dimension}. |
| 280 |
\keyval{after-punct-space}{dimension} |
| 281 |
Sets the space that is inserted after any punctuation mark known to |
| 282 |
\fnpct\ if the punctuation mark precedes a footnote mark to |
| 283 |
\meta{dimension}. |
| 284 |
\keyval{mult-fn-delim}{code}\Default{\code{;}} |
| 285 |
Sets the symbol that divides the seperate notes in the \cs*{mult...} |
| 286 |
variants. |
| 287 |
\keyval{separation-symbol}{value}\default{\code{,}} |
| 288 |
Redefines \cs{multfootsep} to \meta{value}. This symbol separates |
| 289 |
multiple footnotes if \keyis{ranges}{false}. |
| 290 |
\keyval{range-symbol}{value}\Default{\code{--}} |
| 291 |
Redefines \cs{multfootrange} to \meta{value}. This symbol separates |
| 292 |
multiple footnotes if \keyis{ranges}{true}. |
| 293 |
\keyval{print-separation}{code}\Default{\cs*{textsuperscript}\Marg{\cs*{multfootsep}}} |
| 294 |
The actual code placed between multiple footnotes if \keyis{ranges}{false}. |
| 295 |
\keyval{print-range}{code}\Default{\cs*{textsuperscript}\Marg{\cs*{multfootrange}}} |
| 296 |
The actual code placed between multiple footnotes if \keyis{ranges}{true}. |
| 297 |
\end{options} |
| 298 |
|
| 299 |
% \subsection{Language Specific Settings} |
| 300 |
% Package \pkg{babel}'s~\cite{pkg:babel} French settings redefine |
| 301 |
% \cs*{@footnotemark}. \fnpct\ resets this redefinition but sets the |
| 302 |
% \option{before-footnote-space} equal to a thin space (\code{.16667em}). |
| 303 |
|
| 304 |
% In case the automatic kerning doesn't work for whatever reason the spaces are |
| 305 |
% available as user commands as well: |
| 306 |
% \begin{commands} |
| 307 |
% \command{kfp} |
| 308 |
% Insert \option{after-dot-space} or (if \keyis{punct-after}{true}) |
| 309 |
% \option{before-dot-space}. |
| 310 |
% \command{kfc} |
| 311 |
% Insert \option{after-comma-space} or (if \keyis{punct-after}{true}) |
| 312 |
% \option{before-comma-space}. |
| 313 |
% \end{commands} |
| 314 |
|
| 315 |
\section{Multiple footnotes}\label{sec:multiple} |
| 316 |
\subsection{Basics} |
| 317 |
Since multiple footnotes have to be treated differently\footnote{see these |
| 318 |
footnotes}\footnote{for an example}, \fnpct\ recognizes if \cs*{footnote} is |
| 319 |
used multiple times in a row: |
| 320 |
|
| 321 |
\begin{example} |
| 322 |
The three little pigs built their houses out of straw\footnote{not to be |
| 323 |
confused with hay}, sticks\footnote{or lumber according to some sources} |
| 324 |
and bricks\footnote{probably fired clay bricks}\footnote{or something else}. |
| 325 |
\end{example} |
| 326 |
|
| 327 |
\subsection{Ranges} |
| 328 |
Starting with a minimum number of three footnotes in a row \fnpct\ can also |
| 329 |
display the footnote marks as a range. |
| 330 |
\begin{example} |
| 331 |
\setfnpct{ ranges = true } |
| 332 |
The three little pigs built their houses out of straw\footnote{not to be |
| 333 |
confused with hay}, sticks\footnote{or lumber according to some sources} |
| 334 |
and bricks\footnote{probably fired clay bricks}% |
| 335 |
\footnote{or something else}\footnote{what do I know}. |
| 336 |
\end{example} |
| 337 |
It is important to note that this has limits: ranges do not work well with |
| 338 |
\pkg{hyperref}. For that reason \fnpct' disables ranges if it detects that |
| 339 |
\pkg{hyperref} has been loaded. If you insist on using ranges together with |
| 340 |
\pkg{hyperref} use |
| 341 |
\begin{options} |
| 342 |
\keybool{keep-ranges}\Default{false} |
| 343 |
to enable them again. |
| 344 |
\end{options} |
| 345 |
|
| 346 |
\subsection{The delimiter and separator} |
| 347 |
Some packages or classes like the \KOMAScript\ classes define |
| 348 |
\cs{multfootsep}. If it is not predefined it is defined by \fnpct: |
| 349 |
\begin{commands} |
| 350 |
\command{multfootsep}\Default{,} |
| 351 |
In its default definition this command simply expands to a comma. |
| 352 |
\command{multfootrange}\Default{--} |
| 353 |
In its default definition this command simply expands to an endash. |
| 354 |
\end{commands} |
| 355 |
This commands can be redefined to adapt to your needs. You can do this with |
| 356 |
\cs*{renewcommand} or by using these options: |
| 357 |
\begin{options} |
| 358 |
\keyval{separation-symbol}{value}\default{\code{,}} |
| 359 |
Redefines \cs{multfootsep} to \meta{value}. This symbol separates |
| 360 |
multiple footnotes if \keyis{ranges}{false}. |
| 361 |
\keyval{range-symbol}{value}\Default{\code{--}} |
| 362 |
Redefines \cs{multfootrange} to \meta{value}. This symbol separates |
| 363 |
multiple footnotes if \keyis{ranges}{true}. |
| 364 |
\end{options} |
| 365 |
Both symbols are placed inside \cs*{textsuperscript}. This can also be |
| 366 |
redefined if necessary: |
| 367 |
\begin{options} |
| 368 |
\keyval{print-separation}{code}\Default{\cs*{textsuperscript}\Marg{\cs*{multfootsep}}} |
| 369 |
The actual code placed between multiple footnotes if \keyis{ranges}{false}. |
| 370 |
\keyval{print-range}{code}\Default{\cs*{textsuperscript}\Marg{\cs*{multfootrange}}} |
| 371 |
The actual code placed between multiple footnotes if \keyis{ranges}{true}. |
| 372 |
\end{options} |
| 373 |
|
| 374 |
\subsection{\cs*{mult...} variants} |
| 375 |
|
| 376 |
\begin{bewareofthedog} |
| 377 |
The commands presented in this section are defined to keep some backwards |
| 378 |
compatibility to versions of \fnpct\ prior to v1.0. In order to use them |
| 379 |
you have to call the package with |
| 380 |
\cs*{usepackage}\Oarg{multiple}\Marg{fnpct}. |
| 381 |
\end{bewareofthedog} |
| 382 |
In earlier versions of \fnpct\ detecting following footnotes was not as |
| 383 |
reliable as it is now. For that reason it defined the following command: |
| 384 |
\begin{commands} |
| 385 |
\command{multfootnote}[\sarg\Marg{\meta{list};\meta{of};\meta{footnotes}}\meta{tpunct}] |
| 386 |
Different footnotes are separated with a semicolon. The \sarg\ turns the |
| 387 |
footnote/punctuation switching temporarily off. |
| 388 |
\end{commands} |
| 389 |
\begin{example} |
| 390 |
The three little pigs built their houses out of straw\footnote{not to be |
| 391 |
confused with hay}, sticks\footnote{or lumber according to some sources} |
| 392 |
and bricks\multfootnote{probably fired clay bricks;or something else}. |
| 393 |
\end{example} |
| 394 |
\begin{options} |
| 395 |
\keyval{mult-variant-prefix}{letters}\Default{mult} |
| 396 |
\sinceversion{1.1}Determines how the variant commands created by the |
| 397 |
\option{multiple} option are named. Choosing |
| 398 |
\keyis{mult-variant-prefix}{m} would create \cs*{mfootnote} etc.\@ instead |
| 399 |
of \cs{multfootnote}. |
| 400 |
\end{options} |
| 401 |
|
| 402 |
This command splits its content at every occurrence of \code{;} and creates a |
| 403 |
footnote for each. This delimiter can be changed: |
| 404 |
\begin{options} |
| 405 |
\keyval{mult-fn-delim}{code}\Default{;} |
| 406 |
Sets the symbol that divides the seperate notes in the \cs*{mult...} |
| 407 |
variants. |
| 408 |
\end{options} |
| 409 |
|
| 410 |
Since the semicolon might be part of the footnote text you might have some |
| 411 |
trouble. Enclosing it in braces should work: |
| 412 |
\begin{example} |
| 413 |
The three little pigs built their houses out of straw\footnote{not to be |
| 414 |
confused with hay}, sticks\footnote{or lumber according to some sources} |
| 415 |
and bricks\multfootnote{probably fired clay bricks{;} or something else;what |
| 416 |
do I know}. |
| 417 |
\end{example} |
| 418 |
|
| 419 |
\section{Extend \fnpct} |
| 420 |
\subsection{Additional punctuation marks} |
| 421 |
So if you want to extend the punctuation switching and kerning to other punctuation |
| 422 |
marks you can do something like this: |
| 423 |
\begin{sourcecode} |
| 424 |
\setfnpct{ add-trailing-token = !{bang} } |
| 425 |
\end{sourcecode} |
| 426 |
\setfnpct{ add-trailing-token = !{bang} } |
| 427 |
After that the bang is recognized and footnotes switch position: |
| 428 |
\begin{example} |
| 429 |
The three little pigs built their houses out of straw\footnote{not to be |
| 430 |
confused with hay}? Sticks\footnote{or lumber according to some sources} |
| 431 |
and bricks\footnote{probably fired clay bricks}! |
| 432 |
\end{example} |
| 433 |
|
| 434 |
New options have also been defined: |
| 435 |
\begin{example} |
| 436 |
\setfnpct{ after-bang-space = .03em } |
| 437 |
The three little pigs built their houses out of straw\footnote{not to be |
| 438 |
confused with hay}? Sticks\footnote{or lumber according to some sources} |
| 439 |
and bricks\footnote{probably fired clay bricks}! |
| 440 |
\end{example} |
| 441 |
|
| 442 |
And option \option{after-punct-space} is obeyed: |
| 443 |
\begin{example} |
| 444 |
\setfnpct{ after-punct-space = 2pt } |
| 445 |
The three little pigs built their houses out of straw\footnote{not to be |
| 446 |
confused with hay}? Sticks\footnote{or lumber according to some sources} |
| 447 |
and bricks\footnote{probably fired clay bricks}! |
| 448 |
\end{example} |
| 449 |
|
| 450 |
\begin{bewareofthedog} |
| 451 |
Please note that you should not use \option{add-trailing-token} inside a |
| 452 |
group. Ideally it is used in the document preamble only. Using it inside of |
| 453 |
a group can lead to unwanted side effects and should not be attempted. |
| 454 |
\end{bewareofthedog} |
| 455 |
|
| 456 |
\setfnpct{ deactivate-trailing-tokens = ! } |
| 457 |
|
| 458 |
\subsection{Make note commands known to \fnpct}\label{sec:adapt} |
| 459 |
If a package is not natively supported you can try and adapt commands |
| 460 |
yourself. Before you do so please check section~\vref{sec:other:packages}. |
| 461 |
\begin{commands} |
| 462 |
% \AdaptNote |
| 463 |
\command{AdaptNote}[\Marg{\cs*{cs}}\marg{arguments}\oarg{counter name}\marg{code}] |
| 464 |
This redefines \cs*{cs}. How the redefinition works is best demonstrated |
| 465 |
with an example. See below for an example. The arguments \meta{arguments} |
| 466 |
are defined with the same syntax as \pkg{xparse}'s |
| 467 |
\cs*{NewDocumentCommand}. See the \pkg{xparse} manual~\cite{pkg:xparse} |
| 468 |
for a complete description. Within \meta{code} \code{\#NOTE} is replaced |
| 469 |
with the original command. If the optional argument is not used the |
| 470 |
counter name \code{cs} for a note command \cs*{cs} is assumed. |
| 471 |
|
| 472 |
In addition to the arguments specified in \meta{arguments} an optional |
| 473 |
star as first argument is defined which reverses \fnpct's behavior. |
| 474 |
\meta{code} is also placed inside a group. |
| 475 |
% \AdaptNoteName |
| 476 |
\command{AdaptNoteName}[\marg{csname}\marg{arguments}\oarg{counter name}\marg{code}] |
| 477 |
Like \cs{AdaptNote} but the first argument expects a csname instead of a |
| 478 |
command sequence token. |
| 479 |
% \MultVariant |
| 480 |
\command{MultVariant}[\Marg{\cs*{cs}}] |
| 481 |
Defines a command \cs*{multcs} which splits is argument at each occurence |
| 482 |
of the token set by the option \option{mult-fn-delim} and turns it into a |
| 483 |
series of calls of \cs*{cs}. \cs*{multcs} also has a starred variant in |
| 484 |
order to create a series of starred calls of \cs*{cs}. |
| 485 |
% \MultVariantName |
| 486 |
\command{MultVariantName}[\marg{csname}] |
| 487 |
Like \cs{MultVariant} but the argument expects a csname instead of a |
| 488 |
command sequence token. |
| 489 |
% \AddPunctuation |
| 490 |
\command*{AddPunctuation}[\oarg{before}\meta{token}\oarg{after}\marg{name}] |
| 491 |
Adds \meta{token} to \fnpct's mechanism and activates it. \meta{before} |
| 492 |
sets the default value for the newly created option |
| 493 |
\option{before-\meta{name}-space}. \meta{after} sets the default value for |
| 494 |
the newly created option \option{after-\meta{name}-space}. This is the |
| 495 |
same as using option \option{add-trailing-token}. |
| 496 |
\end{commands} |
| 497 |
|
| 498 |
\fnpct\ adapts \LaTeX's standard footnote commands the following |
| 499 |
way\footnote{Using \cs*{@mpfn} as counter name is essential to make ranges |
| 500 |
work in minipages.}: |
| 501 |
\begin{sourcecode} |
| 502 |
\AdaptNote\footnote{o+m}[\@mpfn]{\IfNoValueTF{#1}{#NOTE{#2}}{#NOTE[#1]{#2}}} |
| 503 |
\AdaptNote\footnotemark{o}{\IfNoValueTF{#1}{#NOTE}{#NOTE[#1]}} |
| 504 |
\MultVariant\footnote |
| 505 |
\AdaptNote\footref{m}{#NOTE{#1}} |
| 506 |
\end{sourcecode} |
| 507 |
You essentially have to rebuild the syntax of the original command and place |
| 508 |
\code{\#NOTE} in the code where it should be called. This may seem cumbersome |
| 509 |
at first but allows to adapt commands with a more or less arbitrary kind of |
| 510 |
syntax. |
| 511 |
|
| 512 |
The command \cs{AdaptNote} can be used multiple times on the same command in |
| 513 |
order to change a previous redefinition. |
| 514 |
|
| 515 |
\section{Other packages}\label{sec:other:packages} |
| 516 |
\fnpct\ tries its best to support other footnote and related |
| 517 |
packages\footnote{If you find some package missing please let me know.}. Each |
| 518 |
of the following subsections is dedicated to one of these packages and if and |
| 519 |
how they work together with \fnpct. Fortunately most of them do quite well. |
| 520 |
|
| 521 |
Most notably the \option{ranges} option cannot deal with some packages, often |
| 522 |
due to the lack of a suiting \cs*{...text} |
| 523 |
|
| 524 |
\subsection{bigfoot}\label{sec:bigfoot} |
| 525 |
The package \pkg{bigfoot}~\cite{pkg:bigfoot} is supported. |
| 526 |
|
| 527 |
You need to be a bit cautious, though: \emph{verbatim material won't work |
| 528 |
inside footnotes anymore}. You might use \lefloch's \pkg{cprotect} |
| 529 |
package~\cite{pkg:cprotect} if you really need verbatim material in footnotes |
| 530 |
\emph{and} want to use \fnpct. Since \fnpct\ does not redefine any |
| 531 |
\cs{footnotetext} like command it will still work inside one of them. |
| 532 |
|
| 533 |
\subsection{endnotes}\label{sec:endnotes} |
| 534 |
The package \pkg{endnotes}~\cite{pkg:endnotes} is supported. |
| 535 |
|
| 536 |
\subsection{enotez}\label{sec:enotez} |
| 537 |
The package \pkg{enotez}~\cite{pkg:enotez} is supported. |
| 538 |
|
| 539 |
\subsection{fixfoot}\label{sec:fixfoot} |
| 540 |
The \pkg{fixfoot}~\cite{pkg:fixfoot} package provides a possibility to create |
| 541 |
repeating footnotes. \fnpct\ supports this package provided you take care of |
| 542 |
the following: |
| 543 |
|
| 544 |
\emph{Use \cs{DeclareFixedFootnote} only in the preamble but \emph{after} |
| 545 |
loading \fnpct.} |
| 546 |
|
| 547 |
\cs*{DeclareFixedFootnote}\Marg{\cs*{cs}}\marg{footnote text} is used to store |
| 548 |
the \meta{footnote text} in \cs*{cs} which in turn creates a footnote mark for |
| 549 |
it but doesn't repeat the footnote text on the same page in the bottom. The |
| 550 |
document needs several runs to get all the numbers and footnotes right. |
| 551 |
|
| 552 |
Every fixed footnote declared with \cs{DeclareFixedFootnote} gets an optional |
| 553 |
\sarg\ to prevent the punctuation switching. |
| 554 |
|
| 555 |
\noranges{fixfoot} |
| 556 |
|
| 557 |
\subsection{footmisc}\label{sec:footmisc} |
| 558 |
The \pkg{footmisc} package~\cite{pkg:footmisc} provides a range of options to |
| 559 |
customize footnotes, for example output them as margin notes or count |
| 560 |
footnotes per page. |
| 561 |
|
| 562 |
Testing showed no incompatibilities with \pkg{footmisc}. The only thing is |
| 563 |
that you won't have to (and shouldn't) use its \option{multiple} option. |
| 564 |
|
| 565 |
\subsection{footnote}\label{sec:footnote} |
| 566 |
|
| 567 |
Testing showed no incompatibilities with \pkg{footnote}. It cannot adapt its |
| 568 |
environment \env*{footnote}, though. |
| 569 |
|
| 570 |
\subsection{manyfoot}\label{sec:manyfoot} |
| 571 |
The package \pkg{manyfoot}~\cite{pkg:manyfoot} is supported. |
| 572 |
|
| 573 |
\subsection{pagenote}\label{sec:pagenote} |
| 574 |
The package \pkg{pagenote}~\cite{pkg:pagenote} is supported. |
| 575 |
|
| 576 |
\noranges{pagenote} |
| 577 |
|
| 578 |
\subsection{parnotes}\label{sec:parnotes} |
| 579 |
The package \pkg{parnotes}~\cite{pkg:parnotes} is supported. |
| 580 |
|
| 581 |
\noranges{parnotes} |
| 582 |
|
| 583 |
\subsection{sepfootnotes}\label{sec:sepfootnotes} |
| 584 |
The package \pkg{sepfootnotes}~\cite{pkg:sepfootnotes} is supported. Define |
| 585 |
new footnote types \emph{after} \fnpct\ has been loaded. |
| 586 |
|
| 587 |
\subsection{sidenotes}\label{sec:sidenotes} |
| 588 |
\begin{bewareofthedog} |
| 589 |
The package \pkg{sidenotes}~\cite{pkg:sidenotes} is \emph{not} supported! |
| 590 |
\end{bewareofthedog} |
| 591 |
\fnpct\ is not able to adapt \pkg{sidenotes}' commands due to the current |
| 592 |
implementation of \pkg{sidenotes}. |
| 593 |
|
| 594 |
\subsection{snotez}\label{sec:snotez} |
| 595 |
The package \pkg{snotes}~\cite{pkg:snotez} is supported. |
| 596 |
|
| 597 |
\subsection{tablefootnote}\label{sec:tablefootnote} |
| 598 |
The package \pkg{tablefootnote}~\cite{pkg:tablefootnote} is supported. |
| 599 |
|
| 600 |
\noranges{tablefootnote} |
| 601 |
|
| 602 |
\subsection{tufte-latex's \cs*{sidenote}}\label{sec:tufte} |
| 603 |
The \cs*{sidenote} command from the \pkg*{tufte-latex} classes |
| 604 |
\cls{tufte-book} and \cls{tufte-handout} is supported. |
| 605 |
|
| 606 |
\noranges*{tufte-latex} |
| 607 |
|
| 608 |
More precisely: the \cs*{sidenote} command from \pkg*{tufte-latex} does not |
| 609 |
work with \option{ranges}. But since \cs*{sidenote} is only a synonym for |
| 610 |
\cs*{footnote} for \pkg*{tufte-latex} you can use the latter. |
| 611 |
|
| 612 |
\subsection{biblatex's \cs*{footcite}}\label{sec:biblatex} |
| 613 |
If you're willing to sacrifice \cs*{footcite}'s \sarg\ argument (which it has |
| 614 |
in some styles) you can adapt the commands provided by |
| 615 |
\pkg{biblatex}~\cite{pkg:biblatex} as well: |
| 616 |
\begin{sourcecode} |
| 617 |
\AdaptNote\footcite{oo+m}[footnote]{% |
| 618 |
\setfnpct{dont-mess-around}% |
| 619 |
\IfNoValueTF{#1} |
| 620 |
{#NOTE{#3}} |
| 621 |
{\IfNoValueTF{#2}{#NOTE[#1]{#3}}{#NOTE[#1][#2]{#3}}}% |
| 622 |
} |
| 623 |
\end{sourcecode} |
| 624 |
You could use another token for the star, though, if needed: |
| 625 |
\begin{sourcecode} |
| 626 |
\AdaptNote\footcite{t+oo+m}[footnote]{% |
| 627 |
\setfnpct{dont-mess-around}% |
| 628 |
\IfBooleanTF{#1}{% |
| 629 |
\IfNoValueTF{#2} |
| 630 |
{#NOTE{#4}} |
| 631 |
{\IfNoValueTF{#3}{#NOTE[#2]{#4}}{#NOTE[#2][#3]{#4}}}% |
| 632 |
}{% |
| 633 |
\IfNoValueTF{#2} |
| 634 |
{#NOTE*{#4}} |
| 635 |
{\IfNoValueTF{#3}{#NOTE*[#2]{#4}}{#NOTE*[#2][#3]{#4}}}% |
| 636 |
}% |
| 637 |
} |
| 638 |
\end{sourcecode} |
| 639 |
Testing showed no problems whatsoever but \fnpct\ does not adapt the command |
| 640 |
itself. |
| 641 |
|
| 642 |
\begin{bewareofthedog} |
| 643 |
Turning \fnpct\ off inside of \cs*{footcite} is advised as shown in above |
| 644 |
examples. \cs*{footcite} calls \cs*{footnote} internally which else might |
| 645 |
lead to inconsistent and unwanted spaces. |
| 646 |
\end{bewareofthedog} |
| 647 |
|
| 648 |
|
| 649 |
\appendix |
| 650 |
|
| 651 |
\printbibliography |
| 652 |
|
| 653 |
\end{document} |
| 654 |
TODO: |
| 655 |
- memoir, \multfootsep |
| 656 |
- \thanks |
| 657 |
- nested notes and \AdaptText\footnotetext{om}{\IfNoValueTF{#1}{#NOTE{#2}}{#NOTE[#1]{#2}}} |