From ad49b1da75fc4eef2808ccb07ceae93a5ba5dcf3 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 12 Jan 2006 23:57:08 +0000 Subject: inlinebib git-svn-id: svn://tug.org/texlive/trunk@995 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/inlinebib/inlinebib.sty | 165 +++++++++++++++++++++ .../texmf-dist/tex/latex/inlinebib/pageranges.sty | 94 ++++++++++++ 2 files changed, 259 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/inlinebib/inlinebib.sty create mode 100644 Master/texmf-dist/tex/latex/inlinebib/pageranges.sty (limited to 'Master/texmf-dist/tex/latex') diff --git a/Master/texmf-dist/tex/latex/inlinebib/inlinebib.sty b/Master/texmf-dist/tex/latex/inlinebib/inlinebib.sty new file mode 100644 index 00000000000..b631dd22605 --- /dev/null +++ b/Master/texmf-dist/tex/latex/inlinebib/inlinebib.sty @@ -0,0 +1,165 @@ +%% Copyright (C) 1994, 1995 René Seindal (rene@seindal.dk) + +% This files may be distributed under the terms of the LaTeX Project Public +% License as distributed from CTAN archives in macros/latex/base/lppl.txt; +% either version 1.0 or, at your option, any later version. + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{inlinebib}[1994/12/06\space Inline bibliography style] +\ProcessOptions + + %% No labels in the final list of litterature. + +\let\@biblabel\@gobble + + + %% This is called for each bibitem without option in the bbl file. + %% The inlinebib style does not use bibitems with optional + %% arguments. The arguments are: #1 = key, #2 = basic entry, #3 = + %% notes for last reference list only, #4 = short entry for successive + %% citations. The period that ends an entry in the list is never + %% present in the inline reference. Punctuations should be added + %% manually. + +\long\def\@bibitem#1 #2 \note #3 \short #4 \end{\par\if@filesw + {\def\protect##1{\string ##1\space}% + \let\newblock\@empty + \immediate\write\@auxout{\string + \bibcite{#1}{\string\@bibcall{#1}{#2}{#4}}}}\fi + {\let\cite\shortcite #2#3}} +% {\let\cite\shortcite #2}} + + + + %% This is called from the aux file at the start of the job. + +\long\def\bibcite#1#2{\global\@namedef{b@#1}{#2}} + + + + + %% Set globally true iff an immediate following period should be + %% gobbled, because the citation ends in a period, e.g., from a + %% trailing "cit." or "ibid." and there is no optional part. + +\newif\if@gobbleperiod +\newif\if@withpages + + + %% Separate the first and the following citations of a reference, and + %% handle successive identical citations of the same reference. Each + %% macro b@LABEL is defined as \@bibcall{LABEL}{FULLCITE}{SHORTCITE}. + %% The actual definition of b@LABELis not changed after the first + %% citation, since it provokes messages of "Labels may have changed" + %% from LaTeX. + +\def\@lastcite{} +\def\noibid{\gdef\@lastcite{}} + +\long\def\@bibcall#1#2#3{\global\@gobbleperiodfalse + \@ifundefined{B@#1}% + {{#2}\global\@namedef{B@#1}{}}% + {\@bibsecond{#1}{#3}}% + \gdef\@lastcite{#1}% +} + +\long\def\@bibsecond#1#2{% + \def\@tempa{#1}% + \ifx\@tempa\@lastcite {\em ibid.}\else {#2} cit.\fi + \if@withpages \else \global\@gobbleperiodtrue \fi +} + + %% Called for each normal \cite call. This version does not allow + %% multiple citations in one call, as it makes little sense. The + %% labels are much too long. + +\def\cite{\protect\@pcite} +\def\@pcite{\@ifnextchar [{\@withpagestrue\@citex}{\@withpagesfalse\@citex[]}} + +\def\@citex[#1]#2{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi + \@ifundefined{b@#2}% + {{\reset@font\bf ?}\@warning + {Citation `#2' on page \thepage \space undefined}}% + {\@cite{\@nameuse{b@#2}}{#1}}% + \let\next\relax + \if@gobbleperiod \let\next\check@period \fi + \next +} + + + %% Produces the actual inline citation, no bracketes around it. + +\def\@cite#1#2{{#1\if@withpages , #2\fi}} + + + %% Remove a following period. + +\def\check@period{\futurelet\next\check@peri@d} +\def\check@peri@d{\ifx\next .\let\next\eat@period + \else \let\next\relax \fi \next} +\def\eat@period.{} + + + + + + %% Forced full citation + +\def\fullycite{\protect\@pfcite} +\def\@pfcite{\@ifnextchar [{\@withpagestrue\@fcitex}{\@withpagesfalse\@fcitex[]}} + +\def\@fcitex[#1]#2{\expandafter\let\csname B@#2\endcsname\undefined + \@citex[#1]{#2}} + + %% Forced short citation, with no "cit." suffix or "ibid." + %% substitutions. + +\def\shortcite{\protect\@pscite} +\def\@pscite{\@ifnextchar [{\@withpagestrue\@scitex}{\@withpagesfalse\@scitex[]}} + +\def\@scitex[#1]#2{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi + \@ifundefined{b@#2}{{\reset@font\bf ?}\@warning + {Citation `#2' on page \thepage \space undefined}}% + {\long\def\@bibcall##1##2##3{##3}% + \@cite{\@nameuse{b@#2}}{#1}}} + + + + %% Force full citations of the specified list of references. + +\def\fullcitenext#1{{\@tfor + \@tempa :=#1\do{\expandafter\global\expandafter + \let\csname B@\@tempa\endcsname\undefined}}} + + %% Force short citations of the specified list of references. + +\def\shortcitenext#1{{\@for + \@tempa :=#1\do{\expandafter\global\expandafter + \let\csname B@\@tempa\endcsname\@empty}}} + + + + + %% This is to allow for an introduction to the bibliography + +\let\bibc@mment\@empty +\long\def\bibliographycomment#1{% + \def\bibc@mment{\let\bibc@mment\@empty #1\par\bigskip}% +} + + + + %% Copied from report.sty, changed to avoid unwanted left margin and + %% add bibliography comment. + +\def\thebibliography#1{\chapter*{\bibname\@mkboth + {\uppercase{\bibname}}{\uppercase{\bibname}}}\bibc@mment + \small + \def\newblock{\hskip .11em plus.33em minus.07em}% + \sloppy\clubpenalty4000\widowpenalty4000 + \sfcode`\.=\@m + \parindent\z@\relax + \parskip\medskipamount +} + +\def\endthebibliography{\par\medskip} diff --git a/Master/texmf-dist/tex/latex/inlinebib/pageranges.sty b/Master/texmf-dist/tex/latex/inlinebib/pageranges.sty new file mode 100644 index 00000000000..97fa9603340 --- /dev/null +++ b/Master/texmf-dist/tex/latex/inlinebib/pageranges.sty @@ -0,0 +1,94 @@ +% Copyright (C) 1999 René Seindal (rene@seindal.dk) + +% This program can redistributed and/or modified under the terms +% of the LaTeX Project Public License Distributed from CTAN +% archives in directory macros/latex/base/lppl.txt; either +% version 1 of the License, or (at your option) any later version. + + %% Macros for citing. + +\let\@DEBUG@CIT\@gobble +%\let\@DEBUG@CIT\typeout + + %% \@PG does #1={a} -> {p.~a} + %% and #1={a-} -> {pp.~a~ff} + %% and #1={a-b} -> {pp.~a--b} + %% and #1={a b} -> {pp.~a b} + +\def\@PG#1{% + \@DEBUG@CIT{START: #1}% + {\@@PG#1 \@nil}% +} + +\newcommand\pages[2][\@gobble]{#1{, }\@PG{#2}} + +\def\@@PG#1 #2\@nil{% + \def\@tempa{#1}% + \def\@tempb{#2}% + \ifx\@tempb\@empty + \def\next{\@PGrange#1-\@nil}% + \else + \let\next\@PGspace + \fi + \next +} + + %% argument is "a-b"; tmpa="X" tmpb=void + +\def\@PGrange#1-#2\@nil{\hbox{% + \@DEBUG@CIT{RANGE: =#1=#2=}% + \def\@tempb{#2}% + \ifx\@tempb\@empty + p.~#1% + \else + pp.~#1% + \edef\@tempb{\@PGundash#2}% + \ifx\@tempb\@empty + ff% + \else + --\@tempb + \fi + \fi +}} + +\def\@PGundash#1-{#1} + + + %% argument is "a b"; tmpa="a" tmpb="b " + +\def\@PGspace{% + \@DEBUG@CIT{SPACE: =\@tempa=\@tempb=}% + \ifx\@tempb\@empty + \else + p% + \fi + p.~\expandafter\@PGdash\@tempa-\@nil% + \expandafter\@PGdashloop\@tempb\@nil% +} + + %% argument is "b"; tmpa="a" tmpb="b " + +\def\@PGdashloop#1 #2\@nil{% + \@DEBUG@CIT{TEST: =#1=#2=}% + \space\@PGdash#1-\@nil% + \def\@tempa{#2}% + \ifx\@tempa\@empty + \else + \@PGdashloop#2\@nil% + \fi +} + +\def\@PGdash#1-#2\@nil{\hbox{#1% + \@DEBUG@CIT{DASH: =#1=#2=}% + \def\@tempa{#2}% + \ifx\@tempa\@empty + \else + \edef\@tempa{\@PGundash#2}% + \ifx\@tempa\@empty + ff% + \else + --\@tempa + \fi + \fi +}} + -- cgit v1.2.3