aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2020-08-21 19:11:25 +0200
committerRobert Alessi <alessi@robertalessi.net>2020-08-21 19:11:25 +0200
commit73e4912d7cc2217ad0506269d855ff22f7d0894a (patch)
tree5354c011d7112b43eaf0e5528d66f816e193a304
parentf1aa91c51e256760de1a882d8c78f9d8bc0225ff (diff)
downloadekdosis-73e4912d7cc2217ad0506269d855ff22f7d0894a.tar.gz
new commands \supplied, \surplus, \sic and \gap for editorial changes. documenting the new features
-rw-r--r--ekdosis.dtx259
1 files changed, 245 insertions, 14 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx
index 0433df9..b30f7c0 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -222,13 +222,12 @@ along with this program. If not, see
222\end{filecontents} 222\end{filecontents}
223\begin{filecontents}[overwrite]{\jobname-cfg.tex} 223\begin{filecontents}[overwrite]{\jobname-cfg.tex}
224\footnotelayout{m} 224\footnotelayout{m}
225\EnvtoTEI{ancientgreek}{p}[xml:lang="grc"]
225\DeclareApparatus{fontium}[ 226\DeclareApparatus{fontium}[
226 delim=\hskip0.75em, 227 delim=\hskip0.75em,
227 bhook=\textbf{Sources:}, 228 bhook=\textbf{Sources:}]
228 ehook=.]
229\DeclareApparatus{default}[ 229\DeclareApparatus{default}[
230 delim=\hskip0.75em, 230 delim=\hskip0.75em]
231 ehook=.]
232\DeclareApparatus{ltr}[ 231\DeclareApparatus{ltr}[
233 delim=\hskip0.75em] 232 delim=\hskip0.75em]
234\DeclareApparatus{rtl}[ 233\DeclareApparatus{rtl}[
@@ -282,6 +281,15 @@ along with this program. If not, see
282\DeclareWitness{hI}{I}{\emph{Parisinus Gr.} 2140} 281\DeclareWitness{hI}{I}{\emph{Parisinus Gr.} 2140}
283\DeclareWitness{hR}{R}{\emph{Vaticanus Gr.} 277} 282\DeclareWitness{hR}{R}{\emph{Vaticanus Gr.} 277}
284\DeclareWitness{hH}{H}{\emph{Parisinus Gr.} 2142} 283\DeclareWitness{hH}{H}{\emph{Parisinus Gr.} 2142}
284\DeclareSource{Lit}{Littré}
285\DeclareSource{Erm}{Ermerins}
286\DeclareSource{Sm}{Smith}
287\DeclareScholar{ego}{ego}[
288 forename=Robert,
289 surname=Alessi]
290\DeclareShorthand{hcodd}{codd.}{hV,hI,hR,hH}
291\DeclareShorthand{hedd}{edd.}{Lit,Erm,Sm}
292\DeclareShorthand{hegoscr}{\emph{scripsi}}{ego}
285% Silius Italicus' Punica, IX, 30--2: 293% Silius Italicus' Punica, IX, 30--2:
286\DeclareWitness{sL}{L}{Laurentianus, plut, XXXVII, cod. 16}[ 294\DeclareWitness{sL}{L}{Laurentianus, plut, XXXVII, cod. 16}[
287 origDate=s. XV] 295 origDate=s. XV]
@@ -592,6 +600,7 @@ along with this program. If not, see
592% 600%
593% \changes{v0.99a}{2020/07/08}{First public release (documentation in 601% \changes{v0.99a}{2020/07/08}{First public release (documentation in
594% progress)} 602% progress)}
603% \changes{v1.0}{2020/08/14}{Documentation complete}
595% 604%
596% \begin{abstract} 605% \begin{abstract}
597% \pkg{ekdosis} is a Lua\LaTeX{} package designed for 606% \pkg{ekdosis} is a Lua\LaTeX{} package designed for
@@ -2099,6 +2108,113 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
2099% 2108%
2100% \section{Emendations and Conjectures} 2109% \section{Emendations and Conjectures}
2101% \label{sec:emendations-conjectures} 2110% \label{sec:emendations-conjectures}
2111% From a technical standpoint, \enquote{conjectures} are readings that
2112% are not supported by manuscript evidence, but are instead proposed
2113% by scholars to be taken into consideration for establishing the
2114% edition text. A conjecture is called an \enquote{emendation} if it
2115% is adopted in place of what is provided by or missing from the text
2116% provided by the manuscripts. Emendations and conjectures are
2117% therefore readings and as such expected to be found within |<lem>|
2118% or |<rdg>| elements. However, as both come from editions or
2119% scholars, not from manuscripts, they are naturally associated with
2120% |source| or |resp| attributes as described above
2121% \vpagerefrange{ref:lem-source}{ref:lem-resp},\footnote{See also
2122% \vpagerefrange{ref:declare-scholar}{ref:declare-source}.} and can be
2123% distinguished from one another by the |type| attribute, eg.\ either
2124% |emendation| or |conjecture|.
2125%
2126% As an example, the representation of witnesses, editors and
2127% shorthands of Hippocrates' \emph{Epidemics}, Book~2 could be
2128% summarized as follows:---
2129%
2130% \iffalse
2131%<*example>
2132% \fi
2133\begin{minted}{latex}
2134% Witnesses:
2135\DeclareWitness{V}{V}{\emph{Vaticanus Gr.} 276}
2136\DeclareWitness{I}{I}{\emph{Parisinus Gr.} 2140}
2137\DeclareWitness{R}{R}{\emph{Vaticanus Gr.} 277}
2138\DeclareWitness{H}{H}{\emph{Parisinus Gr.} 2142}
2139% Sources (the first arguments below must refer to biblatex labels and
2140% an xml bibliographical database must be supplied):
2141\DeclareSource{Lit}{Littré}
2142\DeclareSource{Erm}{Ermerins}
2143\DeclareSource{Sm}{Smith}
2144% Persons:
2145\DeclareScholar{ego}{ego}[
2146 forename=Robert,
2147 surname=Alessi]
2148% Useful shorthands:
2149\DeclareShorthand{codd}{codd.}{V,I,R,H}
2150\DeclareShorthand{edd}{edd.}{Lit,Erm,Sm}
2151\DeclareShorthand{egoscr}{\emph{scripsi}}{ego}
2152\end{minted}
2153% \iffalse
2154%</example>
2155% \fi
2156%
2157% As can be seen from lines~16--18, three useful shorthands have been
2158% defined: |codd| prints \enquote{codd.} for Latin pl.\ \emph{codices}
2159% viz.\ \enquote{all manuscripts} and refers to the three \texttt{xml}
2160% identifiers |V|, |I|, |R| and |H| declared at ll.~2--5; |edd| prints
2161% \enquote{edd.} for Latin pl.\ \emph{editores} viz.\ \enquote{all
2162% editors} and refers to the three \texttt{xml} identifiers |Lit|,
2163% |Erm| and |Sm| declared at ll.~8--10;\footnote{For detailed
2164% information on how to use \cs{DeclareSource} and insert references
2165% to cited works, the reader is invited to refer to
2166% \vref{sec:references-cited-works}.} finally, |egoscr| (l.~18) is
2167% used to print the technical Latin term \enquote{\emph{scripsi}},
2168% \enquote{I wrote}, to denote a personal conjecture. Then, the |.tex|
2169% source file can be structured as follows:---
2170%
2171% \iffalse
2172%<*example>
2173% \fi
2174\begin{minted}[linenos=false]{latex}
2175\begin{ekdosis}
2176 εἰ
2177 \app{
2178 \lem[resp=egoscr, type=emendation]{μὲν}
2179 \rdg[wit=codd, source=edd]{μὴ}
2180 } εἴη διὰ ταῦτα [...]
2181\end{ekdosis}
2182\end{minted}
2183% \iffalse
2184%</example>
2185% \fi
2186%
2187% PDF output:---
2188% \medskip
2189%
2190% \needspace{7\baselineskip}
2191% \resetlinenumber
2192% \begin{alignment}[flush,tcols=1,texts=specimen,apparatus=specimen]
2193% \begin{specimen}
2194% \begin{ancientgreek}
2195% εἰ \app{
2196% \lem[resp=hegoscr, type=emendation]{μὲν}
2197% \rdg[wit=hcodd, source=hedd]{μὴ}
2198% } εἴη διὰ ταῦτα [...]
2199% \end{ancientgreek}
2200% \end{specimen}
2201% \end{alignment}
2202%
2203% \texttt{TEI xml} output:---
2204%
2205% \iffalse
2206%<*example>
2207% \fi
2208\begin{minted}[linenos=false]{xml}
2209<p xml:lang="grc">εἰ
2210<app>
2211 <lem resp="#ego" type="emendation">μὲν</lem>
2212 <rdg wit="#V #I #R #H" source="#Lit #Erm #Sm">μὴ</rdg>
2213</app>εἴη διὰ ταῦτα [...]</p>
2214\end{minted}
2215% \iffalse
2216%</example>
2217% \fi
2102% 2218%
2103% \section{Laying Out the Apparatus Criticus } 2219% \section{Laying Out the Apparatus Criticus }
2104% \label{sec:apparatus-layout} 2220% \label{sec:apparatus-layout}
@@ -3256,7 +3372,7 @@ subtype="arabtex">'inna 'abI kAna mina
3256% To elaborate on the example provided above in \vref{sec:latex-divs}, 3372% To elaborate on the example provided above in \vref{sec:latex-divs},
3257% here follows how the first three hierarchical levels could be 3373% here follows how the first three hierarchical levels could be
3258% formatted as un-numbered divisions:--- 3374% formatted as un-numbered divisions:---
3259% 3375%
3260% \iffalse 3376% \iffalse
3261%<*example> 3377%<*example>
3262% \fi 3378% \fi
@@ -5252,13 +5368,13 @@ Sample text with a \textcolor{red}{word} in red.
5252% \end{macrocode} 5368% \end{macrocode}
5253% \end{macro} 5369% \end{macro}
5254% \begin{macro}{\DeclareSource} 5370% \begin{macro}{\DeclareSource}
5255% \changes{v1.1}{2020/08/20}{new command}There is also a table in 5371% \changes{v1.1}{2020/08/20}{new command added}There is also a table in
5256% which are collected data related to sources to be used in the 5372% which are collected data related to sources to be used in the
5257% apparatus criticus. \cs{DeclareSource} is a preamble-only 5373% apparatus criticus. \cs{DeclareSource} is a preamble-only
5258% command and takes two mandatory arguments: a unique id and a 5374% command and takes two mandatory arguments: a unique id and a
5259% shorthand (preferably a Bib\hologo{(La)TeX} label) to be used in 5375% shorthand (preferably a Bib\hologo{(La)TeX} label) to be used in
5260% the apparatus criticus which can be extracted from a bibliographic 5376% the apparatus criticus which can be extracted from a bibliographic
5261% database. 5377% database.
5262% \begin{macrocode} 5378% \begin{macrocode}
5263\NewDocumentCommand{\DeclareSource}{m m}{ 5379\NewDocumentCommand{\DeclareSource}{m m}{
5264 \luadirect{ekdosis.newsource(\luastringN{#1}, 5380 \luadirect{ekdosis.newsource(\luastringN{#1},
@@ -5673,8 +5789,11 @@ Sample text with a \textcolor{red}{word} in red.
5673% \end{macrocode} 5789% \end{macrocode}
5674% \cs{add@@apparatus} inserts the apparatus block on a given page 5790% \cs{add@@apparatus} inserts the apparatus block on a given page
5675% either in the footnote floating block or in a float of its own, 5791% either in the footnote floating block or in a float of its own,
5676% depending on the value set in the |layout| global option. 5792% depending on the value set in the |layout| global option. As some
5793% commands need to know whether they are called from inside the
5794% apparatus criticus, a conditional is first defined.
5677% \begin{macrocode} 5795% \begin{macrocode}
5796\newif\ifekd@inside@app
5678\def\add@@apparatus{% 5797\def\add@@apparatus{%
5679 \if@pkg@parnotes\parnotes\else\fi% 5798 \if@pkg@parnotes\parnotes\else\fi%
5680 \if@pkg@footins% 5799 \if@pkg@footins%
@@ -5685,8 +5804,10 @@ Sample text with a \textcolor{red}{word} in red.
5685 \if@parnotesroman% 5804 \if@parnotesroman%
5686 \renewcommand*{\theparnotemark}{\roman{parnotemark}}\else\fi% 5805 \renewcommand*{\theparnotemark}{\roman{parnotemark}}\else\fi%
5687 \parnoteclear\else\fi% 5806 \parnoteclear\else\fi%
5807 \ekd@inside@apptrue
5688 \footnotesize\apparatus\unless\ifekd@mapps\ekd@end@apparatus\fi% 5808 \footnotesize\apparatus\unless\ifekd@mapps\ekd@end@apparatus\fi%
5689 \if@pkg@parnotes\parnotes\parnotereset\else\fi% 5809 \ekd@inside@appfalse
5810 \if@pkg@parnotes\parnotes\parnotereset\else\fi
5690 }% 5811 }%
5691 \egroup% 5812 \egroup%
5692 \fi% 5813 \fi%
@@ -5696,7 +5817,9 @@ Sample text with a \textcolor{red}{word} in red.
5696 \if@parnotesroman% 5817 \if@parnotesroman%
5697 \renewcommand*{\theparnotemark}{\roman{parnotemark}}\else\fi% 5818 \renewcommand*{\theparnotemark}{\roman{parnotemark}}\else\fi%
5698 \parnoteclear\else\fi% 5819 \parnoteclear\else\fi%
5820 \ekd@inside@apptrue
5699 \ekd@appfontsize\apparatus\unless\ifekd@mapps\ekd@end@apparatus\fi% 5821 \ekd@appfontsize\apparatus\unless\ifekd@mapps\ekd@end@apparatus\fi%
5822 \ekd@inside@appfalse
5700 \if@pkg@parnotes\parnotes\parnotereset\else\fi% 5823 \if@pkg@parnotes\parnotes\parnotereset\else\fi%
5701 }% 5824 }%
5702 \fi% 5825 \fi%
@@ -6366,6 +6489,101 @@ Sample text with a \textcolor{red}{word} in red.
6366} 6489}
6367% \end{macrocode} 6490% \end{macrocode}
6368% \end{macro} 6491% \end{macro}
6492% \paragraph{Emendations and Conjectures}
6493% Here follows the |key-value| options to be used by
6494% \cs{SetCritSymbols} below:---
6495% \begin{macrocode}
6496\ekvdefinekeys{ekd@corr}{
6497 store suppbegin = \suppb@value,
6498 store suppend = \suppe@value,
6499 store delbegin = \delb@value,
6500 store delend = \dele@value,
6501 store sicbegin = \sicb@value,
6502 store sicend = \sice@value,
6503 store gapmark = \gapm@value,
6504 initial suppbegin = \ifbool{al@rlmode}{>}{<},
6505 initial suppend = \ifbool{al@rlmode}{<}{>},
6506 initial delbegin = \ifbool{al@rlmode}{\}}{\{},
6507 initial delend = \ifbool{al@rlmode}{\{}{\}},
6508 initial sicbegin = \dag,
6509 initial sicend = \dag,
6510 initial gapmark = ***
6511}
6512% \end{macrocode}
6513% \begin{macro}{\supplied}
6514% \changes{v1.1}{2020/08/21}{new macro for editorial additions}
6515% \cs{supplied}\marg{text} takes as mandatory argument the text added
6516% or supplied by conjecture.
6517% \begin{macrocode}
6518\NewDocumentCommand{\supplied}{m}{%
6519 \ifekd@inside@app
6520 #1%
6521 \else
6522 \suppb@value #1\suppe@value
6523 \fi
6524}
6525% \end{macrocode}
6526% \end{macro}
6527% \begin{macro}{\surplus}
6528% \changes{v1.1}{2020/08/21}{new macro for editorial deletions}
6529% \cs{surplus}\marg{text} takes as mandatory argument the text
6530% considered by the editor to be inauthentic, but nevertheless
6531% retained between braces in the edition text as it is transmitted by
6532% all witnesses.
6533% \begin{macrocode}
6534\NewDocumentCommand{\surplus}{m}{%
6535 \ifekd@inside@app
6536 #1%
6537 \else
6538 \delb@value #1\dele@value
6539 \fi
6540}
6541% \end{macrocode}
6542% \end{macro}
6543% \begin{macro}{\sic}
6544% \changes{v1.1}{2020/08/21}{new macro for text deemed to be not
6545% understandable}
6546% \cs{sic}\marg{text} takes as mandatory argument the text deemed by
6547% the editor to be readable but not understandable. \cs{sic} insert
6548% \meta{text} between cruces while \cs{sic*} prints only one crux
6549% before \meta{text}.
6550% \begin{macrocode}
6551\NewDocumentCommand{\sic}{s m}{%
6552 \ifekd@inside@app
6553 #2%
6554 \else
6555 \IfBooleanTF{#1}
6556 {\sicb@value #2}
6557 {\sicb@value #2\sice@value}%
6558 \fi
6559}
6560% \end{macrocode}
6561% \end{macro}
6562% \begin{macro}{\gap}
6563% \changes{v1.1}{2020/08/21}{new macro for lacunae}
6564% \cs{gap}\marg{options} indicates that some amount of text has fallen
6565% away from the entire tradition. It takes as mandatory argument a
6566% comma-separated list of options that can be used to further specify
6567% the reason for omission, the unit of measurement, the quantity and
6568% extent.
6569% \begin{macrocode}
6570\NewDocumentCommand{\gap}{m}{%
6571 \gapm@value
6572}
6573% \end{macrocode}
6574% \end{macro}
6575% \begin{macro}{\SetCritSymbols}
6576% \changes{v1.1}{2020/08/21}{new macro to set the symbols to be
6577% used to mark the corrections} \cs{SetCritSymbols}\marg{csv list of
6578% options} is used to change the symbols that \pkg{ekdosis} uses by
6579% default for representing emendations, lacunae, omissions, gaps and
6580% editorial deletions.
6581% \begin{macrocode}
6582\NewDocumentCommand{\SetCritSymbols}{m}{
6583 \ekvset{ekd@corr}{#1}
6584}
6585% \end{macrocode}
6586% \end{macro}
6369% \cs{apparatus} is used internally by \pkg{ekdosis} to print the 6587% \cs{apparatus} is used internally by \pkg{ekdosis} to print the
6370% apparatus at the bottom of pages. Therefore, it is not documented, 6588% apparatus at the bottom of pages. Therefore, it is not documented,
6371% but this may change in the future for it will be possible to have 6589% but this may change in the future for it will be possible to have
@@ -7415,6 +7633,19 @@ local function cmdtotei(str)
7415 return string.format("<ref target=\"%s\">%s</ref>", 7633 return string.format("<ref target=\"%s\">%s</ref>",
7416 teisiglum, printsiglum) 7634 teisiglum, printsiglum)
7417 end) 7635 end)
7636 str = string.gsub(str, "\\(gap)%s?(%b{})",
7637 function(cmd, body)
7638 body = string.sub(body, 2, -2)
7639 teireason = get_attr_value(body, "reason")
7640 if teireason ~= "" then teireason = " reason=\""..teireason.."\"" else end
7641 teiunit = get_attr_value(body, "unit")
7642 if teiunit ~= "" then teiunit = " unit=\""..teiunit.."\"" else end
7643 teiquantity = get_attr_value(body, "quantity")
7644 if teiquantity ~= "" then teiquantity = " quantity=\""..teiquantity.."\"" else end
7645 teiextent = get_attr_value(body, "extent")
7646 if teiextent ~= "" then teiextent = " extent=\""..teiextent.."\"" else end
7647 return string.format("<gap%s%s%s%s/>", teireason, teiunit, teiquantity, teiextent)
7648 end)
7418 str = gsub(str, lpeg.P("\\") * labelrefcmds * spcenc^-1 * bcbraces, 7649 str = gsub(str, lpeg.P("\\") * labelrefcmds * spcenc^-1 * bcbraces,
7419 function(cmd, body) 7650 function(cmd, body)
7420 body = string.sub(body, 2, -2) 7651 body = string.sub(body, 2, -2)