From 773310e58596170d4241a9896088b7b77f2cc312 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 19 Feb 2015 22:16:31 +0000 Subject: citeall (19feb15) git-svn-id: svn://tug.org/texlive/trunk@36325 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/citeall/citeall.sty | 113 ++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/citeall/citeall.sty (limited to 'Master/texmf-dist/tex/latex/citeall') diff --git a/Master/texmf-dist/tex/latex/citeall/citeall.sty b/Master/texmf-dist/tex/latex/citeall/citeall.sty new file mode 100644 index 00000000000..d1c88423f7f --- /dev/null +++ b/Master/texmf-dist/tex/latex/citeall/citeall.sty @@ -0,0 +1,113 @@ +%% --------------------------------------------------------------- +%% The citeall package --- A package to test biblatex-cite commands +%% Maintained by Ulrike Fischer +%% E-mail: fischer@troubleshooting-tex.de +%% www.troubleshooting-tex.de +%% Released under the LaTeX Project Public License v1.3c or later +%% See http://www.latex-project.org/lppl.txt +%% --------------------------------------------------------------- + +\RequirePackage{expl3,xparse} + +\ProvidesExplPackage {citeall} {2015/02/10} {1.0} + {a package to test biblatex-cite commands} + +\@ifpackageloaded{biblatex}{}{% + \PackageWarning{citeall} + { + This~package~works~only~with~biblatex!\MessageBreak + Load~it~before~citeall!\MessageBreak + Loading~citeall~will~abort! + }% + \NewDocumentCommand\citeall { O{} } {} + \tex_endinput:D} + + + +% commands to hold arguments and temporary values +\clist_new:N \l_UF_citecommands_clist +\tl_new:N \l_UF_temp_citefunction_tl +\tl_new:N \l_UF_temp_entrykey_tl +\int_new:N \l_UF_temp_listitem_int +\int_new:N \l_UF_temp_listlength_int +\int_new:N \l_UF_entrynum_int +\int_new:N \l_UF_cur_entrynum_int + +% formatting commands +\NewDocumentCommand\citeallgroupseparator{}{\par} +\NewDocumentCommand\citeallseparator {}{,\c_space_tl} +\NewDocumentCommand\citeallfinentry {}{} +\NewDocumentCommand\citealldefaultcite {}{\cite} + +%init suitable definitions for the fields in the bbl +\cs_new:Nn \_UF_init_bblfields: + {\newcommand\true [2][]{} + \newcommand\field[3][]{} + \newcommand\name [5][]{} + \newcommand\strng[2]{}% + \renewenvironment{refsection}[1]{}{} + \newenvironment{sortlist}[2]{}{} + \renewcommand\verb{\@ifnextchar\bgroup{\@gobble}{\my@verb}} + \def\my@verb##1\endverb{} + \renewcommand\list[4][]{} + \newcommand\inset[1]{} + \newcommand\keyw[1]{} + \newcommand\set[1]{} + } + +% init the entry environment +%#1=number of entries to process, if 0: process all +\cs_new:Nn \_UF_init_bblentryenv:n + {\int_set:Nn \l_UF_entrynum_int {#1} + \int_zero:N \l_UF_cur_entrynum_int + \NewDocumentEnvironment{entry} {m m m} + {\int_incr:N \l_UF_cur_entrynum_int + \tl_set:Nn \l_UF_temp_entrykey_tl {##1} + \int_zero:N \l_UF_temp_listitem_int + \int_set:Nn \l_UF_temp_listlength_int + {\clist_count:N\l_UF_citecommands_clist} + \bool_if:nT + { + \int_compare_p:n { \l_UF_entrynum_int = 0 } + || + \int_compare_p:n { \l_UF_cur_entrynum_int <= \l_UF_entrynum_int} + } + { + \clist_map_inline:Nn \l_UF_citecommands_clist + { + \int_incr:N \l_UF_temp_listitem_int + \tl_set:Nn \l_UF_temp_citefunction_tl {####1} + \l_UF_temp_citefunction_tl {\l_UF_temp_entrykey_tl} + \int_compare:nNnTF + {\l_UF_temp_listitem_int}<{\l_UF_temp_listlength_int} + {\citeallseparator}{\citeallfinentry} + } + \citeallgroupseparator + } + } + {} + } + + +% the main command + +\NewDocumentCommand\citeall { O{\citealldefaultcite} o} + {\nocite{*} %cite all entries + \clist_set:Nn\l_UF_citecommands_clist{#1} + \clist_if_empty:NT\l_UF_citecommands_clist + { + \clist_put_right:Nn\l_UF_citecommands_clist{\citealldefaultcite} + } + \group_begin: + \IfNoValueTF{#2} + {\_UF_init_bblentryenv:n{0}} + {\_UF_init_bblentryenv:n{#2}} + \_UF_init_bblfields: + \file_if_exist:nT + {\jobname.bbl} + {\file_input:n{\jobname.bbl}}% + \group_end: + } + + +\endinput -- cgit v1.2.3