From 1b67be372d9456a6b4c954be453d2a0d2558094b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 4 Apr 2011 00:41:13 +0000 Subject: bibexport now pushing to linked_scripts git-svn-id: svn://tug.org/texlive/trunk@21947 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/bibtex/bibexport/bibexport.dtx | 1072 ++++++++++++++++++++ .../source/bibtex/bibexport/bibexport.ins | 69 ++ 2 files changed, 1141 insertions(+) create mode 100644 Master/texmf-dist/source/bibtex/bibexport/bibexport.dtx create mode 100644 Master/texmf-dist/source/bibtex/bibexport/bibexport.ins (limited to 'Master/texmf-dist/source/bibtex') diff --git a/Master/texmf-dist/source/bibtex/bibexport/bibexport.dtx b/Master/texmf-dist/source/bibtex/bibexport/bibexport.dtx new file mode 100644 index 00000000000..d1530fcb7d6 --- /dev/null +++ b/Master/texmf-dist/source/bibtex/bibexport/bibexport.dtx @@ -0,0 +1,1072 @@ +% \iffalse meta-comment +% +% Copyright +%<*driver> +\documentclass{ltxdoc} +\usepackage{doc} + +\def\script#1{\texttt{#1}} +\def\ext#1{\texttt{.#1}} +\def\var#1{\texttt{\$#1}} +\def\entry#1{\texttt{@#1}} +\def\lang#1{\textsc{#1}} +\def\bst#1{\textsf{#1.bst}} +\def\BibTeX{Bib\TeX} + +%%%\AtBeginDocument{\CodelineIndex\EnableCrossrefs} +%%%\AtEndDocument{\PrintIndex} +\begin{document} + \def\docdate{2009/10/11} + \def\fileversion{2.20} + \def\filedate{2009/10/11} + \DocInput{bibexport.dtx} +\end{document} +% +% +% \fi +% \CheckSum{26} +%% \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 \~} +%% +% +% \title{The \script{bibexport.sh} script} +% \author{Nicolas Markey} +% \date{\filedate} +% \maketitle +% \StopEventually{} +% +% \begin{abstract} +% \script{bibexport.sh} is a small shell script, relying on \BibTeX, that +% extracts entries of one or several \ext{bib} file(s). It will expand +% abbreviations and cross-references, except standard month and journal +% abbreviations. The output is indented as neatly as possible, yielding a +% readable \ext{bib} file even if the original one was not. +% \end{abstract} +% +% +% \section{Exporting \ext{bib} files} +% +% \subsection{Why and how?} +% +% \BibTeX{} aims at allowing for the use of one single \ext{bib} file, +% containing many entries, from which \BibTeX{} extracts only the +% \verb+\cite+d ones. When sending a document to someone else, this +% requires either to send the whole file, or to extract some entries +% from the \ext{bib} file. +% +% \BibTeX{} also has a mechanism for using abbreviations and +% cross-references. When extracting entries of a large \ext{bib} file, +% it can be interesting to develop those abbreviations, in order to get a +% clean, self-contained \ext{bib} file. Also, it may be useful to develop +% cross-references in a \ext{bib} file, independently of any document. +% +% \medskip +% \script{bibexport} can either extract entries that are cited in a document, +% or all the entries of one or several \ext{bib} files. It will always develop +% cross-references and abreviations, except standard abbreviations for months or +% some journals, that are defined in standard \BibTeX{} styles. This script +% uses \BibTeX{}. This has both pros and cons: +% \begin{itemize} +%\item[$+$] it is very simple. Basicaly, the script simply calls \BibTeX{}, and the +% \ext{bst} file just outputs the name and the content of each field. +%\item[$+$] since it uses \BibTeX, we are sure that it will handle everything +% "properly", \emph{i.e.} in the same way as they will be handled when cited in +% a \LaTeX{} document; +%\item[$=$] \BibTeX{} has some strict limitations (especially "no more than 78 consecutive +% non-space characters") that we must be aware of. On the other hand, any such +% problem occuring within the script would also occur when compiling a +% document; +%\item[$-$] abbreviations and cross-references will \emph{always} be +% developped. It could be argued that this is also a positive point, but +% having the choice would have been better. +%\item[$-$] Many people seem to find \BibTeX's internal language clumsy, and thus +% the script could be difficult to adapt to special needs. However, this is +% \emph{really} not that difficult, as will be explained later on. And please, +% don't hesitate to ask for improvements. +% \end{itemize} +% +% \subsection{Related scripts} +% +% Several other tools exist for achieving this task: +% \begin{itemize} +%\item \verb+aux2bib+, written by Ralf Treinen, relies on \verb+bib2bib+, +% which is a \lang{CaML} program for selecting some entries in one or several \ext{bib} +% files. It does not expand anything, but includes all the necessary +% definitions and entries. +%\item \verb+bibextract.sh+, by Nelson Beebe. This script uses \lang{awk} for +% extracting some entries out of a \ext{bib} file. It is said to be +% noncompliant with cross-references. +%\item \bst{subset}, by David Kotz. \bst{export} develops the same ideas (but +% I discovered that only later on). \bst{subset} does not handle +% \entry{preamble}, neither does it "protect" standard abbreviations. +%\item Probalby some others... +% \end{itemize} +% +% \subsection{Some examples} +% +% \begin{itemize} +%\item extracting \verb+\cite+d references of a document, also including +% cross-references: +%\begin{center} +% \ttfamily bibexport -o {\itshape }.bib {\itshape }.aux +%\end{center} +%\item extracting \verb+\cite+d references of a document, without crossrefs, +% and using a special \ext{bst} file: +%\begin{center} +% \ttfamily bibexport -b {\itshape