summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/notes2bib
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-10-01 13:35:02 +0000
committerKarl Berry <karl@freefriends.org>2007-10-01 13:35:02 +0000
commit3b4de807bc36907fe0d045c16180c5503c88f373 (patch)
tree62c56c8bed31a411cc2b9c0a9fab8264f1a9a761 /Master/texmf-dist/tex/latex/notes2bib
parent127cf2f1ba829680b88bbc568d6f2119f9f7cc34 (diff)
notes2bib 1.1 (29sep07)
git-svn-id: svn://tug.org/texlive/trunk@5077 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/notes2bib')
-rw-r--r--Master/texmf-dist/tex/latex/notes2bib/jawltxdoc.sty99
-rw-r--r--Master/texmf-dist/tex/latex/notes2bib/notes2bib.sty298
2 files changed, 239 insertions, 158 deletions
diff --git a/Master/texmf-dist/tex/latex/notes2bib/jawltxdoc.sty b/Master/texmf-dist/tex/latex/notes2bib/jawltxdoc.sty
new file mode 100644
index 00000000000..71327c89cb7
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/notes2bib/jawltxdoc.sty
@@ -0,0 +1,99 @@
+%%
+%% This is file `jawltxdoc.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% notes2bib.dtx (with options: `jawltxdoc')
+%% ----------------------------------------------------------------
+%% note2bib --- Integrating notes into the bibliography
+%% Maintained by Joseph Wright
+%% E-mail: joseph.wright@morningstar2.co.uk
+%% Released under the LaTeX Project Public License v1.3 or later
+%% See http://www.latex-project.org/lppl.txt
+%% ----------------------------------------------------------------
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{jawltxdoc}
+ [2007/09/28 v1.0]
+\usepackage[T1]{fontenc}
+\usepackage[english,UKenglish]{babel}
+\usepackage[scaled=0.95]{helvet}
+\usepackage[version=3]{mhchem}
+\usepackage[final]{microtype}
+\usepackage{mathpazo,booktabs,array,url,graphicx,courier,unitsdef}
+\usepackage{upgreek,ifpdf,listings}
+\ifpdf
+ \usepackage{embedfile}
+ \embedfile[%
+ stringmethod=escape,%
+ mimetype=plain/text,%
+ desc={LaTeX docstrip source archive for package `\jobname'}%
+ ]{\jobname.dtx}
+\fi
+\usepackage{\jobname}
+\usepackage[numbered]{hypdoc}
+\newlength\LaTeXwidth
+\newlength\LaTeXoutdent
+\newlength\LaTeXgap
+\setlength\LaTeXgap{1em}
+\setlength\LaTeXoutdent{-0.15\textwidth}
+\def\typesetexampleandcode{
+ \begin{list}{}{%
+ \setlength\itemindent{0pt}
+ \setlength\leftmargin\LaTeXoutdent
+ \setlength\rightmargin{0pt}
+ }
+ \item
+ \setlength\LaTeXoutdent{-0.15\textwidth}
+ \begin{minipage}[c]{\textwidth-\LaTeXwidth-\LaTeXoutdent-\LaTeXgap}
+ \lst@sampleInput
+ \end{minipage}%
+ \hfill%%
+ \begin{minipage}[c]{\LaTeXwidth}%
+ \hbox to\linewidth{\box\lst@samplebox\hss}%
+ \end{minipage}%
+ \end{list}
+}
+\def\typesetcodeonly{%
+ \begin{list}{}{%
+ \setlength\itemindent{0pt}
+ \setlength\leftmargin{0pt}
+ \setlength\rightmargin{0pt}
+ }
+ \item
+ \begin{minipage}[c]{\LaTeXwidth}%
+ \hbox to\linewidth{\box\lst@samplebox\hss}%
+ \end{minipage}%
+ \end{list}
+}
+\makeatletter
+\lst@RequireAspects{writefile}
+\newbox\lst@samplebox
+\lstnewenvironment{LaTeXexample}[1][\typesetexampleandcode]{%
+ \let\typesetexample#1
+ \global\let\lst@intname\@empty
+ \setbox\lst@samplebox=\hbox\bgroup
+ \setkeys{lst}{language=[LaTeX]{TeX},tabsize=4,gobble=2,%
+ breakindent=0pt,basicstyle=\small\ttfamily,basewidth=0.51em,%
+ keywordstyle=\color{blue},%
+ morekeywords={bibnote,citenote,bibnotetext,bibnotemark,%
+ thebibnote,bibnotename}}
+ \lst@BeginAlsoWriteFile{\jobname.tmp}
+}{%
+ \lst@EndWriteFile\egroup
+ \setlength\LaTeXwidth{\wd\lst@samplebox}
+ \typesetexample%
+}
+\def\lst@sampleInput{%
+ \MakePercentComment\catcode`\^^M=10\relax
+ \small%
+ {\setkeys{lst}{SelectCharTable=\lst@ReplaceInput{\^\^I}%
+ {\lst@ProcessTabulator}}%
+ \leavevmode \input{\jobname.tmp}}%
+ \MakePercentIgnore%
+}
+\makeatother
+\endinput
+%%
+%% End of file `jawltxdoc.sty'.
diff --git a/Master/texmf-dist/tex/latex/notes2bib/notes2bib.sty b/Master/texmf-dist/tex/latex/notes2bib/notes2bib.sty
index 8e73720bd46..760db640055 100644
--- a/Master/texmf-dist/tex/latex/notes2bib/notes2bib.sty
+++ b/Master/texmf-dist/tex/latex/notes2bib/notes2bib.sty
@@ -9,18 +9,29 @@
%% note2bib --- Integrating notes into the bibliography
%% Maintained by Joseph Wright
%% E-mail: joseph.wright@morningstar2.co.uk
-%% Released under the GNU General Public License
-%% See http://www.gnu.org/licenses/gpl.txt
+%% Released under the LaTeX Project Public License v1.3 or later
+%% See http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
+%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{notes2bib}
- [2007/09/03 v1.0a Integrating notes into the bibliography]
-\RequirePackage{xspace}
+ [2007/09/29 v1.1 Integrating notes into the bibliography]
+\@ifundefined{eTeXversion}
+ {\PackageError{notes2bib}
+ {Not running under e-TeX}
+ {This package requires e-TeX. Try compiling the document
+ with\MessageBreak `elatex' instead of `latex'. When using
+ pdfTeX, try `pdfelatex'\MessageBreak instead of `pdflatex'}%
+ \endinput}
+ {}
+\RequirePackage{elatex}[2007/07/13]
\newif\ifniib@fn\niib@fnfalse
\DeclareOption{footnotes}{%
\niib@fntrue
\AtBeginDocument{%
\let\footnote\bibnote%
+ \PackageInfo{notes2bib}%
+ {Converting footnotes to bibnotes}%
}}
\DeclareOption{endnotes}{%
\AtBeginDocument{%
@@ -29,55 +40,52 @@
\let\endnotetext\bibnotetext%
\@ifpackageloaded{endnotes}%
{\let\theendnotes\printbibnotes}{}%
+ \PackageInfo{notes2bib}%
+ {Converting endnotes to bibnotes}%
}}
\newif\ifniib@tail\niib@tailfalse
\newif\ifniib@head\niib@headfalse
\DeclareOption{tail}{\niib@tailtrue}
\DeclareOption{head}{\niib@headtrue}
-\def\niib@percent{\catcode`\%=14\relax}
-\DeclareOption{killpercent}{%
- \def\niib@percent{\catcode`\%=9\relax}
-}
-\@ifclassloaded{ltxdoc}{\ExecuteOptions{killpercent}}{}
\ProcessOptions
\ifniib@fn
- \@ifundefined{eTeXversion}{%
- \PackageWarning{notes2bib}{%
- e-TeX extensions unavailable\MessageBreak
- \protect\footnotemark and \protect\footnotetext%
- \MessageBreak unmodified}%
- }{%
- \let\niib@fnmark\footnotemark
- \let\niib@fntext\footnotetext
- \let\niib@thanks\thanks
- \RequirePackage{elatex}
- \patchcmd{\thanks}{\footnotemark}{\niib@fnmark}{%
- \patchcmd{\thanks}{\footnotetext}{\niib@fntext}{%
- \AtBeginDocument{%
- \let\footnotemark\bibnotemark
- \let\footnotetext\bibnotetext
- }%
+ \let\niib@fnmark\footnotemark
+ \let\niib@fntext\footnotetext
+ \let\niib@thanks\thanks
+ \patchcmd{\thanks}{\footnotemark}{\niib@fnmark}{%
+ \patchcmd{\thanks}{\footnotetext}{\niib@fntext}{%
+ \AtBeginDocument{%
+ \let\footnotemark\bibnotemark
+ \let\footnotetext\bibnotetext
}%
- {\let\thanks\niib@thanks%
- \PackageWarning{notes2bib}%
- {Could not patch \protect\thanks}}%
+ \PackageInfo{notes2bib}%
+ {Modifying \protect\thanks\space macro}%
}{%
\let\thanks\niib@thanks%
\PackageWarning{notes2bib}%
{Could not patch \protect\thanks}}%
- }%
+ }{%
+ \let\thanks\niib@thanks%
+ \PackageWarning{notes2bib}%
+ {Could not patch \protect\thanks}}%
\fi
\ifniib@head
\ifniib@tail
\PackageWarning{notes2bib}
{You've given both ``head'' and ``tail'' as
- options\MessageBreak
- I'm ignoring both!}
+ options\MessageBreak I'm ignoring both!}
\niib@headfalse\niib@tailfalse
+ \else
+ \PackageInfo{notes2bib}%
+ {bibnotes will ``head'' other citations}
\fi
+\else
+ \PackageInfo{notes2bib}%
+ {bibnotes will ``tail'' other citations}
\fi
\AtBeginDocument{%
\ifniib@head
+ \let\delaycite\niib@delaycite
\delaycite{cite}%
\@ifpackageloaded{natbib}{%
\delaycite{citet}%
@@ -94,23 +102,20 @@
\delaycite{Citealt}%
\delaycite{Citealp}%
\delaycite{Citeauthor}%
- }{%
- \@ifpackageloaded{biblatex}{%
- \delaycite{Cite}%
- \delaycite{parencite}%
- \delaycite{Parencite}%
- \delaycite{footcite}%
- \delaycite{Footcite}%
- \delaycite{textcite}%
- \delaycite{Textcite}%
- \ifdefined\autocite%
- \delaycite{autocite}%
- \fi%
- \ifdefined\supercite%
- \delaycite{supercite}%
- \fi%
+ }{}%
+ \@ifpackageloaded{biblatex}{%
+ \delaycite{Cite}%
+ \delaycite{parencite}%
+ \delaycite{Parencite}%
+ \delaycite{footcite}%
+ \delaycite{Footcite}%
+ \delaycite{textcite}%
+ \delaycite{Textcite}%
+ \@ifundefined{autocite}{}%
+ {\delaycite{autocite}}%
+ \@ifundefined{supercite}{}%
+ {\delaycite{supercite}}%
}{}%
- }%
\fi%
}
\newcommand*\bibnotename{Bibnote}
@@ -126,79 +131,52 @@
\newcommand*\niibkeynone{}
\newcommand*\niibkeytail{zzz}
\newcommand*\niibcite{\cite}
-\DeclareRobustCommand\bibnote{%
+\newrobustcmd*{\bibnote}{%
\stepcounter{bibnote}%
\@ifnextchar[%
{\niib@bibnote}%
{\niib@bibnote[\thebibnote]}%
}
-\DeclareRobustCommand\bibnotemark{%
+\newrobustcmd*{\bibnotemark}{%
\stepcounter{bibnote}%
\@ifnextchar[%
{\niib@mark}%
{\niib@mark[\thebibnote]}%
}
-\DeclareRobustCommand\bibnotetext{%
- \@ifnextchar[%
- {\niib@text}%
- {\niib@text[\thebibnote]}%
+\newrobustcmd*{\bibnotetext}[1][\thebibnote]{%
+ \niib@text{#1}%
}
\@ifpackageloaded{biblatex}{%
\let\printbibnotes\printbibliography%
}{%
- \newcommand*{\printbibnotes}{\niib@bib%
+ \newrobustcmd*{\printbibnotes}{\niib@bib%
{\niibprefix\jobname}}%
}%
-\newcommand*\flushcitestack{%
+\newrobustcmd*{\flushcitestack}{%
\ifx\niib@stack\relax\else%
\expandafter\nocite\expandafter{\niib@stack}%
\global\let\niib@stack\relax%
\fi%
}
-\newcommand*\delaycite[1]{%
- \@ifundefined{niib@orig@#1}{%
- \expandafter\expandafter\expandafter\let\expandafter%
- \csname niib@orig@#1\expandafter\endcsname\csname #1\endcsname%
- \expandafter\renewcommand\csname #1\endcsname[2][\relax]{%
- \ifniib@cn%
- \csname niib@orig@#1\endcsname{##2}%
- \else%
- \begingroup%
- \@fileswfalse%
- \ifx##1\relax%
- \csname niib@orig@#1\endcsname{##2}%
- \else%
- \csname niib@orig@#1\endcsname[##1]{##2}%
- \fi%
- \endgroup%
- \edef\niib@temp{##2}%
- \ifx\niib@stack\relax%
- \xdef\niib@stack{\niib@temp}%
- \else%
- \xdef\niib@stack{\niib@stack,\niib@temp}%
- \fi%
- \fi%
- }%
- }{%
- \PackageInfo{notes2bib}%
- {Citation type ``#1'' already delayed}%
- }
+\newrobustcmd*{\delaycite}[1]{%
+ \PackageWarning{notes2bib}{%
+ \@nameuse{delaycite}can only be used in the document
+ body\MessageBreak Not modifying citation macro \@nameuse{#1}}
}
\ifniib@tail
- \newcommand*\citenote[2][\relax]{%
+ \newrobustcmd*\citenote[2][\relax]{%
\begingroup%
\@fileswfalse%
- \ifx#1\relax
+ \ifx#1\relax%
\niibcite{#2}%
\else
- \niibcite[#1]{#2}
+ \niibcite[#1]{#2}%
\fi
\endgroup%
- }
+ }%
\else
- \newcommand*\citenote{\niibcite}
+ \newrobustcmd*\citenote{\niibcite}%
\fi
-\newcommand*{\Percent}{\%\xspace}
\@ifpackageloaded{biblatex}
{\def\niib@keyname{keysort}}
{\def\niib@keyname{key}}
@@ -220,82 +198,87 @@
required.^^J}
\let\niib@stack\relax
\newif\ifniib@cn\niib@cnfalse
-\long\def\niib@text[#1]{%
- \niib@@text{#1}%
+\newrobustcmd*\niib@delaycite[1]{%
+ \@ifundefined{#1}{%
+ \PackageWarning{notes2bib}
+ {Citation macro \@nameuse{#1}undefined\MessageBreak
+ \protect\delaycite\space cannot operate on this macro}
+ }{%
+ \@ifundefined{niib@orig@#1}{%
+ \expandafter\expandafter\expandafter\let\expandafter%
+ \csname niib@orig@#1\expandafter\endcsname\csname #1\endcsname%
+ \expandafter\renewcommand\csname #1\endcsname[2][\relax]{%
+ \ifniib@cn%
+ \csname niib@orig@#1\endcsname{##2}%
+ \else%
+ \begingroup%
+ \@fileswfalse%
+ \ifx##1\relax%
+ \csname niib@orig@#1\endcsname{##2}%
+ \else%
+ \csname niib@orig@#1\endcsname[##1]{##2}%
+ \fi%
+ \endgroup%
+ \edef\niib@temp{##2}%
+ \ifx\niib@stack\relax%
+ \xdef\niib@stack{\niib@temp}%
+ \else%
+ \xdef\niib@stack{\niib@stack,\niib@temp}%
+ \fi%
+ \fi%
+ }%
+ \PackageInfo{notes2bib}%
+ {Modifying citation type \@nameuse{#1}}%
+ }{%
+ \PackageInfo{notes2bib}%
+ {Already delayed \@nameuse{#1}}%
+ }%
+ }
}
-\long\def\niib@bibnote[#1]{%
- \niib@citenote{#1}%
- \niib@@text{#1}%
+\long\def\niib@bibnote[#1]#2{%
+ \niib@text{#1}{#2}%
+ \niib@cite{#1}%
}
-\def\niib@mark[#1]{\niib@citenote{#1}}
-\def\niib@citenote#1{%
- \niib@cntrue%
- \edef\niib@temp{#1}%
+\def\niib@mark[#1]{\niib@cite{#1}}
+\ifniib@head%
+ \def\niib@cite#1{%
+ \niib@cntrue%
+ \niibcite{#1}%
+ \niib@cnfalse%
+ }%
+\else%
\ifniib@tail%
- \begingroup%
- \@fileswfalse%
- \niibcite{#1}%
- \endgroup%
+ \def\niib@cite#1{%
\ifx\niib@stack\relax%
- \xdef\niib@stack{\niib@temp}%
+ \xdef\niib@stack{#1}%
\else%
- \xdef\niib@stack{\niib@stack,\niib@temp}%
+ \xdef\niib@stack{\niib@stack,#1}%
\fi%
+ \begingroup
+ \@fileswfalse%
+ \niibcite{#1}%
+ \endgroup%
+ }%
\else%
- \expandafter\niibcite\expandafter%
- {\expandafter\niib@temp\expandafter}%
+ \def\niib@cite#1{\niibcite{#1}}%
\fi%
- \niib@cnfalse%
-}%
-\newcommand\niib@verbtext[2][\ignorespaces]{%
- \begingroup%
- \let\do\@makeother\dospecials%
- \catcode`\{=1\relax%
- \catcode`\}=2\relax%
- \niib@@verbtext{#1}{#2}%
-}%
-\newcommand\niib@@verbtext[2]{%
- \begingroup%
- \long\def\niib@tempa##1{%
- \def\niib@tempa{##1}%
- \@onelevel@sanitize\niib@tempa%
- \expandafter\endgroup%
- \expandafter\def%
- \expandafter#2%
- \expandafter{%
- \niib@tempa}%
- #1%
- }%
- \catcode`\^^M=10\relax%
- \niib@percent%
- \expandafter\endgroup%
- \niib@tempa%
-}%
-\newcommand*\niib@write{%
- \@bsphack%
- \begingroup%
- \niib@verbtext[\niib@@write\ignorespaces]\niib@tempa%
-}%
-\newcommand*\niib@@write[1]{%
- \immediate\write\niib@out{%
- @\niibrecord\string{\niib@tempb,^^J%
+\fi%
+\long\def\niib@text#1#2{%
+ \@ifundefined{niib@out}{%
+ \if@filesw%
+ \newwrite\niib@out%
+ \gdef\niib@stream{\niibprefix\jobname.bib}%
+ \immediate\openout\niib@out\niib@stream\relax%
+ \immediate\write\niib@out{\niib@msg}%
+ \fi}%
+ {}%
+ \if@filesw%
+ \immediate\write\niib@out{%
+ @\niibrecord\string{#1,^^J%
presort = \string{\niib@presort\string},^^J%
- \niib@keyname\space= \string{\niib@key\niib@tempb\string},^^J%
- \niibfield\space= \string{\niib@tempa\string}^^J%
+ \niib@keyname\space= \string{\niib@key#1\string},^^J%
+ \niibfield\space= \string{\unexpanded{#2}\string}^^J%
\string}^^J}%
- \endgroup%
- \@esphack%
-}%
-\long\def\niib@@text#1{%
- \ifx\niib@out\@undefined%
- \newwrite\niib@out%
- \gdef\niib@stream{\niibprefix\jobname.bib}%
- \immediate\openout\niib@out\niib@stream\relax%
- \immediate\write\niib@out{\niib@msg}%
- \fi%
- \if@filesw%
- \edef\niib@tempb{#1}%
- \expandafter\niib@write%
\fi%
}
\@ifpackageloaded{biblatex}{%
@@ -312,9 +295,8 @@
%%
\AtEndDocument{%
\flushcitestack%
- \ifx\niib@out\@undefined\else%
- \immediate\closeout\niib@out%
- \fi%
+ \@ifundefined{niib@out}{}%
+ {\immediate\closeout\niib@out}%
}
\endinput
%%