%% %% This is file `icite.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% icite.dtx (with options: `package') %% %% Copyright (C) 2019 by Robert Alessi %% %% Please send error reports and suggestions for improvements to Robert %% Alessi %% %% This program is free software: you can redistribute it and/or modify %% it under the terms of the GNU General Public License as published by %% the Free Software Foundation, either version 3 of the License, or %% (at your option) any later version. %% %% This program is distributed in the hope that it will be useful, but %% WITHOUT ANY WARRANTY; without even the implied warranty of %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %% General Public License for more details. %% %% You should have received a copy of the GNU General Public License %% along with this program. If not, see %% . %% %% This work consists of the file icite.dtx, icite.ins and a Makefile. %% Running "make" generates the derived files README.md, icite.pdf and icite.sty. %% Running "make inst" installs the files in the user's TeX tree. %% Running "make install" installs the files in the local TeX tree. %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{icite} [2019/03/12 v1.1 Make Indices locorum citatorum] \RequirePackage{xkeyval} \DeclareOptionX{citecmd}[cite]{\def\ic@dfltcit{#1}} \newif\ifdefault@index \newif\ifno@index \DeclareOptionX{defaultindex}[loccit]{ \edef\@tempa{#1} \edef\@none{none} \ifx\@tempa\@none \no@indextrue \else \default@indextrue \def\ic@dfltind{#1} \fi } \newif\ifno@bibengine \define@boolkey{icite.sty}[@pkg@]{nobibengine}[true]{% \if@pkg@nobibengine\no@bibenginetrue\else\fi} \ExecuteOptionsX{citecmd} \ProcessOptionsX\relax \RequirePackage{xparse} \RequirePackage{datatool} \RequirePackage{usebib} \define@reuse@key{author} \define@reuse@key{indexauthor} \define@reuse@key{sortname} \define@reuse@key{title} \define@reuse@key{shorttitle} \define@reuse@key{indextitle} \define@reuse@key{indexsorttitle} \define@reuse@key{entrysubtype} \define@reuse@key{shorthand} \def\get@bibentry#1#2{\@ifundefined{reuse@#1@#2}{} {\@nameuse{reuse@#1@#2}}} \DTLnewdb{icite@indices} \NewDocumentCommand{\IndexSubtypeAs}{m m}{% \DTLnewrow{icite@indices} \DTLnewdbentry{icite@indices}{subtype}{#1} \DTLnewdbentry{icite@indices}{index}{#2} } \@onlypreamble\IndexSubtypeAs \NewDocumentCommand{\TitleStyle}{m}{\emph{#1}} \NewDocumentCommand{\SetTitleStyle}{m}{% \RenewDocumentCommand{\TitleStyle}{m}{#1} } \@onlypreamble\SetTitleStyle \NewDocumentCommand{\icite}{o o m O{\ic@dfltcit}}{% \edef\@shorthand{\get@bibentry{#3}{shorthand}}% \edef\@subtype{\get@bibentry{#3}{entrysubtype}}% \edef\@author{\get@bibentry{#3}{author}}% \edef\@indexauthor{\get@bibentry{#3}{indexauthor}}% \edef\@sortname{\get@bibentry{#3}{sortname}}% \edef\@indexsorttitle{\get@bibentry{#3}{indexsorttitle}}% \edef\@indextitle{\get@bibentry{#3}{indextitle}}% \edef\@shorttitle{\get@bibentry{#3}{shorttitle}}% \edef\@title{\get@bibentry{#3}{title}}% \ifx\@indexauthor\empty \def\@useauthor{\@author}% \else \def\@useauthor{\@indexauthor}% \fi \ifx\@sortname\empty \def\@sortedauthor{\@useauthor}% \else \def\@sortedauthor{{\@sortname}@\@useauthor}% \fi \ifx\@indextitle\empty \ifx\@shorttitle\empty \def\@usetitle{\@title}% \else \def\@usetitle{\@shorttitle}% \fi \else \def\@usetitle{\@indextitle}% \fi \ifx\@indexsorttitle\empty \def\@sortedtitle{{\@usetitle}@\TitleStyle{\@usetitle}}% \else \def\@sortedtitle{{\@indexsorttitle}@\TitleStyle{\@usetitle}}% \fi \IfNoValueTF{#1}% {\DTLifdbempty{icite@indices}{% \ifno@index\else \ifdefault@index% \index[\ic@dfltind]{\@sortedauthor!\@sortedtitle}% \else% \index{\@sortedauthor!\@sortedtitle}% \fi\fi% }{% \DTLforeach*{icite@indices}{% \icite@subtype=subtype,\icite@index=index}{% \ifx\@subtype\icite@subtype% \index[\icite@index]{\@sortedauthor!\@sortedtitle}% \dtlbreak% \else% \ifno@index\else \ifdefault@index% \index[\ic@dfltind]{\@sortedauthor!\@sortedtitle}% \else% \index{\@sortedauthor!\@sortedtitle}% \fi\fi% \fi}} \ifno@bibengine \ifx\@shorthand\empty% \@useauthor, \TitleStyle{\@usetitle}% \else% \@shorthand% \fi% \else% \csname #4\endcsname{#3}% \fi% } {\IfNoValueTF{#2}% {\DTLifdbempty{icite@indices}{% \ifno@index\else \ifdefault@index% \index[\ic@dfltind]{\@sortedauthor!\@sortedtitle!#1}% \else% \index{\@sortedauthor!\@sortedtitle!#1}% \fi\fi% }{% \DTLforeach*{icite@indices}{% \icite@subtype=subtype,\icite@index=index}{% \ifx\@subtype\icite@subtype% \index[\icite@index]{\@sortedauthor!\@sortedtitle!#1}% \dtlbreak% \else% \ifno@index\else \ifdefault@index% \index[\ic@dfltind]{\@sortedauthor!\@sortedtitle!#1}% \else% \index{\@sortedauthor!\@sortedtitle!#1}% \fi\fi% \fi}}% \ifno@bibengine \ifx\@shorthand\empty% \@useauthor, \TitleStyle{\@usetitle}, {#1}% \else% \@shorthand, {#1}% \fi% \else% \csname #4\endcsname[{#1}]{#3}% \fi% } {\DTLifdbempty{icite@indices}{% \ifno@index\else \ifdefault@index% \index[\ic@dfltind]{\@sortedauthor!\@sortedtitle!#2}% \else% \index{\@sortedauthor!\@sortedtitle!#2}% \fi\fi% }{% \DTLforeach*{icite@indices}{% \icite@subtype=subtype,\icite@index=index}{% \ifx\@subtype\icite@subtype% \index[\icite@index]{\@sortedauthor!\@sortedtitle!#2}% \dtlbreak% \else% \ifno@index\else \ifdefault@index% \index[\ic@dfltind]{\@sortedauthor!\@sortedtitle!#2}% \else% \index{\@sortedauthor!\@sortedtitle!#2}% \fi\fi% \fi}}% \ifno@bibengine \ifx\@shorthand\empty% #1 \@useauthor, \TitleStyle{\@usetitle}, {#2}% \else% #1 \@shorthand, {#2}% \fi \else% \csname #4\endcsname[#1][{#2}]{#3}% \fi% }% }% } \endinput %% %% End of file `icite.sty'.