aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2020-08-20 11:35:56 +0200
committerRobert Alessi <alessi@robertalessi.net>2020-08-20 11:35:56 +0200
commit7cb69bc53c72e547c6d0ecb881a3233a5a79f342 (patch)
tree989c668750a99aacbe24da39afe2629a42556c42
parent27713b0ce27b5850afb9f55bed676f247137cb76 (diff)
downloadekdosis-7cb69bc53c72e547c6d0ecb881a3233a5a79f342.tar.gz
improved \DeclareScholar now builds a list of persons within the <listPerson> element. new command \DeclareSource for editions used as sources
-rw-r--r--Makefile1
-rw-r--r--ekdosis.dtx347
2 files changed, 267 insertions, 81 deletions
diff --git a/Makefile b/Makefile
index 550ae95..39a1aaf 100644
--- a/Makefile
+++ b/Makefile
@@ -34,6 +34,7 @@ $(NAME).pdf: testsamples $(NAME).dtx
34 if [ -f $(NAME).glo ]; then makeindex -q -s gglo.ist -o $(NAME).gls $(NAME).glo; fi 34 if [ -f $(NAME).glo ]; then makeindex -q -s gglo.ist -o $(NAME).gls $(NAME).glo; fi
35 if [ -f $(NAME).idx ]; then makeindex -q -s gind.ist -o $(NAME).ind $(NAME).idx; fi 35 if [ -f $(NAME).idx ]; then makeindex -q -s gind.ist -o $(NAME).ind $(NAME).idx; fi
36 $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null 36 $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null
37 $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null
37 38
38samples: clean sty 39samples: clean sty
39 $(MAKE) --directory=$(SAMPLES) 40 $(MAKE) --directory=$(SAMPLES)
diff --git a/ekdosis.dtx b/ekdosis.dtx
index d2e6c1f..54293c5 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -291,7 +291,7 @@ along with this program. If not, see
291 origDate=s. XV] 291 origDate=s. XV]
292\DeclareWitness{sV}{V}{Vaticanus lat. 1652}[ 292\DeclareWitness{sV}{V}{Vaticanus lat. 1652}[
293 origDate=s. XV] 293 origDate=s. XV]
294\DeclareScholar{sDrak}{\emph{Drakenborch}} 294\DeclareSource{sDrak}{\emph{Drakenborch}}
295\end{filecontents} 295\end{filecontents}
296\documentclass{ltxdoc} 296\documentclass{ltxdoc}
297 %\usepackage[letterpaper,margin=25mm,left=50mm,nohead]{geometry} 297 %\usepackage[letterpaper,margin=25mm,left=50mm,nohead]{geometry}
@@ -369,8 +369,6 @@ along with this program. If not, see
369\labelformat{subsection}{sect.~#1} 369\labelformat{subsection}{sect.~#1}
370\labelformat{subsubsection}{sect.~#1} 370\labelformat{subsubsection}{sect.~#1}
371\labelformat{figure}{fig.~#1} 371\labelformat{figure}{fig.~#1}
372\newcounter{dummy}
373\newcommand{\dummy}{\refstepcounter{dummy}}
374\usepackage[defaultindex=none,citecmd=autocite]{icite} 372\usepackage[defaultindex=none,citecmd=autocite]{icite}
375\bibinput{ekdosis} 373\bibinput{ekdosis}
376\usepackage[nospace,american]{varioref} 374\usepackage[nospace,american]{varioref}
@@ -385,8 +383,8 @@ along with this program. If not, see
385} 383}
386\ifbool{nocolordoc} 384\ifbool{nocolordoc}
387{ 385{
388 \usepackage{fontawesome} 386 \usepackage{academicons}
389 \def\oasymbol{\faUnlock} 387 \def\oasymbol{\aiOpenAccess}
390 \usepackage{biblatex-ext-oa} 388 \usepackage{biblatex-ext-oa}
391} 389}
392{\usepackage[symbolpackage=tikz]{biblatex-ext-oa}} 390{\usepackage[symbolpackage=tikz]{biblatex-ext-oa}}
@@ -513,6 +511,13 @@ along with this program. If not, see
513 \captionof{#1}{#2}% 511 \captionof{#1}{#2}%
514 #3% 512 #3%
515 \egroup} 513 \egroup}
514\NewDocumentCommand{\newfeature}{o}{%
515 \leavevmode
516 \IfNoValueTF{#1}
517 {\marginpar{\hfill\emph{New feature}}}
518 {\marginpar{\hfill\emph{New feature} #1}}%
519 \ignorespaces
520}
516% \usepackage{etoc} 521% \usepackage{etoc}
517% \etocsettocdepth{paragraph} 522% \etocsettocdepth{paragraph}
518% \newcommand{\ekdtableofcontents}{% 523% \newcommand{\ekdtableofcontents}{%
@@ -538,14 +543,14 @@ along with this program. If not, see
538\RecordChanges 543\RecordChanges
539 %\OnlyDescription 544 %\OnlyDescription
540\begin{document} 545\begin{document}
541 \DocInput{\jobname.dtx} 546\DocInput{\jobname.dtx}
542 \PrintChanges 547\PrintChanges
543 \PrintIndex 548\PrintIndex
544\end{document} 549\end{document}
545%</driver> 550%</driver>
546% \fi 551% \fi
547% 552%
548% \CheckSum{1669} 553% \CheckSum{0}
549% 554%
550% \CharacterTable 555% \CharacterTable
551% {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 556% {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
@@ -956,14 +961,14 @@ along with this program. If not, see
956%</example> 961%</example>
957% \fi 962% \fi
958% 963%
959% \subsection{Witnesses, Hands, Shorthands \& Scholars} 964% \subsection{Witnesses, Hands, Shorthands, Scholars \& Sources}
960% \label{sec:declarations} 965% \label{sec:declarations}
961% Any reference that is to be used in the apparatus criticus must be 966% Any reference that is to be used in the apparatus criticus must be
962% \enquote{declared} in the preamble beforehand, namely: manuscript 967% \enquote{declared} in the preamble beforehand, namely: manuscript
963% sigla (either for single manuscripts or manuscript families, primary 968% sigla (either for single manuscripts or manuscript families, primary
964% or later hands, \emph{\&c.}) or abbreviated last names of scholars. 969% or later hands, \emph{\&c.}), abbreviated last names of scholars
965% To that effect, \pkg{ekdosis} provides the following preamble-only 970% and sources. To that effect, \pkg{ekdosis} provides the following
966% commands:--- 971% preamble-only commands:---
967% 972%
968% \paragraph{Witnesses} 973% \paragraph{Witnesses}
969% \DescribeMacro{\DeclareWitness} \cs{DeclareWitness}\marg{unique 974% \DescribeMacro{\DeclareWitness} \cs{DeclareWitness}\marg{unique
@@ -1149,14 +1154,56 @@ along with this program. If not, see
1149% 1154%
1150% \paragraph{Scholars} 1155% \paragraph{Scholars}
1151% \label{ref:declare-scholar} 1156% \label{ref:declare-scholar}
1152% \DescribeMacro{\DeclareScholar} \cs{DeclareScholar}\marg{unique 1157% \DescribeMacro{\DeclareScholar}\cs{DeclareScholar}\marg{unique
1153% label}\marg{rendition}\\ 1158% id}\marg{rendition}\oarg{options}\newfeature[v1.1]\\
1159% Occasionally, it is necessary to refer to a scholar as a person. For
1160% example, corrections and conjectures are commonly inserted as
1161% self-references to the editor of the text in the apparatus criticus
1162% in print with such words as \emph{scripsi}, \emph{addidi},
1163% \emph{correxi} and the like. Other examples come from unpublished
1164% conjectures of other scholars found in private
1165% libraries. \cs{DeclareScholar} takes two mandatory arguments to
1166% specify consecutively:---
1167% \begin{enumerate}
1168% \item The unique identifier of the scholar to be used both in the
1169% |.tex| source file and as an |xml:id| in the \texttt{TEI xml} output
1170% if any.
1171% \item The rendition to be used in the apparatus criticus in print,
1172% which also will be found within the |<sourceDesc>| element of the
1173% \texttt{TEI} header where the description of the persons cited
1174% occurs, within an |<abbr type="siglum">| element.
1175% \end{enumerate}
1176% Finally, the optional argument of \cs{DeclareScholar} accepts the
1177% following comma-separated list of |key-value| arguments:---\\
1178% \DescribeOption{rawname}|rawname|$=$\meta{name}\\
1179% |rawname| refers to a name that is not to be dissected into name
1180% part components such as forename, surname and the like. If |rawname|
1181% be used, then \pkg{ekdosis} will ignore the following three optional
1182% arguments: |forename|, |surname| and |addname|.\\
1183% \DescribeOption{forename}|forename|$=$\meta{forename}\\
1184% |forename| refers to first and middle names or initials.\\
1185% \DescribeOption{surname}|surname|$=$\meta{surname}\\
1186% |surname| stores the last name.\\
1187% \DescribeOption{addname} |addname|$=$\meta{additional name}\\
1188% |addname| refers to an additional or alternate name by which the
1189% scholar is known viz.\ a Latinized form of the name, a nickname, an
1190% epithet or alias.\\
1191% \DescribeOption{note} |note|$=$\meta{note}\\
1192% |note| may hold any relevant information about the material used by
1193% the editor. For example, a note may specify that this material has
1194% been found as marginal notes by the hand of the scholar in some
1195% edition in print.
1196%
1197% \paragraph{Sources}
1198% \label{ref:declare-source}
1199% \DescribeMacro{\DeclareSource} \cs{DeclareSource}\marg{unique
1200% label}\marg{rendition}\newfeature[v1.1]\\
1154% The \emph{Conspectus Siglorum} that is placed ahead of the edition 1201% The \emph{Conspectus Siglorum} that is placed ahead of the edition
1155% text is traditionally divided into two parts: a)~\emph{Codices}, 1202% text is traditionally divided into two parts: a)~\emph{Codices},
1156% which provides the list of sigla used in the apparatus, 1203% which provides the list of sigla used in the apparatus,
1157% b)~\emph{Editiones uel Studia}, which provides references to 1204% b)~\emph{Editiones uel Studia}, which provides references to
1158% scholars whose published or unpublished works contain conjectures 1205% sources, either published or unpublished, which contain conjectures
1159% used in the apparatus criticus. \cs{DeclareScholar} takes two 1206% used in the apparatus criticus. \cs{DeclareSource} takes two
1160% mandatory arguments used to specify consecutively:--- 1207% mandatory arguments used to specify consecutively:---
1161% \begin{enumerate} 1208% \begin{enumerate}
1162% \item A unique label used in the |.tex| source file to refer to the 1209% \item A unique label used in the |.tex| source file to refer to the
@@ -1164,21 +1211,23 @@ along with this program. If not, see
1164% \item The rendition to be used in the printed apparatus criticus. 1211% \item The rendition to be used in the printed apparatus criticus.
1165% \end{enumerate} 1212% \end{enumerate}
1166% 1213%
1167% As \pkg{ekdosis} can include and use \texttt{TEI xml} compliant 1214% \danger As \pkg{ekdosis} can include and use \texttt{TEI xml}
1168% lists of references,\footnote{See below 1215% compliant lists of references,\footnote{See below
1169% \vref{sec:references-cited-works}.} it is avisable to use 1216% \vref{sec:references-cited-works}.} it is advisable to use
1170% Bib\hologo{(La)TeX} labels in the first argument of 1217% Bib\hologo{(La)TeX} labels in the first argument of
1171% \cs{DeclareScholar}. Likewise, shorthands fields from the 1218% \cs{DeclareSource}. Otherwise, the unique label used to declare the
1172% bibliographical database can be recalled from within the second 1219% source would point to no |xml:id| and the \texttt{TEI xml} would not
1173% argument of \cs{DeclareScholar}:--- 1220% be valid. Likewise, shorthands fields from the bibliographical
1221% database can be recalled from within the second argument of
1222% \cs{DeclareSource}:---
1174% 1223%
1175% \iffalse 1224% \iffalse
1176%<*example> 1225%<*example>
1177% \fi 1226% \fi
1178\begin{minted}[linenos=false]{latex} 1227\begin{minted}[linenos=false]{latex}
1179\DeclareScholar{Wil}{Wilamowitz} 1228\DeclareSource{Wil}{Wilamowitz}
1180% or for example: 1229% or for example:
1181\DeclareScholar{Wil}{\citename{Wil}{shorteditor}} 1230\DeclareSource{Wil}{\citename{Wil}{shorteditor}}
1182\end{minted} 1231\end{minted}
1183% \iffalse 1232% \iffalse
1184%</example> 1233%</example>
@@ -1188,9 +1237,9 @@ along with this program. If not, see
1188% \subsubsection{Printing Formatted Witnesses 1237% \subsubsection{Printing Formatted Witnesses
1189% --- Conspectus Siglorum} 1238% --- Conspectus Siglorum}
1190% \label{sec:print-witnesses} 1239% \label{sec:print-witnesses}
1191% Once witnesses, hands and scholars have been declared, \pkg{ekdosis} 1240% Once witnesses, hands, scholars and sources have been declared,
1192% provides two commands to have them printed as declared from their 1241% \pkg{ekdosis} provides two commands to have them printed as declared
1193% indentifiers. 1242% from their indentifiers.
1194% 1243%
1195% \DescribeMacro{\getsiglum} \cs{getsiglum}\marg{csv list of witnesses 1244% \DescribeMacro{\getsiglum} \cs{getsiglum}\marg{csv list of witnesses
1196% or single witness} behaves exactly as the |wit| optional argument of 1245% or single witness} behaves exactly as the |wit| optional argument of
@@ -1338,18 +1387,24 @@ yesterday.
1338% While a single witness may be recorded as in |wit=A|, 1387% While a single witness may be recorded as in |wit=A|,
1339% comma-separated lists of multiple witnesses must obviously be 1388% comma-separated lists of multiple witnesses must obviously be
1340% enclosed in curly braces, like so: 1389% enclosed in curly braces, like so:
1341% |wit={A,B,C}|. \label{ref:mss-sep-families}It must be noted 1390% |wit={A,B,C}|. \label{ref:mss-sep-families}It must be noted that
1342% that witnesses can be grouped by using spaces as separators, like 1391% witnesses can be grouped by using spaces as separators, like so:
1343% so: \verb*|wit={A,B,C, D,E,F}|.\\ 1392% \verb*|wit={A,B,C, D,E,F}|. Of course, any unique identifiers or
1393% labels used to \enquote{declare} scholars and sources as described
1394% above \vpagerefrange{ref:declare-scholar}{ref:declare-source} can
1395% also be used as values of the |wit| optional argument.\footnote{For
1396% an example of an edition text used as a witness,
1397% see below in \vref{sec:references-cited-works}.}\\
1344% \DescribeOption{alt} |alt|$=$\meta{alternate lemma}\\ 1398% \DescribeOption{alt} |alt|$=$\meta{alternate lemma}\\
1345% While the mandatory argument of \cs{lem}, \meta{lemma text}, is 1399% While the mandatory argument of \cs{lem}, \meta{lemma text}, is
1346% always used to print the edition text in the upper part of the page, 1400% always used to print the edition text in the upper part of the page,
1347% \meta{alternate lemma}, if specified, supersedes what is printed in 1401% \meta{alternate lemma}, if specified, supersedes what is printed in
1348% the related entry of the apparatus criticus. This mechanism is useful 1402% the related entry of the apparatus criticus. This mechanism is
1349% in more than one respect. For instance, it can be used to insert 1403% useful in more than one respect. For instance, it can be used to
1350% abbreviated lemmata in the apparatus criticus, or to introduce an 1404% insert abbreviated lemmata in the apparatus criticus, or to
1351% alternate way of writing entries with Latin technical terms in the 1405% introduce an alternate way of writing entries with Latin technical
1352% apparatus criticus as will be demonstrated below in the example 1406% terms in the apparatus criticus as will be demonstrated below in the
1407% example
1353% provided by \vref{lst:pj2}.\\ 1408% provided by \vref{lst:pj2}.\\
1354% \DescribeOption{sep} |sep|$=$\meta{separator}\\ 1409% \DescribeOption{sep} |sep|$=$\meta{separator}\\
1355% |sep| allows to change the symbol used to separate the lemma text 1410% |sep| allows to change the symbol used to separate the lemma text
@@ -3311,10 +3366,10 @@ subtype="arabtex">'inna 'abI kAna mina
3311% language (Latin, English and French) is to be found in two different 3366% language (Latin, English and French) is to be found in two different
3312% places, namely for \texttt{TEI xml} output (ll.~21--3) and for PDF 3367% places, namely for \texttt{TEI xml} output (ll.~21--3) and for PDF
3313% output through \LaTeX\ (ll.~27--9). Finally, it provides examples of 3368% output through \LaTeX\ (ll.~27--9). Finally, it provides examples of
3314% declaring witnesses, hands, scholars and shorthands (ll.~31--60). As 3369% declaring witnesses, hands and shorthands (ll.~31--60). As to the
3315% to the document itself, it shows how to lay out a conspectus 3370% document itself, it shows how to lay out a conspectus siglorum in a
3316% siglorum in a table (ll.~64--80), before giving detailed examples of 3371% table (ll.~64--80), before giving detailed examples of how the
3317% how the edition text is entered (ll.~85--101) and sectional commands 3372% edition text is entered (ll.~85--101) and sectional commands
3318% provided by \pkg{ekdosis} are used (ll.~86, 103 and 3373% provided by \pkg{ekdosis} are used (ll.~86, 103 and
3319% 110).\footnote{The PDF output is available as 3374% 110).\footnote{The PDF output is available as
3320% \href{samples/Caesar_BG-6-13-1.pdf}{a separate file}.} 3375% \href{samples/Caesar_BG-6-13-1.pdf}{a separate file}.}
@@ -3441,11 +3496,12 @@ subtype="arabtex">'inna 'abI kAna mina
3441% letters, digits, hyphens underscores and full stops. \pkg{ekdosis} 3496% letters, digits, hyphens underscores and full stops. \pkg{ekdosis}
3442% issues a warning when it finds that any \meta{unique id} of 3497% issues a warning when it finds that any \meta{unique id} of
3443% \meta{unique label} expected in the first argument of 3498% \meta{unique label} expected in the first argument of
3444% \cs{DeclareWitness}, \cs{DeclareHand} or \cs{DeclareScholar} is not 3499% \cs{DeclareWitness}, \cs{DeclareHand}, \cs{DeclareScholar} or
3445% unique or breaks the rules just described, but does not prevent the 3500% \cs{DeclareSource} is not unique or breaks the rules just described,
3446% |.tex| source file from compiling. Instead, it prints the string 3501% but does not prevent the |.tex| source file from compiling. Instead,
3447% |<??>| in place of the expected formatted siglum so that the error 3502% it prints the string |<??>| in place of the expected formatted
3448% in the |.tex| source file can be easily spotted and corrected. 3503% siglum so that the error in the |.tex| source file can be easily
3504% spotted and corrected.
3449% 3505%
3450% \danger As the \meta{unique id} declared with \cs{DeclareShorthand} 3506% \danger As the \meta{unique id} declared with \cs{DeclareShorthand}
3451% is not to be exported in the \texttt{TEI xml} outputfile, 3507% is not to be exported in the \texttt{TEI xml} outputfile,
@@ -3650,13 +3706,14 @@ many mathematical writings and to the sense of
3650% 3706%
3651% Even more subtly, provided that the code |#STC| points to some more 3707% Even more subtly, provided that the code |#STC| points to some more
3652% information identifying the agency concerned:\footnote{At the time 3708% information identifying the agency concerned:\footnote{At the time
3653% of writing, \enquote*{scholars} can be declared with 3709% of writing, \enquote*{sources} can be declared with
3654% \cs{DeclareScholar} as described above 3710% \cs{DeclareSource} as described above
3655% \vpageref{ref:declare-scholar}. Then the unique ID used in the first 3711% \vpageref{ref:declare-source}. Then the unique identifier used in
3656% argument of this command can point to the list of references 3712% the first argument of this command can point to the list of
3657% inserted by \pkg{ekdosis} in the back matter section of the 3713% references inserted by \pkg{ekdosis} in the back matter section of
3658% \texttt{TEI} ouput file. See below \vref{sec:references-cited-works} 3714% the \texttt{TEI} ouput file. See below
3659% for more information on how to do this.}--- 3715% \vref{sec:references-cited-works} for more information on how to do
3716% this.}---
3660% 3717%
3661% \iffalse 3718% \iffalse
3662%<*example> 3719%<*example>
@@ -3975,7 +4032,7 @@ Sample text with a \textcolor{red}{word} in red.
3975% the Bib\hologo{(La)TeX} file (l.~1) and an |xml:id| in the 4032% the Bib\hologo{(La)TeX} file (l.~1) and an |xml:id| in the
3976% \texttt{TEI} file (l.~3). This same label must be used again in the 4033% \texttt{TEI} file (l.~3). This same label must be used again in the
3977% preamble of the |.tex| source file to declare Arnold Drakenborch as a 4034% preamble of the |.tex| source file to declare Arnold Drakenborch as a
3978% scholar,\footnote{See above \vpageref{ref:declare-scholar}.} like 4035% source,\footnote{See above \vpageref{ref:declare-source}.} like
3979% so:--- 4036% so:---
3980% 4037%
3981% \iffalse 4038% \iffalse
@@ -3986,7 +4043,7 @@ Sample text with a \textcolor{red}{word} in red.
3986\SetxmlBibResource{bibl} % 'bibl' is the basename of 'bibl.xml' 4043\SetxmlBibResource{bibl} % 'bibl' is the basename of 'bibl.xml'
3987 4044
3988% Declare A. Drakenborch as scholar: 4045% Declare A. Drakenborch as scholar:
3989\DeclareScholar{Drak}{\emph{Drakenborch}} 4046\DeclareSource{Drak}{\emph{Drakenborch}}
3990\end{minted} 4047\end{minted}
3991% \iffalse 4048% \iffalse
3992%</example> 4049%</example>
@@ -4002,19 +4059,24 @@ Sample text with a \textcolor{red}{word} in red.
4002% \fi 4059% \fi
4003\begin{minted}{latex} 4060\begin{minted}{latex}
4004% Preamble: 4061% Preamble:
4062\usepackage[style=oxnotes]{biblatex}
4063\addbibresource{bibl.bib}
4064
4005\usepackage[teiexport=tidy]{ekdosis} 4065\usepackage[teiexport=tidy]{ekdosis}
4006 4066
4067% basename of the .xml bibliographical database:
4068\SetxmlBibResource{bibl} % viz. "load bibl.xml"
4069
4007% Witnesses: 4070% Witnesses:
4008\DeclareWitness{L}{L}{Laurentianus, plut, XXXVII, cod. 16}[ 4071\DeclareWitness{L}{L}{Laurentianus, plut, XXXVII, cod. 16}[
4009 origDate=s. XV] 4072 origDate=s. XV]
4010% Other witnesses [...] 4073% Other witnesses [...]
4011 4074
4012% Scholars: 4075% Sources:
4013\DeclareScholar{Drak}{\emph{Drakenborch}} 4076\DeclareSource{Drak}{\emph{Drakenborch}}
4014% Other scholars [...] 4077% Alternatively, use BibLaTeX for the rendition:
4015 4078% \DeclareSource{Drak}{\citename{Drak}{editor}}
4016% basename of the .xml bibliographical database: 4079% Other sources [...]
4017\SetxmlBibResource{bibl}
4018 4080
4019% Document: 4081% Document:
4020\begin{ekdosis} 4082\begin{ekdosis}
@@ -4106,8 +4168,8 @@ Sample text with a \textcolor{red}{word} in red.
4106% \pkg{ekdosis} can also convert into \texttt{TEI xml} references to 4168% \pkg{ekdosis} can also convert into \texttt{TEI xml} references to
4107% cited works. Depending on the optional arguments used in the 4169% cited works. Depending on the optional arguments used in the
4108% citation command, references will be converted into |<ptr>| or 4170% citation command, references will be converted into |<ptr>| or
4109% |<ref>| elements with the appropriate ID supplied by means of the 4171% |<ref>| elements with the appropriate identifier supplied by means
4110% |target| attribute. 4172% of the |target| attribute.
4111% 4173%
4112% Of course, for this mechanism to work, Bib\TeX\ or Bib\LaTeX\ must 4174% Of course, for this mechanism to work, Bib\TeX\ or Bib\LaTeX\ must
4113% be used and connected to some |.bib| bibliographical database 4175% be used and connected to some |.bib| bibliographical database
@@ -5070,11 +5132,11 @@ Sample text with a \textcolor{red}{word} in red.
5070% \end{macrocode} 5132% \end{macrocode}
5071% \end{macro} 5133% \end{macro}
5072% \begin{macro}{\DeclareHand} As \cs{DeclareWitness}, \cs{DeclareHand} 5134% \begin{macro}{\DeclareHand} As \cs{DeclareWitness}, \cs{DeclareHand}
5073% is a preamble-only command meant to collect data and store them in 5135% is a preamble-only command meant to collect data and store them in
5074% |Lua| tables. It takes three mandatory arguments and one optional 5136% |Lua| tables. It takes three mandatory arguments and one optional
5075% argument. The second argument is used to connect the hand to a 5137% argument. The second argument is used to connect the hand to a
5076% declared witness it is related to. Then the table in which this 5138% declared witness it is related to. Then the table in which this
5077% witness is recorded can be fed with new data. 5139% witness is recorded can be fed with new data.
5078% \begin{macrocode} 5140% \begin{macrocode}
5079\NewDocumentCommand{\DeclareHand}{m m m +O{}}{ 5141\NewDocumentCommand{\DeclareHand}{m m m +O{}}{
5080 \luadirect{ekdosis.newhand(\luastringN{#1}, 5142 \luadirect{ekdosis.newhand(\luastringN{#1},
@@ -5085,20 +5147,57 @@ Sample text with a \textcolor{red}{word} in red.
5085\@onlypreamble\DeclareHand 5147\@onlypreamble\DeclareHand
5086% \end{macrocode} 5148% \end{macrocode}
5087% \end{macro} 5149% \end{macro}
5088% \begin{macro}{\DeclareScholar} There is also a table in which are 5150% Build and process the list of scholars:---
5089% collected data related to scholars' names to be used in the
5090% apparatus criticus. \cs{DeclareScholar} is a preamble-only command
5091% and takes two mandatory arguments: a unique id and a shorthand to
5092% be used in the apparatus criticus which can be extracted from a
5093% bibliographic database.
5094% \begin{macrocode} 5151% \begin{macrocode}
5095\NewDocumentCommand{\DeclareScholar}{m m}{ 5152\ekvdefinekeys{ekd@scholar}{
5096 \luadirect{ekdosis.newscholar(\luastringN{#1}, 5153 store rawname = \rawname@value,
5097 \luastringN{#2})} 5154 store forename = \forename@value,
5155 store surname = \surname@value,
5156 store addname = \addname@value,
5157 store note = \note@value
5098} 5158}
5159% \end{macrocode}
5160% \begin{macro}{\DeclareScholar}
5161% \changes{v1.1}{2020/08/20}{nows builds a list of persons}
5162% \cs{DeclareScholar} is used to build a list of persons within the
5163% |<listPerson>| element. It takes two mandatory arguments to specify
5164% consecutively a unique identifier and the rendition to be used in
5165% the apparatus criticus in print, and one optional argument used to
5166% collect the name parts components and further items of information
5167% from |key-value| \enquote*{named} arguments.
5168% \begin{macrocode}
5169\NewDocumentCommand{\DeclareScholar}{m m O{}}{%
5170 \bgroup
5171 \ekvset{ekd@scholar}{#3}
5172 \luadirect{ekdosis.newscholar(
5173 \luastringN{#1},
5174 \luastringN{#2},
5175 \luastringO{\rawname@value},
5176 \luastringO{\forename@value},
5177 \luastringO{\surname@value},
5178 \luastringO{\addname@value},
5179 \luastringO{\note@value})}
5180 \egroup
5181 }
5099\@onlypreamble\DeclareScholar 5182\@onlypreamble\DeclareScholar
5100% \end{macrocode} 5183% \end{macrocode}
5101% \end{macro} 5184% \end{macro}
5185% \begin{macro}{\DeclareSource}
5186% \changes{v1.1}{2020/08/20}{new command}There is also a table in
5187% which are collected data related to sources to be used in the
5188% apparatus criticus. \cs{DeclareSource} is a preamble-only
5189% command and takes two mandatory arguments: a unique id and a
5190% shorthand (preferably a Bib\hologo{(La)TeX} label) to be used in
5191% the apparatus criticus which can be extracted from a bibliographic
5192% database.
5193% \begin{macrocode}
5194\NewDocumentCommand{\DeclareSource}{m m}{
5195 \luadirect{ekdosis.newsource(\luastringN{#1},
5196 \luastringN{#2})}
5197}
5198\@onlypreamble\DeclareSource
5199% \end{macrocode}
5200% \end{macro}
5102% \begin{macro}{\DeclareShorthand} \cs{DeclareShorthand} is a 5201% \begin{macro}{\DeclareShorthand} \cs{DeclareShorthand} is a
5103% preamble-only command that can be used to record manuscript 5202% preamble-only command that can be used to record manuscript
5104% families or any kind of shorthand to be used to refer to 5203% families or any kind of shorthand to be used to refer to
@@ -5118,7 +5217,7 @@ Sample text with a \textcolor{red}{word} in red.
5118% \begin{macro}{\getsiglum} 5217% \begin{macro}{\getsiglum}
5119% \cs{getsiglum}\marg{csv list} takes a comma-separated list of 5218% \cs{getsiglum}\marg{csv list} takes a comma-separated list of
5120% declared ids by means of \cs{DeclareWitness}, \cs{DeclareHand}, 5219% declared ids by means of \cs{DeclareWitness}, \cs{DeclareHand},
5121% \cs{DeclareShorthand} or \cs{DeclareScholar} and returns their 5220% \cs{DeclareShorthand} or \cs{DeclareSource} and returns their
5122% respective renditions. 5221% respective renditions.
5123% \begin{macrocode} 5222% \begin{macrocode}
5124\NewDocumentCommand{\getsiglum}{m}{% 5223\NewDocumentCommand{\getsiglum}{m}{%
@@ -6561,6 +6660,7 @@ local next = next
6561 6660
6562-- General 6661-- General
6563xmlids = {} 6662xmlids = {}
6663table.insert(xmlids, {xmlid = "scholars"} )
6564 6664
6565local function xmlidfound(element) 6665local function xmlidfound(element)
6566 for i = 1,#xmlids do 6666 for i = 1,#xmlids do
@@ -6582,9 +6682,12 @@ local function checkxmlid(str)
6582end 6682end
6583 6683
6584-- Witnesses 6684-- Witnesses
6585listWit = {} 6685local listWit = {}
6586idsRend = {} 6686-- Persons/Scholars
6587shorthands = {} 6687local listPerson = {}
6688
6689local idsRend = {}
6690local shorthands = {}
6588 6691
6589local function isfound(table, value) 6692local function isfound(table, value)
6590 for i = 1,#table do 6693 for i = 1,#table do
@@ -6727,6 +6830,54 @@ function ekdosis.newshorthand(id, rend, xmlids)
6727 return true 6830 return true
6728end 6831end
6729 6832
6833function ekdosis.newscholar(id,
6834 siglum,
6835 rawname,
6836 Forename,
6837 Surname,
6838 AddName,
6839 Note)
6840 if xmlidfound(id)
6841 then
6842 tex.print("\\unexpanded{\\PackageWarning{ekdosis}{\""
6843 ..id..
6844 "\" already exists as an xml:id. "
6845 ..
6846 "Please pick another id.}}")
6847 elseif not checkxmlid(id)
6848 then
6849 tex.print("\\unexpanded{\\PackageWarning{ekdosis}{\""
6850 ..id..
6851 "\" is not a valid xml:id. \\MessageBreak "
6852 ..
6853 "Please pick another id.}}")
6854 else
6855 table.insert(xmlids, {xmlid = id})
6856 table.sort(xmlids, function(a ,b) return(#a.xmlid > #b.xmlid) end)
6857 table.insert(idsRend, {xmlid = id, abbr = siglum})
6858 table.sort(idsRend, function(a ,b) return(#a.xmlid > #b.xmlid) end)
6859 if rawname ~= ""
6860 then
6861 table.insert(listPerson, {xmlid = id,
6862 abbr = siglum,
6863 note = Note,
6864 persName = {
6865 name = rawname}
6866 })
6867 else
6868 table.insert(listPerson, {xmlid = id,
6869 abbr = siglum,
6870 note = Note,
6871 persName = {
6872 forename = Forename,
6873 surname = Surname,
6874 addName = AddName}
6875 })
6876 end
6877 end
6878 return true
6879end
6880
6730local xmlbibresource = nil 6881local xmlbibresource = nil
6731 6882
6732function ekdosis.setxmlbibresource(str) 6883function ekdosis.setxmlbibresource(str)
@@ -6734,7 +6885,7 @@ function ekdosis.setxmlbibresource(str)
6734 return true 6885 return true
6735end 6886end
6736 6887
6737function ekdosis.newscholar(id, siglum) 6888function ekdosis.newsource(id, siglum)
6738 if xmlidfound(id) 6889 if xmlidfound(id)
6739 then 6890 then
6740 tex.print("\\unexpanded{\\PackageWarning{ekdosis}{\"" 6891 tex.print("\\unexpanded{\\PackageWarning{ekdosis}{\""
@@ -7649,6 +7800,40 @@ function ekdosis.openteistream()
7649 f:write("</witness>", "\n") 7800 f:write("</witness>", "\n")
7650 end 7801 end
7651 f:write("</listWit>", "\n") 7802 f:write("</listWit>", "\n")
7803 f:write("<listPerson xml:id=\"scholars\">", "\n")
7804 for i = 1,#listPerson do
7805 f:write('<person xml:id=\"', listPerson[i].xmlid, "\">", "\n")
7806 f:write('<persName>', "\n")
7807 f:write('<abbr type="siglum">', textotei(listPerson[i].abbr), "</abbr>", "\n")
7808 if listPerson[i].persName.name ~= nil
7809 then
7810 f:write(textotei(listPerson[i].persName.name))
7811 else
7812 if listPerson[i].persName.forename ~= ""
7813 then
7814 f:write("<forename>", textotei(listPerson[i].persName.forename), "</forename>", "\n")
7815 else
7816 f:write("<forename><!-- forename --></forename>", "\n")
7817 end
7818 if textotei(listPerson[i].persName.surname) ~= ""
7819 then
7820 f:write("<surname>", textotei(listPerson[i].persName.surname), "</surname>", "\n")
7821 else
7822 f:write("<surname><!-- surname --></surname>", "\n")
7823 end
7824 if textotei(listPerson[i].persName.addName) ~= ""
7825 then
7826 f:write("<addName>", textotei(listPerson[i].persName.addName), "</addName>", "\n")
7827 end
7828 end
7829 if listPerson[i].note ~= ""
7830 then
7831 f:write("<note>", textotei(listPerson[i].note), "</note>", "\n")
7832 end
7833 f:write('</persName>', "\n")
7834 f:write('</person>', "\n")
7835 end
7836 f:write("</listPerson>", "\n")
7652 f:write("</sourceDesc>", "\n") 7837 f:write("</sourceDesc>", "\n")
7653 f:write("</fileDesc>", "\n") 7838 f:write("</fileDesc>", "\n")
7654 f:write("<encodingDesc>", "\n") 7839 f:write("<encodingDesc>", "\n")