%% --------------------------------------------------------------- %% 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/27} {1.1} {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} \DeclareBibliographyCategory{citeall} % 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]{} \newcommand\warn[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} } {\addtocategory{citeall}{##1} \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