diff options
-rw-r--r-- | Master/texmf-dist/doc/latex/sepfootnotes/README | 26 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/sepfootnotes/sepfootnotes.pdf | bin | 128776 -> 200186 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/sepfootnotes/sepfootnotes.tex | 393 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/sepfootnotes/sepfootnotes.dtx | 1003 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/sepfootnotes/sepfootnotes.ins | 47 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/sepfootnotes/sepfootnotes.sty | 195 |
6 files changed, 491 insertions, 1173 deletions
diff --git a/Master/texmf-dist/doc/latex/sepfootnotes/README b/Master/texmf-dist/doc/latex/sepfootnotes/README index 97f51af5f1e..3a372fbea75 100644 --- a/Master/texmf-dist/doc/latex/sepfootnotes/README +++ b/Master/texmf-dist/doc/latex/sepfootnotes/README @@ -1,10 +1,19 @@ Package: sepfootnotes -Description: Footnotes in separate file -Motto: Notes defined before notes inserted - -This package allows the content of footnotes to be defined before their marks -are inserted in a document. Footnotes and endnotes can, thus, be easily -grouped together in a separate file, so that the main body is less cluttered. +Description: Support footnotes and endnotes from separate files + +This package supports footnotes and endnotes from separate files. +Basically, it provides \sepfootnotecontent and \sepfootnote: +the former defines the content of a note; the latter typesets that note. + +2013/01/17 v0.2 + * utf8 Support keys with UTF-8 characters + * \newfootnotes Use the standard footnote counter + * \newfootnotes* Use its own footnote counter + * \sepfootnote Default footnote apparatus + * \addto{prefix}notes Add text and commands to endnotes + * \print{prefix}note Print the content of a note + * \jobname.ent-{prefix} Renamed endnote external file + * \{prefix}noteref Removed 2012/03/06 v0.1 Initial version @@ -12,9 +21,6 @@ grouped together in a separate file, so that the main body is less cluttered. -------------------------------------------------------------------------------- Installation: -*Run: (This will generate sepfootnotes.sty) - latex sepfootnotes.ins - *Copy sepfootnotes.sty to a location where LaTeX will find it. See http://www.tex.ac.uk/faq @@ -24,7 +30,7 @@ Usage: *See sepfootnotes.pdf -------------------------------------------------------------------------------- -Copyright (C) 2012 Eduardo C. Lourenço de Lima +Copyright (C) 2013 Eduardo C. Lourenço de Lima This material is subject to the LaTeX Project Public License. See http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html diff --git a/Master/texmf-dist/doc/latex/sepfootnotes/sepfootnotes.pdf b/Master/texmf-dist/doc/latex/sepfootnotes/sepfootnotes.pdf Binary files differindex 00836773ea4..2f3d4975ca2 100644 --- a/Master/texmf-dist/doc/latex/sepfootnotes/sepfootnotes.pdf +++ b/Master/texmf-dist/doc/latex/sepfootnotes/sepfootnotes.pdf diff --git a/Master/texmf-dist/doc/latex/sepfootnotes/sepfootnotes.tex b/Master/texmf-dist/doc/latex/sepfootnotes/sepfootnotes.tex new file mode 100644 index 00000000000..27bd129a4a2 --- /dev/null +++ b/Master/texmf-dist/doc/latex/sepfootnotes/sepfootnotes.tex @@ -0,0 +1,393 @@ +% Copyright (C) 2013 Eduardo C. Lourenço de Lima +% +% 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. +\documentclass{ltxdoc} +\usepackage{sepfootnotes} +\usepackage{color} +\definecolor{myblue}{rgb}{0,0.2,0.6} + +\newenvironment{Description} + {\par\medskip\noindent\ignorespaces}{} + +\newenvironment{synopsis} + {\begin{list}{} + {\setlength\parsep{0pt} + \setlength\itemsep{0pt}}} + {\end{list}} + +\newenvironment{syntax} + {\par\noindent \textbf{Syntax:}\begin{list}{} + {\setlength\parsep{0pt} + \setlength\itemsep{0pt}}} + {\end{list}} + +\newenvironment{example} + {\par\noindent \textbf{Example:}\begin{list}{} + {\setlength\parsep{0pt} + \setlength\itemsep{0pt}}} + {\end{list}} + +\newcounter{example} +\newenvironment{Example}[1] + {\stepcounter{example}\subsection*{Example \theexample}#1} + {} + +\newenvironment{page} + {\begin{center}\begin{minipage}[t]{0.5\linewidth}} + {\end{minipage}\end{center}} +\newcommand\TODO{\texttt{Todo:}} +\newcommand\fileversion{0.2} +\newcommand\filedate{January 17, 2013} +\begin{document} +\title{The \textsf{\color{myblue} sepfootnotes} package,\thanks{This document corresponds to \textsf{sepfootnotes}~\fileversion, dated~\filedate. +I am grateful to Michael Sellhoff for his valuable feedback on \texttt{sepfootnotes}.}\\{or a footnote to Plato}} +\author{Eduardo C. Louren\c{c}o de Lima \\ \texttt{elourenco@phi.pro.br}} +\date{\filedate} +\maketitle + + + \begin{abstract}\noindent + The |sepfootnotes| package supports footnotes and endnotes from separate files. + Basically, it provides |\sepfootnotecontent| and |\sepfootnote|: the former + defines the content of a note; the latter typesets that note. + \end{abstract} + + \section*{Introduction} + + Standard |\footnote| and |\endnote| both take a note as a mandatory argument. Because notes have to be embedded in the paragraph to which they refer, sentences are often split up into two\footnote {This is precisely what this footnote does to the first paragraph of this document. There are more than thirty words between `two' and `or more' in the code of an otherwise short paragraph.} or more parts. Consequently, footnotes and endnotes may disrupt the flow of reading and editing {\LaTeX} prose.\footnote {In a posting to \texttt{texhax.tug.org} in April 2010, someone complained that using footnotes ``tends to disrupt the flow of the document on the screen and makes editing the text itself harder'', and asked about the possibility of ``putting all of the footnotes in a separate file''~\cite{Nicholas Cole}. Another user, back in 2004, remarked that the ``only thing I missed about word processors was the ability to keep footnote text at the bottom of the page, or in a separate window. I often have extensive footnotes, and don't want them cluttering up my main body text when I'm composing''~\cite{Luecking}.} This can be an issue for those who make extensive use of notes, such as philosophers and people from the humanities in general. + + The |sepfootnotes| package gets around this inconvenience by separating note input from usage. That is, it provides a command to define what a particular note says, and another command to insert that note later on in the document. + + Note definitions may be grouped together---in no particular order---in the preamble, at the beginning of chapters or sections, right before a paragraph, or even in a \emph{separate file}. In that way, the main body is less cluttered. + + You may use |sepfootnotes| and standard |\footnote| simultaneously; the same goes for |\footcite| from |biblatex|. + + +\newpage + + \section{Synopsis} + + + \subsection*{Default footnote apparatus} + +\begin{synopsis} +\item |\sepfootnotecontent| \marg{key} \marg{content} +\item |\sepfootnote| \marg{key} +\end{synopsis} + + + \subsection*{User-defined footnote or endnote apparatus} + +\begin{synopsis} +\item |\newfootnotes | \marg{prefix} +\item |\newfootnotes*| \marg{prefix}\medskip +\item |\newsymbolfootnotes| \oarg{master counter} \marg{prefix}\medskip +\item |\newendnotes| \marg{prefix}\bigskip +\item |\|\meta{prefix}|notecontent| \marg{key} \marg{content} +\item |\|\meta{prefix}|note| \marg{key} +\item |\|\meta{prefix}|notemark| \marg{key} +\item |\|\meta{prefix}|notetext| \marg{key} +\item |\print|\meta{prefix}|note| \marg{key}\medskip +\end{synopsis} + + \subsection*{Endnote-specific} + +\begin{synopsis} +\item |\the|\meta{prefix}|notes| +\item |\addto|\meta{prefix}|notes| \marg{text} +\end{synopsis} + + \subsection*{Formatting} + +\begin{synopsis} +\item |\renewcommand\the|\meta{prefix}|note| +\item |\renewcommand\the|\meta{prefix}|mark| +\item |\renewcommand\make|\meta{prefix}|mark| +\item |\renewcommand\|\meta{prefix}|notesize| +\item |\renewcommand\|\meta{prefix}|noteformat|\medskip +\item |\renewenvironment {|\meta{prefix}|notes}| +\end{synopsis} + + + \section{Basic usage} + + +\begin{Description} +\DescribeMacro{\sepfootnotecontent} +First define the \meta{content} of a footnote by +assigning it a \meta{key} that uniquely identifies it: +\begin{synopsis} +\item |\sepfootnotecontent| \marg{key} \marg{content} +\end{synopsis} +\end{Description} + + +\begin{Description} +\DescribeMacro{\sepfootnote} +Then insert that footnote anywhere in the main body by means of the +same \meta{key} as used before: +\begin{synopsis} +\item |\sepfootnote| \marg{key} +\end{synopsis} +\end{Description} + + +% ------------------------------ Intermediate --------------------------------- + + \section{Advanced usage} + +\begin{Description} +\DescribeMacro{\newfootnotes} +\DescribeMacro{\newfootnotes*} +\DescribeMacro{\newsymbolfootnotes} +\DescribeMacro{\newendnotes} +The |sepfootnotes| apparatus described above is available by default. +But you may create as many distinct and independent footnote or endnote apparatus as needed: +\begin{synopsis} +\item |\newfootnotes |\marg{prefix} + +Create an apparatus of footnote commands named after \meta{prefix} using the standard |footnote| counter.\bigskip + +\item |\newfootnotes* |\marg{prefix} + +Create an apparatus of footnote commands named after \meta{prefix} using its own counter.\bigskip + +\item |\newsymbolfootnotes| \oarg{master counter} \marg{prefix} + +Create an apparatus of symbol-footnote commands named after \meta{prefix} using its own counter. The optional argument \meta{master counter} can be anything like |page|, |section|, |chapter|, etc. The default master counter is |page|. The series of symbols is reset each new page, so that * marks the first symbol-footnote on any page, whereas $\dag$ marks the second, $\ddag$ the third, and so on.\bigskip + +\item |\newendnotes |\marg{prefix} + +Create an apparatus of endnote commands named after \meta{prefix} using its own counter. +\end{synopsis} +\end{Description} + +\begin{Description} +\DescribeMacro{\<prefix>notecontent} +This is how to typeset notes: once a note apparatus of any kind is created, you need to assign a \meta{key} to a \meta{content}: +\begin{synopsis} +\item |\|\meta{prefix}|notecontent| \marg{key} \marg{content} +\end{synopsis} +\end{Description} + +\begin{Description} +\DescribeMacro{\<prefix>note} +\DescribeMacro{\<prefix>notemark} +\DescribeMacro{\<prefix>notetext} +\DescribeMacro{\print<prefix>content} +And then use the \meta{key} to typeset that content using any of the following: +\begin{synopsis} +\item |\|\meta{prefix}|note| \marg{key} + +Typeset a note identified by \meta{key}.\bigskip + +\item |\|\meta{prefix}|notemark| \marg{key} + +Typeset just the mark identified by \meta{key} without the corresponding note.\bigskip + +\item |\|\meta{prefix}|notetext| \marg{key} + +Typeset just the note identified by \meta{key} without the corresponding mark.\bigskip + +\item |\print|\meta{prefix}|content| \marg{key} + +Just print the \meta{content} identified by \meta{key}. +\end{synopsis} +\end{Description} + +\newpage + +\begin{Description} +\DescribeMacro{\the<prefix>notes} +\DescribeMacro{\addto<prefix>notes} +\DescribeEnv{<prefix>notes} +\DescribeMacro{\the<prefix>note} +\DescribeMacro{\the<prefix>mark} +\DescribeMacro{\make<prefix>mark} +\DescribeMacro{\<prefix>notesize} +\DescribeMacro{\<prefix>noteformat} +These are endnote-specific: +\begin{synopsis} +\item |\the|\meta{prefix}|notes| + +Typeset the actual endnotes at the end of a chapter or section.\bigskip + +\item |\addto|\meta{prefix}|notes| \marg{text} + +Add \meta{text} to endnotes. + +Suggestion: |\subsection*|\bigskip + +\item |\renewcommand\<prefix>notesize| + +Define the fontsize in which to typeset endnotes. + +Default: |\footnotesize|\bigskip + +\item |\renewenvironment {<prefix>notes}| + +Define the environment in which endnotes are typeset. + +Default: |\<prefix>notesize\setlength\parskip\footnotesep|\bigskip + +\item |\renewcommand\the<prefix>note| + +Define how endnote numbers are typeset. + +Default: |\arabic {<prefix>note}|\bigskip + +\item |\renewcommand\the<prefix>mark| + +Define how endnote marks are typeset. + +Default: |\the<prefix>note|\bigskip + +\item |\renewcommand\make<prefix>mark| + +Define how a particular endnote mark is typeset. + +Default:\footnote{Adapted from the {LaTeX2e} sources.} |\hbox {\normalfont\the<prefix>mark.\ }|\bigskip + +\item |\renewcommand\<prefix>noteformat| + +Define how a particular endnote is typeset. + +Default:\footnote{Adapted from the \texttt{endnotes} package.} + +|\noindent\rightskip\z@ \leftskip\z@|\newline +|\leavevmode\llap{\make<prefix>mark}| +\end{synopsis} +\end{Description} + + +\section{Examples} + +% -------------------------------- Examples ----------------------------------- +\begin{Example} +{How to typeset `Socrates's pupil' as a footnote to Plato using the default |sepfootnotes| apparatus:} +\begin{verbatim} +\documentclass{article} +\usepackage{sepfootnotes} +\sepfootnotecontent{Plato}{Socrates's pupil.} +\begin{document} +This was first brought up by the great Plato.\sepfootnote{Plato} +\end{document} +\end{verbatim} +\end{Example} + +\begin{Example} +{How to typeset `Socrates's pupil' as a footnote to Plato using a \emph{user-defined} footnote apparatus with prefix |a-|} +\begin{verbatim} +\documentclass{article} +\usepackage{sepfootnotes} +\newfootnotes{a} +\anotecontent{Plato}{Socrates's pupil.} +\begin{document} +This was first brought up by the great Plato.\anote{Plato} +\end{document} +\end{verbatim} +\end{Example} + +\begin{Example} +{How to typeset a footnote \emph{from a separate file} using a user-defined apparatus with prefix |b-|} +\begin{itemize}\item mynotes.tex: +\begin{verbatim} +\bnotecontent{Plato}{Socrates's pupil.} +\end{verbatim} +\item document.tex: +\begin{verbatim} +\documentclass{article} +\usepackage{sepfootnotes} +\newfootnotes{b} +\input{mynotes} +\begin{document} +This was first brought up by the great Plato.\bnote{Plato} +\end{document} +\end{verbatim} +\end{itemize} +\end{Example} + +\begin{Example} +{How to typeset `Socrates's pupil' as a \emph{symbol-footnote} to Plato using a user-defined footnote apparatus with prefix |symbol-|} +\begin{verbatim} +\documentclass{article} +\usepackage{sepfootnotes} +\newsymbolfootnotes{symbol} +\symbolnotecontent{Plato}{Socrates's pupil.} +\begin{document} +This was first brought up by the great Plato.\symbolnote{Plato} +\end{document} +\end{verbatim} +\end{Example} + +\begin{Example} +{How to typeset `Socrates's pupil' as an \emph{endnote} to Plato using a user-defined endnote apparatus with prefix |x-|} +\begin{verbatim} +\documentclass{article} +\usepackage{sepfootnotes} +\newendnotes{x} +\xnotecontent{Plato}{Socrates's pupil.} +\begin{document} +This was first brought up by the great Plato.\xnote{Plato} +\section*{Notes} +\thexnotes +\end{document} +\end{verbatim} +\end{Example} + +\begin{Example} +{How to typeset a footnote to Plato \emph{and} an endnote to Homer from a separate file \emph{in no particular order}:} + +\begin{itemize} +\item mynotes.tex: +\begin{verbatim} +\xnotecontent{Homer}{The greatest of ancient poets.} +\anotecontent{Plato}{Socrates's pupil.} +\end{verbatim} + +\item document.tex: +\begin{verbatim} +\begin{document} +\usepackage{sepfootnotes} +\newfootnotes{a} +\newendnotes{x} +\input{mynotes} +\begin{document} + This was first brought up by the great Plato.\anote{Plato} + But an antecedent is to be found in Homer.\xnote{Homer} +\section*{Notes} +\thexnotes +\end{document} +\end{verbatim} +\end{itemize} + +\end{Example} + + + +\begin{thebibliography}{1} + + \bibitem{Nicholas Cole} + \texttt{http://tug.org/mailman/htdig/texhax/2010-April/014558.html} + + \bibitem{Luecking} + \texttt{http://www.44342.com/tex-f809-t9440-p1.htm}. + +% \bibitem{Companion} +% Frank Mittelbach, and Michel Goossens, with Johannes Braams, David Carlisle, +% and Chris Rowley. +% \newblock \emph{The {\LaTeX} Companion}. 2nd +% \newblock Addison~Wesley, 2004. +% \newblock ISBN~\mbox{0-201-36299-6}. + +\end{thebibliography} + +\end{document} diff --git a/Master/texmf-dist/source/latex/sepfootnotes/sepfootnotes.dtx b/Master/texmf-dist/source/latex/sepfootnotes/sepfootnotes.dtx deleted file mode 100644 index 7a5ab7800d8..00000000000 --- a/Master/texmf-dist/source/latex/sepfootnotes/sepfootnotes.dtx +++ /dev/null @@ -1,1003 +0,0 @@ -% \iffalse meta-comment -% -% Copyright (C) 2012 Eduardo C. Lourenço de Lima -% -% 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. -% -% \fi -% \iffalse -% -%<package>\NeedsTeXFormat{LaTeX2e}[1996/06/01] -%<package>\ProvidesPackage{sepfootnotes}[2012/03/06 v0.1 Footnotes in separate file] -%<*driver> -\documentclass{ltxdoc} -\usepackage{sepfootnotes} -\newenvironment{Description} - {\par\medskip\noindent\ignorespaces}{} -\newenvironment{synopsis} - {\begin{list}{} - {\setlength\parsep{0pt} - \setlength\itemsep{0pt}}} - {\end{list}} -\newenvironment{Example}[1] - {\if#1\else\paragraph{Example.}#1\fi} - {} -\newenvironment{page} - {\begin{center}\begin{minipage}[t]{0.5\linewidth}} - {\end{minipage}\end{center}} -\newcommand\TODO{\texttt{Todo:}} -\begin{document} - \DocInput{sepfootnotes.dtx} -\end{document} -%</driver> -% \fi -% \changes{0.1}{2012/03/06}{Initial version} -% \GetFileInfo{sepfootnotes.sty} -% \CheckSum{185} -% \CharacterTable -% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z -% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z -% Digits \0\1\2\3\4\5\6\7\8\9 -% Exclamation \! Double quote \" Hash (number) \# -% Dollar \$ Percent \% Ampersand \& -% Acute accent \' Left paren \( Right paren \) -% Asterisk \* Plus \+ Comma \, -% Minus \- Point \. Solidus \/ -% Colon \: Semicolon \; Less than \< -% Equals \= Greater than \> Question mark \? -% Commercial at \@ Left bracket \[ Backslash \\ -% Right bracket \] Circumflex \^ Underscore \_ -% Grave accent \` Left brace \{ Vertical bar \| -% Right brace \} Tilde \~} -% \DoNotIndex{\,,\@addtoreset,\begin,\closeout,\csname,\end,\endcsname} -% \DoNotIndex{\expandafter,\fnsymbol,\@footnotemark,\footnotesep,\footnotesize} -% \DoNotIndex{\@footnotetext,\@ifundefined,\immediate,\input,\jobname,\label} -% \DoNotIndex{\@makebox,\makebox,\mbox,\MessageBreak,\@namedef,\@nameuse} -% \DoNotIndex{\newcommand,\newcounter,\newenvironment,\newwrite,\noindent} -% \DoNotIndex{\normalfont,\openout,\PackageError, \par,\parskip,\ref} -% \DoNotIndex{\refstepcounter,\relax,\renewcommand,\setlength,\string} -% \DoNotIndex{\@thefnmark\write} -% \title{The \textsf{sepfootnotes} package,\thanks{This document -% corresponds to \textsf{sepfootnotes}~\fileversion, -% dated~\filedate.}\\{or a footnote to Plato}} -% \author{Eduardo C. Louren\c{c}o de Lima \\ \texttt{elourenco@phi.pro.br}} -% \maketitle -% -% -% \begin{abstract}\noindent This package allows the content of footnotes -% to be defined before their marks are inserted in a document. -% Footnotes and endnotes can, thus, be easily grouped together -% in a separate file, so that the main body is less -% cluttered.\end{abstract} -% -% -% \section*{Introduction} -% -% Footnotes and endnotes can be a problem when reading {\LaTeX} code. If there -% are many notes to a document, or if some of them are too long, as is often -% the case with philosophers and people from the humanities in general, reading -% and editing the main body may be quite difficult. -% -% They can be a problem for the simple reason that standard |\footnote| and -% |\endnote| both take the text of a note as a mandatory argument. For one -% thing, a verb and its complement may be\footnote{Notice that this footnote -% does precisely that to the main body of this document. There are ten or more -% lines of code between `may be' and `severed' in such an otherwise short -% paragraph. In a posting to \texttt{texhax.tug.org} in April 2010, someone -% complained that using footnotes ``tends to disrupt the flow of the document -% on the screen and makes editing the text itself harder'', and asked about the -% possibility of ``putting all of the footnotes in a separate file''~\cite{Nicholas Cole}. -% Another user, back in 2004, remarked that the ``only thing I -% missed about word processors was the ability to keep footnote text at the -% bottom of the page, or in a separate window. I often have extensive -% footnotes, and don't want them cluttering up my main body text when I'm -% composing''~\cite{Luecking}. Some people circumvent that issue by -% other artful maneuvering, such as indenting or folding footnote code lines.} -% severed by a dozen lines of code. -% -% This package aims to get around this inconvenience by means of -% macros that take as arguments mere \emph{identifiers,} instead of text, thus -% allowing the content of footnotes and endnotes to be defined \emph{before} -% their marks are inserted in a document. Notes can, thus, be easily grouped -% together in a \emph{separate file,} so that the main body is less -% cluttered. -% -% The point is not to prevent writers from indulging in footnotes. Quite the -% contrary. -% -% -% \section*{Synopsis} -% -% \begin{synopsis} -% \item |\newfootnotes| \marg{prefix} -% \item |\newendnotes| \marg{prefix} -% \item |\newsymbolfootnotes| \oarg{master counter} \marg{prefix}\medskip -% \item |\|\meta{prefix}|note| \marg{id} -% \item |\|\meta{prefix}|notemark| \marg{id} -% \item |\|\meta{prefix}|notetext| \marg{id} -% \item |\|\meta{prefix}|notecontent| \marg{id} \marg{text}\medskip -% \item |\|\meta{prefix}|notes| \marg{id} -% \end{synopsis} -% -% \setcounter{tocdepth}{2} -% \tableofcontents -% \newpage -% \section{Basic Usage} -% -% \subsection{Footnotes} -% -% \begin{Description} -% \DescribeMacro{\newfootnotes} -% The first step is to create a new footnote apparatus. -% \begin{synopsis} -% \item |\newfootnotes| \marg{prefix} -% \end{synopsis} -% The -% argument \meta{prefix} can be any sequence of letters, such as `a' -% or `dog', except `foot' and other names that have already been taken. -% For example, executing |\newfootnotes{a}| creates a number of new commands, the -% names of which all begin with~`a-': |\anotemark|, |\anotetext|, |\anote|, and |\anotecontent|. -% \end{Description} -% \begin{Description} -% \DescribeMacro{\<prefix>notemark} -% \DescribeMacro{\<prefix>notetext} -% The first two correspond to {\LaTeX} -% |\footnotemark|, and |\footnotetext|. -% They also produce a footnote, or rather, a mark without a footnote, and a footnote without a mark. But the important difference -% to their analogues is that they do not have the text of the footnote as -% arguments. They take a \emph{identifier} instead. -% \begin{synopsis} -% \item |\|\meta{prefix}|notemark| \marg{id} -% \item |\|\meta{prefix}|notetext| \marg{id} -% \end{synopsis} -% \end{Description} -% \begin{Description} -% \DescribeMacro{\<prefix>notecontent} -% The identifier \meta{id} identifies the text of a footnote. -% It can be any arbitrary sequence of letters, numbers, space and punctuation marks. -% But it is not -% itself the text -% of the footnote; it is more like a tag, or a name. This naming is brought -% about by: -% \begin{synopsis} -% \item |\|\meta{prefix}|notecontent| \marg{id} \marg{text} -% \end{synopsis} -% \end{Description} -% \begin{Description} -% \DescribeMacro{\<prefix>note} -% And once \meta{text} bears a name it can be identified -% by |\|\meta{prefix}|note| to produce a footnote. -% \begin{synopsis} -% \item |\|\meta{prefix}|note| \marg{id} -% \end{synopsis} -% \end{Description} -% \begin{Example} -% {How to typeset `Aristotle's master' as a footnote.} -% \iffalse -%<*example> -% \fi -\begin{verbatim} -\newfootnotes{a} -\anotecontent{Plato}{Aristotle's master.} - -This was first brought up by -the great Plato\anote{Plato} -in the \textit{Sophist}. -\end{verbatim} -% \iffalse -%</example> -% \fi -% \begin{page} -% \newfootnotes{a} -% \anotecontent{PlatoFoot}{Aristotle's master.} -% This was first brought up by -% the great Plato\anote{PlatoFoot} -% in the \textit{Sophist}. -% \end{page} -% -% \medskip\noindent That sentence will take three lines of code however long the footnote to -% Plato is. No pun intended. -% \end{Example} -% -% -% \subsection{Endnotes} -% -% \begin{Description} -% \DescribeMacro{\newendnotes} -% \DescribeMacro{\<prefix>notes} -% Endnote and footnote commands are essentially the same but for two -% differences. To use endnotes first substitute |\newendnotes| -% for |\newfootnotes|, and then insert |\|\meta{prefix}|notes|, -% plural, at the end of the document. -% \begin{synopsis} -% \item |\newendnotes| \marg{prefix} -% \item |\|\meta{prefix}|notes| -% \end{synopsis} -% \end{Description} -% \begin{Example} -% {How to effortlessly convert all footnotes into endnotes.} -% \iffalse -%<*example> -% \fi -% \begin{verbatim}\newendnotes{a} -\anotecontent{Plato}{Aristotle's master.} - -This was first brought up by -the great Plato\anote{Plato} -in the \textit{Sophist}. - -\section*{Notes} -\anotes -\end{verbatim} -% \iffalse -%</example> -% \fi -% \end{Example} -% -% \subsection{Symbol footnotes} -% -% \begin{Description} -% \DescribeMacro{\newsymbolfootnotes} -% To get footnotes with symbols, such as *, $\dag$, and $\ddag$, instead of -% numbers, just declare |\newsymbolfootnotes| instead of |\newfootnotes|. -% (See section~\ref{Roman} for notes with Roman numerals or letters.) -% \begin{synopsis} -% \item |\newsymbolfootnotes| \oarg{master counter} \marg{prefix} -% \end{synopsis} -% \end{Description} -% The optional argument \meta{master counter} can be anything like |page|, -% |section|, |chapter|, etc. The default master counter is |page|. The series -% of symbols is reset each new page, so that * marks the first symbol footnote -% on any page, whereas $\dag$ marks the second, $\ddag$ the third, and so on. -% \begin{Example}{} -% \iffalse -%<*example> -% \fi -%\begin{verbatim}\newsymbolfootnotes[page]{a} -\anotecontent{Plato}{Aristotle's master.} - -This was first brought up by -the great Plato\anote{Plato} -in the \textit{Sophist}. -\end{verbatim} -% \iffalse -%</example> -% \fi -% No need to modify the main body. Symbol footnotes are just footnotes using -% the same commands as before. -% \end{Example} -% \newpage -% -% \subsection{Footnotes in separate file} -% -% It is now easy to see how footnotes can be stored in a separate file. It is -% just a matter of moving all |\|\meta{prefix}|notecontent| declarations to a -% new file, say, |notes.tex|, and then loading it in the preamble with |\input|. -% -% \begin{Example}{How to move all footnotes to a separate file.} -% -% \bigskip This is |notes.tex| -% \iffalse -%<*example> -% \fi -% \begin{verbatim} -\anotecontent{Homer}{Everybody's master.} -\anotecontent{Plato}{Aristotle's master.} -\end{verbatim} -% -% And here is |document.tex| -%\begin{verbatim}\documentclass{article} -\usepackage{sepfootnotes} -\newfootnotes{a} -\input{notes.tex} -\begin{document} - This was first brought up by - the great Plato\anote{Plato} - in the \textit{Sophist}. But - nobody could suppose that an - antecedent is to be found in - Homer.\anote{Homer} -\end{document} -\end{verbatim} -% \iffalse -%</example> -% \fi -% Notice that |Homer| is the first entry in |notes.tex| though it will be -% typeset as note~\ref{homer}, whereas |Plato| is the first footnote here but -% the second entry there. -%\begin{page}\makeatletter\let\c@a\undefined\makeatother -%\newfootnotes{a} -%\anotecontent{HomerSep}{Everybody's master.} -%\anotecontent{PlatoSep}{Aristotle's master.} -%This was first brought up by -%the great Plato\anote{PlatoSep} -%in the \textit{Sophist}. But -%nobody could suppose that an -%antecedent is to be found in -%Homer.\anote{HomerSep}\label{homer} -% \end{page} -% \end{Example} -% -% \medskip\noindent Fortunately, the order in which content declarations -% appear in |notes.tex| is \textbf{not} particularly important when it comes to -% numbering footnotes. Numbering depends solely upon the order in which -% |\|\meta{prefix}|note| commands appear in the document. -% -% Content declarations can be either randomly inserted into -% |notes.tex|, or more interestingly perhaps, grouped together by similarity of -% subject or size. -% -% \newpage -% \section{Advanced Usage} -% -% \subsection{Footnotes and endnotes together} -% -% If a writer wants to insert footnotes and endnotes in the same document, all -% he has to do is declare |\newfootnotes| \marg{prefix$_1$} and -% |\newendnotes| \marg{prefix$_2$} in the preamble. Each |\new...notes| creates -% an independent note apparatus with its own counter, |\|\meta{prefix}|note|, -% |\|\meta{prefix}|notecontent|, etc. -% -% The trick though is to give each apparatus a different prefix, say, `a' and -% `b': -% \begin{Example}{} -% \iffalse -%<*example> -% \fi -\begin{verbatim}\newfootnotes{a} -\newendnotes{b} -\end{verbatim} -% \iffalse -%</example> -% \fi -% and then substitute prefix~`b' for `a' whenever a note is to be identified by -% the |b| apparatus. In our example if |Plato| is a footnote, but |Homer| is to be made into an endnote, -% just replace |\anotecontent{Homer}| with |\bnotecontent{Homer}| in -% |notes.tex| -% \iffalse -%<*example> -% \fi -% \begin{verbatim} -\bnotecontent{Homer}{Everybody's master.} -\anotecontent{Plato}{Aristotle's master.} -\end{verbatim} -% \iffalse -%</example> -% \fi -% And do the same to |\anote{Homer}| and |\bnote{Homer}| in |document.tex|. -% But don't forget the |\bnotes|, plural, at the end. -% \iffalse -%<*example> -% \fi -%\begin{verbatim}\newfootnotes{a} -\newendnotes{b} -\input{notes.tex} -\begin{document} - This was first brought up by - the great Plato\anote{Plato} - in the \textit{Sophist}. But - nobody could suppose that an - antecedent is to be found in - Homer.\bnote{Homer} -\section*{Notes} -\bnotes -\end{document} -\end{verbatim} -% \iffalse -%</example> -% \fi -% Here |Plato| will be typeset as a footnote, whereas |Homer| as an endnote. -% \end{Example} -% -% Now imagine that, for whatever reason, a writer or editor needs -% footnotes, endnotes, and symbol footnotes all together in the -% same document. He just has to declare three independent note apparatus taking -% three distinct prefixes: -% \begin{Example}{} -% \iffalse -%<*example> -% \fi -\begin{verbatim}\newfootnotes{a} -\newendnotes{b} -\newsymbolfootnotes{c} -\end{verbatim} -% \iffalse -%</example> -% \fi -% and then use |\anote| and |\anotecontent| for footnotes, but reserve |\bnote| -% and |\bnotecontent| for endnotes, as well as |\cnote| and |\cnotecontent| for -% symbol footnotes. -% \end{Example} -% -% -% \subsection{Cross-references} -% -% \begin{Description} -% \DescribeMacro{\<prefix>noteref} -% Footnotes and endnotes can be referenced to with |\|\meta{prefix}|noteref|. -% \begin{synopsis} -% \item |\|\meta{prefix}|noteref| \marg{id}. -% \end{synopsis} -% \end{Description} -% \begin{Example} -% {How to produce the number of that footnote to Plato.} -% \iffalse -%<*example> -% \fi -% \begin{verbatim} - This was first brought up by - the great Plato\anote{Plato} - in the \textit{Sophist}. - - See note~\anoteref{Plato}. -\end{verbatim} -% \iffalse -%</example> -% \fi -% \end{Example} -% It is okay to use {\LaTeX} |\label| and |\ref| to refer the reader to notes -% created by |sepfootnotes|. However, because both |\label|, and |\|\meta{prefix}|note|, -% assign a unique identifier---or label, tag, marker, or name---to a particular -% note number, it may in most cases be just superfluous to label it twice. Compare: -% \begin{Example}{} -% \iffalse -%<*example> -% \fi -% \begin{verbatim} - This was first brought up by - the great Plato\anote{Plato}\label{Plato} - in the \textit{Sophist}. - - See note~\ref{Plato}. -\end{verbatim} -% \iffalse -%</example> -% \fi -% \end{Example} -% But imagine our writer would rather stick to |\ref|. Since the labels |sepfootnotes| -% internally assigns to note numbers all have names like -% |Notes@refs@|\meta{prefix}|@|\meta{id}, the footnote number to |Plato| in our example -% may also be typeset, though somewhat clumsily, by -% |\ref{Notes@refs@a@Plato}|. -% -% -% \subsection{Roman numerals and letters} -% \label{Roman} -% -% \begin{Description} -% \DescribeMacro{\the<prefix>} -% To change the style of footnote or endnote marks, simply redefine -% |\the|\meta{prefix} to use another style: |roman|, |Roman|, |alph|, |Alph|, or -% |fnsymbol|. -% \begin{synopsis} -% \item |\renewcommand\the|\meta{prefix} |{\|\meta{style}| {|\meta{prefix}|}}| -% \end{synopsis} -% \end{Description} -% \begin{Example} -% {How to typeset lowercase Roman numerals in footnotes.} -% \iffalse -%<*example> -% \fi -\begin{verbatim} -\renewcommand\thea{\roman{a}} - -This was first brought up by -the great Plato\anote{Plato} -in the \textit{Sophist}. -\end{verbatim} -% \iffalse -%</example> -% \fi -%\begin{page}\makeatletter\let\c@a\undefined\makeatother -%\newfootnotes{a} -%\renewcommand\thea{\roman{a}} -%\anotecontent{PlatoRoman}{Aristotle's master.} -%This was first brought up by -%the great Plato\anote{PlatoRoman} -%in the \textit{Sophist}. -%\end{page} -% \end{Example} -% -% -% \subsection{Endnotes customization} -% -% To customize how the text of endnotes is typeset at the end of the document, -% you may redefine |\|\meta{prefix}|endnotemark| and the -% \meta{prefix}|endnotes| environment. -% \begin{Description} -% \DescribeMacro{\<prefix>endnotemark} Numbers right before the text of -% endnotes are typeset by |\|\meta{prefix}|endnotemark|, which is not to be -% confused with |\the|\meta{prefix}. See section~\ref{Roman}. -% \begin{synopsis} -% \item |\|\meta{prefix}|endnotemark| \marg{number} -% \end{synopsis} -% \end{Description} -% \begin{Description} -% \DescribeEnv{<prefix>endnotes} -% The text of all endnotes is typeset within the \meta{prefix}|endnotes| -% environment. -% \end{Description} -% \iffalse -%<*example> -% \fi -% \begin{Example}{How to typeset endnotes as a list of numbers, instead of numbered paragraphs, and in boldface.} -%\begin{verbatim} -\newendnotes{a} -\anotecontent{Homer}{Everybody's master.} -\anotecontent{Plato}{Aristotle's master.} - -\renewcommand \aendnotemark [1] {\item[\textbf{#1.}]} -\renewenvironment {aendnotes} {\begin{list}{}{}} - {\end{list}} -This was first brought up by -the great Plato\anote{Plato} -in the \textit{Sophist}. But -nobody could suppose that an -antecedent is to be found in -Homer.\anote{Homer} -\section*{Notes} -\anotes -\end{verbatim} -% \begin{page}\makeatletter\let\c@a\undefined\makeatother -% \newendnotes{a} -% \anotecontent{HomerCustom}{Everybody's master.} -% \anotecontent{PlatoCustom}{Aristotle's master.} -% \renewcommand \aendnotemark [1] {\item[\textbf{#1.}]} -% \renewenvironment {aendnotes} -% {\begin{list}{} -% {\setlength\topsep {0pt} -% \setlength\parsep {0pt} -% \setlength\itemsep{0pt}}} -% {\end{list}} -% This was first brought up by -% the great Plato\anote{PlatoCustom} -% in the \textit{Sophist}. But -% nobody could suppose that an -% antecedent is to be found in -% Homer.\anote{HomerCustom} -% \par\smallskip\noindent\textbf{Notes} -% \anotes -% \end{page} -% \end{Example} -% \iffalse -%</example> -% \fi -% -%\begin{thebibliography}{1} -% -% \bibitem{Nicholas Cole} -% At \texttt{http://tug.org/mailman/htdig/texhax/2010-April/014558.html} -% -% \bibitem{Luecking} -% At \texttt{http://www.44342.com/tex-f809-t9440-p1.htm}. -% -% \bibitem{Companion} -% Frank Mittelbach, and Michel Goossens, with Johannes Braams, David Carlisle, -% and Chris Rowley. -% \newblock \emph{The {\LaTeX} Companion}. 2nd -% \newblock Addison~Wesley, 2004. -% \newblock ISBN~\mbox{0-201-36299-6}. -% -%\end{thebibliography} -% -% -% \StopEventually -% -% \section{Implementation} -% -% \subsection*{Namespace} -% -% First we define a namespace for labels and identifiers. -% \begin{macrocode} -\newcommand\@SFnNamespace{Notes@} -% \end{macrocode} -% -% \subsection{Public macros} -% -% This section comments on public macros dynamically named, and defined, using a user provided prefix. -% They fall into four categories: footnote macros, endnote macros, symbol footnote macros, and -% macros that are common to all of them. -% -% \subsubsection{Common macros} -% -% \begin{macro}{\@SFnNew} -% The public |\newfootnotes|, |\newsymbolfootnotes|, and |\newendnotes| -% commented upon in the next sections first call -% the private |\@SFnNew| \marg{prefix}, which dynamically defines a counter and -% three public macros common to both footnotes and endnotes. They are all named with \meta{prefix}: if -% `bar' is provided as the prefix then |\barnotecontent|, |\barnoteref|, |\barnmark|, -% and the counter |bar| are defined. -% \begin{macrocode} -\newcommand\@SFnNew [1]{% -% \end{macrocode} -% The counter \meta{prefix} will only track notes typeset by macros named with \meta{prefix}. -% \begin{macrocode} - \newcounter{#1}% -% \end{macrocode} -% \begin{macro}{\<prefix>notecontent} -% The macro |\|\meta{prefix}|notecontent| \marg{id} \marg{text} stores -% \meta{text} as \meta{id}, which is in the \meta{prefix} namespace itself. -% \begin{macrocode} - \expandafter - \newcommand\csname #1notecontent\endcsname [2] - {\@SFnStoreText {#1} {##1} {##2}}% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\<prefix>noteref} -% The macro |\|\meta{prefix}|noteref| \marg{id} typesets the reference to the label -% associated with \meta{id}. See |\|\meta{prefix}|notemark| in \ref{footnotes} below. -% \begin{macrocode} - \expandafter - \newcommand\csname #1noteref\endcsname [1] - {\@SFnGetReference {#1} {##1}}% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\<prefix>nmark} -% Finally |\|\meta{prefix}|nmark| typesets the default note mark. -% \begin{macrocode} - \expandafter - \newcommand\csname #1nmark\endcsname - {\csname the#1\endcsname}}% -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \subsubsection{Footnotes} -% \label{footnotes} -% -% \begin{macro}{\newfootnotes} -% The macro |\newfootnotes| \marg{prefix} dynamically defines three public -% macros. They also are all named with \meta{prefix}. -% \begin{macrocode} -\newcommand\newfootnotes [1] - {\@SFnNew{#1}% -% \end{macrocode} -% \begin{macro}{\<prefix>notemark} -% The macro |\|\meta{prefix}|notemark| \marg{id} steps the counter, assigns it a -% label, links that label up with \meta{id}, and typesets a footnote mark. See -% |\@SFnInsertMark|. -% \begin{macrocode} - \expandafter - \newcommand\csname #1notemark\endcsname [1] - {\@SFnInsertMark {#1} {##1}}% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\<prefix>notetext} -% The macro |\|\meta{prefix}|notetext| \meta{id} typesets the text that was -% previously associated with \meta{id} by |\|\meta{prefix}|notecontent|. -% \begin{macrocode} - \expandafter - \newcommand\csname #1notetext\endcsname [1] - {\@SFnSetMark {#1}% - \@SFnTypesetText {#1} {##1}} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\<prefix>note} -% The macro |\|\meta{prefix}|note| \meta{id} typesets the mark and text of a -% footnote. -% \begin{macrocode} - \expandafter - \newcommand\csname #1note\endcsname [1] - {\csname #1notemark\endcsname{##1}% - \csname #1notetext\endcsname{##1}}} -% \end{macrocode} -% \end{macro} -% -% \subsubsection{Symbol footnotes} -% -% \begin{macro}{\newsymbolfootnotes} -% The macro |\newsymbolfootnotes| \oarg{master counter} \marg{prefix} dynamically -% define all of the footnote macros commented upon in \ref{footnotes}, but it also -% redefines |\|\meta{prefix}|nmark| so as to render symbols instead of numbers. Further, -% it creates a counter to be reset when \meta{master counter} is stepped. -% The default master counter is |page|. -% \begin{macrocode} -\newcommand\newsymbolfootnotes [2][page] - {\newfootnotes {#2}% - \@addtoreset {#2} {#1}% - \expandafter - \renewcommand\csname #2nmark\endcsname - {\fnsymbol {#2}}} -% \end{macrocode} -% \end{macro} -% -% \subsubsection{Endnotes} -% \label{endnotes} -% -% Endnote identifiers, but not endnote number and text, need to be stored in a file -% for later processing. The list of endnote identifiers may then be converted into -% endnotes at the end of the document within a suitable environment. -% -% The following is similar to \ref{footnotes} on footnotes but for -% the fact that now we have to deal with files, and delayed typesetting of -% endnote text. Another difference to the footnote set is that -% |\|\meta{prefix}|notemark| and |\|\meta{prefix}|note| are the same here. -% -% \begin{macro}{\newendnotes} -% The macro |\newendnotes| \marg{prefix} dynamically defines a corresponding -% environment \meta{prefix}|endnotes|, as well as five public macros -% available to endnotes only. They also are -% all named with \meta{prefix}. -% \begin{macrocode} -\newcommand\newendnotes [1] - {\@SFnNew {#1}% - \@SFnOpenFileOut {#1}% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\<prefix>note} -% \begin{macro}{\<prefix>notemark} -% Both |\|\meta{prefix}|note| \marg{id} and |\|\meta{prefix}|notemark| \marg{id} -% typeset an endnote mark, and write down its \meta{id} for later -% processing. -% \begin{macrocode} - \expandafter - \newcommand\csname #1notemark\endcsname [1] - {\@SFnInsertMark {#1} {##1}% - \@SFnWriteToFile {#1} {##1}}% - \expandafter - \newcommand\csname #1note\endcsname [1] - {\csname #1notemark\endcsname {##1}}% -% \end{macrocode} -% \end{macro} -% \end{macro} -% \begin{macro}{\<prefix>notetext} -% Though public, |\|\meta{prefix}|notetext| \marg{id} is not meant to be directly used -% when applied to endnotes. It typesets a single -% endnote mark and text, preferably within the \meta{prefix}|endnotes| -% environment. -% \begin{macrocode} - \expandafter - \newcommand\csname #1notetext\endcsname [1] - {\csname #1endnotemark\endcsname - {\@SFnGetReference {#1} {##1}}% - \@SFnRetrieveText {#1} {##1}\par}% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\<prefix>notes} -% The |\|\meta{prefix}|notes| immediately closes the auxiliary file, and typesets all endnotes -% within a \meta{prefix}|endnotes| environment. -% \begin{macrocode} - \expandafter - \newcommand\csname #1notes\endcsname - {\@SFnCloseFile {#1}% - \begin{#1endnotes} - \input\@SFnFileName{#1}% - \end{#1endnotes}}% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\<prefix>endnotemark} -% Now, the macro |\|\meta{prefix}|endnotemark| \marg{number} -% typesets marks preferably within the \meta{prefix}|endnotes| -% environment.\footnote{From \cite[p.114]{Companion}.} -% \begin{macrocode} - \expandafter - \newcommand\csname #1endnotemark\endcsname [1] - {\noindent\makebox[0pt][r]{\mbox{{\normalfont ##1.\,}}}} -% \end{macrocode} -% \end{macro} -% \begin{environment}{<prefix>endnotes} -% And here is the environment where to typeset all endnotes. -% \begin{macrocode} - \newenvironment{#1endnotes} - {\footnotesize\setlength\parskip\footnotesep} - {}}% -% \end{macrocode} -% \end{environment} -% -% \newpage -% \subsection{Private macros} -% -% This section comments on private macros. -% -% \subsubsection{Files} -% -% The following apply to endnotes only. See~\ref{endnotes}. -% -% \begin{macro}{\@SFnFileName} -% The macro |\@SFnFileName| \marg{prefix} returns a filename based on, -% surprise, \meta{prefix}. \TODO{} 3 letter extension: |sep|. -% \begin{macrocode} -\newcommand\@SFnFileName [1] - {\jobname.notes-#1} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\@SFnOpenFileOut} -% \begin{macro}{\@SFnWriteToFile} -% \begin{macro}{\@SFnCloseFile} -% Here are three macros that operate on file descriptors: -% -% The first, -% |\@SFnOpenFileOut| \marg{prefix}, opens for writing a dynamically named -% file |\@SFnFileOut|\meta{prefix}. -% \begin{macrocode} -\newcommand\@SFnOpenFileOut [1] - {\expandafter\newwrite\csname @SFnFileOut#1\endcsname - \immediate\expandafter\openout - \csname @SFnFileOut#1\endcsname=\@SFnFileName#1\relax} -% \end{macrocode} -% The macro |\@SFnWriteToFile| \marg{prefix} \marg{id} writes down a -% note identifier, \meta{id}, for later processing. See -% |\|\meta{prefix}|notes| in section~\ref{endnotes}. -% \begin{macrocode} -\newcommand\@SFnWriteToFile [2] - {\immediate\write\csname @SFnFileOut#1\endcsname - {\expandafter\string\csname #1notetext\endcsname - {#2}}}% -% \end{macrocode} -% And |\@SFnCloseFile| \marg{prefix} closes the file containing note -% identifiers related to \meta{prefix}. -% \begin{macrocode} -\newcommand\@SFnCloseFile [1] - {\immediate\expandafter - \closeout\csname @SFnFileOut#1\endcsname\relax} -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% -% \subsubsection{Text} -% -% These are private macros to store, retrieve, and typeset the text of notes. -% They apply to both footnotes and endnotes. -% -% \begin{macro}{\@SFnStoreText} -% First |\@SFnStoreText| \marg{prefix} \marg{id} \marg{text} stores the -% text of a note as \meta{id} in the \meta{prefix} |text| namespace. The -% package aborts if \meta{id} is already in use in that namespace. -% \begin{macrocode} -\newcommand\@SFnStoreText [3] - {\@ifundefined{\@SFnNamespace text@#1@#2} - {\@SFnNameDef {#1} {#2} {#3}} - {\PackageError - {\@SFnPackageName} - {`#1' is already in use.} - {The note identifier `#1' already identifies a piece of - text.\MessageBreak Solution: Use another identifier.}}} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\@SFnRetrieveText} -% And |\@SFnRetrieveText| \marg{prefix} \marg{id} retrieves a previously -% stored piece of text identified by \meta{id} in the \meta{prefix} |text| -% namespace. It silently ignores undefined content. -% \begin{macrocode} -\newcommand\@SFnRetrieveText [2] - {\@ifundefined{\@SFnNamespace text@#1@#2} - {} - {\@SFnNameUse {#1} {#2}}} -% \end{macrocode} -% ^^A {\PackageWarningNoLine -% ^^A {\@SFnPackageName} -% ^^A {Empty note `#2' on page \thepage}} -% ^^A% {Note `#2' has no content assigned to it.\MessageBreak -% ^^A% Solution: Insert \expandafter\protect\csname #1notetext\endcsname{#2}{...} -% ^^A% before it.} -% \end{macro} -% \begin{macro}{\@SFnTypesetText} -% Finally, |\@SFnTypesetText| \marg{prefix} \marg{id} not only retrieves -% but also typesets a note text identified by \meta{id} in the \meta{prefix} -% |text| namespace. -% \begin{macrocode} -\newcommand\@SFnTypesetText [2] - {\@footnotetext{\@SFnRetrieveText {#1} {#2}}} -% \end{macrocode} -% \end{macro} -% -% \subsubsection{Marks} -% -% These are private macros to typeset note marks. -% They apply to both footnotes and endnotes. -% -% \begin{macro}{\@SFnInsertMark} -% The macro |\@SFnInsertMark| \marg{prefix} \marg{id} steps the counter, -% assigns it a label, links that label up with \meta{id}, and then typesets a note -% mark. It does the real work behind |\|\meta{prefix}|notemark| in sections \ref{footnotes} and~\ref{endnotes}. -% \begin{macrocode} -\newcommand\@SFnInsertMark [2] - {\@SFnStepCounter {#1}% - \@SFnSetReference {#1} {#2}% - \@SFnSetMark {#1}% - \@SFnTypesetMark} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\@SFnSetMark} -% Now, |\@SFnSetMark| \marg{prefix} sets\footnote{From {\LaTeX} Kernel (Floats), -% 2002/10/01 v1.1v.: |base/ltfloat.dtx|.} \LaTeX{} internal note engine to typeset a mark as -% publicly defined by |\|\meta{prefix}|nmark|. -% \begin{macrocode} -\newcommand\@SFnSetMark [1] - {\protected@xdef\@thefnmark{\csname #1nmark\endcsname}} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\@SFnTypesetMark} -% And |\@SFnTypesetMark| is just a more descriptive wrapper to the -% internal macro that typesets the note mark. -% \begin{macrocode} -\newcommand\@SFnTypesetMark - {\@footnotemark} -% \end{macrocode} -% \end{macro} -% -% \subsubsection{Labels and cross-references} -% -% This package relies heavily on labels and cross-references to keep track of endnote -% numbers. But every note number, be it footnote or endnote, is assigned a -% label in the \meta{prefix} |label| namespace. Thus note numbers can be -% directly referenced to with |\ref{Notes@refs@|\meta{prefix}|@|\meta{id}|}|, or -% indirectly, but more simply, with |\|\meta{prefix}|noteref| \meta{id}. -% -% On the one hand, labels require running |latex| at least twice to get -% cross-references right. But on the other they allow us not to bother -% with note numbers. As long as note text and labels are implicitly connected by a unique -% identifier \meta{id} in \meta{prefix} namespace, the explicit connection between note -% content and number does not need to be hard coded into the endnote auxiliary -% file, as it is in the |endnotes| package. -% -% But the motivation for the identifier approach---notes defined before notes -% inserted---is quite independent of such a feature, if it is a feature. -% -% \TODO{} However it be, the identifier approach might prove itself useful in solving -% \LaTeX{} misnumbering footnotes when two or more |\footnotemark| precedes two -% or more |\footnotetext|. Since the |sepfootnotes| package requires note text to -% be defined before note marks are inserted, even in a separate file, it no -% longer matters how many times |\|\meta{prefix}|notemark| \meta{id} is invoked before -% |\|\meta{prefix}|notetext| \meta{id}. That is precisely what goes on with endnotes. -% \begin{macro}{\@SFnSetReference} -% The macro |\@SFnSetReference| \marg{prefix} \marg{id} assigns a note -% number a label in the \meta{prefix} |refs| namespace. -% \begin{macrocode} -\newcommand\@SFnSetReference [2] - {\label{\@SFnNamespace refs@#1@#2}} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\@SFnGetReference} -% And |\@SFnGetReference| \marg{prefix} \marg{id} simply returns that -% number. -% \begin{macrocode} -\newcommand\@SFnGetReference [2] - {\ref{\@SFnNamespace refs@#1@#2}} -% \end{macrocode} -% \end{macro} -% -% \subsubsection{Counters} -% -% \begin{macro}{\@SFnStepCounter} -% The macro |\@SFnStepCounter| \marg{prefix} steps the counter |prefix|, -% and makes sure it can be properly labeled afterwards. -% \begin{macrocode} -\newcommand\@SFnStepCounter [1] - {\refstepcounter{#1}} -% \end{macrocode} -% \end{macro} -% -% \subsubsection{Names} -% \label{names} -% -% \begin{macro}{\@SFnNameDef} -% The macro |\@SFnNameDef| \marg{prefix} \marg{id} \marg{text} stores -% \meta{text} as \meta{id} in the \meta{prefix} |text| -% namespace.\footnote{I owe Dan Luecking the idea of using \LaTeX{} internal -% table to store note text.~\cite{Luecking}} -% \begin{macrocode} -\newcommand\@SFnNameDef [3] - {\@namedef{\@SFnNamespace text@#1@#2}{#3}} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\@SFnNameUse} -% And |\@SFnNameUse| \marg{prefix} \marg{id} retrieves a previously stored -% piece of text identified by \meta{id} in the \meta{prefix} |text| namespace. -% Undefined content is silently ignored. -% \begin{macrocode} -\newcommand\@SFnNameUse [2] - {\@nameuse{\@SFnNamespace text@#1@#2}} -% \end{macrocode} -% \end{macro} -% \end{macro} -%\Finale diff --git a/Master/texmf-dist/source/latex/sepfootnotes/sepfootnotes.ins b/Master/texmf-dist/source/latex/sepfootnotes/sepfootnotes.ins deleted file mode 100644 index 69792d228a8..00000000000 --- a/Master/texmf-dist/source/latex/sepfootnotes/sepfootnotes.ins +++ /dev/null @@ -1,47 +0,0 @@ -%% sepfootnotes.ins -%% -%% Copyright (C) 2012 Eduardo C. Lourenço de Lima -%% -%% 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. -%% -\input docstrip.tex -\keepsilent -\preamble - -Copyright (C) 2012 Eduardo C. Lourenço de Lima - -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. - -\endpreamble -\generate{\file{sepfootnotes.sty}{\from{sepfootnotes.dtx}{package}}} -\obeyspaces -\Msg{****************************************************} -\Msg{* *} -\Msg{* To finish the installation you have to move the *} -\Msg{* following file into a directory searched by TeX: *} -\Msg{* *} -\Msg{* sepfootnotes.sty *} -\Msg{* *} -\Msg{* To produce the documentation run the file *} -\Msg{* sepfootnotes.dtx through LaTeX. *} -\Msg{* *} -\Msg{* Happy TeXing! *} -\Msg{* *} -\Msg{****************************************************} -\endbatchfile diff --git a/Master/texmf-dist/tex/latex/sepfootnotes/sepfootnotes.sty b/Master/texmf-dist/tex/latex/sepfootnotes/sepfootnotes.sty index 2571daf0ee5..31e8be64fd4 100644 --- a/Master/texmf-dist/tex/latex/sepfootnotes/sepfootnotes.sty +++ b/Master/texmf-dist/tex/latex/sepfootnotes/sepfootnotes.sty @@ -1,12 +1,4 @@ -%% -%% This is file `sepfootnotes.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% sepfootnotes.dtx (with options: `package') -%% -%% Copyright (C) 2012 Eduardo C. Lourenço de Lima +%% Copyright (C) 2013 Eduardo C. Lourenço de Lima %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either @@ -19,111 +11,88 @@ %% version 2005/12/01 or later. %% \NeedsTeXFormat{LaTeX2e}[1996/06/01] -\ProvidesPackage{sepfootnotes}[2012/03/06 v0.1 Footnotes in separate file] -\newcommand\@SFnNamespace{Notes@} -\newcommand\@SFnNew [1]{% - \newcounter{#1}% - \expandafter - \newcommand\csname #1notecontent\endcsname [2] - {\@SFnStoreText {#1} {##1} {##2}}% - \expandafter - \newcommand\csname #1noteref\endcsname [1] - {\@SFnGetReference {#1} {##1}}% - \expandafter - \newcommand\csname #1nmark\endcsname - {\csname the#1\endcsname}}% -\newcommand\newfootnotes [1] - {\@SFnNew{#1}% - \expandafter - \newcommand\csname #1notemark\endcsname [1] - {\@SFnInsertMark {#1} {##1}}% - \expandafter - \newcommand\csname #1notetext\endcsname [1] - {\@SFnSetMark {#1}% - \@SFnTypesetText {#1} {##1}} - \expandafter - \newcommand\csname #1note\endcsname [1] - {\csname #1notemark\endcsname{##1}% - \csname #1notetext\endcsname{##1}}} -\newcommand\newsymbolfootnotes [2][page] - {\newfootnotes {#2}% - \@addtoreset {#2} {#1}% - \expandafter - \renewcommand\csname #2nmark\endcsname - {\fnsymbol {#2}}} +\ProvidesPackage{sepfootnotes}[2013/01/17 v0.2 Footnotes in separate file] + +\newcommand\sep@packagename{sepfootnotes} + +% ********************************* Public ************************************ + +% ==================== shared by footnotes and endnotes ======================= + +\newcommand\sep@new [1] +{\newcounter{#1note}% + \expandafter\newcommand\csname #1note\endcsname [1] {\csname #1notemark\endcsname{##1}\csname #1notetext\endcsname{##1}}% + \expandafter\newcommand\csname #1notecontent\endcsname [2] {\sep@namedef {#1} {##1} {##2}}% + \expandafter\newcommand\csname print#1note\endcsname [1] {\sep@nameuse {#1} {##1}}% + \expandafter\newcommand\csname the#1mark\endcsname {\csname the#1note\endcsname}}% + +% -------------------------------- footnotes ---------------------------------- + +\newcommand\newfootnotes{\@ifstar\sep@newfootnotesfree\sep@newfootnotes} + +\newcommand\sep@newfootnotes [1] +{\sep@new{#1}% + \expandafter\renewcommand\csname #1note\endcsname [1] {\footnote {\csname print#1note\endcsname{##1}}}% + \expandafter\newcommand\csname #1notetext\endcsname [1] {\footnotetext {\csname print#1note\endcsname{##1}}}% + \expandafter\newcommand\csname #1notemark\endcsname [1] {\footnotemark}% + \expandafter\renewcommand\csname the#1mark\endcsname {\thefootnote}} + +\newcommand\sep@newfootnotesfree [1] +{\sep@new{#1}% + \expandafter\newcommand\csname #1notemark\endcsname [1] {\sep@mark {#1} {##1}}% + \expandafter\newcommand\csname #1notetext\endcsname [1] {\sep@markset {#1}\@footnotetext{\csname print#1note\endcsname {##1}}}} + +\newcommand\newsymbolfootnotes [2] [page] +{\newfootnotes* {#2}% + \@addtoreset {#2note} {#1}% + \expandafter\renewcommand\csname the#2mark\endcsname {\fnsymbol {#2note}}} + +% -------------------------------- endnotes ----------------------------------- + \newcommand\newendnotes [1] - {\@SFnNew {#1}% - \@SFnOpenFileOut {#1}% - \expandafter - \newcommand\csname #1notemark\endcsname [1] - {\@SFnInsertMark {#1} {##1}% - \@SFnWriteToFile {#1} {##1}}% - \expandafter - \newcommand\csname #1note\endcsname [1] - {\csname #1notemark\endcsname {##1}}% - \expandafter - \newcommand\csname #1notetext\endcsname [1] - {\csname #1endnotemark\endcsname - {\@SFnGetReference {#1} {##1}}% - \@SFnRetrieveText {#1} {##1}\par}% - \expandafter - \newcommand\csname #1notes\endcsname - {\@SFnCloseFile {#1}% - \begin{#1endnotes} - \input\@SFnFileName{#1}% - \end{#1endnotes}}% - \expandafter - \newcommand\csname #1endnotemark\endcsname [1] - {\noindent\makebox[0pt][r]{\mbox{{\normalfont ##1.\,}}}} - \newenvironment{#1endnotes} - {\footnotesize\setlength\parskip\footnotesep} - {}}% -\newcommand\@SFnFileName [1] - {\jobname.notes-#1} -\newcommand\@SFnOpenFileOut [1] - {\expandafter\newwrite\csname @SFnFileOut#1\endcsname - \immediate\expandafter\openout - \csname @SFnFileOut#1\endcsname=\@SFnFileName#1\relax} -\newcommand\@SFnWriteToFile [2] - {\immediate\write\csname @SFnFileOut#1\endcsname - {\expandafter\string\csname #1notetext\endcsname - {#2}}}% -\newcommand\@SFnCloseFile [1] - {\immediate\expandafter - \closeout\csname @SFnFileOut#1\endcsname\relax} -\newcommand\@SFnStoreText [3] - {\@ifundefined{\@SFnNamespace text@#1@#2} - {\@SFnNameDef {#1} {#2} {#3}} - {\PackageError - {\@SFnPackageName} - {`#1' is already in use.} - {The note identifier `#1' already identifies a piece of - text.\MessageBreak Solution: Use another identifier.}}} -\newcommand\@SFnRetrieveText [2] - {\@ifundefined{\@SFnNamespace text@#1@#2} - {} - {\@SFnNameUse {#1} {#2}}} -\newcommand\@SFnTypesetText [2] - {\@footnotetext{\@SFnRetrieveText {#1} {#2}}} -\newcommand\@SFnInsertMark [2] - {\@SFnStepCounter {#1}% - \@SFnSetReference {#1} {#2}% - \@SFnSetMark {#1}% - \@SFnTypesetMark} -\newcommand\@SFnSetMark [1] - {\protected@xdef\@thefnmark{\csname #1nmark\endcsname}} -\newcommand\@SFnTypesetMark - {\@footnotemark} -\newcommand\@SFnSetReference [2] - {\label{\@SFnNamespace refs@#1@#2}} -\newcommand\@SFnGetReference [2] - {\ref{\@SFnNamespace refs@#1@#2}} -\newcommand\@SFnStepCounter [1] - {\refstepcounter{#1}} -\newcommand\@SFnNameDef [3] - {\@namedef{\@SFnNamespace text@#1@#2}{#3}} -\newcommand\@SFnNameUse [2] - {\@nameuse{\@SFnNamespace text@#1@#2}} +{\sep@new {#1}% + \sep@openout {#1}% + \expandafter\newcommand\csname #1notemark\endcsname [1] {\sep@mark {#1} {##1}}% + \expandafter\newcommand\csname #1notetext\endcsname [1] {\sep@markset {#1}\sep@write {#1} {\expandafter\noexpand\csname do#1note\endcsname{\arabic{#1note}}{\unexpanded{##1}}}}% + \expandafter\newcommand\csname addto#1notes\endcsname [1] {\sep@write {#1} {\unexpanded{##1}}}% + \expandafter\newcommand\csname the#1notes\endcsname {\sep@close {#1}\setcounter {#1note} {0}\begin{#1notes}\input\sep@filename{#1}\end{#1notes}}% + \expandafter\newcommand\csname make#1mark\endcsname {\hbox{\normalfont\csname the#1mark\endcsname.\ }}% + \expandafter\newcommand\csname #1noteformat\endcsname {\noindent\rightskip\z@ \leftskip\z@ \leavevmode\llap{\csname make#1mark\endcsname}}% + \expandafter\newcommand\csname do#1note\endcsname [2] {\sep@refsetcounter{#1note}{##1}\par\csname #1noteformat\endcsname\csname print#1note\endcsname{##2}\par}% + \expandafter\newcommand\csname #1notesize\endcsname {\footnotesize} + \newenvironment {#1notes} {\csname #1notesize\endcsname\setlength\parskip\footnotesep} {}} + + +% ********************************* Private *********************************** + +% ---------------------------------- files ------------------------------------ + +\newcommand\sep@filename [1] {\jobname.ent-#1} +\newcommand\sep@openout [1] {\expandafter \newwrite\csname sep@fileout#1\endcsname\immediate\expandafter\openout\csname sep@fileout#1\endcsname=\sep@filename#1\relax} +\newcommand\sep@write [2] {\immediate \write\csname sep@fileout#1\endcsname {#2}}% +\newcommand\sep@close [1] {\immediate\expandafter\closeout\csname sep@fileout#1\endcsname\relax} + +% ---------------------------------- table ------------------------------------ + +\newcommand\sep@nameuse [2] {\@ifundefined{sepfootnotes@text@#1@#2} {} {\@nameuse{sepfootnotes@text@#1@#2}}} +\newcommand\sep@namedef [3] {\@ifundefined{sepfootnotes@text@#1@#2} {\@namedef{sepfootnotes@text@#1@#2}{#3}} {\PackageError {\sep@packagename} {`#2' is already in use} {The key `#2' already identifies a note content.\MessageBreak Solution: Use another key.}}} + +% ---------------------------------- marks ------------------------------------ + +\newcommand\sep@markset [1] {\protected@xdef\@thefnmark{\csname the#1mark\endcsname}} +\newcommand\sep@mark [2] {\stepcounter {#1note}\sep@markset {#1}\@footnotemark} + +% ---------------------- cross-references and counters ------------------------ + +\newcommand\sep@refsetcounter [2] {\setcounter{#1}{#2}\protected@edef\@currentlabel{\csname p@#1\endcsname\csname the#1\endcsname}} + +% ********************************* Default *********************************** + +% ------------------------- footnotes: \sepfootnote --------------------------- + +%% Default: The default \sepfootnote family relies on \footnote +\newfootnotes{sepfoot} + \endinput %% %% End of file `sepfootnotes.sty'. |