From 4c20f243cb551718af3b0e88aab09cd6460658d6 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 3 Sep 2011 23:15:34 +0000 Subject: new latex package xcite (2sep11) git-svn-id: svn://tug.org/texlive/trunk@23783 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/xcite/README | 41 +++++ Master/texmf-dist/doc/latex/xcite/xcite.pdf | Bin 0 -> 206721 bytes Master/texmf-dist/source/latex/xcite/xcite.dtx | 189 ++++++++++++++++++++++ Master/texmf-dist/source/latex/xcite/xcite.ins | 71 ++++++++ Master/texmf-dist/tex/latex/xcite/xcite.sty | 66 ++++++++ Master/tlpkg/bin/tlpkg-ctan-check | 2 +- Master/tlpkg/tlpsrc/collection-bibtexextra.tlpsrc | 1 + Master/tlpkg/tlpsrc/xcite.tlpsrc | 0 8 files changed, 369 insertions(+), 1 deletion(-) create mode 100644 Master/texmf-dist/doc/latex/xcite/README create mode 100644 Master/texmf-dist/doc/latex/xcite/xcite.pdf create mode 100644 Master/texmf-dist/source/latex/xcite/xcite.dtx create mode 100644 Master/texmf-dist/source/latex/xcite/xcite.ins create mode 100644 Master/texmf-dist/tex/latex/xcite/xcite.sty create mode 100644 Master/tlpkg/tlpsrc/xcite.tlpsrc diff --git a/Master/texmf-dist/doc/latex/xcite/README b/Master/texmf-dist/doc/latex/xcite/README new file mode 100644 index 00000000000..b93b15c7ad3 --- /dev/null +++ b/Master/texmf-dist/doc/latex/xcite/README @@ -0,0 +1,41 @@ +The xcite lets you use citations keys used in another +document, just like the package xr does with labels. + +This is version 1.0 of the package + +Copyright (C) 2011 by Enrico Gregorio + +------------------------------------------------------- + +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 + xcite.dtx + xcite.ins +and the derived file xcite.sty. + +To install the distribution: + +o run "latex xcite.ins" +o move "xcite.sty" to locations where LaTeX will find + it (the FAQ on CTAN in /help/uktug-FAQ gives more + information about this magic place + +To produce the documentation in pdf format: + +o run "pdflatex xcite.dtx" +o run "makeindex -s gglo.ist -o xcite.gls xcite.glo" +o run "pdflatex xcite.dtx" + +2011/09/02 +Enrico Gregorio diff --git a/Master/texmf-dist/doc/latex/xcite/xcite.pdf b/Master/texmf-dist/doc/latex/xcite/xcite.pdf new file mode 100644 index 00000000000..5d5ad24c1a4 Binary files /dev/null and b/Master/texmf-dist/doc/latex/xcite/xcite.pdf differ diff --git a/Master/texmf-dist/source/latex/xcite/xcite.dtx b/Master/texmf-dist/source/latex/xcite/xcite.dtx new file mode 100644 index 00000000000..d341e4399d2 --- /dev/null +++ b/Master/texmf-dist/source/latex/xcite/xcite.dtx @@ -0,0 +1,189 @@ +% \iffalse meta-comment +% +% Copyright 2011 Enrico Gregorio +% +% This file 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.3c 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 +% xcite.dtx +% xcite.ins +% and the derived file xcite.sty. +% +% \fi +% \iffalse +% +%<*driver> +\ProvidesFile{xcite.dtx} +% +%\NeedsTeXFormat{LaTeX2e} +%\ProvidesPackage{xcite} +%<*package> + [2011/09/02 v1.0 eXternal Citations (EG)] +% +% +%<*driver> +\documentclass{ltxdoc} +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\begin{document} + \DocInput{xcite.dtx} + \PrintChanges +\end{document} +% +% \fi +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% \CheckSum{82} +% +% \changes{v1.00}{2011/09/02} +% {First version} +% +% \GetFileInfo{xcite.dtx} +% +% \title{The \textsf{xcite} package\thanks{This file +% has version number \fileversion, last +% revised \filedate.}} +% \author{Enrico Gregorio\thanks{% +% This package derives from \textsf{xr} by David Carlisle}\\ +% {\small\texttt{Enrico dot Gregorio at univr dot it}}} +% \date{\filedate} +% \maketitle +% +% \section{Description} +% This package implements a system for eXternal Citations. +% If one document needs to refer to citations in another, say |aaa.tex|, +% then this package may be loaded in the main file, and the command\\[\topsep] +% |\externalcitedocument{aaa}|\\[\topsep] +% given in the preamble. +% +% Then you may use |\cite| to refer to anything which has been +% declared by |\bibitem| in either |aaa.tex| or the main document. +% You may declare any number of such external documents. Notice that +% |\bibitem| commands may not appear in |aaa.tex|, but rather in +% |aaa.bbl| if \textsc{Bib}\negthinspace\TeX{} or Biber are used to +% generate the bibliography, but this doesn't matter. The important +% thing is that |aaa.tex| is in final form with all citations resolved +% and that |aaa.aux| is readable. +% +% If any of the external documents, or the main document, use the same +% citation key then an error will occur as the label will be multiply +% defined. To overcome this problem |\externalcitedocument| has an +% optional argument. If you declare\\[\topsep] +% |\externalcitedocument[A-]{aaa}|\\[\topsep] +% then all references from |aaa| are prefixed by |A-|. So for +% instance, if |aaa.tex| had |\bibitem{xyz}|, then this could be +% referenced with |\cite{A-xyz}|. The prefix need not be |A-|, it can +% be any string chosen to ensure that all the keys imported from +% external files are unique. Note however that if your style declares +% certain active characters (|:| in French, |"| in German) then these +% characters can not usually be used in |\cite|, and similarly may +% not be used in the optional argument to |\externalcitedocument|. +% +% \section{Acknowledgment} +% This package is just a straightforward modification of David +% Carlisle's \textsf{xr} package (based on Jean-Pierre Drucbert's +% work). The changes consisted in renaming the main command and +% substituting |\newlabel| with |\bibcite|; the |XR| prefix to +% internal commands has been changed into |XC|. +% +% These modifications are possible because |\newlabel| and |\bibcite| +% are almost the same command in disguise. +% +% This package originated from a question in +% |TeX.StackExchange.com|.\footnote{\ttfamily +% http://tex.stackexchange.com/questions/27243/} +% +% \StopEventually{} +% +% \section{The macros} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% Save the optional prefix. Start processing the first |aux| file. +% \begin{macrocode} +\newcommand\externalcitedocument[2][]{{% + \makeatletter + \def\XC@prefix{#1}% + \XC@next#2.aux\relax\\}} +% \end{macrocode} +% +% Process the next |aux| file in the list and remove it from the head of +% the list of files to process. +% \begin{macrocode} +\def\XC@next#1\relax#2\\{% + \edef\XC@list{#2}% + \XC@loop{#1}} +% \end{macrocode} +% +% Check whether the list of |aux| files is empty. +% \begin{macrocode} +\def\XC@aux{% + \ifx\XC@list\@empty\else\expandafter\XC@explist\fi} +% \end{macrocode} +% +% Expand the list of |aux| files, and call |\XC@next| to process the first +% one. +% \begin{macrocode} +\def\XC@explist{\expandafter\XC@next\XC@list\\} +% \end{macrocode} +% +% If the |aux| file exists, loop through line by line, looking for +% |\bibcite| and |\@input|. Otherwise process the next file in the +% list. +% \begin{macrocode} +\def\XC@loop#1{\openin\@inputcheck#1\relax + \ifeof\@inputcheck + \PackageWarning{xc}{^^JNo file #1^^JLABELS NOT IMPORTED.^^J}% + \expandafter\XC@aux + \else + \PackageInfo{xc}{IMPORTING LABELS FROM #1}% + \expandafter\XC@read\fi} +% \end{macrocode} +% +% Read the next line of the aux file. +% \begin{macrocode} +\def\XC@read{% + \read\@inputcheck to\XC@line +% \end{macrocode} +% The |...| make sure that |\XC@test| always has sufficient arguments. +% \begin{macrocode} + \expandafter\XC@test\XC@line...\XC@} +% \end{macrocode} +% +% Look at the first token of the line. +% If it is |\bibcite|, do the |\bibcite|. If it is |\@input|, add the +% filename to the list of files to process. Otherwise ignore. +% Go around the loop if not at end of file. Finally process the next +% file in the list. +% \begin{macrocode} +\long\def\XC@test#1#2#3#4\XC@{% + \ifx#1\bibcite + \bibcite{\XC@prefix#2}{#3}% + \else\ifx#1\@input + \edef\XC@list{\XC@list#2\relax}% + \fi\fi + \ifeof\@inputcheck\expandafter\XC@aux + \else\expandafter\XC@read\fi} +% \end{macrocode} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \Finale +% + diff --git a/Master/texmf-dist/source/latex/xcite/xcite.ins b/Master/texmf-dist/source/latex/xcite/xcite.ins new file mode 100644 index 00000000000..91dc70f7f67 --- /dev/null +++ b/Master/texmf-dist/source/latex/xcite/xcite.ins @@ -0,0 +1,71 @@ +% Copyright (C) 2011 by Enrico Gregorio +% +% ------------------------------------------------------- +% +% 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 +% xcite.dtx +% xcite.ins +% and the derived file xcite.sty. + +\input docstrip.tex +\keepsilent + +\usedir{tex/latex/xcite} + +\preamble + +This is a generated file. + +Copyright (C) 2011 by Enrico Gregorio + +------------------------------------------------------- + +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 + xcite.dtx + xcite.ins +and the derived file xcite.sty. + +\endpreamble + +\generate{\file{xcite.sty}{\from{xcite.dtx}{package}}} + +\obeyspaces +\Msg{*************************************************************} +\Msg{* *} +\Msg{* To finish the installation you have to move the following *} +\Msg{* file into a directory searched by TeX: *} +\Msg{* *} +\Msg{* xcite.sty *} +\Msg{* *} +\Msg{* To produce the documentation run the file *} +\Msg{* xcite.dtx through LaTeX. *} +\Msg{* *} +\Msg{* Happy TeXing! *} +\Msg{* *} +\Msg{*************************************************************} + +\endbatchfile diff --git a/Master/texmf-dist/tex/latex/xcite/xcite.sty b/Master/texmf-dist/tex/latex/xcite/xcite.sty new file mode 100644 index 00000000000..ce30889ce6c --- /dev/null +++ b/Master/texmf-dist/tex/latex/xcite/xcite.sty @@ -0,0 +1,66 @@ +%% +%% This is file `xcite.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% xcite.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright (C) 2011 by Enrico Gregorio +%% +%% ------------------------------------------------------- +%% +%% 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 +%% xcite.dtx +%% xcite.ins +%% and the derived file xcite.sty. +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{xcite} + [2011/09/02 v1.0 eXternal Citations (EG)] +\newcommand\externalcitedocument[2][]{{% + \makeatletter + \def\XC@prefix{#1}% + \XC@next#2.aux\relax\\}} +\def\XC@next#1\relax#2\\{% + \edef\XC@list{#2}% + \XC@loop{#1}} +\def\XC@aux{% + \ifx\XC@list\@empty\else\expandafter\XC@explist\fi} +\def\XC@explist{\expandafter\XC@next\XC@list\\} +\def\XC@loop#1{\openin\@inputcheck#1\relax + \ifeof\@inputcheck + \PackageWarning{xc}{^^JNo file #1^^JLABELS NOT IMPORTED.^^J}% + \expandafter\XC@aux + \else + \PackageInfo{xc}{IMPORTING LABELS FROM #1}% + \expandafter\XC@read\fi} +\def\XC@read{% + \read\@inputcheck to\XC@line + \expandafter\XC@test\XC@line...\XC@} +\long\def\XC@test#1#2#3#4\XC@{% + \ifx#1\bibcite + \bibcite{\XC@prefix#2}{#3}% + \else\ifx#1\@input + \edef\XC@list{\XC@list#2\relax}% + \fi\fi + \ifeof\@inputcheck\expandafter\XC@aux + \else\expandafter\XC@read\fi} + +\endinput +%% +%% End of file `xcite.sty'. diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index 860d3b4b072..40461ea60dd 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -393,7 +393,7 @@ my @TLP_working = qw( wadalab wallpaper warning warpcol was widetable williams wnri wnri-latex wordlike wrapfig wsuipa - xargs xcolor xcomment xdoc + xargs xcite xcolor xcomment xdoc xecjk xecolour xecyr xeindex xepersian xesearch xetex-def xetex-devanagari xetex-itrans xetex-pstricks xetexfontinfo xetexref xfor xgreek xhfill diff --git a/Master/tlpkg/tlpsrc/collection-bibtexextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-bibtexextra.tlpsrc index d45e62fb120..21aff0d8a06 100644 --- a/Master/tlpkg/tlpsrc/collection-bibtexextra.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-bibtexextra.tlpsrc @@ -66,5 +66,6 @@ depend splitbib depend uni-wtal-ger depend urlbst depend vak +depend xcite # depend collection-latex diff --git a/Master/tlpkg/tlpsrc/xcite.tlpsrc b/Master/tlpkg/tlpsrc/xcite.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d -- cgit v1.2.3