aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2019-03-14 15:19:53 +0100
committerRobert Alessi <alessi@robertalessi.net>2019-03-14 15:19:53 +0100
commit0e9519fa29b1c9c5abe2fe50bd53e253b65684fe (patch)
tree8c8a09668a0dc42f1817689408cefbafb7bc0961
parent9519935e55fb341e745c532e43d80ff99ff93712 (diff)
downloadicite-0e9519fa29b1c9c5abe2fe50bd53e253b65684fe.tar.gz
not-a-bugfix: biblatex citation commands cannot be found inside \if ... \fi, otherwise autopunct becomes inoperative
-rw-r--r--Makefile8
-rw-r--r--icite.dtx17
-rw-r--r--samples/icite-biblatex.tex33
-rw-r--r--samples/icite-nobiblatex.tex34
4 files changed, 64 insertions, 28 deletions
diff --git a/Makefile b/Makefile
index a628307..028aea7 100644
--- a/Makefile
+++ b/Makefile
@@ -26,13 +26,13 @@ $(NAME).pdf: $(NAME).dtx
26 cp $(PWD)/samples/*.bib $(PWD)/TMP 26 cp $(PWD)/samples/*.bib $(PWD)/TMP
27 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-biblatex.tex 27 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-biblatex.tex
28 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-biblatex.tex 28 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-biblatex.tex
29 texindy $(PWD)/TMP/pr-sources.idx 29 texindy -M $(PWD)/TMP/icite-biblatex.xdy $(PWD)/TMP/pr-sources.idx
30 biber $(PWD)/TMP/icite-biblatex 30 biber $(PWD)/TMP/icite-biblatex
31 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-biblatex.tex 31 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-biblatex.tex
32 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-biblatex.tex 32 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-biblatex.tex
33 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-nobiblatex.tex 33 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-nobiblatex.tex
34 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-nobiblatex.tex 34 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-nobiblatex.tex
35 texindy $(PWD)/TMP/pr-sources.idx 35 texindy -M $(PWD)/TMP/icite-nobiblatex.xdy $(PWD)/TMP/pr-sources.idx
36 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-nobiblatex.tex 36 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-nobiblatex.tex
37 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-nobiblatex.tex 37 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-nobiblatex.tex
38 mv TMP/*.pdf samples/ 38 mv TMP/*.pdf samples/
@@ -42,13 +42,13 @@ samples:
42 cp $(PWD)/samples/*.bib $(PWD)/TMP 42 cp $(PWD)/samples/*.bib $(PWD)/TMP
43 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-biblatex.tex 43 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-biblatex.tex
44 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-biblatex.tex 44 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-biblatex.tex
45 texindy $(PWD)/TMP/pr-sources.idx 45 texindy -M $(PWD)/TMP/icite-biblatex.xdy $(PWD)/TMP/pr-sources.idx
46 biber $(PWD)/TMP/icite-biblatex 46 biber $(PWD)/TMP/icite-biblatex
47 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-biblatex.tex 47 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-biblatex.tex
48 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-biblatex.tex 48 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-biblatex.tex
49 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-nobiblatex.tex 49 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-nobiblatex.tex
50 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-nobiblatex.tex 50 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-nobiblatex.tex
51 texindy $(PWD)/TMP/pr-sources.idx 51 texindy -M $(PWD)/TMP/icite-nobiblatex.xdy $(PWD)/TMP/pr-sources.idx
52 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-nobiblatex.tex 52 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-nobiblatex.tex
53 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-nobiblatex.tex 53 lualatex --output-dir=$(PWD)/TMP --shell-escape samples/icite-nobiblatex.tex
54 mv TMP/*.pdf samples/ 54 mv TMP/*.pdf samples/
diff --git a/icite.dtx b/icite.dtx
index 6415227..2b63455 100644
--- a/icite.dtx
+++ b/icite.dtx
@@ -194,6 +194,7 @@ Running "make install" installs the files in the local TeX tree.
194\documentclass{ltxdoc} 194\documentclass{ltxdoc}
195\usepackage{filecontents} 195\usepackage{filecontents}
196\begin{filecontents*}{\jobname.xdy} 196\begin{filecontents*}{\jobname.xdy}
197(merge-rule "\*" "" :eregexp)
197(markup-locclass-list :open "\tabto{3.5cm}" :sep ", ") 198(markup-locclass-list :open "\tabto{3.5cm}" :sep ", ")
198\end{filecontents*} 199\end{filecontents*}
199\begin{filecontents*}{\jobname.bib} 200\begin{filecontents*}{\jobname.bib}
@@ -416,7 +417,7 @@ Running "make install" installs the files in the local TeX tree.
416%</driver> 417%</driver>
417% \fi 418% \fi
418% 419%
419% \CheckSum{316} 420% \CheckSum{0}
420% 421%
421% \CharacterTable 422% \CharacterTable
422% {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 423% {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
@@ -1028,6 +1029,11 @@ Running "make install" installs the files in the local TeX tree.
1028\RequirePackage{datatool} 1029\RequirePackage{datatool}
1029\RequirePackage{usebib} 1030\RequirePackage{usebib}
1030% \end{macrocode} 1031% \end{macrocode}
1032% If |nobibengine| is set to true, then \cs{ic@dfltcit} will be
1033% redefined by \cs{icite} to \cs{ic@nullcmd} which does nothing.
1034% \begin{macrocode}
1035\NewDocumentCommand{\ic@nullcmd}{O{}O{}m}{}
1036% \end{macrocode}
1031% Define fields to be used by \package{icite}: 1037% Define fields to be used by \package{icite}:
1032% \begin{macrocode} 1038% \begin{macrocode}
1033\define@reuse@key{author} 1039\define@reuse@key{author}
@@ -1086,6 +1092,9 @@ Running "make install" installs the files in the local TeX tree.
1086% qualified citation lists or so-called \enquote*{multicite} commands. 1092% qualified citation lists or so-called \enquote*{multicite} commands.
1087% \begin{macrocode} 1093% \begin{macrocode}
1088\NewDocumentCommand{\icite}{o o m O{\ic@dfltcit}}{% 1094\NewDocumentCommand{\icite}{o o m O{\ic@dfltcit}}{%
1095 \edef\ic@argiv{#4}%
1096 \edef\ic@null{ic@nullcmd}%
1097 \ifno@bibengine\let\ic@argiv\ic@null\else\fi%
1089 \edef\@shorthand{\get@bibentry{#3}{shorthand}}% 1098 \edef\@shorthand{\get@bibentry{#3}{shorthand}}%
1090 \edef\@subtype{\get@bibentry{#3}{entrysubtype}}% 1099 \edef\@subtype{\get@bibentry{#3}{entrysubtype}}%
1091 \edef\@author{\get@bibentry{#3}{author}}% 1100 \edef\@author{\get@bibentry{#3}{author}}%
@@ -1148,8 +1157,8 @@ Running "make install" installs the files in the local TeX tree.
1148 \@shorthand% 1157 \@shorthand%
1149 \fi% 1158 \fi%
1150 \else% 1159 \else%
1151 \csname #4\endcsname{#3}%
1152 \fi% 1160 \fi%
1161 \csname\ic@argiv\endcsname{#3}%
1153 } 1162 }
1154 {\IfNoValueTF{#2}% 1163 {\IfNoValueTF{#2}%
1155 {\DTLifdbempty{icite@indices}{% 1164 {\DTLifdbempty{icite@indices}{%
@@ -1180,8 +1189,8 @@ Running "make install" installs the files in the local TeX tree.
1180 \@shorthand, {#1}% 1189 \@shorthand, {#1}%
1181 \fi% 1190 \fi%
1182 \else% 1191 \else%
1183 \csname #4\endcsname[{#1}]{#3}%
1184 \fi% 1192 \fi%
1193 \csname\ic@argiv\endcsname[{#1}]{#3}%
1185 } 1194 }
1186 {\DTLifdbempty{icite@indices}{% 1195 {\DTLifdbempty{icite@indices}{%
1187 \ifno@index\else 1196 \ifno@index\else
@@ -1211,8 +1220,8 @@ Running "make install" installs the files in the local TeX tree.
1211 #1 \@shorthand, {#2}% 1220 #1 \@shorthand, {#2}%
1212 \fi 1221 \fi
1213 \else% 1222 \else%
1214 \csname #4\endcsname[#1][{#2}]{#3}%
1215 \fi% 1223 \fi%
1224 \csname\ic@argiv\endcsname[#1][{#2}]{#3}%
1216 }% 1225 }%
1217 }% 1226 }%
1218} 1227}
diff --git a/samples/icite-biblatex.tex b/samples/icite-biblatex.tex
index e52cb8b..678f9f4 100644
--- a/samples/icite-biblatex.tex
+++ b/samples/icite-biblatex.tex
@@ -1,3 +1,8 @@
1\RequirePackage{filecontents}
2\begin{filecontents*}{\jobname.xdy}
3(merge-rule "\*" "" :eregexp)
4(markup-locclass-list :open ": " :sep ", ")
5\end{filecontents*}
1% Compile with --shell-escape 6% Compile with --shell-escape
2\documentclass{article} 7\documentclass{article}
3\usepackage[english]{babel} 8\usepackage[english]{babel}
@@ -20,7 +25,11 @@
20\IndexSubtypeAs{ancient}{pr-sources} 25\IndexSubtypeAs{ancient}{pr-sources}
21\bibinput{bibsample} 26\bibinput{bibsample}
22 27
23\usepackage[xindy]{imakeidx} 28\usepackage{classics}
29\newclassic{plat}{#1|#1|#1}
30\newclassic{arist}{#1|\textit{#1}|#1}
31
32\usepackage[xindy,nonewpage]{imakeidx}
24\makeindex[name=pr-sources, title={Index locorum citatorum}] 33\makeindex[name=pr-sources, title={Index locorum citatorum}]
25 34
26\usepackage[style=oxnotes]{biblatex} 35\usepackage[style=oxnotes]{biblatex}
@@ -43,6 +52,10 @@ The relevant part of the preamble which is used here follows:
43\IndexSubtypeAs{ancient}{pr-sources} 52\IndexSubtypeAs{ancient}{pr-sources}
44\bibinput{bibsample} 53\bibinput{bibsample}
45 54
55\usepackage{classics}
56\newclassic{plat}{#1|#1|#1}
57\newclassic{arist}{#1|\textit{#1}|#1}
58
46\usepackage[xindy]{imakeidx} 59\usepackage[xindy]{imakeidx}
47\makeindex[name=pr-sources, title={Index locorum citatorum}] 60\makeindex[name=pr-sources, title={Index locorum citatorum}]
48 61
@@ -65,19 +78,19 @@ The relevant part of the preamble which is used here follows:
65 78
66\section*{Body text} 79\section*{Body text}
67Plato, \emph{Laches}: first 80Plato, \emph{Laches}: first
68citation\icite[179a1--4]{Plato:Laches}. And 81citation\icite[\plat{179}[a][1--4]]{Plato:Laches}. And
69another\icite[179c5--180a1]{Plato:Laches}, and 82another\icite[\plat*{179}[c][5]{180}[a][1]]{Plato:Laches}, and
70another\icite[181b5--181c3]{Plato:Laches}. 83another\icite[\plat*{181}[b][5]{181}[c][3]]{Plato:Laches}.
71 84
72Plato, \emph{Theaetetus}: first 85Plato, \emph{Theaetetus}: first
73citation\icite[142c2--142d3]{Plato:Theaetetus}. And 86citation\icite[\plat*{142}[c][2]{142}[d][3]]{Plato:Theaetetus}. And
74another\icite[142d4--5]{Plato:Theaetetus}, and 87another\icite[\plat{142}[d][4--5]]{Plato:Theaetetus}, and
75another\icite[143b5]{Plato:Theaetetus}. 88another\icite[\plat{143}[b][5]]{Plato:Theaetetus}.
76 89
77Aristotle, \emph{Politica}: first 90Aristotle, \emph{Politica}: first
78citation\icite[1252a25--1252.b27]{Aristotle:Politica}. And 91citation\icite[\arist*{1252}[a][25]{1252}[b][27]]{Aristotle:Politica}. And
79another\icite[1253a5]{Aristotle:Politica}, and 92another\icite[\arist{1253}[a][5]]{Aristotle:Politica}, and
80another\icite[1253a30--39]{Aristotle:Politica}. 93another\icite[\arist{1253}[a][30--39]]{Aristotle:Politica}.
81 94
82This passage should not be indexed\icite[44--78]{Reynolds.Wilson1994}. 95This passage should not be indexed\icite[44--78]{Reynolds.Wilson1994}.
83 96
diff --git a/samples/icite-nobiblatex.tex b/samples/icite-nobiblatex.tex
index 6893247..baf2973 100644
--- a/samples/icite-nobiblatex.tex
+++ b/samples/icite-nobiblatex.tex
@@ -1,3 +1,8 @@
1\RequirePackage{filecontents}
2\begin{filecontents*}{\jobname.xdy}
3(merge-rule "\*" "" :eregexp)
4(markup-locclass-list :open ": " :sep ", ")
5\end{filecontents*}
1% Compile with --shell-escape 6% Compile with --shell-escape
2\documentclass{article} 7\documentclass{article}
3\usepackage[english]{babel} 8\usepackage[english]{babel}
@@ -21,7 +26,11 @@
21\IndexSubtypeAs{ancient}{pr-sources} 26\IndexSubtypeAs{ancient}{pr-sources}
22\bibinput{bibsample} 27\bibinput{bibsample}
23 28
24\usepackage[xindy]{imakeidx} 29\usepackage{classics}
30\newclassic{plat}{#1|#1|#1}
31\newclassic{arist}{#1|\textit{#1}|#1}
32
33\usepackage[xindy,nonewpage]{imakeidx}
25\makeindex[name=pr-sources, title={Index locorum citatorum}] 34\makeindex[name=pr-sources, title={Index locorum citatorum}]
26 35
27\begin{document} 36\begin{document}
@@ -42,6 +51,10 @@ The relevant part of the preamble which is used here follows:
42\IndexSubtypeAs{ancient}{pr-sources} 51\IndexSubtypeAs{ancient}{pr-sources}
43\bibinput{bibsample} 52\bibinput{bibsample}
44 53
54\usepackage{classics}
55\newclassic{plat}{#1|#1|#1}
56\newclassic{arist}{#1|\textit{#1}|#1}
57
45\usepackage[xindy]{imakeidx} 58\usepackage[xindy]{imakeidx}
46\makeindex[name=pr-sources, title={Index locorum citatorum}] 59\makeindex[name=pr-sources, title={Index locorum citatorum}]
47\end{Verbatim} 60\end{Verbatim}
@@ -61,19 +74,20 @@ The relevant part of the preamble which is used here follows:
61 74
62\section*{Body text} 75\section*{Body text}
63Plato, \emph{Laches}: first 76Plato, \emph{Laches}: first
64citation.\footnote{\icite[179a1--4]{Plato:Laches}.} And 77citation.\footnote{\icite[\plat{179}[a][1--4]]{Plato:Laches}.} And
65another,\footnote{\icite[179c5--180a1]{Plato:Laches}.} 78another,\footnote{\icite[\plat*{179}[c][5]{180}[a][1]]{Plato:Laches}.}
66and another.\footnote{\icite[181b5--c3]{Plato:Laches}.} 79and another.\footnote{\icite[\plat*{181}[b][5]{181}[c][3]]{Plato:Laches}.}
67 80
68Plato, \emph{Theaetetus}: first 81Plato, \emph{Theaetetus}: first
69citation.\footnote{\icite[142c2--d3]{Plato:Theaetetus}.} 82citation.\footnote{\icite[\plat*{142}[c][2]{142}[d][3]]{Plato:Theaetetus}.}
70And another,\footnote{\icite[142d4--5]{Plato:Theaetetus}.} 83And another,\footnote{\icite[\plat{142}[d][4--5]]{Plato:Theaetetus}.}
71and another.\footnote{\icite[143b5]{Plato:Theaetetus}.} 84and another.\footnote{\icite[\plat{143}[b][5]]{Plato:Theaetetus}.}
72 85
73Aristotle, \emph{Politica}: first citation.\footnote{% 86Aristotle, \emph{Politica}: first citation.\footnote{%
74 \icite[1252a25--b27]{Aristotle:Politica}.} And 87 \icite[\arist*{1252}[a][25]{1252}[b][27]]{Aristotle:Politica}.} And
75another,\footnote{\icite[1253a5]{Aristotle:Politica}.} and 88another,\footnote{\icite[\arist{1253}[a][5]]{Aristotle:Politica}.}
76another.\footnote{\icite[1253a30--39]{Aristotle:Politica}.} 89and another.\footnote{%
90 \icite[\arist{1253}[a][30--39]]{Aristotle:Politica}.}
77 91
78This passage should not be 92This passage should not be
79indexed.\footnote{\icite[44--78]{Reynolds.Wilson1994}.} 93indexed.\footnote{\icite[44--78]{Reynolds.Wilson1994}.}