summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/usebib
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-03-18 23:22:05 +0000
committerKarl Berry <karl@freefriends.org>2012-03-18 23:22:05 +0000
commit61065674de81d0dccba11b46076f426e424ad58a (patch)
treecbc6052c862aa97d2d7eada767ef8983c45e48df /Master/texmf-dist/tex/latex/usebib
parentf15fbb8503dce68666829792d7251f0e60a2c6f2 (diff)
new latex package usebib (18mar12)
git-svn-id: svn://tug.org/texlive/trunk@25686 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/usebib')
-rw-r--r--Master/texmf-dist/tex/latex/usebib/usebib.sty94
1 files changed, 94 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/usebib/usebib.sty b/Master/texmf-dist/tex/latex/usebib/usebib.sty
new file mode 100644
index 00000000000..096a7be44f3
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/usebib/usebib.sty
@@ -0,0 +1,94 @@
+%%
+%% This is file `usebib.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% usebib.dtx (with options: `package')
+%%
+%% This is a generated file.
+%%
+%% Copyright (C) 2012 by Enrico Gregorio
+%% <Enrico dot Gregorio at univr dot it>
+%% -------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any
+%% later version. The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions
+%% of LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Enrico Gregorio.
+%%
+%% This work consists of the files
+%% usebib.dtx
+%% usebib.ins
+%% and the derived file usebib.sty.
+%%
+\NeedsTeXFormat{LaTeX2e}[2008/04/05]
+\ProvidesPackage{usebib}
+ [2012/03/17 v1.0 Reusing bib files]
+\@ifundefined{eTeXversion}
+ {\PackageError{usebib}{LaTeX engine too old, aborting}
+ {Please upgrade your TeX system}\@@end}{}
+\RequirePackage{url}
+\RequirePackage{keyval}
+\define@key{usebib}{currenttype}{\def\@tempa{#1}}
+\define@key{usebib}{currententry}{\def\reuse@current{#1}}
+\def\define@reuse@key#1{%
+ \define@key{usebib}{#1}{\lowercase{\global\@namedef{reuse@\reuse@current @#1}}{##1}}}
+\define@reuse@key{title}
+\define@reuse@key{isbn}
+\define@reuse@key{url}
+\define@reuse@key{year}
+\define@reuse@key{note}
+\def\reuse@find#1#{%
+ \lowercase{\setkeys{usebib}{currenttype=#1}}%
+ \ifcsname reuse@type@\@tempa\endcsname
+ \expandafter\@gobble
+ \else
+ \begingroup\@makeother\%\makeatother
+ \expandafter\reuse@extract
+ \fi}
+\def\reuse@extract#1{\setkeys{usebib}{currententry=#1}\endgroup}
+\let\reuse@type@preamble\@empty
+\let\reuse@type@string\@empty
+\def\newbibignore#1{\expandafter\let\csname reuse@type@#1\endcsname\@empty}
+\def\reuse@error#1#2{%
+ \PackageError{usebib}
+ {Undefined key `#1' or empty value for `#2'}
+ {The key you used is wrong or the value to `#2' has not been set}}
+\newcommand\newbibfield[1]{\define@reuse@key{#1}}
+\def\usebibentry#1#2{\@ifundefined{reuse@#1@#2}
+ {\reuse@error{#1}{#2}}
+ {\@nameuse{reuse@#1@#2}}}
+\newcommand{\usebibentryurl}[2][|]{\@ifundefined{reuse@#2@url}
+ {\reuse@error{#2}{url}}
+ {\reuse@usebibentryurl{#1}{#2}}}
+\@ifpackageloaded{hyperref}{\@tempswatrue}{\@tempswafalse}
+\if@tempswa
+ \def\reuse@usebibentryurl#1#2{%
+ \scantokens{\url{\csname reuse@#2@url\endcsname}\endinput}}
+\else
+ \def\reuse@usebibentryurl#1#2{%
+ \toks@=\expandafter\expandafter\expandafter
+ {\csname reuse@#2@url\endcsname}%
+ \scantokens\expandafter{%
+ \expandafter\url\expandafter#1\the\toks@#1\endinput}}
+\fi
+\newcommand{\bibinput}[1]{%
+ \begingroup
+ \catcode`\^^M=10
+ \let\KV@err=\@gobble
+ \let\KV@errx=\@gobble
+ \let\XKV@err=\@gobble
+ \begingroup\lccode`\~=`\@
+ \lowercase{\endgroup\let~}\reuse@find
+ \catcode`\@=\active \input{#1.bib}\endgroup}
+\endinput
+%%
+%% End of file `usebib.sty'.