diff options
author | Karl Berry <karl@freefriends.org> | 2019-03-17 21:38:40 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-03-17 21:38:40 +0000 |
commit | 92df70634c796daf81679360e2cc092d28cb6edc (patch) | |
tree | a3403716b50edd585d1ec3d100964b8e5030abeb /Master/texmf-dist/source/latex/icite/icite.dtx | |
parent | 39948ee1306a518baab7bd81a847e11249643885 (diff) |
icite (17mar19)
git-svn-id: svn://tug.org/texlive/trunk@50429 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/icite/icite.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/icite/icite.dtx | 310 |
1 files changed, 252 insertions, 58 deletions
diff --git a/Master/texmf-dist/source/latex/icite/icite.dtx b/Master/texmf-dist/source/latex/icite/icite.dtx index 64152276433..1e61a15d9c6 100644 --- a/Master/texmf-dist/source/latex/icite/icite.dtx +++ b/Master/texmf-dist/source/latex/icite/icite.dtx @@ -188,15 +188,27 @@ Running "make install" installs the files in the local TeX tree. %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<package>\ProvidesPackage{icite} %<*package> - [2019/03/12 v1.1 Make Indices locorum citatorum] + [2019/03/17 v1.2 Make Indices locorum citatorum] %</package> %<*driver> \documentclass{ltxdoc} \usepackage{filecontents} \begin{filecontents*}{\jobname.xdy} +(merge-rule "\*" "" :eregexp) (markup-locclass-list :open "\tabto{3.5cm}" :sep ", ") \end{filecontents*} \begin{filecontents*}{\jobname.bib} +@Book{Aristotle:Politica, + title = {Politica}, + date = 1964, + author = {Aristotle}, + editor = {Ross, W. D.}, + origdate = 1957, + entrysubtype = {classical}, + publisher = {Clarendon Press}, + location = {Oxford} +} + @Book{Bürgel2016, shorttitle = {Ärztliches Leben\ldots}, editortype = {reviser}, @@ -211,6 +223,16 @@ Running "make install" installs the files in the local TeX tree. author = {Bürgel, Johann Christoph} } +@Software{classics, + title = {The Classics package}, + subtitle = {Cite classic works}, + author = {Lourenço de Lima, Eduardo C.}, + publisher = {CTAN}, + url = {http://www.ctan.org/pkg/classics}, + date = {2013-02-02}, + version = {0.1} +} + @Article{Dols1987, author = {Dols, Michael W.}, title = {The Origins of the Islamic Hospital: Myth and @@ -222,6 +244,19 @@ Running "make install" installs the files in the local TeX tree. pages = {367--390} } +@InBook{Endress1992, + title = {Die Wissenschaftliche Literatur}, + date = 1992, + author = {Endress, Gerhard}, + booktitle = {Grundriß der arabischen Philologie}, + editor = {Fisher, Wolfdietrich}, + volume = 3, + note = {Supplement}, + publisher = {Reichert}, + location = {Wiesbaden}, + pages = {3--152} +} + @Book{IAUMuller, sortname = {Ibn abi Usaybia}, editor = {Müller, August}, @@ -238,32 +273,19 @@ Running "make install" installs the files in the local TeX tree. volumes = 2 } -@MVBook{al-Nadim, - author = {\prname{ibn al-nadIm}}, - title = {\arb[trans]{\uc{f}ihrist}}, - sortname = {Ibn al-Nadim}, - date = {1871/1872}, - shorthand = {\arb[trans]{\uc{f}ihrist}}, - editor = {Flügel, Gustav}, - volumes = 2, - location = {Leipzig}, - entrysubtype = {classical} -} - -@Book{al-Qifti, - sortname = {Ibn al-Qifti}, - entrysubtype = {classical}, - shorthand = {\prname{al-qif.tiyy}, \arb[trans]{\uc{t}a'rI_h}}, - location = {Leipzig}, - editor = {Lippert, Julius}, - date = 1903, - title = {\arb[trans]{\uc{t}a'rI_h al-.hukamA'}}, - author = {\prname{ibn al-qif.tiyy}} +@Software{imakeidx, + title = {The Imakeidx package}, + subtitle = {A package for producing multiple indexes}, + author = {Gregorio, Enrico and Beccari, Claudio}, + publisher = {CTAN}, + url = {http://www.ctan.org/pkg/imakeidx}, + date = {2016-10-15}, + version = {1.3e} } @Book{RaziShukuk, - author = {\prname{al-rAziyy}, \prname{mu.hammad - ibn zakariyyA'}}, + author = {\prname{al-rAziyy}, \prname{mu.hammad ibn + zakariyyA'}}, title = {\arb[trans]{\uc{k}itAb al-^sukUk `al_A \uc{^g}AlInUs}}, indextitle = {\arb[trans]{\uc{^s}ukUk}}, @@ -285,27 +307,37 @@ Running "make install" installs the files in the local TeX tree. author = {Ullmann, Manfred}, } -@InBook{Endress1992, - title = {Die Wissenschaftliche Literatur}, - date = 1992, - author = {Endress, Gerhard}, - booktitle = {Grundriß der arabischen Philologie}, - editor = {Fisher, Wolfdietrich}, - volume = 3, - note = {Supplement}, - publisher = {Reichert}, - location = {Wiesbaden}, - pages = {3--152} +@MVBook{al-Nadim, + author = {\prname{ibn al-nadIm}}, + title = {\arb[trans]{\uc{f}ihrist}}, + sortname = {Ibn al-Nadim}, + date = {1871/1872}, + shorthand = {\arb[trans]{\uc{f}ihrist}}, + editor = {Flügel, Gustav}, + volumes = 2, + location = {Leipzig}, + entrysubtype = {classical} +} + +@Book{al-Qifti, + sortname = {Ibn al-Qifti}, + entrysubtype = {classical}, + shorthand = {\prname{al-qif.tiyy}, \arb[trans]{\uc{t}a'rI_h}}, + location = {Leipzig}, + editor = {Lippert, Julius}, + date = 1903, + title = {\arb[trans]{\uc{t}a'rI_h al-.hukamA'}}, + author = {\prname{ibn al-qif.tiyy}} } @Software{usebib, - title = {The Usebib package}, - subtitle = {A simple bibliography processor}, - author = {Gregorio, Enrico}, - publisher = {CTAN}, - url = {http://www.ctan.org/pkg/usebib}, - date = {2012-04-13}, - version = {1.0a} + title = {The Usebib package}, + subtitle = {A simple bibliography processor}, + author = {Gregorio, Enrico}, + publisher = {CTAN}, + url = {http://www.ctan.org/pkg/usebib}, + date = {2012-04-13}, + version = {1.0a} } \end{filecontents*} \usepackage[english]{babel} @@ -317,10 +349,10 @@ Running "make install" installs the files in the local TeX tree. \newunicodechar{Ǧ}{Ǧ} % \usepackage{arabluatex} \SetTranslitConvention{loc} -\usepackage{varioref} \usepackage{xurl} \usepackage{uri} \usepackage{hyperxmp} +\usepackage{varioref} \usepackage[numbered]{hypdoc} \hypersetup{unicode=true, colorlinks, allcolors=blue, linktocpage=true, pdfauthor={Robert Alessi}, pdftitle={The @@ -335,9 +367,10 @@ Running "make install" installs the files in the local TeX tree. pdflicenseurl={https://creativecommons.org/licenses/by-sa/4.0/legalcode}, pdfmetalang={en-US}, pdftype={Text}, pdfkeywords={bibtex, biblatex, indexing}} +\usepackage{amsmath} +\usepackage{cleveref} \CodelineIndex \usepackage[citecmd=autocite,defaultindex]{\jobname} -\usepackage{cleveref} \IndexSubtypeAs{classical}{primary} \bibinput{icite} \usepackage[nonewpage,xindy]{imakeidx} @@ -346,11 +379,13 @@ Running "make install" installs the files in the local TeX tree. \makeindex \makeindex[name=loccit] \makeindex[name=primary] +\usepackage{needspace} \usepackage{tabto} \usepackage{classics} \newclassic{iau}{\classicsRoman{#1}|, #1|.#1} \newclassic{razi}{#1|.#1} \newclassic{nadim}{\classicsRoman{#1}|.#1|, #1} +\newclassic{aristotle}{#1|\textit{#1}|#1} \usepackage[scale=1.5]{ccicons} \usepackage{dox} \doxitem{Option}{option}{options} @@ -416,7 +451,7 @@ Running "make install" installs the files in the local TeX tree. %</driver> % \fi % -% \CheckSum{316} +% \CheckSum{352} % % \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 @@ -619,9 +654,9 @@ Running "make install" installs the files in the local TeX tree. % \DescribeMacro{\bibinput} Once \package{icite} is loaded, it must be % connected to at least one bibliographic |.bib| file. To that end, % \package{icite} uses the same \cs{bibinput} command as -% \package{usebib}.\footnote{Please refer to \cite[1]{usebib} for more -% detailed information on how to use this command.} An example -% follows:--- +% \package{usebib}.\footnote{Please refer to \cite[1]{usebib} for +% more detailed information on how to use this command.} An example +% follows:--- % % \iffalse %<*example> % \fi @@ -636,6 +671,8 @@ Running "make install" installs the files in the local TeX tree. %</example> % \fi % +% \subsection{Preamble-only commands} +% The following commands may be found in the preamble only. % \paragraph{Styling the titles} % \DescribeMacro{\SetTitleStyle} By default, \package{icite} prints % the titles of the works cited in italics.\\ @@ -654,6 +691,21 @@ Running "make install" installs the files in the local TeX tree. % As this example shows, |#1| is the token that is replaced with the % actual title in the formatting directives of the \cs{SetTitleStyle} % command. +% +% \paragraph{Delimiters} +% \NEWfeature{v1.2}\DescribeMacro{\AuthorTitleDelim} +% \cs{AuthorTitleDelim}\marg{delimiter} sets the delimiter between +% authors and titles in the body text when the |nobibengine| option is +% set to |true|. The default delimiter is a comma and a space. +% +% \DescribeMacro{\TitlePageDelim} +% \cs{TitlePageDelim}\marg{delimiter} sets the delimiter between +% titles and pages in the body text when the |nobibengine| option is +% set to |true|. The default delimiter is a comma and a space. +% +% \subsection[\textsf{icite} for the Impatient]% +% {\package{icite} for the Impatient} +% Read \href{samples/icite-minimal.pdf}{\texttt{icite-minimal.pdf}}. % % \subsection{Entry fields} % \label{sec:entry-fields} @@ -873,9 +925,11 @@ Running "make install" installs the files in the local TeX tree. % those whose |entrysubtype| field does not match the string % |classical| should go into the default |loccit| index. As for those % whose |entrysubtype| matches |classical|, they should to into an -% index named |primary|. Furthermore, the \package{classics} package -% is used to format references in which a volume number is used. In -% this way, \package{xindy} only has numbers to handle:--- % +% index named |primary|. \label{ref:classics-pkg}Furthermore, the +% \package{classics} package is used to format references in which a +% volume number is used.\footnote{For more information, see below +% \vref{sec:classics-usage}.} In this way, \package{xindy} only has +% numbers to handle:--- % % \iffalse %<*example> % \fi @@ -964,6 +1018,109 @@ Running "make install" installs the files in the local TeX tree. % one can see, \prname{al-rAziyy} has been sorted under the letter R % and references to classical works have been formatted properly. % +% +% \subsection[The \textsf{classics} package]% +% {The \package{classics} package} % +% \label{sec:classics-usage} +% As said above \vpageref{ref:classics-pkg}, it is advisable to use +% the \package{classics} package to format volume, page, column, line +% numbers and the like which are inserted in the \meta{post} optional +% argument of the \cs{icite} command\autocite{classics}. An example of +% using \package{classics} to format references to Aristotle according +% to Bekker pagination follows:\footnote{See \cite[2]{classics} for +% more information.}--- % +% \iffalse +%<*example> +% \fi +\begin{code} + % preamble: + \usepackage{classics} + \newclassic{aristotle}{#1|\textit{#1}|#1} +\end{code} +% \iffalse +%</example> +% \fi +% \iffalse +%<*example> +% \fi +\begin{example} + In \emph{Politics}, Aristotle says that man is by nature a political + animal in the following passages: \aristotle{1253}[a][2--9] (Book~1) + and again in \aristotle{1278}[b][19] (Book~3). The latter passage + shows that one should read the whole section of Book~1 concerning + household management and the control of slaves + (\aristotle*{1253}[b][1]{1253}[b][39]). +\end{example} +% \iffalse +%</example> +% \fi +% The following prints the same body text while using \package{icite} +% to have the passages cited inserted in the \emph{Index locorum +% citatorum} (see below \vref{sec:index-loc-cit}):--- % +% \iffalse +%<*example> +% \fi +\begin{example} + In \emph{Politics}, Aristotle says that man is by nature a political + animal in the following passages: + \icite[\aristotle{1253}[a][2--9]]{Aristotle:Politica}[notecite] + (Book~1) and again in \icite[\aristotle{1278}[b][19]]% + {Aristotle:Politica}[notecite] (Book~3). The latter passage shows + that one should read the whole section of Book~1 concerning + household management and the control of slaves + \icite[\aristotle*{1253}[b][1]{1253}[b][39]]% + {Aristotle:Politica}[pnotecite]. +\end{example} +% \iffalse +%</example> +% \fi +% As can be seen, the \cs{notecite} and \cs{pnotecite} commands have +% been used to insert only the references in the body text. +% +% It is also advisable to use \package{xindy} to compile indices of +% passages cited because \package{xindy}, unlike \package{makeindex} +% or \package{xindex}, is able to sort numbers properly: for example, +% with \package{xindy}, such a number as 81 will come before 100, but +% will be sorted after 100 with the other two engines. +% \begin{tcblisting}{text only, title=Caveat} +% \package{xindy} (actually |texindy|) is also designed to ignore +% \TeX\ commands by default. However, due to a missing line in +% |xindy/modules/base/tex.xdy|,\footnote{As the time of writing, in +% \package{xindy} v2.5.1.} this does not apply to so-called +% \enquote*{starred} \TeX\ commands, such as \cs{aristotle*} from +% the example above. +% \end{tcblisting} +% One easy way to get around this issue is to create a style file with +% a single line that instructs \package{xindy} to ignore the asterisk +% when processing the index, like so:--- % +% \iffalse +%<*example> +% \fi +\begin{tcblisting}{minted language=lisp, listing only, title=icite.xdy} + (merge-rule "\*" "" :eregexp) +\end{tcblisting} +% \iffalse +%</example> +% \fi +% +% The following example shows how this simple rule can be +% applied:--- % +% \iffalse +%<*example> +% \fi +\begin{code} + % preamble: + \usepackage[xindy]{imakeidx} + \makeindex[name=loccit, options=-M icite.sty] + % document: + \printindex[loccit] +\end{code} +% \iffalse +%</example> +% \fi +% Of course, the document itself must be compiled with +% |--shell-escape|.\footnote{See \cite[2--4]{imakeidx}.} +% % \section{Appendix} % Designing the layout of indices is out of the scope of this % documentation. For information, the \package{tabto} package has been @@ -984,7 +1141,9 @@ Running "make install" installs the files in the local TeX tree. % \label{ref:indices} % \subsubsection{Index of Passages Cited (modern authors)} % \printindex[loccit] +% \needspace{8\baselineskip} % \subsubsection{\emph{Index locorum citatorum}} +% \label{sec:index-loc-cit} % \printindex[primary] % % \subsection{\texorpdfstring{\hologo{BibTeX} @@ -1028,6 +1187,11 @@ Running "make install" installs the files in the local TeX tree. \RequirePackage{datatool} \RequirePackage{usebib} % \end{macrocode} +% If |nobibengine| is set to true, then \cs{ic@dfltcit} will be +% redefined by \cs{icite} to \cs{ic@nullcmd} which does nothing. +% \begin{macrocode} +\NewDocumentCommand{\ic@nullcmd}{O{}O{}m}{} +% \end{macrocode} % Define fields to be used by \package{icite}: % \begin{macrocode} \define@reuse@key{author} @@ -1073,7 +1237,32 @@ Running "make install" installs the files in the local TeX tree. } \@onlypreamble\SetTitleStyle % \end{macrocode} -% +% \DescribeMacro{\AuthorTitleDelim} +% \changes{v1.2}{2019/03/17}{\cs{AuthorTitleDelim}: delimiter +% between authors and titles}\cs{AuthorTitleDelim}\marg{delimiter} +% sets the delimiter between authors and titles in the body text when +% the |nobibengine| option is set to |true|. The default delimiter is +% a comma. +% \begin{macrocode} +\def\ic@authtitdelim{, } +\NewDocumentCommand{\AuthorTitleDelim}{m}{% + \def\ic@authtitdelim{#1} +} +\@onlypreamble\AuthorTitleDelim +% \end{macrocode} +% \DescribeMacro{\TitlePageDelim} +% \changes{v1.2}{2019/03/17}{\cs{TitlePageDelim}: the delimiter +% between titles and pages}\cs{TitlePageDelim}\marg{delimiter} sets +% the delimiter between titles and pages in the body text when the +% |nobibengine| option is set to |true|. The default delimiter is a +% comma. +% \begin{macrocode} +\def\ic@titpgdelim{, } +\NewDocumentCommand{\TitlePageDelim}{m}{% + \def\ic@titpgdelim{#1} +} +\@onlypreamble\TitlePageDelim +% \end{macrocode} % \DescribeMacro{\icite} \cs{icite} both inserts a formatted citation % and an entry in the \emph{index locorum citatorum}. It is to be used % in place of any \hologo{BibTeX} or Bib\LaTeX\ citation command the @@ -1086,6 +1275,9 @@ Running "make install" installs the files in the local TeX tree. % qualified citation lists or so-called \enquote*{multicite} commands. % \begin{macrocode} \NewDocumentCommand{\icite}{o o m O{\ic@dfltcit}}{% + \edef\ic@argiv{#4}% + \edef\ic@null{ic@nullcmd}% + \ifno@bibengine\let\ic@argiv\ic@null\else\fi% \edef\@shorthand{\get@bibentry{#3}{shorthand}}% \edef\@subtype{\get@bibentry{#3}{entrysubtype}}% \edef\@author{\get@bibentry{#3}{author}}% @@ -1143,13 +1335,13 @@ Running "make install" installs the files in the local TeX tree. \fi}} \ifno@bibengine \ifx\@shorthand\empty% - \@useauthor, \TitleStyle{\@usetitle}% + \@useauthor\ic@authtitdelim\TitleStyle{\@usetitle}% \else% \@shorthand% \fi% \else% - \csname #4\endcsname{#3}% \fi% + \csname\ic@argiv\endcsname{#3}% } {\IfNoValueTF{#2}% {\DTLifdbempty{icite@indices}{% @@ -1175,13 +1367,14 @@ Running "make install" installs the files in the local TeX tree. \fi}}% \ifno@bibengine \ifx\@shorthand\empty% - \@useauthor, \TitleStyle{\@usetitle}, {#1}% + \@useauthor\ic@authtitdelim\TitleStyle{\@usetitle}% + \ic@titpgdelim{#1}% \else% \@shorthand, {#1}% \fi% \else% - \csname #4\endcsname[{#1}]{#3}% \fi% + \csname\ic@argiv\endcsname[{#1}]{#3}% } {\DTLifdbempty{icite@indices}{% \ifno@index\else @@ -1206,13 +1399,14 @@ Running "make install" installs the files in the local TeX tree. \fi}}% \ifno@bibengine \ifx\@shorthand\empty% - #1 \@useauthor, \TitleStyle{\@usetitle}, {#2}% + #1 \@useauthor\ic@authtitdelim\TitleStyle{\@usetitle}% + \ic@titpgdelim{#2}% \else% #1 \@shorthand, {#2}% \fi \else% - \csname #4\endcsname[#1][{#2}]{#3}% \fi% + \csname\ic@argiv\endcsname[#1][{#2}]{#3}% }% }% } |