% \iffalse meta-comment % % ekdosis -- Typesetting TEI xml-compliant critical editions % Copyright (c) 2020, 2021, 2022, 2023 Robert Alessi % % % Permission to use, copy, modify, and distribute this software for any % purpose with or without fee is hereby granted, provided that the above % copyright notice and this permission notice appear in all copies. % % THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES % WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF % MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR % ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES % WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN % ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF % OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. % % Please send error reports and suggestions for improvements to Robert % Alessi % %<*internal> \iffalse % %<*luapre> --[[ This file is part of the `ekdosis' package ekdosis -- Typesetting TEI xml-compliant critical editions Copyright (c) 2020, 2021, 2022, 2023 Robert Alessi Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Please send error reports and suggestions for improvements to Robert Alessi --]] % %<*internal> \fi % % \fi % % \iffalse %<*driver> \ProvidesFile{ekdosis.dtx} % %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{ekdosis} %<*package> [2023/06/22 v1.5-dev Typesetting TEI xml-compliant critical editions] % %<*driver> \begin{filecontents}[noheader,overwrite]{bibdata.xml} Scribes and Scholars L. D. Reynolds N. G. Wilson 3 Oxford Clarendon Press 1991 Punicorum libri septemdecim Tiberius Catius Silius Italicus Arnold Drakenborch Trajecti ad Rhenum Utrecht 1717 Works of Mr. William Shakespeare Charles Gildon 17 E. Curl and E. Sanders 1710 Works of Mr. William Shakespeare Charles Gildon 2 17 E. Curl and E. Sanders 1714 Venus and Adonis, Tarquin and Lucrece, and Mr. Shakespeare's Miscellany Poems Sewell A. Bettesworth 1725 Poems, containing I. Venus and Adonis... IV. Sonnets William Shakespeare T. Ewing Dublin 1771 Works of W. Shakespeare H. N. Hudson Boston Munroe 1856 Shakespeare's Complete Sonnets C. M. Walsh 1908 Shakespeare's Sonnets Samuel Butler Fifield 1899 \end{filecontents} \begin{filecontents}[overwrite]{\jobname.bib} @Article{Alessi2020, author = {Alessi, Robert}, title = {ekdosis: Using Lua\LaTeX{} for Producing \texttt{TEI xml}-Compliant Critical Editions and Highlighting Parallel Writings}, journaltitle = {Journal of Data Mining and Digital Humanities}, date = {2020-11}, issuetitle = {Collecting, Preserving, and Disseminating Endangered Cultural Heritage for New Understandings through Multilingual Approaches}, eprinttype = {jdmdh}, eprint = {6536} } @Book{Caesar-BG-v2, author = {{Caesar}}, title = {Gallic War}, origtitle = {Guerre des Gaules}, date = 1987, origdate = 1926, editor = {Constans, L.-A.}, volume = 2, pagination = {none}, entrysubtype = {primary}, series = {Collection des Universités de France}, publisher = {Les Belles Lettres}, location = {Paris} } @Book{CaesarTr, author = {{Caesar}}, title = {Gallic War}, date = 1869, editor = {McDevitte, W. A., and Bohn, W. S.}, edition = 1, entrysubtype = {primary}, series = {Harper's New Classical Library}, publisher = {Harper \& Brothers}, location = {New York}} @Book{CiceroAtt, author = {Cicero}, title = {Ad Atticum epistularum libri sedecim}, date = 1916, entrysubtype = {primary}, editor = {Sjögren, H.}, editortype = {recensuit}, series = {Collectio scriptorum ueterum Vpsaliensis}, publisher = {Eranos' Förlag} } @Book{CiceroAttTr, author = {Cicero}, title = {Letters to Atticus}, date = 1919, entrysubtype = {primary}, editor = {Winstedt, E.O.}, series = {The Loeb Classical Library}, number = 2, publisher = {William Heinemann \& The MacMillan Co.}, location = {London -- New York} } @MVBook{HomerMurray, author = {{Homer}}, title = {The Odyssey}, date = 1919, entrysubtype = {primary}, editor = {Murray, A. T.}, volumes = 2, publisher = {Harvard University Press -- William Heinemann}, location = {Cambridge, MA. -- London} } @Book{McDonald1916, author = {Shakespeare}, editor = {MacDonald Alden, Raymond}, shorteditor = {MacDonald}, title = {The Sonnets}, date = 1916, entrysubtype = {primary}, titleaddon = {From the Quarto of 1609 with Variorum Readings and Commentary}, organization = {Houghton Mifflin Co.}, publisher = {The Riverside Press Cambridge}, location = {Boston \& New York} } @Book{ReynoldsWilson1991, author = {Reynolds, L. D. and Wilson, N. G.}, title = {Scribes and Scholars}, year = {1991}, subtitle = {A Guide to the Translation of Greek and Latin Literature}, edition = {3}, publisher = {Clarendon Press}, location = {Oxford} } @Book{West1973, author = {West, Martin L.}, title = {Textual Criticism and Editorial Technique}, date = 1973, titleaddon = {Applicable to Greek and Latin Texts}, publisher = {B. G. Teubner}, location = {Stuttgart} } @Online{DLL-TC, author = {{Digital Latin Library}}, title = {Textual Criticism}, url = {https://digitallatin.org/library-digital-latin-texts/textual-criticism}, urldate = {2020-05-24} } @Online{Mastronarde.Tarrant2017, author = {Mastronarde, Donald J. and Tarrant, Richard J.}, title = {Review: Guidelines for Encoding Critical Editions for the Library of Digital Latin Texts}, date = {2017-12-04}, url = {https://classicalstudies.org/scs-blog/donald-j-mastronarde/review-guidelines-encoding-critical-editions-library-digital-latin}, organization = {Society for Classical Studies} } @Online{TBE, author = {Van den Branden, Ron and Terras, Melissa and Vanhoutte, Edward}, title = {TEI by Example}, urldate = {2020-08-04}, url = {http://www.teibyexample.org} } @Software{babel, title = {The Babel package}, titleaddon = {Multilingual support for Plain TeX or LaTeX}, author = {Bezos López, Javier and Braams, Johannes L.}, url = {http://www.ctan.org/pkg/babel}, date = {2020-07-13}, version = {3.47} } @Software{extdash, title = {The Extdash package}, titleaddon = {A range of dash commands for compound words}, author = {Rozhenko, Alexander I.}, url = {http://www.ctan.org/pkg/extdash}, date = {2018-06-24}, version = {1.3} } @Software{fgruler, title = {The Fgruler package}, titleaddon = {Draw rulers on the foreground or in the text}, author = {Tómács, Tibor}, url = {https://ctan.org/pkg/fgruler}, date = {2022-06-25}, version = {1.5}, } @Software{fnpos, title = {The Fnpos package}, titleaddon = {Control the position of footnotes on the page}, author = {Nakashima, Hiroshi}, url = {http://www.ctan.org/pkg/fnpos}, date = {2018-09-03}, version = {1.0} } @Software{footmisc, title = {The Footmisc package}, titleaddon = {A range of footnote options}, author = {Mittelbach, Frank and Fairbairns, Robin}, url = {https://ctan.org/pkg/footmisc}, date = {2022-05-26}, version = {6.0e}, } @Software{keyfloat, title = {The Keyfloat package}, titleaddon = {Provides a key/value interface for generating floats}, author = {Dunn, Brian}, url = {https://ctan.org/pkg/keyfloat}, date = {2021-06-29}, version = {2.06}, } @Software{lineno, title = {The Lineno package}, titleaddon = {Line numbers on paragraphs}, author = {Lück, Uwe and Böttcher, Stephan}, url = {http://www.ctan.org/pkg/lineno}, date = {2005-11-02}, version = {4.41} } @Software{memoir, title = {The Memoir package}, titleaddon = {Typeset fiction, non-fiction and mathematical books}, author = {Madsen, Lars and Wilson, Peter R.}, url = {http://www.ctan.org/pkg/memoir}, date = {2021-03-23}, version = {3.7o} } @Software{marginnote, title = {The Marginnote package}, titleaddon = {Notes in the margin, even where \textbackslash marginpar fails}, author = {Kohm, Markus}, url = {https://komascript.de/marginnote}, date = {2018-08-09}, version = {1.4b}, } @Software{paracol, title = {The Paracol package}, titleaddon = {Multiple columns with texts “in parallel”}, author = {Nakashima, Hiroshi}, url = {http://www.ctan.org/pkg/paracol}, date = {2018-12-31}, version = {1.35} } @Software{polyglossia, title = {The Polyglossia package}, titleaddon = {An alternative to babel for XeLaTeX and LuaLaTeX}, author = {Charette, François and Reutenauer, Arthur}, url = {http://www.ctan.org/pkg/polyglossia}, date = {2020-04-08}, version = {1.49} } @Software{tcolorbox, title = {The Tcolorbox package}, titleaddon = {Coloured boxes, for LaTeX examples and theorems, etc}, author = {Sturm, Thomas F.}, url = {https://ctan.org/pkg/tcolorbox}, date = {2021-06-14}, version = {4.51}, } @Software{titleps, title = {The Titleps package}, titleaddon = {Page style control}, author = {Bezos López, Javier}, url = {https://ctan.org/pkg/titleps}, date = {2019-10-16}, version = {2.13} } @Software{verse, title = {The Verse package}, titleaddon = {Aids for typesetting simple verse}, author = {Wilson, Peter R. and Robertson, Will}, url = {http://www.ctan.org/pkg/verse}, date = {2014-05-10}, version = {2.4b} } @Software{xparse, title = {The Xparse package}, titleaddon = {A generic document command parser}, author = {{The LaTeX Team}}, url = {https://ctan.org/pkg/xparse}, date = {2022-01-12}, } @Software{arabluatex, title = {The Arabluatex package}, titleaddon = {ArabTeX for LuaLaTeX}, author = {Alessi, Robert}, url = {http://ctan.org/pkg/arabluatex}, date = {2020-03-23}, version = {1.20} } @Software{icite, title = {The Icite package}, titleaddon = {Indices locorum citatorum}, author = {Alessi, Robert}, url = {http://ctan.org/pkg/icite}, date = {2020-03-05}, version = {1.3a} } @Software{oldstandard, title = {Old Standard}, subtitle = {A Unicode Font for Classical and Medieval Studies}, titleaddon = {Based on Alexey Kryukov's original Old Standard}, author = {Alessi, Robert}, url = {http://ctan.org/pkg/oldstandard}, date = {2020-12-18}, version = {2.6} } @Software{arabtex, title = {The Arabtex package}, titleaddon = {Macros and fonts for typesetting Arabic}, author = {Lagally, Klaus}, url = {http://baobab.informatik.uni-stuttgart.de/ifi/bs/research/arab_e.html}, date = {2004-03-11}, version = {4.00} } \end{filecontents} \begin{filecontents}[overwrite]{\jobname-ekd.cfg} %% ekdosis:--- \footnotelayout{m} \SetCritSymbols{suppbegin = ⟨,suppend = ⟩} \EnvtoTEI{ancientgreek}{p}[xml:lang="grc"] \DeclareApparatus{fontium}[ delim=\hskip0.75em, bhook=\textbf{Sources:}] \DeclareApparatus{default}[ delim=\hskip0.75em] \DeclareApparatus{ltr}[ delim=\hskip0.75em] \DeclareApparatus{rtl}[ direction=RL, delim=\hskip0.75em] \DeclareWitness{M}{M}{\emph{Marcianus Gr.} 269}[ settlement=Venice, institution=Marciana Library, msName=Marcianus Gr., idno=269, origDate=s. X] \DeclareHand{M1}{M}{M\textsuperscript{1}}[Emendatio scribae ipsius] \DeclareHand{M2}{M}{M\textsuperscript{2}}[Manus posterior] % Peter and John Story: \DeclareWitness{pjA}{A}{Manuscript A Call No 123} \DeclareWitness{pjB}{B}{Manuscript B Call No 456} \DeclareWitness{pjC}{C}{Manuscript C Call No 789} % Caesar's Gallic War: \DeclareWitness{cA}{A}{\emph{Bongarsianus} 81}[ msName=Bongarsianus, settlement=Amsterdam, idno=81, institution=University Library, origDate=s. IX--X] \DeclareHand{cA1}{cA}{A\textsuperscript{1}}[\emph{Emendationes scribae ipsius}] \DeclareWitness{cM}{M}{\emph{Parisinus Lat.} 5056}[ origDate={s. XII}] \DeclareWitness{cB}{B}{\emph{Parisinus Lat.} 5763}[ origDate={s. IX--X}] \DeclareWitness{cR}{R}{\emph{Vaticanus Lat.} 3864}[ origDate={s. X}] \DeclareWitness{cS}{S}{\emph{Laurentianus} R 33}[ origDate={s. X}] \DeclareWitness{cL}{L}{\emph{Londinensis} Br. Mus. 10084}[ origDate={s. XI}] \DeclareWitness{cN}{N}{\emph{Neapolitanus} IV, c. 11}[ origDate={s. XII}] \DeclareWitness{cT}{T}{\emph{Parisinus Lat.} 5764}[ origDate={s. XI}] \DeclareWitness{cf}{\emph{f}}{\emph{Vindobonensis} 95}[ origDate={s. XII}] \DeclareWitness{cU}{U}{\emph{Vaticanus Lat.} 3324}[ origDate={s. XI}] \DeclareWitness{cl}{\emph{l}}{\emph{Laurentianus} Riccard. 541}[ origDate={s. XI--XII}] \DeclareShorthand{ca}{α}{cA,cM,cB,cR,cS,cL,cN} \DeclareShorthand{cb}{β}{cT,cf,cU,cl} % Hippocrates Epidemics, Book 2: \DeclareWitness{hV}{V}{\emph{Vaticanus Gr.} 276} \DeclareWitness{hI}{I}{\emph{Parisinus Gr.} 2140} \DeclareHand{hIac}{hI}{I\textsuperscript{ac}}[Lectio ante correctionem] \DeclareHand{hIpc}{hI}{I\textsuperscript{pc}}[Lectio post correctionem] \DeclareWitness{hR}{R}{\emph{Vaticanus Gr.} 277} \DeclareWitness{hH}{H}{\emph{Parisinus Gr.} 2142} \DeclareWitness{hGalE1.Q}{Gal.E1(Q)}{\emph{Parisinus Gr.} 2174}[origDate=s. XIV] \DeclareWitness{hGalE1.M}{Gal.E1(M)}{\emph{Monacencis Gr.} 231}[origDate=s. XVI] \DeclareShorthand{hGalE1.M.Q}{Gal.E1(MQ)}{hGalE1.M,hGalE1.Q} \DeclareSource{Lit}{Littré} \DeclareSource{Erm}{Ermerins} \DeclareSource{Sm}{Smith} \DeclareSource{Gal}{Gal.} \DeclareScholar{ego}{ego}[ forename=Robert, surname=Alessi] \DeclareShorthand{egomute}{\unskip}{ego} \DeclareShorthand{hcodd}{codd.}{hV,hI,hR,hH} \DeclareShorthand{hedd}{edd.}{Lit,Erm,Sm} \DeclareShorthand{hegoscr}{\emph{scripsi}}{ego} % Silius Italicus' Punica, IX, 30--2: \DeclareWitness{sL}{L}{Laurentianus, plut, XXXVII, cod. 16}[ origDate=s. XV] \DeclareWitness{sF}{F}{Florentianus, Bibl. Aed. Fl. Eccl. CXCVI}[ origDate=s. XV] \DeclareWitness{sO}{O}{Oxoniensis Collegii Reginensis CCCXIV}[ origDate=s. XV] \DeclareWitness{sV}{V}{Vaticanus lat. 1652}[ origDate=s. XV] \DeclareSource{sDrak}{\emph{Drakenborch}} % Homer, Odyssey \DeclareScholar{hZen}{Zen.}[rawname=Zenodotus] % Shakespeare's Sonnets: \NewDocumentEnvironment{ekdcenter}{}{\par\centering}{\nobreak\par} \NewDocumentCommand{\ekdlettrine}{mm}{% \adjustbox{valign=t,raise=-0.75ex}{\Huge #1}\textsc{#2}% } \TeXtoTEIPat{\ekdlettrine {#1}{#2}}{#1#2} \DeclareSource{shGildon1710}{G} \DeclareSource{shGildon1714}{G\textsuperscript{2}} \DeclareSource{shSewell1725}{S} \DeclareSource{shEwing1771}{E} \DeclareSource{shHudson1856}{Hu\textsuperscript{2}} \DeclareSource{shButler1899}{But} \DeclareSource{shWalsh1908}{Wa} \DeclareScholar{shGod}{Godwin}[rawname=Godwin] \DeclareScholar{shStee}{Stee}[rawname=Steevens, note=Notes in Malone] % Cicero, ad Atticum, VII.9.4 \DeclareWitness{cicC}{C}{Lectiones quas Cratander in margine editionis, quae a. 1528 Basileae prodiit, adscripsit} \DeclareWitness{cicΩ}{Ω}{Consensus codicum Σ et Δ uel archetypum codicum Italicorum} \end{filecontents} \documentclass{ltxdoc} %\usepackage[letterpaper,margin=25mm,left=50mm,nohead]{geometry} \usepackage[letterpaper,margin=1.25in,left=50mm,nohead]{geometry} %^^A dox does not work with the latest latex-dev: \ifdefined\SpecialMacroIndex \NewDocElement{Option}{option} \NewDocElement[printtype=\textit{cnt.}]{Counter}{counter} \else \usepackage{dox} \doxitem{Option}{option}{options} \doxitem{Counter}{counter}{counter} \fi \usepackage{fontspec} \defaultfontfeatures{Renderer=Harfbuzz} \usepackage{microtype} \usepackage[latin.classic,greek.ancient,american]{babel} \babelfont{rm}[RawFeature=onum]{Old Standard} \babelfont{sf}{NewComputerModernSans10} \babelfont{tt}{NewComputerModernMono10} \babelfont[greek]{rm}[Script=Greek, RawFeature={+ss06;onum}] {Old Standard} \newfontfamily{\junicode}{Junicode}[ Ligatures=TeX, RawFeature={+hist;+dlig}] \newfontfamily\missaali{Missaali Regular} \babeltags{ancientgreek = greek} \def\sg#1{\textancientgreek{#1}} \usepackage[biblatex=true]{embrac} \usepackage[nospace,american]{varioref} \usepackage{addlines} \newcommand\phts{\phantomsection} \usepackage{chifoot} \usepackage{savefnmark} \usepackage{menukeys} \usepackage{nameref} \usepackage{arabluatex} \usepackage[parnotes=roman, teiexport=tidy, poetry=verse]{ekdosis} \makeatletter \NewDocumentCommand{\ekdelide}{m}{% \IfSubStr{#1}{--}{% \StrBefore{#1}{--}[\@before]% \StrBehind{#1}{--}[\@behind]% \luadirect{tex.sprint(ekdosis.numrange( \luastring{\@before}, \luastring{\@behind}))}}{#1}} \makeatother \AddxmlBibResource{bibdata.xml} \usepackage{booktabs} \usepackage{xltabular} \usepackage[prevent-all]{widows-and-orphans} \usepackage[shortcuts,nospacearound]{extdash} \usepackage[american]{isodate} \usepackage{nextpage} \usepackage{spacingtricks} \usepackage{csquotes} \usepackage{relsize} \usepackage{enumitem} \setlist{nosep} \setlist[itemize]{label=\textendash} \setlist[enumerate,1]{label=(\alph*)} \newlist{remarks}{enumerate}{10} \setlist[remarks]{ label*=\textsc{Rem.} \arabic*, left=0.25in, before=\smaller} \usepackage{manfnt} \usepackage{lettrine} \newcommand\danger{\lettrine[loversize=-.5]{\textdbend}{\hskip6pt}} \newcommand\mansee{\lettrine[loversize=-.4, lraise=.55]{\mantriangleright}{\hskip6pt}} \usepackage{metalogox} \usepackage{hologo} \usepackage{xcolor} \newbool{nocolordoc} \definecolor{ekdcolor}{RGB}{243,241,235} \definecolor{cinnamon}{rgb}{0.82, 0.41, 0.12} \definecolor{lavender}{RGB}{152,115,172} \ifbool{nocolordoc}{ \colorlet{ekdcolor}{white} \colorlet{cinnamon}{black} \colorlet{lavender}{gray}}{} \definecolor{gainsboro}{RGB}{222,222,222} \PassOptionsToPackage{bookmarks=true}{hyperref} \usepackage[numbered]{hypdoc} \usepackage[titlematter,loadlang=en|de|fr|es]{metastr} \hypersetup{ colorlinks, allcolors=cinnamon, linktocpage=true, pdftype={Text} } \labelformat{section}{sect.~#1} \labelformat{subsection}{sect.~#1} \labelformat{subsubsection}{sect.~#1} \labelformat{figure}{fig.~#1} \usepackage[defaultindex=none,citecmd=autocite]{icite} \bibinput{ekdosis} \newcommand\vnref[1]{\vref{#1}, \enquote{\nameref{#1}}} \newcommand\lnref[1]{\getrefnumber{#1}} \usepackage[style=oxnotes-inote,dashed]{biblatex} \usepackage{uri} \usepackage[obeyspaces]{xurl} \DefineBibliographyStrings{english}{ seenote={cf\adddotspace n\adddotspace}} \DeclareSourcemap{ \maps[datatype=bibtex]{ \map{ \step[fieldsource=issuetitle] \step[fieldset=journalsubtitle,origfieldval] } } } % include seenote in parentheses \renewbibmacro*{footcite:note}{% \ifnameundef{labelname} {\printfield{label}} {\printnames{labelname}}% \ifsingletitle {} {\setunit*{\printdelim{nametitledelim}}% \printfield[title]{labeltitle}}% \setunit*{\addspace}% \printtext{% \mkbibparens{% \bibstring{seenote}\addnbspace \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}% \iftoggle{cbx:pageref} {\ifsamepage{\the\value{instcount}} {\csuse{cbx@f@\thefield{entrykey}}} {} {\addcomma\space\bibstring{page}\addnbspace \pageref{cbx@\csuse{cbx@f@\thefield{entrykey}}}}} {}}}} \ifbool{nocolordoc} { \usepackage{academicons} \def\oasymbol{\aiOpenAccess} \usepackage{biblatex-ext-oa} } {\usepackage[symbolpackage=tikz]{biblatex-ext-oa}} \DeclareDelimFormat[bib,biblist]{nametitledelim}{\addcomma\space} \DeclareDelimFormat[bib,biblist]{innametitledelim}{\addcomma\space} \renewcommand*\newunitpunct{\addcomma\space} \newcommand*{\halurl}[1]{http://hal.archives-ouvertes.fr/#1} \DeclareFieldFormat{eprint:hal}{% \ifhyperref {\href{\halurl{#1}}{hal:~\nolinkurl{#1}}} {hal:~\nolinkurl{#1}}} \DeclareFieldAlias{eprint:HAL}{eprint:hal} \DeclareOpenAccessEprintUrl[always]{hal}{% http://hal.archives-ouvertes.fr/\thefield{eprint}} \DeclareOpenAccessEprintAlias{HAL}{hal} \newcommand*{\jdmdhurl}[1]{https://jdmdh.episciences.org/#1} \DeclareFieldFormat{eprint:jdmdh}{% \ifhyperref {\href{\jdmdhurl{#1}}{jdmdh:~\nolinkurl{#1}}} {jdmdh:~\nolinkurl{#1}}} \DeclareFieldAlias{eprint:JDMDH}{eprint:jdmdh} \DeclareOpenAccessEprintUrl[always]{jdmdh}{% https://jdmdh.episciences.org/\thefield{eprint}} \DeclareOpenAccessEprintAlias{JDMDH}{jdmdh} \addbibresource{ekdosis.bib} \metaset{titletext}{% \metapick[#1]{title}% \metacompose[#1]{subtitle}{\metaget[sep]{subtitle}}{}{}} \metaset[print]{titletext}{% \metatitleline[print]{title}% \metatitleline[print]{subtitle}% \metatitleline[print]{author}% \metatitleline[print]{contactemail}% \metatitlelinetwo[print]{date}[print]{draft}} \metaset[skip]{subtitle}{\vspace{1ex}} \metaset[skip]{author}{\vspace{2ex}} \metaset[skip]{date}{\vspace{1ex}} \metaset[style]{title}{\LARGE} \metaset[style]{author}{\large} \metaset[sep]{draft}{ -- } \metasetlang{en-US} \metaset{title}{ἔκδοσις} \metaset[print]{title}{\href{http://www.ekdosis.org}{\eKd}\hfill ἔκδοσις\hfill\phantom{\eKd}} \metaset{date}{\filedate} \metaset{draft}{\fileversion} \metaset{subject}{TEI xml-compliant critical editions} \metaset{subtitle}{Typesetting TEI xml-Compliant Critical Editions} \metaset[print]{subtitle}{Typesetting \texttt{TEI xml}-Compliant Critical Editions} \metaset{author}{Robert Alessi} \metaset{keywords}{LaTeX, Lua, TEI xml, multilingual critical editions, alignment, segmentation} \metaset{contactemail}{alessi@roberalessi.net} \metaset[print]{contactemail}{\mailto[ekdosis]{alessi@robertalessi.net}} \metaset{contacturl}{http://www.roberalessi.net} \metaset{partof}{The ekdosis Package} \metaset[print]{partof}{The \textsf{ekdosis} Package} \metaset[altlang]{rightstext}{en,de,fr,es} \metaset[fr]{partofmessage}{% Ce document fait partie de l'œuvre: \metapick[#1]{partof}.} \metaset[es]{partofmessage}{% Este documento forma parte de la obra: \metapick[#1]{partof}.} \metaset[es]{licenseurlmessage}{% Para ver una copia de esta licencia, siga el vínculo: \metapick[#1]{licenseurl}.} \metaset{copyrightowner}{\metapick[#1]{author}} \metaset{copyrightdate}{2020, 2021, 2022, 2023} \metaset{licensemessage}{Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.} \metaset{licenseurl}{% https://cvsweb.openbsd.org/src/share/misc/license.template?rev=HEAD} \metaset[print]{licenseurl}{% \url{https://cvsweb.openbsd.org/src/share/misc/license.template?rev=HEAD}} \metawritepdfinfo \metawritepdfaux \metawritepdfpreamble \metawritepdfcontact \metawritepdfrights \usepackage{multicol} \setlength\IndexMin{100pt} \usepackage{tocloft} \newlistof{listing}{lol}{List of listings} \renewcommand\cfttocprehook{\begin{multicols}{2}} \renewcommand\cfttocposthook{\end{multicols}} \renewcommand\cfttoctitlefont{\Large\bfseries} \renewcommand\cftlolprehook{\begin{multicols}{2}} \renewcommand\cftlolposthook{\end{multicols}} \renewcommand\cftloltitlefont{\Large\bfseries} \usepackage{units} \newcommand*\tred[1]{\textcolor{red}{#1}} \usepackage{fbox} \usepackage{tikz} \usetikzlibrary{tikzmark} \NewDocumentCommand{\pointto}{m}{% \tikz[remember picture] \draw[>->,color=blue,overlay] (0em,0.5ex) to ([shift={(0.5em,0pt)}]pic cs:#1);% \tikz[remember picture] \draw[color=gray, overlay] ([shift={(0.5em,0.5ex)}]pic cs:#1) circle [radius=8pt];} \NewDocumentCommand{\pointtol}{m}{% \tikz[remember picture] \draw[>->,color=blue,overlay] (0em,0.5ex) to [bend left] ([shift={(0.5em,0pt)}]pic cs:#1);% \tikz[remember picture] \draw[color=gray, overlay] ([shift={(0.5em,0.5ex)}]pic cs:#1) circle [radius=8pt];} \NewDocumentCommand{\pointtor}{m}{% \tikz[remember picture] \draw[>->,color=blue,overlay] (0em,0.5ex) to [bend right] ([shift={(0.5em,0pt)}]pic cs:#1);% \tikz[remember picture] \draw[color=gray, overlay] ([shift={(0.5em,0.5ex)}]pic cs:#1) circle [radius=8pt];} \NewDocumentCommand{\pointtoer}{m}{% \tikz[remember picture] \draw[>->,color=blue,overlay] (0em,0.5ex) to [bend right] ([shift={(0em,0pt)}]pic cs:#1);% \tikz[remember picture] \draw[color=gray, overlay] ([shift={(-0.5em,0.5ex)}]pic cs:#1) ellipse [x radius=45pt, y radius=6pt];} \usepackage[breakable, skins, xparse]{tcolorbox} \tcbset{colback=white, boxrule=0.4pt, colframe=cinnamon, breakable} \usepackage[newfloat]{minted} \labelformat{listing}{listing~#1} \ifbool{nocolordoc}{\usemintedstyle{bw}}{} \setminted{bgcolor=ekdcolor,linenos, fontsize=\small} \newminted[ekdlua]{lua}{bgcolor={}, linenos, fontsize=\relsize{-0.5}, xleftmargin=12pt, breaklines, numberblanklines=false, numbersep=3pt} \renewcommand{\theFancyVerbLine}{\normalfont\smaller\arabic{FancyVerbLine}} \usepackage[contents]{colordoc} \newcommand{\cls}[1]{\textsf{#1}\index{#1=#1 (class)}} \newcommand{\pkg}[1]{\textsf{#1}\index{#1=#1 (package)}} \newcommand{\env}[1]{\texttt{#1}\index{#1=#1 (environment)}} \backgroundcolor{c}{ekdcolor} \usepackage{caption} \captionsetup[listing]{position=above,skip=-1ex} \usepackage{needspace} \NewDocumentCommand{\captof}{O{listing} m O{}}{% \bgroup \nobreak \vskip 1ex plus 2pt minus 2pt% \captionof{#1}{#2}% #3% \egroup} \NewDocumentCommand{\newfeature}{o}{% \leavevmode \IfNoValueTF{#1} {\marginpar{\hfill\emph{New feature}}} {\marginpar{\hfill\emph{New feature} #1}}% \ignorespaces } % \usepackage{etoc} % \etocsettocdepth{paragraph} % \newcommand{\ekdtableofcontents}{% % \begingroup % \etocsetstyle{section}{}{} % {\etocsavedsectiontocline{% % \numberline{\etocnumber}\etocname}{\etocpage}}{} % \etocsetstyle{subsection}{}{} % {\etocsavedsubsectiontocline{% % \numberline{\etocnumber}\etocname}{\etocpage}}{}% % \etocsetstyle{subsubsection}{}{} % {\etocsavedsubsubsectiontocline{% % \numberline{\etocnumber}\etocname}{\etocpage}}{}% % \etocsetstyle{paragraph}{}{\leftskip2cm\rightskip 2.2em \parfillskip % 0pt plus 1fil\relax \nobreak} % {\noindent\etocname{} \etocpage{} }{\par}% % \etocmulticolstyle[2]{\section*{Contents}} % \pdfbookmark[1]{Contents}{toc} % \tableofcontents % \endgroup} \EnableCrossrefs \CodelineIndex \RecordChanges %\OnlyDescription \begin{document} \DocInput{\jobname.dtx} \PrintChanges \PrintIndex \end{document} % % \fi % % \CheckSum{0} % % \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 % Lower-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 % Digits \0\1\2\3\4\5\6\7\8\9 % Exclamation \! Double quote \" Hash (number) \# % Dollar \$ Percent \% Ampersand \& % Acute accent \' Left paren \( Right paren \) % Asterisk \* Plus \+ Comma \, % Minus \- Point \. Solidus \/ % Colon \: Semicolon \; Less than \< % Equals \= Greater than \> Question mark \? % Commercial at \@ Left bracket \[ Backslash \\ % Right bracket \] Circumflex \^ Underscore \_ % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % % \GetFileInfo{\jobname.dtx} % \DoNotIndex{\newcommand,\newenvironment,\begin,\begingroup} % \DoNotIndex{\bgroup,\def,\edef,\egroup,\else,\expandafter,\endgroup} % \DoNotIndex{\fi,\ifdefined,\luadirect,\luastring,\luastringN} % \DoNotIndex{\luastringO,\NewDocumentCommand,\space,\unexpanded} % % \pdfbookmark[1]{\metaterm{title}}{title} % \begin{tcolorbox}[ % colframe=black, % enhanced, % drop lifted shadow, % colback=white, % boxrule=.25mm, % halign=center, % center % ] % \metapick[print]{titletext} % \end{tcolorbox} % % \tableofcontents % \listoflistings % % \changes{v0.99a}{2020/07/08}{First public release (documentation in % progress)} % \changes{v1.0}{2020/08/14}{Documentation complete} % % \begin{abstract} % \pkg{ekdosis} is a Lua\LaTeX{} package designed for multilingual % critical editions. It can be used to typeset texts and different % layers of critical notes in any direction accepted by % Lua\TeX. Texts can be arranged in running paragraphs or on facing % pages, in any number of columns which in turn can be synchronized % or not. In addition to printed texts, \pkg{ekdosis} can convert % \texttt{.tex} source files so as to produce \texttt{TEI % xml}-compliant critical editions. Database-driven encoding under % \LaTeX{} then allows extraction of texts entered segment by % segment according to various criteria: main edited text, variant % readings, translations or annotated borrowings between texts. It % is published under the terms of the OpenBSD license. % \end{abstract} % % \section*{License and Disclaimer} % \addcontentsline{toc}{section}{License and disclamer} % \label{sec:license-software} % % \pkg{ekdosis} --- \metapick[print]{subtitle} % \metapick[print]{copyrightstatement} % % \leavevmode\marginpar{\hfill\texttt{OpenBSD}} \pkg{ekdosis} is % licensed under the terms of the so-called OpenBSD license, as it is % modelled after the ISC copyright, which is functionally equivalent % to a two-term BSD copyright with language removed that is made % unnecessary by the Berne convention.\footnote{More information about % the OpenBSD policy to which \pkg{ekdosis} adheres: % \url{https://www.openbsd.org/policy.html}.} % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{text} ekdosis -- Typesetting TEI xml-Compliant Critical Editions ---------------------------------------------------------- Copyright (c) 2020, 2021, 2022, 2023 Robert Alessi Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. \end{minted} % \iffalse % % \fi % % Please send error reports and suggestions for improvements to Robert % Alessi: % \begin{itemize} % \item email: % \mailto[ekdosis package]{Robert Alessi } % \item website: \url{http://www.ekdosis.org} % \item development: \url{http://git.robertalessi.net/ekdosis} or\\ % \phantom{development:} \url{https://sr.ht/~ralessi/ekdosis} % \item comments, feature requests, bug reports: % \url{http://www.ekdosis.org/issues} % \end{itemize} % % This release of \pkg{ekdosis} consists of the following % source files: % \begin{itemize} % \item |ekdosis.ins| % \item |ekdosis.dtx| % \item |ekdosis.el| % \item |Makefile| % \end{itemize} % % \DescribeMacro{\eKd} \newfeature[v1.5] The distinctive emblem of % \pkg{ekdosis} is made of the three Greek letters \sg{ε}, \sg{κ} and % \sg{δ}, like so: \eKd. Provided that the font used includes these % Unicode glyphs, it is produced by the command \cs{eKd} and best % printed with the \emph{Old Standard} Greek % font.\footcite{oldstandard} % % \section{Introduction} % \label{sec:introduction} % \begin{comment} % \begin{keyfigure}{l={fig:grid-typesetting},c={Grid Typesetting % (which never came into existence)}, t={Each square in the grid % has a side length of \unit[10]{pt}. Therefore, the distance % between the last line of the text and the first line of the % apparatus is here approximately \unit[25]{pt}.}} % \centering % \begin{tikzpicture} % \draw[gainsboro,thin] (0.5,0.5) grid [step=10pt] (10,5); % % \path node [align=justify, text width=8cm] at (5.5,3) {% % I saw my friend Peter at the station yesterday. We were both % in a great mood. \enquote{How nice to find you here!} he % said. I chuckled to myself, recalling the last time we % met.\par % \rule{3cm}{0.01cm}\par\footnotesize% % \textbf{1}~saw A] met B\hskip1em Peter A] John B \hskip1em % \textbf{2}~great A] good B\hskip1em \textbf{2--3}~How % nice... said A] \emph{om.} B\hskip1em \textbf{4} \emph{post} % met \emph{add.} there B.}; \node at (0,3) {\scriptsize % $\approx$ \unit[25]{pt}}; \draw [->] (0,2.875) -- (0,2.025); % \end{tikzpicture} % \end{keyfigure} % \end{comment} % % \lettrine{\color{cinnamon}\missaali +T+}{he reader} will find here, % by way of introduction, a summarized version of the first part of an % article published in the % \mkbibemph{\citefield{Alessi2020}{journaltitle}} as a contribution % to a Digital Humanities workshop held at Stanford University % (\printdate{2019-04-15}).\footcite{Alessi2020} % % The name of this package, \pkg{ekdosis}, derives from a Greek % action noun\---\sg{ἔκδοσις}\---the meaning of which is: % \enquote{publishing a book}, and also in concrete sense: \enquote{a % publication, treatise}. For us moderns, this term refers to a long % tradition of scholarly work consisting in establishing from % manuscript evidence the texts of Greek and Latin classics that were % handled down through the Middle Ages to the time of the first % printed editions. Of course, this definition is extendible to other % languages as well. The basic premise is that critical editions % exhibit reconstructed texts from manuscript evidence either under % the title of the edited text (direct tradition) or from explicit % citations or parallel passages or translations in other languages % (indirect tradition). % % Whether in print or digital, critical editions come with an % apparatus criticus in which is mentioned all the evidence that was % used to build the edited text. Arguably, it is precisely on this % common point that the two kind of editions part ways for reading a % traditional, well written apparatus criticus is only meant for % experienced readers. Getting oneself familiarized with its many % conventional rules is not unrelated to learning a language, equipped % with technical terms, grammar rules and style embellishments, which % came into existence out of over three centuries of scholarly % attainments. Nevertheless, whereas this language is immediately % accessible to human mind's ability to use language and interpret % conventional symbols, it is quite inaccessible to a computer unless % every item of information has been encoded in the rather dumb format % that is suited to machines. % % On the other hand, editions in print have their own limitations. For % example, every detail that editors of classical texts decide to % discard to save space, regardless to its relevance to the purpose of % the edition, is lost permanently as in the case of dialectal % coloring of ancient books. Furthermore, passages collected as % indirect tradition are only available as references in the % \emph{apparatus testium} and cannot be referred to the original % text. As a result, the reader is refrained from bestowing attention % upon major parallel passages to understand better difficult passages. % % To conclude on these issues, print publications and digital editions % are often contrasted as they belonged to two different % worlds.\footnote{For a good illustration of this point, see % \cite[\mkbibquote{Content, not Display}]{DLL-TC}.} It is commonly % said that the content of editions in print is the result of the % binding of the book itself as an object, whereas digital editions, % in which format and presentation are by definition separated from % content, are free from limitations coming from such bindings. To sum % up from the foregoing considerations, this statement is likely to be % qualified: as already seen above, the apparatus criticus must be % looked at as a brilliant production of mind refined by centuries of % scholarly tradition\---and surely tradition must go on\---arguably % not as compact paragraphs that require special and painful training % to be \enquote*{decoded}. On the other hand, what editions in print % do not provide are what \citename{Mastronarde.Tarrant2017}{author} % have called \enquote{actionable texts for use in digital research},% % {\interfootnotelinepenalty=10000\footcite{Mastronarde.Tarrant2017}} % namely database-driven texts allowing the reader to select % annotations and display or arrange translations, parallel passages % or borrowings in a variety of ways. % % \pkg{ekdosis} can be seen as an attempt at combining the two % approaches. % % \subsection{Requirements} % \label{sec:requirements} % Please refer to \vref{ref:ekdrequirements}. % % \subsection{Features} % \label{sec:features} % A list of the main features of \pkg{ekdosis} follows:--- % \begin{enumerate} % \item \phts\label{it:multicol-feature}\emph{Multilingual critical % editions\/}: \pkg{ekdosis} can be used to typeset any number of % texts in any direction accepted by \hologo{LuaTeX}. Running % paragraphs of text can be arranged in any number of columns, % either on single or facing pages, which in turn can be % synchronized or not. \pkg{ekdosis} is also suitable for complex % layouts as in the case of Arabic poetry or images where three-way % alignment is required, or diagrams, \emph{\&c}. % \item \phts\label{it:multilayer-feature}\emph{Apparatus criticus\/}: % Edited texts can receive multiple layers of apparatus, e.g.\ % apparatus criticus (to record variant readings), apparatus fontium % (to collect references to texts quoted or cited in the edited % text), apparatus testium (to collect testimonia or parallel % passages), or any kind of short notes to be printed on the same % page as the edited text, \emph{\&c}. % \item \texttt{TEI xml} output: \pkg{ekdosis} can be instructed to % output both PDF and \texttt{TEI xml} files at the same time. % \item \emph{Database-driven encoding} under \LaTeX{} of texts % entered segment by segment allows for alignment of parallel texts % from multilingual corpora. % \end{enumerate} % % Before going into detail, the following simple example will give the % reader a general idea of the method of encoding with % \pkg{ekdosis} authoritative texts composed of lemmata, in a way % that is very close to \texttt{TEI xml} encoding:--- % % \captof{The \enquote{Peter/John} basic example}[\label{lst:pj1}] % \iffalse %<*example> % \fi \begin{minted}[escapeinside=++]{latex} \begin{ekdosis} +\label{ln:pj1:1}+ I \app{ +\label{ln:pj1:3}+ \lem{saw} \rdg{met} +\label{ln:pj1:5}+ } my friend \app{\lem{Peter}\rdg{John}} at the station yesterday. +\label{ln:pj1:7}+ \end{ekdosis} +\label{ln:pj1:8}+ \end{minted} % \iffalse % % \fi % % PDF output:--- % \medskip % % \needspace{7\baselineskip} % \begin{alignment}[flush,tcols=1,texts=specimen,apparatus=specimen] % \begin{specimen} % I % \app{ % \lem{saw} % \rdg{met} % } % my friend % \app{ % \lem{Peter} % \rdg{John} % } % at the station yesterday. % \end{specimen} % \end{alignment} % % \texttt{TEI xml} output:--- % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml}

I saw met my friend Peter John at the station yesterday.

\end{minted} % \iffalse % % \fi % % As can be seen from \vref{lst:pj1}, the edition text is inserted in % the \env{ekdosis} environment (ll.~\lnref{ln:pj1:1} to % \lnref{ln:pj1:8}). Then two \cs{app}\marg{apparatus entry} % commands (ll.~\lnref{ln:pj1:3} and \lnref{ln:pj1:7}) % contain the lemma (\cs{lem}\marg{lemma}), namely the reading that is % accepted by the editor, and at least one variant reading % (\cs{rdg}\marg{reading}, ll.~\lnref{ln:pj1:5} and % \lnref{ln:pj1:7}). As the listing shows, the editor is free % to lay out the code in a legible manner to the eye: the first lemma % above spans several lines whereas the second one is written in % sequence without spaces. % % In the PDF output, the edition text is printed in the upper part of % the page, above the line, and naturally shows the accepted % readings. The margins are used for numeration. In the apparatus % criticus, below the line, reference to the text is made by % specifying the number of the line and if several entries refer to % the same line, numbers are not repeated. Instead, entries are % separated from one another by a broad horizontal space. Finally, a % square bracket is used inside entries to distinguish the lemma from % the variant readings. % % Furthermore, as said above, if a \texttt{TEI xml} output be % required, \pkg{ekdosis} compiles an additional |.xml| file an % excerpt of which is provided above. % % \section{The Basics of \pkg{ekdosis}} % \label{sec:ekdosis-basics} % % \subsection{Loading the Package\---General Options} % \label{sec:load-general-options} % % \pkg{ekdosis} is loaded in the preamble like so:--- % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \usepackage{ekdosis} \end{minted} % \iffalse % % \fi % % \pkg{ekdosis} may be loaded with five optional \enquote*{named % arguments} either of which is set using the syntax % \meta{key}$=$\meta{value}. The description of the optional arguments % follows. % % \danger The reader is invited to refer to the relevant sections of % this documentation for more information on how to use these options. % % \DescribeOption{layout}\phts\label{ref:layout-opt} % |layout|$=$\verb+float|footins|keyfloat|fitapp+ % \hfill\tcboxverb{Default: float} % \begin{enumerate} % \item |layout=float| By default, layers of critical notes are % inserted as floating environments to be printed at the bottom of % the pages. % \item |layout=footins| This can be set to insert critical notes in % the default footnote block which can be considered to be a special % kind of float that is printed at the bottom of the pages. In this % case, the apparatus criticus will be inserted between regular % numbered footnotes, but will carry no footnote mark of its own. % \item \label{ref:keyfloat-opt}\newfeature[v1.3] |layout=keyfloat| % does approximately the % same as the default option |layout=float| but uses the % \pkg{keyfloat} package\footcite{keyfloat} to generate the floating % environments to be used as containers for critical footnotes. This % way, the keys and values provided by this % package\footcite[See][sect. 2.3, \ppno~13--16]{keyfloat} may be % used to achieve such effects as append additional, informative % text below the apparatus, draw a line around the apparatus block % or change its width.\footnote{See below, \vpageref{ref:keyparopts} % for more information.} % \item \label{ref:fitapp-opt}\newfeature[v1.3] |layout=fitapp| As % described below in \vnref{sec:oscillating-problem}, \pkg{ekdosis} % may oscillate indefinitely between different sets of page % decisions when one or more apparatus entries attached to the last % lines of the edition text on a given page do not fit in the % apparatus block. The reader will find in this section of the % documentation a detailed account of several ways to circumvent % this issue. Alternatively, or rather conjointly with those ways, % |layout=fitapp| can be used to instruct \pkg{ekdosis} to scale % down the characters of the apparatus block so that the contentious % entries can fit. This mechanism uses the \enquote{fitting} library % provided by the \pkg{tcolorbox} package.\footcite[sect.~22, % \ppno~\pnfmt{438--449}]{tcolorbox} When this option is set, the % apparatus criticus grows normally until a predefined height is % reached. This height is set to |0.5\textheight| by % default.\footnote{Of course, this height can be modified. See % below \vpageref{ref:appheight} for details.} From this point on, % the apparatus block ceases to grow; rather, the size of the % characters is reduced to allow for additional entries. As a % consequence of this rationale, the total number of entries on a % given page must not be too high. It is therefore advisable to use % |layout=fitapp| conjointly with |maxlines| or |maxentries| as % described below on page~\pageref{ref:gmaxlines} (for |maxlines|), % and on pages~\pageref{ref:glimit} and~\pageref{ref:maxentries} (for % |maxentries|) and in \vref{sec:oscillating-problem}. \danger If % used appropriately, this mechanism gives excellent typographical % results, notably with complex edition texts of which the entries % in the associated apparatus can be quite abundant in number. It % may even put an end to the % \enquote{\hyperref[sec:oscillating-problem]{oscillating problem}} % in most of the cases. However, as suitable it may be for high % quality typeset texts and final, camera-ready copies, its benefit % comes at the expense of slowing down the compilation process. Yet % looser algorithms can be selected when speed must prevail over % quality for intermediate or draft copies.\footnote{See below % \vpageref{ref:fitalgorithm} for more information.} % \end{enumerate} % % \DescribeOption{divs}\phts\label{ref:divs-opt} % |divs|$=$\verb+ekdosis|latex+\hfill\tcboxverb{Default: ekdosis}\\ % In many occasions, \LaTeX{} standard textual divisions do not meet % the specific requirements of classical and literary texts, the % divisions of which may depend on many different received % traditions. \pkg{ekdosis} provides a flexible mechanism in which % format and presentation have been carefully separated from % content. It is designed to build un-numbered \texttt{TEI} divisions % allowed to nest recursively.\footnote{See below, % \vref{sec:body-divisions}.} However, if |divs| be set to |latex|, % \LaTeX{} standard textual divisions can be used and will be % translated into \texttt{TEI} numbered |
| elements. % % \danger It must be noted that the two styles are mutually exclusive. % \vskip\baselineskip % % \DescribeOption{poetry}\phts\label{ref:poetry-opt} % \newfeature[v1.2] |poetry|$=$\verb+verse+ % \hfill\tcboxverb{Default: not set}\\ % |poetry=verse| instructs \pkg{ekdosis} to load and use the facilites % supplied by the \pkg{verse} package for the typesetting of lines of % poetry.\footnote{\texttt{verse} does not need to be set if the % \cls{memoir} class be used. See \vref{sec:verse-package} for more % detail.} The \env{ekdverse} environment must then be used instead of % the \env{verse} environment that is provided by the \pkg{verse} % package as described below in \vref{sec:verse-package}. % % \DescribeOption{parnotes}\phts\label{ref:parnotes-opt} % |parnotes|$=$\verb+true|false|roman+% % \hfill\tcboxverb{Default: not set}\\ % This named argument does not need a value as it defaults to |true| % if used. Apparatus criticus typeset by \pkg{ekdosis} may contain % notes and footnotes. The latter can be laid out as paragraphed notes % below the block of critical notes by means of the \pkg{parnotes} % package. Additionally, |parnotes=roman| prints these footnotes % numbered with Roman numerals. % % \DescribeOption{teiexport}\phts\label{ref:teiexport-option} % |teiexport|$=$\verb+true|false|tidy+% % \hfill\tcboxverb{Default: not set}\\ % This named argument does not need a value as it defaults to |true| % if used. If |teiexport| be set to |true|, \pkg{ekdosis} is % instructed to output both PDF and \texttt{TEI xml} files at the same % time. By default, the \texttt{TEI} file will receive the same % basename as the |.tex| source file, suffixed with |-tei.xml|. The % raw |.xml| file that is produced by \pkg{ekdosis} can be further % processed by the \textsf{tidy} console application.\footnote{See % \url{http://www.html-tidy.org}.} To make this happen, \textsf{tidy} % must be installed and the |.tex| source file must be compiled with % the |--shell-escape| facility so that spawning programs from % \LaTeX{} can be allowed.\footnote{See % \url{https://texfaq.org/FAQ-spawnprog} for more information on how % to do this.} % % As an example, the following line loads \pkg{ekdosis} and instructs % it to output a \texttt{TEI xml} file (in addition to the PDF one) % and to use \pkg{parnotes} to format with Roman numerals the footnotes % that are inserted in the apparatus criticus:--- % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \usepackage[teiexport, parnotes=roman]{ekdosis} \end{minted} % \iffalse % % \fi % % \subsection{Setup} % \label{sec:setup} % \DescribeMacro{\ekdsetup} \newfeature[v1.3] Starting from v1.3, % \cs{ekdsetup} can be used to specify options that affect the general % behavior of \pkg{ekdosis}. \cs{ekdsetup} is a preamble-only % command. It accepts the following |key=value| options the number of % which is expected to increase as \pkg{ekdosis} grows:\\ % \DescribeOption{showpagebreaks}\phts\label{ref:showpagebreaks-opt} % \unskip|showpagebreaks|$=$\verb+true|false+ % \hfill \tcboxverb{Initially: false; Default: true}\\ % This named argument, which defaults to |true| if used without value, % has specific marks printed in the margins so as to spot with a rapid % cast of the eye the locations of conditional page breaks generated % by the \cs{ekdpb} command described below \vpageref{ref:ekdpb}. By % default, page breaks generated by \cs{ekdpb} are identified by the % string |spb|\===for \enquote{soft} page break\=== whereas those % generated by \cs{ekdpb*} are identified by |hpb|\===for % \enquote{hard} page break. Furthermore, when \cs{ekdpb} triggers no % page break, the marker is printed between square brackets, like so: % |[spb]|. In this % way, inoperative \cs{ekdpb} can be easily spotted and removed.\\ % \DescribeOption{spbmk} |spbmk|$=$\meta{string} % \hfill\tcboxverb{Default: spb}\\ % |spbmk| is used to change the string associated to \enquote{soft} % page breaks.\\ % \DescribeOption{hpbmk} |hpbmk|$=$\meta{string} % \hfill\tcboxverb{Default: hpb}\\ % |hpbmk| is used to change the string associated to \enquote{hard} % page breaks. % % As an example, what follows has \enquote{soft} page breaks printed % in blue and \enquote{hard} page breaks printed in red:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \ekdsetup{ showpagebreaks, spbmk = \textcolor{blue}{spb}, hpbmk = \textcolor{red}{hpb} } \end{minted} % \iffalse % % \fi % % \subsection{Using a Configuration File} % \label{sec:using-conf-file} % Complex editions may use a large number of witnesses, sources and % scholars. It may also be required to define a multiple-layer % apparatus criticus, several text environments to be aligned and % quite a number of new commands. \pkg{ekdosis} provides a convenient % way to avoid overloading the document preamble: all the settings % related to the critical edition can be gathered in a separate % configuration file named |\jobname-ekd.cfg|. If such a file can be % found, its contents are automatically read and used by % \pkg{ekdosis}. % % \subsection{Witnesses, Hands, Sources, Scholars \& Shorthands} % \label{sec:declarations} % \paragraph{Terminology} % \label{sec:terminology} % Strictly speaking, the term \enquote{witness} should apply to any % manuscript evidence dating back to the Middle Ages used by the % editor to establish the edition text. That said, editors often % consult many other types of documents, such as modern editions, % articles, notes, correspondence and the like, all of which fall into % the category of \enquote{sources}. Furthermore, unpublished % conjectures are also taken into account, not to mention the % corrections and emendations that are proposed in many places by the % editor of the text. As it is necessary to refer to scholars as % individuals, \enquote{scholars} naturally emerges as a third % category. % % Any reference that is to be used in the apparatus criticus must be % \enquote{declared} in the preamble beforehand, namely: manuscript % sigla (either for single manuscripts or manuscript families, primary % or later hands, \emph{\&c.}), abbreviated last names of sources % and scholars. To that effect, \pkg{ekdosis} provides the following % preamble-only commands:--- % % \paragraph{Witnesses} % \DescribeMacro{\DeclareWitness} \cs{DeclareWitness}\marg{unique % id}\marg{rendition}\marg{description}\oarg{options} % \phts\label{ref:declarewitness}\\ % This command requires three mandatory arguments enclosed between % curly braces used to specify consecutively: % \begin{enumerate} % \item The unique identifier of the witness to be used both in the % |.tex| source file and as an |xml:id| in the \texttt{TEI xml} % output if any.\footnote{See \vpageref{ref:xmlid} for more % information.} % \item The rendition to be used in the printed apparatus criticus, % which also will be found within the || element of the % \texttt{TEI} header where the description of the witness occurs, % within a || element. % \item A basic description of the manuscript to be found in a typical % printed Conspectus Siglorum, namely: the name of the manuscript % followed by its call number. % \end{enumerate} % Finally, the optional argument of \cs{DeclareWitness} accepts a % comma-separated list of the following \enquote{name=value} arguments % the first six of which are used to collect items of information to % be found within the || element in the \texttt{TEI} % header:\footnote{See % \url{https://tei-c.org/release/doc/tei-p5-doc/en/html/MS.html\#msid} % for detailed information on these elements.}---\\ % \DescribeOption{settlement} |settlement|$=$\meta{name}: The name of % a city or administrative unit.\\ % \DescribeOption{institution} |institution|$=$\meta{name}: The name % of an institution such as a university or library.\\ % \DescribeOption{repository} |repository|$=$\meta{name}: The name of % the repository within which the witness is stored.\\ % \DescribeOption{collection} |collection|$=$\meta{name}: The name of % a collection of manuscripts.\\ % \DescribeOption{idno} |idno|$=$\meta{call \#}: Any form of call % number.\\ % \DescribeOption{msName} |msName|$=$\meta{name}: The name commonly % used for the witness.\\ % \DescribeOption{origDate} |origDate|$=$\meta{date}: Any form of date % used to identify the date of origin for the witness.\\ % \DescribeOption{locus} |locus|$=$\meta{locus}\newfeature[v1.3]: The % sequence of folio references where the edition text is found in the % manuscript. % % \phts\label{ref:marcianus-b} % To take here one example, a witness such as the \emph{Marcianus % Graecus}~269, referred to as manuscript \enquote*{M} in the % editions, which contains sixty treatises transmitted under the name % of Hippocrates, could be declared as follows:\footnote{The locus % specified refers to Hippocrates' \emph{Epidemics}, Book~6.}--- % %\iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \DeclareWitness{M}{M}{\emph{Marcianus Gr.} 269}[ settlement=Venice, institution=Marciana Library, msName=Marcianus Gr., idno=269, origDate=s. X, locus=fol. 416\textsuperscript{v}–426\textsuperscript{v}] \end{minted} % \iffalse % % \fi % % \paragraph{Hands} % \DescribeMacro{\DeclareHand} \cs{DeclareHand}\marg{unique % id}\marg{base ms.}\marg{rendition}\oarg{note}\\ % This command requires three mandatory arguments enclosed between % curly braces and one optional argument between square brackets used % to specify consecutively:--- % \begin{enumerate} % \item The unique identifier of the hand to be used both in the % |.tex| source file and as an |xml:id| in the \texttt{TEI xml} output % if any.\footnote{See \vpageref{ref:xmlid} for more information.} % \item The unique identifier of the witness the hand is related % to. Of course, this witness must have been declared beforehand. % \item The rendition to be used in the printed apparatus criticus, % which also will be found within the || element of the % \texttt{TEI} header where the description of the hand occurs, within % a || element. % \item Some further information about the hand. % \end{enumerate} % % To continue the preceding example, here is how additions and % corrections found in the \emph{Marcianus Gr.}~269 could be declared % after this witness has been declared itself:--- % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \DeclareHand{M1}{M}{M\textsuperscript{1}}[Emendatio scribae ipsius] \DeclareHand{M2}{M}{M\textsuperscript{2}}[Manus posterior] \end{minted} % \iffalse % % \fi % % As can be seen, values such as |M|, |M1| and |M2| in the |.tex| % source file will be printed as \getsiglum{M}, \getsiglum{M1} and % \getsiglum{M2} respectively. Not only the code gains legibility, but % also flexibility for simply changing any declared rendition will % update corresponding sigla throughout the entire edition. % % As a final example, here is how \pkg{ekdosis} would encode % information as declared above for the \emph{Marcianus Gr.}~269 % should a \texttt{TEI} output be required:--- % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml} M Marcianus Gr.269 Venice Marciana Library 269 Marcianus Gr. M 1

Emendatio scribae ipius

M 2

Manus posterior

s. X
\end{minted} % \iffalse % % \fi % \phts\label{ref:marcianus-e} % % \paragraph{Sources} % \phts\label{ref:declare-source} % \DescribeMacro{\DeclareSource} \cs{DeclareSource}\marg{unique % label}\marg{rendition}\newfeature[v1.1]\\ % The \emph{Conspectus Siglorum} that is placed ahead of the edition % text is traditionally divided into two parts: a)~\emph{Codices}, % which provides the list of sigla used in the apparatus, % b)~\emph{Editiones uel Studia}, which provides references to % sources, either published or unpublished, which contain conjectures % used in the apparatus criticus. \cs{DeclareSource} takes two % mandatory arguments used to specify consecutively:--- % \begin{enumerate} % \item A unique label used in the |.tex| source file to refer to the % work where the conjecture is found. % \item The rendition to be used in the printed apparatus criticus. % \end{enumerate} % % \danger As \pkg{ekdosis} can include and use \texttt{TEI % xml}-compliant lists of references,\footnote{See below % \vref{sec:references-cited-works}.} it is advisable to use % Bib\hologo{(La)TeX} labels in the first argument of % \cs{DeclareSource}. Otherwise, the unique label used to declare the % source would point to no |xml:id| and the \texttt{TEI xml} would not % be valid. Likewise, shorthands fields from the bibliographical % database can be recalled from within the second argument of % \cs{DeclareSource}:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \DeclareSource{Wil}{Wilamowitz} % or for example: \DeclareSource{Wil}{\citename{Wil}{shorteditor}} \end{minted} % \iffalse % % \fi % \phts\label{sec:declarations-end} % % \paragraph{Scholars} % \phts\label{ref:declare-scholar} % \DescribeMacro{\DeclareScholar}\cs{DeclareScholar}\marg{unique % id}\marg{rendition}\oarg{options}\newfeature[v1.1]\\ % Occasionally, it is necessary to refer to a scholar as a person. For % example, corrections and conjectures are commonly inserted as % self-references to the editor of the text in the apparatus criticus % in print with such words as \emph{scripsi}, \emph{addidi}, % \emph{correxi} and the like. Other examples come from unpublished % conjectures of other scholars found in private % libraries. \cs{DeclareScholar} takes two mandatory arguments to % specify consecutively:--- % \begin{enumerate} % \item The unique identifier of the scholar to be used both in the % |.tex| source file and as an |xml:id| in the \texttt{TEI xml} output % if any.\footnote{See \vpageref{ref:xmlid} for more information.} % \item The rendition to be used in the apparatus criticus in print, % which also will be found within the || element of the % \texttt{TEI} header where the description of the persons cited % occurs, within an || element. % \end{enumerate} % Finally, the optional argument of \cs{DeclareScholar} accepts the % following comma-separated list of |key-value| arguments:---\\ % \DescribeOption{rawname}|rawname|$=$\meta{name}\\ % |rawname| refers to a name that is not to be dissected into name % part components such as forename, surname and the like. If |rawname| % be used, then \pkg{ekdosis} will ignore the following three optional % arguments: |forename|, |surname| and |addname|.\\ % \DescribeOption{forename}|forename|$=$\meta{forename}\\ % |forename| refers to first and middle names or initials.\\ % \DescribeOption{surname}|surname|$=$\meta{surname}\\ % |surname| stores the last name.\\ % \DescribeOption{addname} |addname|$=$\meta{additional name}\\ % |addname| refers to an additional or alternate name by which the % scholar is known viz.\ a Latinized form of the name, a nickname, an % epithet or alias.\\ % \DescribeOption{note} |note|$=$\meta{note}\\ % |note| may hold any relevant information about the material used by % the editor. For example, a note may specify that this material has % been found as marginal notes by the hand of the scholar in some % edition in print. % % \paragraph{Shorthands} % \DescribeMacro{\DeclareShorthand} \cs{DeclareShorthand}\marg{unique % id}\marg{rendition}\marg{csv list of identifiers}\\ % This command provides a convenient way to declare \emph{families} of % witnesses. It takes three mandatory arguments used to specify % consecutively:--- % \begin{enumerate} % \item The unique identifier of the family to be used in the |.tex| % source file. % \item The rendition to be used in the printed apparatus criticus. % \item A comma-separated list of previously declared witnesses. % \end{enumerate} % % As an example, the manuscripts of Caesar's \emph{Gallic War} are % divided into two families: α, which includes mss.\ A, M, B, R, S, L % and N, and β, which includes mss.\ T, f, U and l. Therefore, % provided that all these witnesses have been already declared, here % is how the two families α and β could be % declared:\footnote{These witnesses are used in the example % provided below in \vref{lst:caesar-bg}.}--- % \phts\label{ref:caesar-bg-sigla} % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \DeclareShorthand{a}{α}{A,M,B,R,S,L,N} \DeclareShorthand{b}{β}{T,f,U,l} \end{minted} % \iffalse % % \fi % % Then, symbols |a| and |b| can be used in the |.tex| source file in % place of manuscripts that belong to either family. % % That said, \cs{DeclareShorthand} is not meant to be restricted to % declared witnesses. On the contrary, it also applies to any declared % sources and scholars by means of \cs{DeclareSource} and % \cs{DeclareScholar}. As an example, assuming that a self-reference % to the person responsible for the edition has been set in the % preamble, an associated shorthand can be defined like so:--- % % \iffalse %<*example> % \fi \begin{minted}[escapeinside=++]{latex} \DeclareScholar{ego}{ego}[ forename=John, surname=Smith, note=Main editor of the text] \DeclareShorthand{egoscr}{\emph{scripsi}}{ego}+\label{ln:egoscr}+ \end{minted} % \iffalse % % \fi % % Then, the shorthand |egoscr| (l.~\lnref{ln:egoscr}) can be % used to print in the apparatus criticus the technical term % \emph{scripsi} and use at the same time the pointer |#ego| that is % expected in the \texttt{TEI xml} output file. Detailed examples of % this technique will be provided below in % \vref{sec:emendations-conjectures}. % % \subsubsection{Printing Formatted Witnesses % --- Conspectus Siglorum} % \label{sec:print-witnesses} % Once witnesses, hands, scholars and sources have been declared, % \pkg{ekdosis} provides two commands to have them printed as declared % from their identifiers. % % \DescribeMacro{\getsiglum} \cs{getsiglum}\marg{csv list of witnesses % or single witness} behaves exactly as the |wit| optional argument of % \cs{lem} and \cs{rdg} described below on pages~\pageref{ref:lem-wit} % and \pageref{ref:rdg-wit}. From a single identifier or from a % comma-separated list of identifiers, it returns their formatted % counterparts. To return to the example provided % \vpagerefrange{ref:marcianus-b}{ref:marcianus-e}, |\getsiglum{M}| % would return \getsiglum{M}, while |\getsiglum{M1}| would return % \getsiglum{M1}. % % \DescribeMacro{\SigLine} \cs{SigLine}\marg{unique id} returns from % \meta{unique id} used in the first argument of % \cs{DeclareWitness}\footnote{See above % \vpageref{ref:declarewitness}.} a line ready to be inserted in a % table set to print a Conspectus Siglorum with the following items of % information separated by the symbol |&|: the siglum referring to the % witness, the contents of the |description| field, followed if % applicable by the sequence of folios that refers to the edition % text, and the contents of the |origDate| field. An example of how % one could print the Conspectus Siglorum of the manuscripts of % Caesar's \emph{Gallic War} from the list provided % \vpageref{ref:caesar-bg-sigla} follows:--- % % \captof{Conspectus Siglorum of Caesar's \emph{Gallic War}} % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \begin{xltabular}[c]{0.75\linewidth}{lXl} \caption*{\textbf{Conspectus siglorum}}\\ \multicolumn{3}{c}{\emph{Familia} \getsiglum{a}}\\ \SigLine{A}\\ & \getsiglum{A1} \emph{Emendationes scribae ipsius} & \\ \SigLine{M}\\ [...] \SigLine{N}\\ \multicolumn{3}{c}{\emph{Familia} \getsiglum{b}}\\ \SigLine{T}\\ [...] \SigLine{l}\\ \end{xltabular} \end{minted} % \iffalse % % \fi % % \begin{xltabular}[c]{0.75\linewidth}{lXl} % \caption*{\textbf{Conspectus siglorum}}\\ % \multicolumn{3}{c}{\emph{Familia} \getsiglum{ca}}\\ % \SigLine{cA}\\ % & \getsiglum{cA1} \emph{Emendationes scribae ipsius} & \\ % \SigLine{cM}\\ % \SigLine{cB}\\ % \SigLine{cR}\\ % \SigLine{cS}\\ % \SigLine{cL}\\ % \SigLine{cN}\\ % \multicolumn{3}{c}{\emph{Familia} \getsiglum{cb}}\\ % \SigLine{cT}\\ % \SigLine{cf}\\ % \SigLine{cU}\\ % \SigLine{cl}\\ % \end{xltabular} % % \subsection{Editing a Single Text} % \label{sec:single-text-editing} % \DescribeEnv{ekdosis} % Running paragraphs of one single text to be edited should be % inserted in the \env{ekdosis} environment, like so:\footnote{See % above \vref{lst:pj1}.}--- % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \begin{ekdosis} Edition text goes here. \end{ekdosis} \end{minted} % \iffalse % % \fi % % \paragraph{Apparatus Entries} % \DescribeMacro{\app} \cs{app}|[type=|\meta{type}|]|\marg{apparatus % entries}\phts\label{ref:app-cmd}\\ % This command takes one mandatory argument and accepts one optional % argument. Once references to be used as witnesses in the apparatus % criticus have been declared in the preamble as described in % \ref{sec:declarations} % \vpagerefrange{sec:declarations}{sec:declarations-end}, the \cs{app} % command is used for inserting entries in the apparatus criticus, % either lemmata, readings or notes, like so:--- % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} I saw my friend \app{\lem{Peter}\rdg{John}} yesterday. or: I saw my friend \app{ \lem{Peter} \rdg{John} } yesterday. \end{minted} % \iffalse % % \fi % \cs{app} accepts one further optional argument:---\\ % \DescribeOption{type} |type|$=$\meta{type}\phts\label{ref:app-type} % \hfill\tcboxverb{Default: default}\\ % As will be described below in \vref{sec:multilayer-apparatus}, % \pkg{ekdosis} initially sets one layer of notes\===the |default| % layer\===in the apparatus criticus. This layer is fit to receive % notes related to variant readings from witnesses and sources used by % the editor to establish the edition text. Additional layers can be % defined to receive other kinds of notes, such as references to texts % quoted or cited in the text of the edition (\emph{apparatus % fontium}), references to testimonia, or quotations of the edited % text by other authors (\emph{apparatus testium}), explanatory notes, % and so forth.\footnote{See below, \vref{ref:type-note}.} Once % additional layers have been defined and assigned to new % \enquote*{types}, such as \enquote*{testium} and the like, these % types can be used as values appended to the |type| \enquote*{named % option}. For more information about inserting notes in % multiple-layer apparatus, see \vref{sec:notes-in-multilayer-app}. % % \mansee \pkg{ekdosis} also provides a two-argument \cs{App} command % which is strictly equivalent to \cs{app} but allows for much more % flexible code folding in the \textsf{emacs} text editor. Code % folding may be needed when readings and critical notes grow in % number to a point where the edition text becomes illegible. This % command is described below in \vnref{sec:using-emacs}. (See % \vpageref{ref:App-cmd}.) % % \paragraph{Base text and variants} As can be seen in \vref{lst:pj1} % and the examples provided above, there are two kinds of individual % readings: the \emph{lemma}, which contains the base text accepted by % the editor, and the \emph{reading}, which contains deviant readings % rejected by the editor. % % \danger What follows refers to the notions of \enquote{witness}, % \enquote{source} and \enquote{scholar} as defined above % \vpageref{sec:terminology}. % % \paragraph{Lemmata} \phts\label{ref:lemmata}\DescribeMacro{\lem} % \cs{lem}\oarg{options}\marg{lemma text}\\ % As \meta{lemma text} is a word or a phrase judged by the editor to % be authentic or authoritative, \cs{lem} prints it by default both in % the edition text and as the first part of a new entry in the % apparatus criticus, preceded by the line number where it occurs or a % broad space when the entry refers to the same line as the preceding % entry. \phts\label{ref:lem-opts-b}The optional argument of \cs{lem} % accepts the following comma-separated list of \enquote{name$=$value} % arguments:---\\ % \DescribeOption{wit} |wit|$=$\meta{csv list of % witnesses}\phts\label{ref:lem-wit}\\ % While a single witness may be recorded as in |wit=A|, % comma-separated lists of multiple witnesses must obviously be % enclosed in curly braces, like so: % |wit={A,B,C}|. \phts\label{ref:mss-sep-families}It must be noted % that witnesses can be grouped by using spaces as separators, like % so: \verb*|wit={A,B,C, D,E,F}|. \danger In the apparatus criticus in % print, it is customary to remind the reader of the manuscript % groupings by spaces or commas. \pkg{ekdosis} prints spaces by % default, but can be instructed to print any other symbol % instead.\footnote{See below \vpageref{ref:familysep} for details.} % \danger Although any unique identifiers or labels used to % \enquote{declare} sources and scholars as described above % \vpagerefrange{ref:declare-source}{ref:declare-scholar} can also be % used as values of the |wit| optional argument, it is recommended to % use |sources| and |resp| to refer to either category % respectively as described below.\\ % \DescribeOption{source} |source|$=$\meta{csv list of % sources}\phts\label{ref:lem-source}\newfeature[v1.1]\\ % A \enquote{source} refers to any type of document consulted by the % editor to establish the edition text. Most commonly, corrections and % emendations from previous editions are cited in the apparatus % criticus.\footnote{For edition texts used as sources, see examples % below in \vref{sec:emendations-conjectures} and % \vref{sec:references-cited-works}.}\\ % \DescribeOption{resp} |resp|$=$\meta{csv list of % scholars}\phts\label{ref:lem-resp}\newfeature[v1.1]\\ % |resp| refers to scholars responsible for the emendations, % conjectures and corrections that are cited in the apparatus % criticus.\footnote{See detailed examples in % \vref{sec:emendations-conjectures}.}\\ % \DescribeOption{alt} |alt|$=$\meta{alternate lemma}\\ % While the mandatory argument of \cs{lem}, \meta{lemma text}, is % always used to print the edition text in the upper part of the page, % \meta{alternate lemma}, if specified, supersedes what is printed in % the related entry of the apparatus criticus. This mechanism is % useful in more than one respect. For instance, it can be used to % insert abbreviated lemmata in the apparatus criticus, or to % introduce an alternate way of writing entries with Latin technical % terms in the apparatus criticus as will be demonstrated below in the % example provided by \vref{lst:pj2}.\\ % \DescribeOption{ilabel}\phts\label{ref:ilabel-opt} % |ilabel|$=$\meta{indexed label}\\ % \newfeature[v1.5] If used, |ilabel| instructs \pkg{ekdosis} not to % set a label at the place where \meta{lemma text} ends. Instead, the % label is indexed as \meta{indexed label} and only used to compute % the ending line number at the place where the index is recalled by % \cs{ilabel}\marg{indexed label}.\footnote{See below % \vpageref{ref:ilabel-cmd}.} This allows for abbreviated lemmas % corresponding to spans of texts that cross verse, paragraph or % section boundaries as described below in \vnref{sec:lacunae}.\\ % \DescribeOption{delim} (no-value argument) \newfeature[v1.5]\\ % |delim| takes no value. If used, this argument instructs to forcibly % print the delimiter that \pkg{ekdosis} may have decided not to print % in the apparatus criticus before the lemma text.\\ % \DescribeOption{nodelim} (no-value argument)\\ % \newfeature[v1.5] |nodelim| takes no value. If used, this argument % removes the delimiter that is printed just before the entry in the % apparatus criticus. This option is typically used in rare occasions % in combination with |nolem| and |nonum| for entries that carry % information not to be printed in the apparatus but nevertheless to % be retained in the \texttt{TEI xml} % output file.\\ % \DescribeOption{sep} |sep|$=$\meta{separator}\\ % |sep| allows to change the symbol used to separate the lemma text % from deviant readings, which is by default the closing square % bracket (|]|)\\ % \DescribeOption{nosep} |nosep|$=$\verb+true|false+\\ % This named argument does not need a value as it defaults to |true| % if used. |nosep| removes the separator mentioned above. Obviously, % |nosep| must be used when for some reason no \cs{rdg} command % follows a \cs{lem} command that has just been used, as shown below % in \vref{lst:emend-coni-corr}, % l.~\lnref{ln:emend:nosep}. \danger If |nosep| be used so as % to insert an explanatory note after the lemma text with the % \cs{note} command described below \vpageref{ref:editorial-notes}, % then the |sep| optional argument of \cs{note} can be used to put % back in the separator. This technique is demonstrated below in % \vref{lst:emend-coni-corr}, % ll.~\ekdelide{\lnref{ln:emend:sep:b}%^^A % --\lnref{ln:emend:sep:e}}.\\ % \DescribeOption{nolem} |nolem|$=$\verb+true|false+\\ % This named argument does not need a value as it defaults to |true| % if used. |nolem| completely removes the lemma text from the related % entry in the apparatus criticus.\\ % \DescribeOption{Nolem} (no-value argument)\\ % \newfeature[v1.5] |Nolem| takes no value and is equivalent to % |nodelim,| |nolem,| |nonum|. For an example of its usage, see % \vnref{sec:lacunae} and \vref{lst:cic-att}.\\ % \DescribeOption{type} |type|$=$\meta{value}\\ % This named argument has no effect on the apparatus criticus of the % edition in print, but it is used in the \texttt{TEI xml} output to % classify the variation recorded in the entry according to some % convenient typology. Categories such as lexical, morphological, % orthographical and the like may apply. Obviously, |type=emendation| % should be restricted to lemma texts and |type=conjecture| to variant % readings recorded by means of \cs{rdg} described below. % % \needspace{2\baselineskip} % \noindent % \DescribeOption{num} (no-value % argument)\phts\label{ref:lem-num}\newfeature[v1.3]\\ % |num| takes no value. If used, this argument instructs to print any % line number that \pkg{ekdosis} may have decided not to print in the % apparatus criticus before the lemma text.\\ % \DescribeOption{nonum} (no-value % argument)\phts\label{ref:lem-nonum}\newfeature[v1.3]\\ % Compared to |num|, |nonum| does the opposite. If used, any number % that \pkg{ekdosis} may have decided to print before the lemma text % is suppressed. % % \needspace{11\baselineskip} % Finally, four named arguments can be used to insert words at the % following specific places in the lemma text:\\ % \noindent % \fparbox*{\centered{\textbf{1} \tikzmark{pre}\tred{pre} Peter % \tikzmark{post}\tred{post} \tikzmark{prewit}\tred{prewit} % \getsiglum{pjA} % \tikzmark{postwit}\tred{postwit}] John \getsiglum{pjB}}}\\ % \DescribeOption{pre} |pre|$=$\meta{words}\pointtol{pre}\\ % |pre| inserts \meta{words} \emph{before} the lemma text.\\ % \DescribeOption{post} |post|$=$\meta{words}\pointto{post}\\ % |post| inserts \meta{words} \emph{after} the lemma text.\\ % \DescribeOption{prewit} |prewit|$=$\meta{words}\pointto{prewit}\\ % |prewit| inserts \meta{words} \emph{before} the list of witnesses.\\ % \DescribeOption{postwit} |postwit|$=$\meta{words}\pointtor{postwit}\\ % |postwit| inserts \meta{words} \emph{after} the list of witnesses. % \phts\label{ref:lem-opts-e} % % \paragraph{Readings} \DescribeMacro{\rdg} % \cs{rdg}\oarg{options}\marg{variant reading}\\ % As \meta{reading} is a word or a phrase judged by the editor to be % unsatisfactory or corrupted, \cs{rdg} prints it by default in the % last part of the corresponding entry in the apparatus criticus, % after the symbol that is used to separate words of the base text % (the lemma text) from words rejected by the editor. The optional % argument of \cs{rdg} accepts a comma-separated list of % \enquote{name$=$value} arguments that is almost identical to % \cs{app}. Therefore, emphasis will be placed here only on the % differences. The reader is invited to refer to the description % provided above \vpagerefrange{ref:lem-opts-b}{ref:lem-opts-e} for % more detailed information:---\\ % \DescribeOption{wit} |wit|$=$\meta{csv list of % witnesses}\phts\label{ref:rdg-wit}\\ % \DescribeOption{source} |source|$=$\meta{csv list of sources}\\ % \DescribeOption{resp} |resp|$=$\meta{csv list of scholars}\\ % \DescribeOption{alt} |alt|$=$\meta{alternate reading}\\ % \DescribeOption{nordg} |nordg|$=$\verb+true|false+\\ % This named argument does not need a value as it defaults to |true| % if used. |nordg| completely removes the variant reading from % the related entry in the apparatus criticus.\\ % \DescribeOption{type} |type|$=$\meta{value}\\ % Obviously, |type=conjecture| should be restricted to variant % readings and |type=emendation| to lemma texts recorded by means of % \cs{lem} described above.\\ % \DescribeOption{pre} |pre|$=$\meta{words}\\ % \DescribeOption{post} |post|$=$\meta{words}\\ % \DescribeOption{prewit} |prewit|$=$\meta{words}\\ % \DescribeOption{postwit} |postwit|$=$\meta{words}\\ % \DescribeOption{subsep} |subsep|$=$\meta{subseparator}\\ % \newfeature[v1.4] |subsep| inserts a subseparator to be printed % \emph{before} the current entry as described below % \vpageref{ref:setsubseparator}. This option is supposed to be used % when no subseparator is defined, or when one is defined but for some % reason a different subseparator is needed for the current % entry.\\ % \DescribeOption{nosubsep} This argument-less option removes the % subseparator from the current entry, provided one has been set by % means of \cs{SetSubseparator}, \cs{SetApparatus} or % \cs{DeclareApparatus}.\footnote{See % \vpagerefrange{ref:setsubseparator}{ref:apparatus-settings-e} and % \vref{sec:declaring-layers} for details.} % % \paragraph{Notes} % \DescribeMacro{\note}\phts\label{ref:notes-b}\DescribeMacro{\note*} % \cs{note}\oarg{options}\marg{text} or % \cs{note*}\oarg{options}\marg{text}\phts\label{ref:editorial-notes}\\ % It may happen that editorial notes are needed to record short % comments of general nature \emph{between} lemmata and % readings. \cs{note} inserts inline comments while \cs{note*} places % comments below the entire apparatus block. Furthermore, if % \pkg{ekdosis} be loaded with the |parnotes| option as described % above \vpageref{ref:parnotes-opt}, \cs{note*} will use the % \pkg{parnotes} package to lay out the notes as an additional % paragraph below the apparatus criticus. The optional argument of % \cs{note}/\cs{note*} accepts the following comma-separated list of % \enquote{name$=$value} % arguments:---\\ % \DescribeOption{pre} |pre|$=$\meta{words}\\ % |pre| inserts \meta{words} immediately before the note.\\ % \DescribeOption{post} |post|$=$\meta{words}\\ % |post| inserts \meta{words} immediately after the note.\\ % \DescribeOption{sep} This argument-less option is equivalent to % |post=\ekdsep|.\footnote{See below % \vpageref{ref:ekdsep-subsep} for more information and % \vref{lst:emend-coni-corr}, ll.~%^^A % \ekdelide{\lnref{ln:emend:sep:b}--\lnref{ln:emend:sep:e}} % for an illustrative example.}\saveFN\fnEmend\\ % \DescribeOption{subsep} This argument-less option is equivalent to % |pre=\ekdsubsep|.\useFN\fnEmend\\ % % \danger Under no circumstances is it permitted to insert this % command \cs{note} or \cs{note*} inside the argument of \cs{lem} or % \cs{rdg}. \cs{note}/\cs{note*} must go \emph{between} these % commands. As a general rule, within \cs{app}|{}| elements, notes are % inserted immediately \emph{after} the lemma or the variant reading % they are related to. However, as will be described below in % \vref{ref:type-note}, the command \cs{note}\---with no star % appended\---that is used to insert explanatory notes or references % to sources or testimonia is permitted within the mandatory argument % of \cs{lem}|{}|, although it is subject to a very strict syntax. % % \Vref{lst:pj2} provides an illustration of some of the possibilities % afforded by the commands just described:--- % % \captof{The \enquote{Peter/John} full example}[\label{lst:pj2}] % \iffalse %<*example> % \fi \begin{minted}[escapeinside=++]{latex} \begin{ekdosis} I \app{ \lem[wit=A]{saw} \rdg[wit=B]{met}} my friend \app{ \lem{Peter} \rdg{John} } at the station yesterday. We were both in a \app{ \lem[wit=A]{great} \rdg[wit=B]{good}} mood. \app{ \lem[wit=A, alt={How nice... said}]{\enquote{How nice to find+\label{ln:pj2:alt:b}+ you here!} he said.}+\label{ln:pj2:alt:e}+ \note*{There are no quotation marks in the mss.}+\label{ln:pj2:note1}+ \rdg[wit=B, alt=\emph{om.}]{}} I chuckled to myself, recalling the last time we \app{ \lem[wit=A,nolem]{met}+\label{ln:pj2:nolem}+ \rdg[wit=B, alt={\emph{post} met \emph{add.} there}]{met+\label{ln:pj2:alt2}+ there} \note*{Ms. \getsiglum{B} provides other additions of this kind.}}.+\label{ln:pj2:note2}+ \end{ekdosis} \end{minted} % \iffalse % % \fi % % \needspace{7\baselineskip} % \resetlinenumber % \begin{alignment}[flush,tcols=1,texts=specimen,apparatus=specimen] % \begin{specimen} % I \app{\lem[wit=pjA]{saw}\rdg[wit=pjB]{met}} my friend % \app{ % \lem{Peter} % \rdg{John} % } % at the station yesterday. We were both in a % \app{ % \lem[wit=pjA]{great} % \rdg[wit=pjB]{good}} % mood. % \app{ % \lem[wit=pjA, alt={\textooquote How nice... said}]{\enquote{How % nice to find you here!} he said.} % \note*{There are no quotation marks in the mss.} % \rdg[wit=pjB, alt=\emph{om.}]{}} % I chuckled to myself, recalling the last time we % \app{ % \lem[wit=pjA,nolem]{met} % \rdg[wit=pjB, alt={\emph{post} met \emph{add.} there}]{met % there} % \note*{Ms. \getsiglum{pjB} provides other additions of this kind.}}. % \end{specimen} % \end{alignment} % % \begin{remarks} % \item Close examination of lines~\ekdelide{%^^A % \lnref{ln:pj2:alt:b}--\lnref{ln:pj2:alt:e}} from % \vref{lst:pj2} shows how |alt| has been used to insert an abridged % lemma text in the apparatus criticus in print while keeping safe % what is to be found in the \texttt{TEI xml} output. % \item The same technique has been used at % line~\lnref{ln:pj2:alt2} to insert alternate words, % including Latin technical terms, in place of the variant % reading. Hence the use of |nolem| at % line~\lnref{ln:pj2:nolem} to remove the lemma text from the % apparatus criticus in print. % \item \cs{note*} has been used to insert short annotations in two % places (ll.~\lnref{ln:pj2:note1} and % \lnref{ln:pj2:note2}). % \item For an example of the use of |nordg|, see below % \vref{lst:caesar-bg}, l.~\lnref{ln:caes:nordg}. % \end{remarks} % % The corresponding \texttt{TEI xml} output produced by \pkg{ekdosis} % from the \LaTeX{} source file follows:--- % % \captof{The \enquote{Peter/John} full example: \texttt{TEI xml} % output}[\label{lst:pj2-tei}] % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml}

I saw met my friend Peter John at the station yesterday. We were both in a great good mood. How nice to find you here! he said. There are no quotation marks in the mss. I chuckled to myself, recalling the last time we met met there Ms. Bprovides other additions of this kind. .

\end{minted} % \iffalse % % \fi % \phts\label{ref:notes-e} % % \subsection{Indicating Subvariation in Apparatus Entries} % \label{sec:indic-subv-appar} % It must be noted that grouping readings so as to keep emphasis on % subvariation, regardless of its cause, is entirely optional. % Furthermore, the applicability of this technique is limited to the % \texttt{TEI xml} output as it helps the machines to understand a % grouping otherwise immediately accessible to human mind from the % information that is available in well-written % apparatus. \pkg{ekdosis} provides two ways of expressing % subvariation. % % \subsubsection{Implicit Grouping} % \label{sec:implicit-grouping} % Because apparatus entries may nest recursively, the \cs{app} command % can be used to group similar readings. % % \danger However, for nesting to work, the |alt| optional argument % must be used in every \cs{lem} and \cs{rdg} command involved in the % nesting. This rule applies to both parent and child commands, as % demonstrated in the following example:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} As I was walking home through Times Square, I saw my friend \app{ \lem[wit={A,B}, alt={Peter\---Street}]{Peter at the \app{ \lem[wit=A, alt=station]{station} \rdg[wit=B, alt=bookstore]{bookstore} } on 42nd Street} \rdg[wit=C, alt={John on Broadway}]{John on Broadway} }. \end{minted} % \iffalse % % \fi % % PDF output:--- % \medskip % % \needspace{7\baselineskip} % \resetlinenumber % \begin{alignment}[flush,tcols=1,texts=specimen,apparatus=specimen] % \begin{specimen} % As I was walking home through Times Square, I saw my friend % \app{ % \lem[wit={pjA,pjB}, alt={Peter\---Street}]{Peter at the % \app{ % \lem[wit=pjA, alt=station]{station} % \rdg[wit=pjB, alt=bookstore]{bookstore}} % on 42nd Street} % \rdg[wit=pjC, alt={John on Broadway}]{John on Broadway}}. % \end{specimen} % \end{alignment} % % \begin{remarks} % \item[\textsc{Rem.}] Two \cs{app} commands naturally insert two % entries in the apparatus criticus. As the subvariation comes % first, what ms.\ C reads is only mentioned in the subsequent % entry. % \end{remarks} % % \texttt{TEI xml} output:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml}

As I was walking home through Times Square, I saw my friend Peter at the station bookstore on 42nd Street John on Broadway .

\end{minted} % \iffalse % % \fi % % \danger It must be noted that from a technical standpoint, albeit % the nested lemmas are printed \emph{before} their parents in the % apparatus criticus, they are seen by \pkg{ekdosis} \emph{after} the % latter as the source file is compiled. As a result, notably when the % whole nested group of lemmas falls on the same line without being % preceded by an apparatus entry on this line, it may be needed to % suppress redundant numbers that \pkg{ekdosis} may have decided to % print in the appartus criticus. Conversely, it may be needed to % print numbers that \pkg{ekdosis} may have decided not to print. To % both ends, the |num| and |nonum| optional arguments of the \cs{lem} % command can be used as described above % \vpagerefrange{ref:lem-num}{ref:lem-nonum}. % % \subsubsection{Explicit Grouping} % \label{sec:explicit-grouping} % \DescribeMacro{\rdgGrp} \cs{rdgGrp}\oarg{options}\marg{lemma text % \textbar\ readings}\newfeature[v1.1]\\ % Explicit grouping of readings can be achieved by means of the % \cs{rdgGrp} command. It takes as mandatory argument the commands % used for inserting lemma texts, readings and notes that are % described \vpagerefrange{ref:lemmata}{ref:notes-e}, viz.\ \cs{lem}, % \cs{rdg} and \cs{note}. \cs{rdgGrp} accepts one further optional % argument:---\\ % \DescribeOption{type} |type|$=$\meta{value}\\ % This named argument is used in the \texttt{TEI xml} output to % define an attribute common to all elements representing the % variation. % % Here follows how the technique of explicit grouping would apply to % the same passage as above:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} As I was walking home through Times Square, I saw my friend \app{ \rdgGrp[type=subvariation]{ \lem[wit=A, alt={Peter\---Street}]{Peter at the station on 42nd Street} \rdg[wit=B, alt={bookstore \emph{pro} station}]{Peter at the bookstore on 42nd Street} } \rdg[wit=C]{John on Broadway} }. \end{minted} % \iffalse % % \fi % % PDF output:--- % \medskip % % \needspace{7\baselineskip} % \resetlinenumber % \begin{alignment}[flush,tcols=1,texts=specimen,apparatus=specimen] % \begin{specimen} % As I was walking home through Times Square, I saw my friend % \app{ % \rdgGrp[type=subvariation]{ % \lem[wit=pjA, alt={Peter\---Street}]{Peter at the station % on 42nd Street} % \rdg[wit=pjB, alt={bookstore \emph{pro} station}]{Peter at the % bookstore on 42nd Street} % } % \rdg[wit=pjC]{John on Broadway} % }. % \end{specimen} % \end{alignment} % % \begin{remarks} % \item[\textsc{Rem.}] In this example, the subvariation is emphasized % with a Latin technical term and may be expressed in one single % entry in a more economical manner. % \end{remarks} % % \texttt{TEI xml} output:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml}

As I was walking home through Times Square, I saw my friend Peter at the station on 42nd Street Peter at the bookstore on 42nd Street John on Broadway .

\end{minted} % \iffalse % % \fi % % \section{Emendations and Conjectures} % \label{sec:emendations-conjectures} % From a technical standpoint, \enquote{conjectures} are readings that % are not supported by manuscript evidence, but are instead proposed % by scholars to be taken into consideration for establishing the % edition text. A conjecture is called an \enquote{emendation} when it % is adopted in place of what is provided by or missing from the text % provided by the manuscripts. Emendations and conjectures are % therefore readings and as such expected to be found within || % or || elements. However, as both come from editions or % scholars, not from manuscripts, they are naturally associated with % |source| or |resp| attributes as described above % \vpagerefrange{ref:lem-source}{ref:lem-resp},\footnote{See also % \vpagerefrange{ref:declare-source}{ref:declare-scholar}.} and can be % distinguished from one another by the |type| attribute, eg.\ either % |emendation| or |conjecture|. % % As an example, the representation of witnesses, editors and % shorthands of Hippocrates' \emph{Epidemics}, Book~2 could be % summarized as follows:--- % % \iffalse %<*example> % \fi \begin{minted}[escapeinside=++]{latex} % Witnesses: \DeclareWitness{V}{V}{\emph{Vaticanus Gr.} 276}+\label{ln:wsc:wit1}+ \DeclareWitness{I}{I}{\emph{Parisinus Gr.} 2140}+\label{ln:wsc:wit2}+ \DeclareHand{Iac}{I}{I\textsuperscript{ac}}[Lectio ante correctionem] \DeclareHand{Ipc}{I}{I\textsuperscript{pc}}[Lectio post correctionem] \DeclareWitness{R}{R}{\emph{Vaticanus Gr.} 277}+\label{ln:wsc:wit3}+ \DeclareWitness{H}{H}{\emph{Parisinus Gr.} 2142}+\label{ln:wsc:wit4}+ % Sources (the first arguments below must refer to biblatex labels and % an xml bibliographical database must be supplied): \DeclareSource{Lit}{Littré}+\label{ln:wsc:src1}+ \DeclareSource{Erm}{Ermerins} \DeclareSource{Sm}{Smith}+\label{ln:wsc:src2}+ % Persons: \DeclareScholar{ego}{ego}[ forename=Robert, surname=Alessi] % Useful shorthands: \DeclareShorthand{codd}{codd.}{V,I,R,H}+\label{ln:wsc:short1}+ \DeclareShorthand{edd}{edd.}{Lit,Erm,Sm} \DeclareShorthand{egoscr}{\emph{scripsi}}{ego}+\label{ln:wsc:short2}+ \end{minted} % \iffalse % % \fi % % As can be seen from lines~\ekdelide{%^^A % \lnref{ln:wsc:short1}--\lnref{ln:wsc:short2}}, % three useful shorthands have been defined: |codd| prints % \enquote{codd.} for Latin pl.\ \emph{codices} viz.\ \enquote{all % manuscripts} and refers to the three \texttt{xml} identifiers |V|, % |I|, |R| and |H| declared at % ll.~\ekdelide{%^^A % \lnref{ln:wsc:wit1}--\lnref{ln:wsc:wit2}} and % \ekdelide{\lnref{ln:wsc:wit3}--\lnref{ln:wsc:wit4}}; % |edd| prints \enquote{edd.} for Latin pl.\ \emph{editores} viz.\ % \enquote{all editors} and refers to the three \texttt{xml} % identifiers |Lit|, |Erm| and |Sm| declared at % ll.~\ekdelide{%^^A % \lnref{ln:wsc:src1}--\lnref{ln:wsc:src2}};%^^A % \footnote{For detailed information on how to use \cs{DeclareSource} % and insert references to cited works, the reader is invited to refer % to \vref{sec:references-cited-works}.} finally, |egoscr| % (l.~\lnref{ln:wsc:short2}) is used to print the technical % Latin term \enquote{\emph{scripsi}}, \enquote{I wrote}, to denote a % personal conjecture. Then, the |.tex| source file can be structured % as follows:--- % % \iffalse %<*example> % \fi \begin{minted}{latex} \begin{ekdosis} καὶ ἐγίνετο μᾶλλον \app{ \lem[wit={V, Ipc,R,H}]{νότῳ} \rdg[wit=Iac]{νότου} \rdg[source=Erm, type=conjecture]{ἐν νώτῳ}}· [...] % conjecture εἰ \app{ \lem[resp=egoscr, type=emendation]{μὲν} % emendation \rdg[wit=codd, source=edd]{μὴ} } εἴη διὰ ταῦτα [...] \end{ekdosis} \end{minted} % \iffalse % % \fi % % \begin{remarks} % \item Line~5 introduces a \emph{conjecture} which has been annotated % with |type=conjecture| to facilitate its identification. Other % optional arguments could have been used, such as % |prewit=|\texttt{coni.} or |prewit=|\texttt{falso coni.}, to print % explanatory words in the apparatus criticus before the abridged % name of the scholar. % \item \phts\label{it:egomute}Conversely, line~9 introduces an % \emph{emendation} for which the shorthand |egoscr| has been used % to print the exact term \emph{scripsi} in the apparatus criticus % while keeping |ego| as an |xml:id| for the \texttt{TEI xml} output % file. Other strategies could have been used. For example, one % could have defined a specific shorthand to print nothing in place % of |ego| and leave the insertion of technical terms to the |post| % optional argument of \cs{lem}, like so:--- % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} % Preamble: % (\unskip is for removing the space left by the empty 2nd argument % below.) \DeclareShorthand{egomute}{\unskip}{ego} % Document: \app{ \lem[resp=egomute, post=\emph{scripsi}, type=emendation]{μὲν} \rdg[wit=codd, source=edd]{μὴ} } εἴη διὰ ταῦτα [...] \end{minted} % \iffalse % % \fi % \end{remarks} % % PDF output:--- % \medskip % % \needspace{7\baselineskip} % \resetlinenumber % \begin{alignment}[flush,tcols=1,texts=specimen,apparatus=specimen] % \begin{specimen} % \begin{ancientgreek} % καὶ ἐγίνετο μᾶλλον \app{ % \lem[wit={hV, hIpc,hR,hH}]{νότῳ} % \rdg[wit=hIac]{νότου} % \rdg[source=Erm, type=conjecture]{ἐν νώτῳ}}· [...] % % εἰ \app{ % \lem[resp=hegoscr, type=emendation]{μὲν} % \rdg[wit=hcodd, source=hedd]{μὴ} % } εἴη διὰ ταῦτα [...] % \end{ancientgreek} % \end{specimen} % \end{alignment} % % \texttt{TEI xml} output:--- % \enlargethispage{\baselineskip} % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml}

καὶ ἐγίνετο μᾶλλον νότῳ νότου ἐν νώτῳ · [...]

εἰ μὲν μὴ εἴη διὰ ταῦτα [...]

\end{minted} % \iffalse % % \fi % % \subsection{Editorial Addition and Deletion} % \label{sec:editorial-add-del} % \pkg{ekdosis} provides a set of commands to indicate that text has % been supplied or removed by conjecture. As regards critical % symbols conventionally used for representing emendations, lacunae, % omissions, gaps, editorial deletions or additions and the like, % \pkg{ekdosis} follows the standards as described by % \textcite[80--82]{West1973}:--- % \begin{description}[font=\ttfamily] % \item[<>] text added by conjecture or from a parallel source. % \item[***] lacuna in the whole textual tradition. % \item[<***>] conjectured lacuna. % \item[\{\}] editorial deletion. % \item[\dag\dag] text judged by the editor to be corrupt. Note that if % only one word be suspect, only one crux is needed. % \end{description} % % \DescribeMacro{\SetCritSymbols}\newfeature[v1.1] % \cs{SetCritSymbols}\marg{csv list of options} can be used to change % the critical symbols described above. This command accepts the % following list of |key-value| % optional arguments:---\\ % \DescribeOption{suppbegin}|suppbegin|$=$\meta{symbol} % \hfill\tcboxverb{Default: <}\\ % The opening symbol used to mark the text that is supplied.\\ % \DescribeOption{suppend}|suppend|$=$\meta{symbol} % \hfill\tcboxverb{Default: >}\\ % The closing symbol used to mark the text that is supplied.\\ % \DescribeOption{delbegin}|delbegin|$=$\meta{symbol} % \hfill\tcboxverb|Default: {|\\ % The opening symbol used to mark the text that is deleted.\\ % \DescribeOption{delend}|delend|$=$\meta{symbol} % \hfill\tcboxverb|Default: }|\\ % The closing symbol used to mark the text that is deleted.\\ % \DescribeOption{sicbegin}|sicbegin|$=$\meta{symbol} % \hfill\tcboxverb{Default: †}\\ % The opening symbol used to mark the text that is deemed to be % suspect.\\ % \DescribeOption{sicend}|sicend|$=$\meta{symbol} % \hfill\tcboxverb{Default: †}\\ % The closing symbol used to mark the text that is deemed to be % suspect.\\ % \DescribeOption{gapmark}|gapmark|$=$\meta{symbols} % \hfill\tcboxverb{Default: ***}\\ % The symbols used to mark lacunae.\\ % \DescribeOption{keepinapp} |keepinapp|$=$\verb+true|false+ % \hfill\tcboxverb{Default: false}\\ % \newfeature[v1.4] This named argument does not need a value as it % defaults to |true| if used. By default, the critical symbols used by % \cs{supplied}, \cs{surplus} and \cs{sic} described below % \vpagerefrange{ref:corr-cmds-b}{ref:corr-cmds-e} are printed in the % edition text but removed from the apparatus. |keepinapp| instructs % \pkg{ekdosis} to print these symbols in both places. % % As an example, what follows sets |[]| for deletions and |...| for % lacunae:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \SetCritSymbols{ delbegin = [, delend = ], gapmark = \dots } \end{minted} % \iffalse % % \fi % % \danger If modified, brackets can be adapted to languages that are % written from right to left. To that effect, \pkg{ekdosis} provides a % boolean expression |al@rlmode| which is evaluated as |true| if the % writing direction be set from right to left and as |false| % otherwise. As the \pkg{etoolbox} package is loaded by \pkg{ekdosis}, % \cs{ifboolean}|{al@rlmode}|\marg{rtl symbol}\marg{ltr symbol} can be % used to perform the test. % % \paragraph{Editorial Addition} % \phts\label{ref:corr-cmds-b} % \DescribeMacro{\supplied}\newfeature[v1.1]\cs{supplied}\marg{text} % is used to mark \meta{text} that is by definition missing from the % tradition as supplied by the editor or some other scholar. This % command is normally expected in \cs{lem}|{}| or \cs{rdg}|{}|. % % \paragraph{Editorial Deletion} % \DescribeMacro{\surplus}\newfeature[v1.1] \cs{surplus}\marg{text} % is used to mark \meta{text} that is deemed to be inauthentic, but % nevertheless retained between braces in the edition text as it is % transmitted by all witnesses. This command is normally expected in % \cs{lem}|{}| or \cs{rdg}|{}|. % % \paragraph{Crux} % \DescribeMacro{\sic}\newfeature[v1.1] \cs{sic}\marg{text} takes as % mandatory argument the text deemed by the editor to be readable but % not understandable. \cs{sic} inserts \meta{text} between cruces % while \cs{sic*} prints only one crux before \meta{text}. % \phts\label{ref:corr-cmds-e} % % \paragraph{Lacuna} % \DescribeMacro{\gap}\newfeature[v1.1] \cs{gap}\marg{csv list of % options} indicates that some amount of text has fallen away from the % entire tradition. It takes as mandatory argument a comma-separated % list of options that can be used to further specify the reason for % omission, the unit of measurement, the quantity or the extent, as % follows:---\\ % \DescribeOption{reason}|reason|$=$\meta{reason}\\ % |reason| gives the reason for omission.\\ % \DescribeOption{unit} |unit|$=$\meta{unit}\\ % |unit| provides some regularized measurement, such as |character|, % |word|, |line| and the like. % \DescribeOption{quantity} |quantity|$=$\meta{n}\\ % |quantity| specifies the number of the given unit that comprise the % measurement.\\ % \DescribeOption{extent} |extent|$=$\meta{description}\\ % |extent| describes the size, including quantity and unit in a single % string of words. % % \paragraph{Conjectured Lacuna} % Assumably, the conjectured lacuna should be enclosed by % \cs{supplied} and as such contained by \cs{lem} with % |type=emendation| to indicate that the lacuna has been accepted by % the editor. % % Examples follow:\footnote{On the use of \texttt{egomute} % (l.~\lnref{ln:emend:egomute}), see above \vref{it:egomute}.}--- % % \captof{Emendations, conjectures and % corrections}[\label{lst:emend-coni-corr}] % \iffalse %<*example> % \fi \begin{minted}[escapeinside=++]{latex} % Preamble: \DeclareShorthand{egomute}{\unskip}{ego}+\label{ln:emend:egomute}+ % Document: \begin{ekdosis} σχεδὸν \app{ \lem[resp=egomute, nosep, post={post σχεδὸν quattuor uerba+\label{ln:emend:nosep}+ excidisse uid.}, type=emendation]{\supplied{\gap{reason=lost, unit=word, quantity=4}}} } οὗτοι subsidiis magnis \sic*{epicuri} constabilitas declinare quis est qui \sic{possit cernere sese}. \app{ \lem[resp=egomute, type=emendation, nosep, post={ante ὑπογίν.}]{\surplus{καὶ}} \note{deleui e Gal.P} } ὑπογίνονται Πάντων δὲ \app{ \lem[resp=egomute, type=emendation, nosep]{\supplied{τῶν πυρετῶν}}+\label{ln:emend:sep:b}+ \note[sep]{addidi (\arb{^gamI`a 'l-.hummayAti} \getsiglum{Gal})}+\label{ln:emend:sep:e}+ \rdg[nordg, source=Gal]{\arb{al-.hummayAti}} \rdg[wit=codd, source=edd, alt=om.]{} }, \end{ekdosis} \end{minted} % \iffalse % % \fi % % \needspace{11\baselineskip} % PDF output:--- % \medskip % % \resetlinenumber % \begin{alignment}[flush,tcols=1,texts=specimen,apparatus=specimen] % \begin{specimen} % σχεδὸν \app{ % \lem[resp=egomute, nosep, post={post σχεδὸν quattuor uerba % excidisse uid.}, type=emendation]{\supplied{\gap{reason=lost, % unit=word, quantity=4}}} % } οὗτοι % % subsidiis magnis \sic*{epicuri} constabilitas % % declinare quis est qui \sic{possit cernere sese}. % % \app{ % \lem[resp=egomute, type=emendation, nosep, post={ante % ὑπογίν.}]{\surplus{καὶ}} % \note{deleui e Gal.P} % } ὑπογίνονται % % % Πάντων δὲ \app{ % \lem[resp=egomute, type=emendation, nosep]{\supplied{τῶν πυρετῶν}} % \note[sep]{addidi (\arb{^gamI`a 'l-.hummayAti} % \getsiglum{Gal})} % \rdg[nordg, source=Gal]{\arb{al-.hummayAti}} % \rdg[wit=hcodd, source=hedd, alt=om.]{} % }, % \end{specimen} % \end{alignment} % % \texttt{TEI xml} output:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml}

σχεδὸν οὗτοι

subsidiis magnis epicuri constabilitas

declinare quis est qui possit cernere sese.

καὶ deleui e Gal.P ὑπογίνονται

Πάντων δὲ τῶν πυρετῶν addidi ( ^gamI`a 'l-.hummayAti Gal.) al-.hummayAti ,

\end{minted} % \iffalse % % \fi % % \section[Lacunae]{\newfeature[v1.5]Lacunae} % \label{sec:lacunae} % The term \enquote{lacuna} is used here to indicate a series of words % or phrases that are missing from one or more witnesses in the % manuscript tradition. When the lacuna is limited to just a few % words, it may fill an entire entry of the apparatus criticus, % especially when the other witnesses do not provide variants on this % span of text. % % On the other hand, when the lacuna is longer, or includes variants, % or crosses a verse, paragraph or section boundary, it is usually not % desirable to break it into pieces. The recommended method of % encoding is therefore to record explicitly where the lacuna begins % and where it ends. However, in well-written apparatus criticus, % these two items of information must be provided only in the first % entry. Moreover, the line numbering of this entry and the % abbreviated lemma must make clear where the lacuna ends. As a % consequence, the apparatus in print is silent at the place where the % lacuna ends, unlike the \texttt{TEI xml} code which must be explicit % at both places. % % \DescribeMacro{\lacunaStart}\DescribeMacro{\lacunaEnd} % \cs{lacunaStart}\oarg{opt} and \cs{lacunaEnd}\oarg{opt} are used in % the mandatory argument of the \cs{rdg} command to indicate the % beginning and the end of the lacuna. The optional argument of these % commands can be used to specify which witnesses are affected by the % lacuna, as follows:---\\ % \DescribeOption{wit} |wit|$=$\meta{csv list of witnesses}\\ % This option is described above \vpageref{ref:lem-wit}. Of course, it % is unnecessary to use it in the case where only one witness in % involved in the variant reading that supply the information on the % lacuna. % % \DescribeMacro{\ilabel} \phts\label{ref:ilabel-cmd} % \cs{ilabel}\marg{indexed label} is used to recall the indexed label % set by means of the |ilabel| optional argument of the \cs{lem} % command as described above \vpageref{ref:ilabel-opt}. This command % is used to compute the line number where the lacuna ends and must be % inserted precisely at this place, supposedly outside the group % formed by the \cs{app} command used to print the information on the % lacuna in the apparatus criticus. % % This technique is demonstrated by the following example taken from % Cicero's \emph{Letters to Atticus}, VII, % 9.4:\footnote{\cite[121.13--15]{CiceroAtt}. English translation: % \cite[51]{CiceroAttTr}.}--- % % \captof{Cicero, \emph{ad Atticum epistulae}, VII, % 9.4}[\label{lst:cic-att}] % \iffalse %<*example> % \fi \begin{minted}[linenos,escapeinside=++,highlightlines={4-5,7-8}]{latex} \begin{alignment} \begin{edition} Praeteriit tempus non legis, \app{ \lem[wit={C}, ilabel={sed7.9.4.14}, alt={sed\===legis}]{sed}+\label{ln:lac:ilabel:opt}+ \rdg[wit={Ω}, alt=\emph{om.}]{\lacunaStart}+\label{ln:lac:lstart}+ } libidinis tuae, fac tamen \app{ \lem[Nolem, wit={C}]{legis\ilabel{sed7.9.4.14}}+\label{ln:lac:ilabel:cmd}+ \rdg[nordg, wit={Ω}]{\lacunaEnd}}; ut succedatur+\label{ln:lac:lend}+ decernitur; impedis et ais: \enquote{habe meam rationem.} \end{edition} \begin{translation} This term, not a legal term, but a term of your own will and pleasure\===or say, this legal term\===comes to an end. The House passes a decree for the appointment of a successor. You object and cry, \enquote{Consider my candidature.} \end{translation} \end{alignment} \end{minted} % \iffalse % % \fi % % \begin{remarks} % \item At line~\lnref{ln:lac:ilabel:opt}, from the |ilabel| optional % argument, \pkg{ekdosis} knows that the span of text affected by % the lacuna does not end after \emph{sed}, but after \emph{legis} % (l.~\lnref{ln:lac:ilabel:cmd}), at the place where the indexed label % is recalled by \cs{ilabel}. So line numbers are computed % accordingly in the apparatus criticus. % \item The starting and ending points of the lacuna from which the % \sg{Ω} family suffers have been marked by \cs{lacunaStart} and % \cs{lacunaEnd} respectively (ll.~\lnref{ln:lac:lstart} and % \lnref{ln:lac:lend}). % \item Line~\lnref{ln:lac:lend} shows that \emph{legis} % (l.~\lnref{ln:lac:ilabel:cmd}) does not appear in the \sg{Ω} % family. This is where the lacuna ends. Furthermore, as no other % witnesses are mentioned in the \cs{rdg} command % (l.~\lnref{ln:lac:lend}), using the |wit| optional argument of % \cs{lacunaEnd} would introduce an unnecessary redundancy. % \end{remarks} % % PDF output:---\nobreak\medskip % \resetlinenumber % \begin{alignment}[flush,lcols=2] % \begin{edition} % Praeteriit tempus non legis, \app{ % \lem[wit={cicC}, ilabel={sed7.9.4.14}, alt={sed\===legis}]{sed} % \rdg[wit={cicΩ}, alt=\emph{om.}]{\lacunaStart} % } libidinis tuae, fac tamen \app{ % \lem[Nolem, wit={cicC}]{legis\ilabel{sed7.9.4.14}} % \rdg[nordg, wit={cicΩ}]{\lacunaEnd}}; ut succedatur % decernitur; impedis et ais: \enquote{habe meam rationem.} % \end{edition} % \begin{translation} % This term, not a legal term, but a term of your own will and % pleasure\===or say, this legal term\===comes to an end. The % House passes a decree for the appointment of a successor. You % object and cry, \enquote{Consider my candidature.} % \end{translation} % \end{alignment} % % \medskip % \nobreak \texttt{TEI xml} output (Latin only):--- % \iffalse %<*example> % \fi \begin{minted}[linenos]{xml}

Praeteriit tempus non legis, sed libidinis tuae, fac tamen legis ; ut succedatur decernitur; impedis et ais: habe meam rationem.

\end{minted} % \iffalse % % \fi % % \section{Alignment of Parallel Texts} % \label{sec:alignment-basic} % As already said above,\footnote{See point % \vref{it:multicol-feature}.} \pkg{ekdosis} can arrange sundry texts % in parallel columns\---synchronized or not\---either on the same % page or on facing pages. Depending on what is needed, any text can % be equipped with an apparatus criticus. The most common example is % that of an edition of a classical text with an apparatus criticus % accompanied by a translation into a modern language on the facing % page. One can also imagine an edition of two classical texts or two % different recensions of the same text, each of which provides % variants recorded in separate apparatus criticus, laid out on the % left-hand pages, with one or more translations on the corresponding % right-hand pages, and so forth. % % \paragraph{The \env{alignment} Environment} % \DescribeEnv{alignment} \cs{begin}|{alignment}|\oarg{options}\dots % \cs{end}|{alignment}|\phts\label{ref:alignment-syntax}\\ % This environment can be used as it is provided to typeset a standard % critical edition, namely an edition text, equipped with an apparatus % criticus and laid out on the left-hand pages, accompanied by a % translation into a modern language on the facing pages. % % \DescribeEnv{edition}\DescribeEnv{translation} Within % \env{alignment}, two environments are available by default: % \cs{begin}|{edition}|\allowbreak\dots % \cs{end}|{ed|\allowbreak|ition}| and \cs{begin}|{translation}|\dots % \cs{end}|{translation}|. Obviously, the former is used to typeset % the edition text with an apparatus criticus on the left, while the % latter is used to typeset the translation on the right, like so:--- % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \begin{alignment} \begin{edition} First § of the edition text. \end{edition} \begin{translation} First § of the translation. \end{translation} \begin{edition} Second § of the edition text. \end{edition} \begin{translation} Second § of the translation. \end{translation} \end{alignment} \end{minted} % \iffalse % % \fi % % \DescribeEnv{edition*} % \DescribeEnv{translation*} % \phts\label{ref:starred-envs} Furthermore, so-called % \enquote{starred} versions of these environments can be used at any % point to synchronize texts, that is to print them in such a way that % the tops of all paragraphs are vertically aligned. To that effect, % it must be noted that merely applying this command on a single % environment\---for instance the leftmost one\---will have all other % associated paragraphs printed aligned. % % \danger While the whole edition text and the whole translation can % be inserted in a single \env{edition}/\env{translation} environment % respectively, it is recommended to enter both texts paragraph by % paragraph as shown in the example above. Not only this method of % encoding allows not to lose sight of paragraphs that are meant to be % read together, but it is also the only way to align paragraphs in % print, and it is much more suitable to mark up correspondence % between spans of texts. % % As an illustration, a short extract of Caesar's \emph{Gallic War}, % VI, XIII.1 follows.\footnote{Latin text: \cite{Caesar-BG-v2}; % English translation: \cite{CaesarTr}.} See the list of sigla for % manuscripts and manuscript families above % \vpageref{ref:caesar-bg-sigla}. As this document is not set for % duplex printing, both texts have been put together on the same % page. However, the reader will find the full |.tex| source file in % \vref{sec:caesar-gw-tex} and \texttt{TEI xml} output in % \vref{sec:caesar-gw-tei}. The corresponding PDF output is available % in \href{samples/Caesar_BG-6-13-1.pdf}{a separate file}:\footnote{On % the use of \cs{ekddiv} (ll.~\lnref{ln:caes:div1} and % \lnref{ln:caes:div2}), see below \vref{sec:ekddiv}.}--- % % \captof{Caesar's \emph{Gallic War}, VI, 13.1}[\label{lst:caesar-bg}] % \iffalse %<*example> % \fi \begin{minted}[escapeinside=++]{latex} \begin{alignment} \begin{edition} \ekddiv{head=XIII, depth=2, n=6.13, type=section}+\label{ln:caes:div1}+ In omni Gallia eorum hominum qui \app{ \lem[wit=a]{aliquo} \rdg[wit=b, alt=in al-]{in aliquo}} sunt numero atque honore genera sunt duo. Nam plebes paene seruorum habetur loco, quae \app{ \lem[wit={A,M}, alt={nihil audet (aut et \getsiglum{A1}) per se}]{nihil audet per se} \rdg[wit=A1,nordg]{nihil aut et per se}+\label{ln:caes:nordg}+ \rdg[wit={R,S,L,N}]{nihil habet per se} \rdg[wit=b]{per se nihil audet}}, \app{ \lem[wit=a]{nullo} \rdg[wit=b]{nulli}} adhibetur \app{ \lem{consilio} \rdg[wit={T, U}, alt=conc-]{concilio}}. \end{edition} \begin{translation} \ekddiv{head=XIII, depth=2, n=6.13, type=section}+\label{ln:caes:div2}+ Throughout all Gaul there are two orders of those men who are of any rank and dignity: for the commonality is held almost in the condition of slaves, and dares to undertake nothing of itself, and is admitted to no deliberation. \end{translation} \end{alignment} \end{minted} % \iffalse % % \fi % % \begingroup % \needspace{7\baselineskip} % \resetlinenumber % \FormatDiv{2}{}{.} % \begin{alignment}[flush,lcols=2, % texts=edition[xml:lang="la"]; % translation[xml:lang="en"]] % \AtBeginEnvironment{edition}{\selectlanguage{latin}} % \AtBeginEnvironment{translation}{\selectlanguage{american}} % \begin{edition} % \ekddiv{head=XIII, depth=2, n=6.13, type=section} % In omni Gallia eorum hominum qui \app{ % \lem[wit=ca]{aliquo} % \rdg[wit=cb, alt=in al-]{in aliquo}} % sunt numero atque honore genera sunt duo. Nam plebes paene % seruorum habetur loco, quae \app{ % \lem[wit={cA,cM}, alt={nihil audet (aut et \getsiglum{cA1}) % per se}]{nihil audet per se} % \rdg[wit=cA1,nordg]{nihil aut et per se} % \rdg[wit={cR,cS,cL,cN}]{nihil habet per se} % \rdg[wit=cb]{per se nihil audet}}, \app{ % \lem[wit=ca]{nullo} % \rdg[wit=cb]{nulli}} adhibetur \app{ % \lem{consilio} % \rdg[wit={cT, cU}, alt=conc-]{concilio}}. % \end{edition} % \begin{translation} % \ekddiv{head=XIII, depth=2, n=6.13, type=section} % Throughout all Gaul there are two orders of those men who are of % any rank and dignity: for the commonality is held almost in the % condition of slaves, and dares to undertake nothing of itself, % and is admitted to no deliberation. % \end{translation} % \end{alignment} % \endgroup % % \begin{remarks} % \item As can be seen from the apparatus entry related to l.~4 above, % a subvariant has been inserted in the lemma part: \enquote{(aut et % \getsiglum{cA1})}. This was done by using |alt| in % \vref{lst:caesar-bg}, ll.~9--10. But as this variant is already % recorded\---and printed\---in the lemma part, it was necessary to % remove the entire otherwise redundant variant from the apparatus % criticus in print. Hence the use of |nordg| at l.~11. % \item For examples of abbreviations, see ll.~6 and 17. % \item Line~17 shows how mss.\ T and U (which belong to two distinct % subfamilies) have been separated from one another: % % \verb*+wit={T, U}+. See above \vpageref{ref:mss-sep-families} for % more information on this technique. % \end{remarks} % % Finally, the corresponding \texttt{TEI xml} output follows:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml}
XIII

In omni Gallia eorum hominum qui aliquo in aliquo sunt numero atque honore genera sunt duo. Nam plebes paene seruorum habetur loco, quae nihil audet per se nihil aut et per se nihil habet per se per se nihil audet , nullo nulli adhibetur consilio concilio .

XIII

Throughout all Gaul there are two orders of those men who are of any rank and dignity: for the commonality is held almost in the condition of slaves, and dares to undertake nothing of itself, and is admitted to no deliberation.

\end{minted} % \iffalse % % \fi % % \subsection{Alignment of Several Texts} % \label{sec:multiple-alignment} % As described above \vpageref{ref:alignment-syntax}, the % \env{alignment} environment may receive an optional argument in % which % the following \enquote{name$=$value} arguments are accepted:---\\ % \DescribeOption{tcols} % |tcols|$=$\meta{number}\hfill\tcboxverb{Default: 2}\\ % |tcols| stores the \underLine{t}otal number of % \underLine{col}umn\underLine{s} of text to be aligned.\\ % \DescribeOption{lcols} % |lcols|$=$\meta{number}\hfill\tcboxverb{Default: 1}\\ % |lcols| stores the number of \underLine{col}umn\underLine{s} to be % printed on the \underLine{l}eft-hand page, \emph{out of the total % number} of columns specified with |tcols|. As can be seen from the % preceding two default values, \env{alignment} initially sets two % columns of text on facing pages. Of course, for this setting to work % properly, one must ensure that the \env{alignment} environment is % started on a % left page.\\ % \DescribeOption{texts} % |texts|$=$\meta{\underLine{semicolon}-separated % values}\hfill\tcboxverb{Default: edition;translation}\\ % Depending on the total number of columns that has been specified % with |tcols| above, |texts| is then used to define the names of the % environments that shall receive edition texts, translations, % \emph{\&c.} Furthermore, as described \vpageref{ref:starred-envs}, % \pkg{ekdosis} also defines \enquote{starred} versions of these % environments to be used to synchronize columns so that corresponding % paragraphs are printed vertically aligned. Some very important % points need to be emphasized in this respect:--- % \begin{enumerate} % \item Only unaccented letters of the alphabet (whatever the case) % are allowed to compose the names of \LaTeX{} environments. % \item These names must be separated from one another by % \emph{semicolons}, as shown in red in the listing below at the end % of lines~1 and 2. % \begin{enumerate} % \item[\dbend] The comma at the end of line~3 closes the whole % value of |text| and acts as a higher level separator. % \end{enumerate} % \item \phts\label{it:lang-subopt} Each name may be followed by a % \enquote*{suboptional} argument between square brackets which will % then be used to insert \texttt{TEI xml} attributes in the % corresponding |
| element. For example, \iffalse %<*example> % \fi \begin{minted}[escapeinside=++]{latex} texts=latin[xml:lang="la"]+\textcolor{red}{;}+ english[xml:lang="en"]+\textcolor{red}{;}+ french[xml:lang="fr"]+\textcolor{red}{,}+ \end{minted} % \iffalse % % \fi % will be converted into \texttt{TEI xml} as follows:--- % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml}
...
...
...
\end{minted} % \iffalse % % \fi % \begin{enumerate} % \item[\dbend] As can be seen, \pkg{ekdosis} takes care of % computing and inserting the |xml:id| attributes which are % therefore not accepted in the \enquote*{suboptional} arguments % of |texts|. % \end{enumerate} % \item The names of the environments must be specified in exactly the % same order as they are supposed to appear in the print edition, % from left to right. % \end{enumerate} % \DescribeOption{apparatus} % |apparatus|$=$\meta{\underLine{semicolon}-separated % values}\hfill\tcboxverb{Default: edition}\\ % Then, the |apparatus| option, just as |texts|, takes a % \underLine{semicolon}-separated list of previously defined % environments that shall receive at least one layer of apparatus % criticus.\\ % \DescribeOption{paired} |paired|$=$\verb+true|false+%^^A % \phts\label{ref:paired-opt}%^^A % \hfill\tcboxverb{Default: true (initially not set)}\\ % This named argument does not need a value as it defaults to |true| % if used. By default, \pkg{ekdosis} follows the \LaTeX{} page % numbering scheme when multiple texts are arranged on facing % pages. The |paired| option leaves every right-hand page number % unchanged, so that both facing pages hold the same page % number.\footnote{For setting headers and footers in this arrangement % of text, but also for the current limitations attached to this % option, see \vpageref{sec:header-paired-pages}.}\\ % \DescribeOption{lineation} |lineation|$=$\verb+page|document|none+ % \hfill\tcboxverb{Default: document}\\ % This option applies to edition texts initially set to receive an % apparatus criticus. By default, lines are continuously numbered % throughout the document. |lineation=page| sets the numbering to % start afresh at the top of each page. |none| does the same as |page| % but prevents the numbers from being printed in % the margins while keeping them in use in the apparatus criticus.\\ % \DescribeOption{flush} |flush|$=$\verb+true|false+ % \hfill\tcboxverb{Default: false}\\ % This named argument does not need a value as it defaults to |true| % if used. This option applies when two or more distinct % \env{alignment} environments are started on the same page. Should % this happen, any subsequent \env{alignment} environment must be set % with the |flush| option so that every one of them carry its own % apparatus criticus. % % As an example, the alignment of the Latin edition text of Caesar's % \emph{Gallic War}, printed on left-hand pages, along with two % translations into English and French, printed on right-hand pages, % can be set as follows:--- % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \begin{alignment}[tcols=3, lcols=1, texts=latin[xml:lang="la"]; english[xml:lang="en"]; french[xml:lang="fr"], apparatus=latin, lineation=page] \begin{latin} Gallia est omnis divisa in partes tres quarum unam incolunt Belgae, [...] \end{latin} \begin{english} All Gaul is divided into three parts, one of which the Belgae inhabit, [...] \end{english} \begin{french} L'ensemble de la Gaule est divisé en trois parties: l'une est habitée par les Belges, [...] \end{french} \end{alignment} \end{minted} % \iffalse % % \fi % % \DescribeMacro{\SetAlignment} % \cs{SetAlignment}\marg{alignment settings}\\ % If the same alignment settings be shared by several \env{alignment} % environments, common settings can be collected in the argument of % \cs{SetAlignment}, like % so:---\\ % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \SetAlignment{ tcols=3, lcols=1, texts=latin[xml:lang="la"]; english[xml:lang="en"]; french[xml:lang="fr"], apparatus=latin, lineation=page } \begin{alignment} ... \end{alignment} \end{minted} % \iffalse % % \fi % % \cs{SetAlignment} can be used either in the preamble or at % any point of the document to set or to modify alignment settings. % % \subsubsection{Appending Hooks to Environments} % \label{sec:alignment-hooks} % \DescribeMacro{\AtBeginEnvironment} Once environments corresponding % to texts to be aligned have been defined, it is advisable to use the % \cs{AtBeginEnvironment}\marg{environment}\marg{code} command to % further adjust languages, hyphenation rules, and/or fonts to be % applied in each environment. To return to the example provided % above, once \cs{SetAlignment} has been used, the languages can be % set as follows:\footnote{The \cs{setmaxlines} command provides a % further example of applying this technique. See below % \vpageref{ref:setmaxlines-hook}.}--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \AtBeginEnvironment{latin}{\selectlanguage{latin}} \AtBeginEnvironment{english}{\selectlanguage{english}} \AtBeginEnvironment{french}{\selectlanguage{french}} \end{minted} % \iffalse % % \fi % % \subsection{Laying Out Parallel Texts} % \label{sec:laying-out-parallel} % As \pkg{ekdosis} uses the \pkg{paracol} package for the layout of % parallel texts, most of the commands provided by this package % apply. In this respect, quite useful are the commands described in % sections 7.3 to 7.6 on pp.~15--21 of the documentation of this % package.\footcite{paracol} % % \danger It must be noted that all these commands are to be inserted % \emph{before} the \env{alignment} environments on which they are % supposed to operate. % % \subsubsection{Columns and Gutters} % \label{sec:columns-gutters} % % \paragraph{Column Ratio on Single Pages} % \DescribeMacro{\columnratio} % \cs{columnratio}\marg{r\textsubscript{1}, r\textsubscript{2}, \dots\ % , r\textsubscript{n}}, where \emph{r\textsubscript{1}} refers to the % leftmost column, can be used to set the ratio of the columns in % relation to each other. Depending on the total number of columns on % which one wishes to operate, a comma-separated list of decimal % numbers is expected. As an example, \cs{columnratio}|{0.6}| will % instruct \pkg{ekdosis} to have the first column spread over 60~\% of % the total width of the text block, minus the total width of % intercolumnar gutters. % % \paragraph{Column Ratio on Facing Pages} % \cs{columnratio} accepts an optional argument which can be used as % described above to set the ratio of columns to be printed on % right-hand pages, like so: \cs{columnratio}\marg{r\textsubscript{1}, % r\textsubscript{2}, \dots\ , % r\textsubscript{n}}\oarg{r\textsubscript{1}, r\textsubscript{2}, % \dots\ , r\textsubscript{n}}. % % \paragraph{Column Width on Single Pages} % \DescribeMacro{\setcolumnwidth} % \cs{setcolumnwidth}\marg{w\textsubscript{1}, w\textsubscript{2}, % \dots\ , w\textsubscript{n}} operates the same way as % \cs{columnratio} described above, except that dimensions are % expected instead of ratios. As an example, % \cs{setcolumnwidth}|{1in}| will have the width of the first column % set to \unit[1]{in}. % % \paragraph{Gutter Width} % Each value accepted by \cs{setcolumnwidth} can be expressed as a % pair as in % \cs{setcolumnwidth}\marg{w\textsubscript{1}/g\textsubscript{1}, % w\textsubscript{2}/g\textsubscript{2}, \dots\ , % w\textsubscript{n}/g\textsubscript{n}} where the character |/| acts % as a separator, in which case \emph{g\textsubscript{x}} is used to % set the width of the gutter that follows the % \emph{x}\textsuperscript{th} column. As an example, % \cs{setcolumnwidth}|{1in/0.25in}| will print a % \unit[1]{in} first column, followed by a \unit[0.25]{in} gutter. % % \paragraph{Automatically Computed Values} % Widths of columns and widths of gutters can be replaced with % \cs{fill} and \cs{columnsep} respectively. As an example, % \cs{setcolumnwidth}|{\fill/0.25|\allowbreak|in}| will only operate % on the width that follows the first column, all remaining values % being computed automatically. % % \paragraph{Column and Gutter Width on Facing Pages} % Just like \cs{columnratio}, \cs{setcolumnwidth} accepts an optional % argument which can be used to set the width of columns and gutters % to be printed on right-hand pages, like so: % \cs{setcolumnwidth}\marg{w\textsubscript{1}, w\textsubscript{2}, % \dots\ , w\textsubscript{n}}\oarg{w\textsubscript{1}, % w\textsubscript{2}, \dots\ , w\textsubscript{n}} for columns only, % and \cs{setcolumnwidth}\marg{w\textsubscript{1}/g\textsubscript{1}, % w\textsubscript{2}/g\textsubscript{2}, \dots\ , % w\textsubscript{n}/g\textsubscript{n}}% % \oarg{w\textsubscript{1}/g\textsubscript{1}, % w\textsubscript{2}/g\textsubscript{2}, \dots\ , % w\textsubscript{n}/g\textsubscript{n}} for columns and gutters. % % \paragraph{Vertical Rules} % Vertical rules between columns can be drawn by setting the length of % the \LaTeX\ \cs{columnseprule} register to a non-zero value, like % so:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \setlength{\columnseprule}{0.4pt} \end{minted} % \iffalse % % \fi % % \subsubsection{Marginal Notes} % \label{sec:marginal-notes} % By default, marginal notes that refer to the first column are % printed in the left margin, while notes that refer to subsequent % columns are printed in the right margin. % % \DescribeMacro{\marginparthreshold} \cs{marginparthreshold}\marg{n}, % where \emph{n} is an integer, can be used to change the default % settings. This command instructs \pkg{ekdosis} that columns of text, % up to the \emph{n}\textsuperscript{th} column included, shall have % their marginal notes printed to the left. As a result, to take an % example, \cs{marginparthreshold}|{0}| will have all marginal notes % printed in the right margin. \cs{marginparthreshold} also accepts an % optional argument, namely % \cs{marginparthreshold}\allowbreak\marg{n}\oarg{n'}, that can be % used to set the threshold for columns printed in right-hand pages. % % \subsubsection{Regular Footnotes} % \label{sec:regular-footnotes} % \DescribeMacro{\footnotelayout} By default, regular footnotes are % printed at the bottom of the column on which they are % called. \cs{footnotelayout}\marg{key-letter} can be used to change % this setting. This command accepts as mandatory argument a % key-letter which can be either |c|, |p| or |m|. |c| means % \emph{column-wise} footnotes, which is the default value. |p| means % \emph{page-wise}: footnotes from all columns are gathered in a % single spanning block at the bottom of the page. Finally, |m| stands % for \emph{merge}, which means that all footnotes that are called on % a given page, including notes that are called outside the % \env{alignment} environment, are printed in a single spanning block % at the bottom of the page. % % \danger Regular footnotes are printed above the block of critical % notes. The respective places of these blocks can be interchanged by % just loading the \pkg{fnpos} package in the % preamble.\footcite{fnpos} % % \danger The \pkg{footmisc} package\footcite{footmisc} is not % compatible with \pkg{ekdosis}. More precisely, \pkg{footmisc} is % incompatible with the way the \cs{footnote} command is defined % inside the |alignment| environment. Therefore, \pkg{footmisc} can % only be used on the condition that no regular \cs{footnote} be % inserted in the |alignment| environment. % % \section{Laying Out the Apparatus Criticus} % \label{sec:apparatus-layout} % % \subsection{General Hooks} % \label{sec:general-hooks} % Some hooks are shared by all layers of notes that are inserted in % the apparatus criticus (e.g. sources, testimonia, variant readings % \emph{\&c.}) % % \DescribeMacro{\SetHooks} \cs{SetHooks}\marg{csv list of hooks} can % be used either in the preamble or at any point of the document. The % list of accepted % hooks at the time of writing follows:---\\ % \DescribeOption{appfontsize} |appfontsize|$=$\meta{command} % \hfill\tcboxverb{Default: \footnotesize}\\ % This option sets the size of the font to be used in the whole % apparatus criticus. By default, it is the same as the size used for % footnotes.\\ % \DescribeOption{refnumstyle} |refnumstyle|$=$\meta{command} % \hfill\tcboxverb{Default: \bfseries}\\ % |refnumstyle| can be used to set the family, series or shape of the % font used to print references to line numbers in the apparatus % criticus. By default, numbers are printed in bold face. As an % example, |refnumstyle=\normalfont| will have them printed in the % font and shape selected by default for the document, while % |refnumstyle=\bfseries\itshape| will have them % printed in bold and italic.\\ % \DescribeOption{postrefnum} |postrefnum|$=$\meta{command \textbar\ % chars}\hfill\tcboxverb{Default: ~}\\ % |postrefnum| can be used to set what immediately follows the % reference to line numbers. By default, it is |~|, namely an % unbreakable space. As an example, |postrefnum=\hskip 0.5em| will % insert a \unit[0.5]{em} space between the numerals and the beginning % of all subsequent notes.\\ % \DescribeOption{lemmastyle} |lemmastyle|$=$\meta{command} % \hfill\tcboxverb{Default: not set}\\ % \newfeature[v1.2] |lemmastyle| can be used to set the family, series % or shape of the font used to print lemma texts in the apparatus % criticus. For example, |lemmastyle=|\cs{bfseries} will print all % instances of lemma text in bold while % |lemmastyle=|\cs{color}|{blue}| will print them in blue. % \DescribeOption{readingstyle} |readingstyle|$=$\meta{command} % \hfill\tcboxverb{Default: not set}\\ % \newfeature[v1.2] |readingstyle| operates in the same way as % |lemmastyle| but applies to variant readings.\\ % \DescribeOption{familysep} |familysep|$=$\meta{symbol}\verb+|reset+ % \phts\label{ref:familysep}\hfill\tcboxverb{Default: not set}\\ % \newfeature[v1.4] As described above \vpageref{ref:lem-wit}, % multiple witnesses must be recorded in the |wit| optional argument % of the \cs{lem} and \cs{rdg} commands as comma-separated lists of % sigla which can be further grouped into families by inserting spaces % as separators just after commas at specific places. \pkg{ekdosis} % saves and prints these spaces in the apparatus criticus but can be % instructed to print any other symbol instead by means of % |familysep|. For instance, |familysep={,}| has the separating spaces % replaced with commas and |familysep={,\allowbreak}| does the same % while further allowing breaks after commas at the end of % lines. Finally, |familysep=reset| can be used to restore the default % behavior.\\ % \DescribeOption{initialrule} |initialrule|$=$\meta{command} % \phts\label{ref:initialrule}\hfill\bgroup\footnotesize % \tcboxverb{Default: \rule{0.4\columnwidth}{0.4pt} (initially not set)}% % \egroup \newfeature[v1.2] |initialrule| draws a separating rule % between the edition text and all subsequent layers of critical % notes. Of course, this option only makes sense when multiple-layer % apparatus criticus are set. Therefore, it has no effect on % single-layer apparatus criticus.\\ % \DescribeOption{noinitialrule}\hfill\tcboxverb{Default: not set}\\ % This is a no-value option. It removes any previously set % |initialrule|. % % An example of the way these hooks may be used is provided below in % \vref{lst:shak-sonnet1}. % % \medskip\noindent\textbf{Limiting the Number of Entries per Page} % \phts\label{ref:glimit}\\ % \DescribeOption{maxentries} |maxentries|=\meta{n} (where % $n \geq 10$) \hfill\tcboxverb{Default: not set}\\ % \newfeature[v1.5] This option may be used to set a limit to the % number of entries per page that \emph{all layers of critical notes % taken together} may accept, notably when entries are so abundant in % number that \pkg{ekdosis} may oscillate indefinitely between % different sets of page decisions without being able to settle down. % \danger It is also possible to restrict this option to a given layer % of the apparatus criticus as described below % \vpageref{ref:maxentries}. If |maxentries| be set both globally in % \cs{SetHooks} and in \cs{DeclareApparatus} for specific layers, then % the page will break when \emph{any} of the values defined as % |maxentries| has been reached. % % If |maxentries|$=$\meta{n} be set, then \pkg{ekdosis} will issue % \cs{pagebreak} (namely \cs{penalty}|-10000|) just after the % \emph{n\textsuperscript{th}} entry has been inserted in whichever % layer of the apparatus criticus. As a result, the page will actually % break at the end of the current line. The particulars of this % technique will be discussed below in % \vref{sec:oscillating-problem}.\\ % \DescribeOption{nomaxentries}\hfill\tcboxverb{Default: not set}\\ % |nomaxentries| does not accept any value and is equivalent to % |maxentries=none|. % % \medskip % \noindent\textbf{Option Specific to the |layout=keyfloat| Global % Setting}\footnote{See above \vref{ref:keyfloat-opt}.}\\ % \DescribeOption{keyparopts}% % \phts\label{ref:keyparopts}|keyparopts|$=$\meta{csv options} % \hfill\tcboxverb{Default: empty}\\ % \newfeature[v1.3] The comma-separated options that can be used are % those described in the documentation of the \pkg{keyfloat} % package.\footcite[sect.~2.3, \ppno~\pnfmt{13--15}]{keyfloat} As an % example, |keyparopts={ft, tr={made with ekdosis},| % % \allowbreak|lw=1.2}| will draw a tight frame around the apparatus % block, have the words \enquote{made with \pkg{ekdosis}} printed % below this block on the % right and set its width to |1.2\linewidth|. % % \medskip\noindent % \textbf{Options Specific to the |layout=fitapp| Global % Setting}\footnote{See above \vref{ref:fitapp-opt}.}\\ % \DescribeOption{appheight}% % \phts\label{ref:appheight}|appheight|$=$\meta{dimension} % \hfill\tcboxverb{Default: 0.5\textheight}\\ % \newfeature[v1.3] This option is used to change the maximum height % up to which the apparatus block is allowed to grow before the size % of the characters is reduced to allow for more entries. The value % must be a dimension, namely a number followed by a length unit, such % as |0.65\textheight|, |18cm| or |6in|. \mansee To learn how this % value can be adjusted on given pages, see below % \vpageref{ref:fitapp-trick}.\\ % \DescribeOption{fitalgorithm}% % \phts\label{ref:fitalgorithm} % \unskip|fitalgorithm|$=$\verb+fontsize|hybrid|areasize|squeeze+ % \hfill\tcboxverb{Default: fontsize}\\ % \newfeature[v1.3] The four algorithms that can be used to have the % entries inserted in the apparatus criticus fit to the selected % height are presented here from the tightest to the loosest, that is, % the slowest to the fastest.\footnote{See \cite[446--449]{tcolorbox} % for details and illustrative examples.} While it is advisable to % limit the use of |fontsize| to high quality typesetting for % camera-ready copies, |areasize| offers a satisfactory settlement % when speed must be given an advantage for intermediate or draft % copies. |squeeze| should be avoided as it gives results that are % offensive to the sight and unacceptable to any reader. % % \subsection{Single-Layer Apparatus Criticus} % \label{sec:single-layer-app} % \paragraph{Specific Commands} % Single-layer apparatus criticus can be laid out in a variety of % ways with the following specialized commands, all of which can be % used in the preamble or at any point of the document:--- % % \DescribeMacro{\SetLTRapp} % \DescribeMacro{\SetRTLapp} % \cs{SetLTRapp} and \cs{SetRTLapp} are two argument-less commands to % set the direction of the apparatus criticus, either left-to-right or % right-to-left. % % \DescribeMacro{\SetSeparator} \cs{SetSeparator}\marg{separator} is % used to change the separator between lemma texts and variant % readings. By default, the separator is a closing square bracket % followed by a space (\verb*+] +). % % \DescribeMacro{\SetSubseparator}\label{ref:setsubseparator} % \newfeature[v1.4] \cs{SetSubseparator}\marg{subseparator} is used to % set or change the \enquote{subseparator} between succeeding variant % readings. By default, no subseparator is set. % % \danger As the subseparator applies to subsequent variant readings % only, it is naturally preceded by a breakable space. This space can % be removed by \cs{unskip}. As an example, what follows replaces the % breakable space with an unbreakable space, then prints a colon as % subseparator followed by a space:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \SetSubseparator{\unskip~: } \end{minted} % \iffalse % % \fi % % \danger \DescribeMacro{\ekdsep} \DescribeMacro{\ekdsubsep} % \phts\label{ref:ekdsep-subsep} Once the separator and if applicable % the subseparator have been set, they can be accessed by \cs{ekdsep} % and \cs{ekdsubsep} respectively. It is therefore advisable to use % these commands instead of the mere symbols at whatever place one % would have them printed. % % \DescribeMacro{\SetBeginApparatus} % \cs{SetBeginApparatus}\marg{characters\textbar commands} can be used % to append \meta{characters} or \meta{commands} at the beginning of % the apparatus block. By default, nothing is appended. For instance, % |\SetBeginApparatus{\textbf{Apparatus:}}| will append % \enquote{\textbf{Apparatus:}} at the beginning of the apparatus % block, while |\SetBeginApparatus{\hskip 1em}| will set an % indentation of one em. % % \DescribeMacro{\SetEndApparatus}\phts\label{ref:setendapparatus} % \cs{SetEndApparatus}\marg{characters} can be used to append % \meta{characters} at the end of the apparatus block. By default, % nothing is appended. \phts\label{ref:ending-dot}As an example of % use, |\SetEndApparatus{.}| will have a period printed at the end of % the apparatus as it is customary in some % editions.\footnote{\label{fn:rm-dots}See also below % \vpageref{sec:superfluous-dots} on how to remove superfluous dots.} % % \DescribeMacro{\SetUnitDelimiter} % \cs{SetUnitDelimiter}\marg{delimiter} can be used to set the % delimiter between entries in the apparatus criticus. By default, % there is no delimiter except a simple space. \meta{delimiter} can be % a broad space (such as |\hskip 0.75em| for instance as in the OCT % series) or the divider-sign (‖, as in the Budé series). % % \DescribeMacro{\SetDefaultRule} % By default, \pkg{ekdosis} draws a separating line between the % edition text and the apparatus criticus. This line is initially % defined as % |\rule{0.4\columnwidth}{0.4pt}|. \cs{SetDefaultRule}\marg{line % definition} can be used in the preamble or at any point of the % document to change the default setting. Leaving this argument empty % as in \cs{SetDefaultRule}|{}| removes the line. % % \DescribeMacro{\SetApparatusLanguage} % \phts\label{ref:app-lang}\newfeature[v1.2] % \cs{SetApparatusLanguage}\marg{languagename} can be used when it is % needed to apply in the apparatus criticus a language different from % the one that is selected in the edition text. % % \DescribeMacro{\SetApparatusNoteLanguage} % \phts\label{ref:app-note-lang}\newfeature[v1.3] % \cs{SetApparatusNoteLanguage}\marg{languagename} can be used when it % is needed to apply in text entries introduced by the mandatory % argument of the \cs{note} command as described in % \vref{ref:type-note}\===namely % \cs{note}\oarg{options}\marg{text}\===a language different from the % one that is selected in the edition text. % % \paragraph{General Command} % \DescribeMacro{\SetApparatus} \cs{SetApparatus}\marg{csv list of % apparatus settings}\phts\label{ref:apparatus-settings-b}\\ % Finally, all the settings described above can also be collected in % the argument of \cs{SetApparatus}. \cs{SetApparatus} accepts the % following list of comma-separated |key=value| options:---\\ % \DescribeOption{direction} |direction|$=$\verb+LR|RL+ % \hfill\tcboxverb{Default: LR}\\ % The writing direction of the apparatus criticus, either % left-to-right (|LR|) or right-to-left (|LR|).\\ % \DescribeOption{sep} |sep|$=$\meta{command \textbar\ chars} % \hfill\tcboxverb{Default: ]␣}\\ % The separator between lemma texts and variant readings.\\ % \DescribeOption{subsep} |subsep|$=$\meta{command \textbar\ chars} % \hfill\tcboxverb{Default: not set}\\ % The \enquote{subseparator} between succeeding variant readings.\\ % \DescribeOption{delim} |delim|$=$\meta{delimiter} % \hfill\tcboxverb{Default: not set}\\ % The delimiter between entries in the apparatus criticus. As said % above, there is no default delimiter except a simple space.\\ % \DescribeOption{bhook} |bhook|$=$\meta{characters\textbar commands} % \hfill\tcboxverb{Default: empty}\\ % The characters or commands to be appended at the beginning of the % apparatus block.\\ % \DescribeOption{ehook} |ehook|$=$\meta{characters} % \hfill\tcboxverb{Default: empty}\\ % The characters to be appended at the end of the apparatus % block.\footnote{See also n.~\vref{fn:rm-dots}.}\\ % \DescribeOption{rule} |rule|$=$\meta{command} % \hfill\tcboxverb{Default: \rule{0.4\columnwidth}{0.4pt}}\\ % As described above, |rule| is used to draw the separating line % between the edition text and the apparatus criticus.\\ % \DescribeOption{norule}\hfill\tcboxverb{Default: not set}\\ % |norule| does not accept any value and is used to remove the % line.\\ % \DescribeOption{lang} |lang|$=$\meta{languagename} % \newfeature[v1.2]\phts\label{ref:app-lang-opt} % \hfill\tcboxverb{Default: not set}\\ % |lang=| is used as described % \vpageref[above]{ref:app-lang} when it is needed to apply in the % apparatus criticus a language different from the one that is % selected in the edition text. |languagename| can be any value % accepted by \pkg{babel} or \pkg{polyglossia}. % \DescribeOption{notelang} |notelang|$=$\meta{languagename} % \newfeature[v1.3]\phts\label{ref:app-note-lang-opt} % \hfill\tcboxverb{Default: not set}\\ % |notelang=| is used as described % \vpageref[above]{ref:app-note-lang} when is needed to apply in text % entries introduced by the mandatory argument of the \cs{note} % command as described in \vref{ref:type-note}\===namely % \cs{note}\oarg{options}\marg{text}\===a language different from the % one that is selected in the edition text. |languagename| can be any % value accepted by \pkg{babel} or \pkg{polyglossia}. % \phts\label{ref:apparatus-settings-e} % % As an example, an apparatus criticus with references to line numbers % printed in normal font, a colon as a separator between lemma texts % and variant readings, a broad space as a delimiter between entries % and a \unit[0.7]{in} line above could be laid out as follows:--- % % \phts\label{ex:single-layer-app-layout} % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \SetHooks{ refnumstyle=\normalfont } \SetApparatus{ sep={: }, delim=\hskip 1em, rule=\rule{0.7in}{0.4pt} } \end{minted} % \iffalse % % \fi % % \paragraph{Footnote Separator} % \DescribeMacro{\footnoteruletrue} \DescribeMacro{\footnoterulefalse} % As already seen above, \pkg{ekdosis} takes care of drawing a % separating line between the edition text and the apparatus % criticus. Therefore, it may be not desirable to have the standard % \LaTeX\ \enquote{footnoterule} printed on every page where regular % footnotes are found. \cs{footnoterulefalse} removes it while % \cs{footnoteruletrue} leaves it untouched. The latter is set by % default. % % \subsection{Multiple-Layer Apparatus Criticus} % \label{sec:multilayer-apparatus} % As said above in \vref{it:multilayer-feature}, \pkg{ekdosis} can % print edition texts equipped with multiple-layer apparatus % criticus. To take an example, most classical editions provide at % least two layers of notes: one to collect references to testimonia % or parallel passages (apparatus testium) and the other to record % variant readings (the apparatus criticus \emph{stricto sensu}). The % former is always printed above the latter. % % \danger The default single-layer apparatus criticus that is % described above in \vref{sec:single-layer-app} is called |default| % internally. If any additional layer of notes be declared in the % preamble, this |default| layer must be included in the list of % declared layers.\\ % \DescribeMacro{\SetDefaultApparatus}\phts\label{ref:ekd-default-app} % \cs{SetDefaultApparatus}\marg{name} can be used at any point of the % document to change the name to be used as the default one by % \pkg{ekdosis}. % % \subsubsection{Declaring Additional Layers} % \label{sec:declaring-layers} % \DescribeMacro{\DeclareApparatus} % \cs{DeclareApparatus}\marg{name}\oarg{csv list of apparatus % settings} is a preamble-only command. As a mandatory argument, it % takes the name of the new layer of notes to be inserted in the % apparatus block. Declared layers are then printed one below the % other in the exact same order as they are declared in the % preamble. Therefore, one additional layer meant to print the % testimonia above the variant readings (apparatus testium) can be % declared as follows:--- % % \iffalse %<*example> % \fi \begin{minted}{latex} % preamble: \DeclareApparatus{testium} \DeclareApparatus{default} \end{minted} % \iffalse % % \fi % % In this example, |testium| is a new name for |default|, as said % just above, is already known to \pkg{ekdosis} and used as the % default layer of notes. Furthermore, as |testium| is declared before % |default|, \pkg{ekdosis} will print the testimonia at the top of the % apparatus block. % % \subsubsection{Laying Out Layers With The Optional Argument % of \cs{DeclareApparatus}} % \label{sec:layout-layers} % \DescribeOption{direction} % \DescribeOption{sep} % \DescribeOption{subsep} % \DescribeOption{delim} % \DescribeOption{bhook} % \DescribeOption{ehook} % \DescribeOption{rule} % \DescribeOption{norule} % \DescribeOption{lang}\phts\label{ref:apps-lang-opt} % \DescribeOption{notelang} % With regard to layout, any declared layer inherits the default values % described above in \vref{sec:single-layer-app}. That said, as the % optional argument of \cs{DeclareApparatus} accepts the exact same % |key-value| options as \cs{SetApparatus} described % \vpagerefrange{ref:apparatus-settings-b}{ref:apparatus-settings-e}, % \pkg{ekdosis} provides a straightforward mechanism to have any layer % printed in a distinct layout. % % To return to the example provided % \vpageref[above]{ex:single-layer-app-layout}, one could keep the % same settings as above for the variant readings, declare an % apparatus testium with a closing square bracket as a separator and % finally remove the line between the testimonia and the variant % readings like so:--- % % \iffalse %<*example> % \fi \begin{minted}[numbersep=-.5\linewidth]{latex} \SetHooks{ refnumstyle=\normalfont, initialrule=\rule{0.7in}{0.4pt} } \DeclareApparatus{testium}[ sep={] }, delim=\hskip 1em, norule ] \DeclareApparatus{default}[ sep={: }, delim=\hskip 1em, rule=\relax ] \end{minted} % \iffalse % % \fi % % \begin{remarks} % \item The general hook \texttt{initialrule} used here (l.~3) is % described above \vpageref{ref:initialrule}. % \item \cs{relax} (l.~13) is a \TeX\ primitive that instructs to do % nothing. Therefore, |rule=\relax| is not strictly equivalent to % |norule|: with the former, \cs{relax} removes the rule but leaves % untouched the subsequent carriage return: as a result, the layers % are visually separated from one another by a blank line. With the % latter everything is removed, carriage return included. % \end{remarks} % % \paragraph{Limiting the Number of Entries per Page} % \phts\label{ref:maxentries} % In some instances, it may be useful to set a limit to the number of % entries per page that a given layer of critical notes may accept, % notably when entries are so abundant in number that \pkg{ekdosis} % may oscillate indefinitely between different sets of page decisions % without being able to settle down.\\ % \DescribeOption{maxentries} |maxentries|=\meta{n} (where $n \geq % 10$) \hfill\tcboxverb{Default: not set} % \danger It is also possible to set a maximum number of entries for % all layers of critical notes taken together as described above % \vpageref{ref:glimit}. If |maxentries| be set both globally in % \cs{SetHooks} and in \cs{DeclareApparatus} for specific layers, then % the page will break when \emph{any} of the values defined as % |maxentries| has been reached. % % If |maxentries|$=$\meta{n} be set, then \pkg{ekdosis} will issue % \cs{pagebreak} (namely \cs{penalty}|-10000|) just after the % \emph{n\textsuperscript{th}} entry has been inserted in the layer of % the apparatus criticus this option is related to. As a result, the % page will actually break at the end of the current line. The % particulars of this technique will be discussed below in % \vref{sec:oscillating-problem}. % % \section{Inserting Notes in Multiple-Layer Apparatus} % \label{sec:notes-in-multilayer-app} % As said above in \vref{sec:multilayer-apparatus}, \pkg{ekdosis} % initially sets one layer of notes that is called the % \textooquote|default|\textcoquote\ layer. As a result, any note % inserted within the argument of \cs{app}|{}| as described % \vpageref{ref:app-cmd} will go into that layer of the apparatus, % unless \cs{SetDefaultApparatus} has been used to set another % name for the default layer (see above % \vpageref{ref:ekd-default-app}). % % \subsection{Variant Readings} % \label{sec:variant-readings} % In most cases, all variant readings go into the % \textooquote|default|\textcoquote\ layer of the apparatus % criticus. But in some other cases, for example when the manuscripts % used refer to different recensions, it may happen that one wishes to % record the related variants in separate layers. As already described % \vpageref{ref:app-type}, the |type| optional argument of the % \cs{app} command can be used to insert lemma texts and associated % variants in any other \enquote*{declared} layer of the apparatus % criticus. % % The following example assumes that some edition text is received in % two different recensions and the variant readings that belong to the % first recension are recorded in the default layer of notes while % those of the second recension are to be printed in a second layer, % below the default one. First, both layers must be declared in the % preamble in sequence, like so:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \DeclareApparatus{default} % default layer \DeclareApparatus{rec2} % additional layer below the default one \end{minted} % \iffalse % % \fi % % Should one wish to refer to |rec1| as the default layer, then % \cs{SetDefaultApparatus} must be used, like so:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \SetDefaultApparatus{rec1} \DeclareApparatus{rec1} % new layer set as default \DeclareApparatus{rec2} % additional layer below the default one \end{minted} % \iffalse % % \fi % % Then, whatever option has been chosen, lemma texts and variants % inserted with \cs{app}|{}| will go into the upper, default layer of % notes, while those inserted with \cs{app}|[type=rec2]{}| will go % into the lower one:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} Some \app{ \lem{word} \rdg{reading} } to go into the default layer of notes. Some \app[type=rec2]{ \lem{note} \rdg{comment} } to be recorded as part of the second recension. \end{minted} % \iffalse % % \fi % % \danger At any rate, |type=default| or |type=rec1|, depending on % what has been chosen, must be used should the editor wish to retain % that information in the \texttt{TEI xml} output file. % % \subsection{Other Notes for Comments, Sources or Testimonia} % \label{ref:type-note} % Additional layers of notes can be used to print short comments or to % record references to texts quoted by the author of the edited text % or references to the edited text by other authors or % translators. The former set is called an \emph{apparatus fontium} % while the latter is called an \emph{apparatus testium}. % % \danger From a technical standpoint, these notes are very different % from the short editorial notes inserted between lemma texts and % variant readings that have been described above % \vpageref{ref:editorial-notes}. However, for the sake of consistency % with \texttt{TEI xml} encoding, \pkg{ekdosis} uses the same command % \cs{note} to insert both kinds of notes. % % \danger One must also keep in mind that the notes that are described % in this section refer either to a single word or to a span of % text. By consequence, as boundaries must always be set outside spans % of text, notes must be inserted immediately before the word or words % they are related to. As a result of this rule, all spaces subsequent % to \cs{note} are ignored. % % \needspace{2\baselineskip} % \DescribeMacro{\note} \cs{note}\oarg{options}\marg{text}\\ % As said above, \cs{note}, when found outside \cs{app}|{}|, is used % to insert in additional layers of the apparatus short comments or % references to texts quoted or cited in the edition text. It accepts % the following comma-separated list of |key-value| optional % arguments:---\\ % \DescribeOption{type} |type|$=$\meta{type}\\ % |type| is used to specify the name of the layer where the note is to % be printed.\footnote{See \vref{sec:declaring-layers} to learn how to % declare and lay out new layers of notes.}\\ % \DescribeOption{nodelim} |nodelim|$=$\verb+true|false+\\ % \newfeature[v1.5] This named argument does not need a value as it % defaults to |true| if used. This option removes the delimiter that % is printed just before the note in the apparatus criticus.\\ % \DescribeOption{sep} |sep|$=$\meta{command \textbar\ chars}\\ % The separator between the lemma text and the contents of the note.\\ % \DescribeOption{nosep} |nosep|$=$\verb+true|false+\\ % This named argument does not need a value as it defaults to |true| % if used. Obviously, |nosep| removes the separator mentioned % above.\\ % \DescribeOption{lem} |lem|$=$\meta{lemma text}\\ % |lem| is the span of text the note is about. It may consist of one % or more words, or of an abridged lemma text.\\ % \DescribeOption{num} (no-value argument)\newfeature[v1.3]\\ % |num| takes no value. If used, this argument instructs to print any % line number that \pkg{ekdosis} may have decided not to print in the % apparatus criticus before the note.\\ % \DescribeOption{nonum} (no-value argument)\\ % Compared to |num|, |nonum| does the opposite. If used, any number % that \pkg{ekdosis} may have decided to print before the note % is suppressed.\\ % \DescribeOption{labelb} |labelb|$=$\meta{label} % \hfill\tcboxverb{Mandatory}\\ % |labelb| is the unique label to serve as a reference for the point % immediately preceding the lemma text. \danger |labelb| is used by % \pkg{ekdosis} to print the line numbers in the apparatus criticus % and to set the |left()| XPointer should \texttt{TEI} output be % required. Therefore, it must be specified. Otherwise, \pkg{ekdosis} % will issue an error message. However, two strictly consecutive % \cs{note} commands are allowed to share the same |labelb| value for % it may happen that consecutive notes need to refer to spans of text % that begin at the exact same location. In this case, \pkg{ekdosis} % generates only one \cs{linelabel} and one corresponding % || element in the \texttt{TEI xml} file.\\ % \DescribeOption{labele} |labele|$=$\meta{label}\\ % |labele| is the unique label to serve as a reference for the point % immediately following the lemma text. Contrary to |labelb|, |labele| % may be left unspecified if the note be only about one word. If the % note be about a span, then |labele| must be specified.\\ % \DescribeMacro{\linelabel} \cs{linelabel}\marg{label}\\ % If |labele|$=$\meta{some\_label} be specified in the optional % argument of \cs{note}, \cs{linelabel}\marg{some\allowbreak\_label} % must be inserted immediately after the span of text that the note is % about so that \pkg{ekdosis} can locate the exact point where the % lemma text addressed by the note ends, like so:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} % Preamble: % \DeclareApparatus{fontium}[ % delim=\hskip0.75em, % bhook=\textbf{Sources:}, % ehook=.] % \DeclareApparatus{default}[ % delim=\hskip0.75em, % ehook=.] % Document: \begin{ekdosis} The oldest monument of the Germans is their language, which, before untold centuries, was the companion of their travels from central Asia; a language, copious, elastic, inviting self-explaining combinations and independent development; lending itself alike to daily life and imagination, to description and abstract thought. \note[type=fontium, labelb=B61e, labele=B62a, lem={They had... slave}]{Waitz, \emph{Deutsche Verfassungs Geschichte}, i. 86} They had a class of nobles, but their tongue knew no word for slave.\linelabel{B62a}\footnote{George Bancroft, \emph{History of the United States from the Discovery of the American Continent}, II.61--2.} \end{ekdosis} \end{minted} % \iffalse % % \fi % % PDF output:--- % \medskip % % \needspace{7\baselineskip} % \resetlinenumber % \begin{alignment}[flush,tcols=1,texts=specimen,apparatus=specimen] % \begin{specimen} % The oldest monument of the Germans is their language, which, % before untold centuries, was the companion of their travels from % central Asia; a language, copious, elastic, inviting % self-explaining combinations and independent development; % lending itself alike to daily life and imagination, to % description and abstract thought. \note[type=fontium, % labelb=B61e, labele=B62a, lem={They had... slave}]{Waitz, % \emph{Deutsche Verfassungs Geschichte}, i. 86} They had a class % of nobles, but their tongue knew no word for % slave.\linelabel{B62a}\footnote{George Bancroft, \emph{History of % the United States from the Discovery of the American Continent}, % II.61--2.} % \end{specimen} % \end{alignment} % % \texttt{TEI xml} output:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml}

The oldest monument of the Germans is their language, which, before untold centuries, was the companion of their travels from central Asia; a language, copious, elastic, inviting self-explaining combinations and independent development; lending itself alike to daily life and imagination, to description and abstract thought. Waitz, Deutsche Verfassungs Geschichte, i. 86 They had a class of nobles, but their tongue knew no word for slave. George Bancroft, History of the United States from the Discovery of the American Continent, II.61--2.

\end{minted} % \iffalse % % \fi % % \paragraph{\cs{note} or \cs{linelabel} inside \cs{lem}} % It may happen that the \cs{note} or \cs{linelabel} command is found % inside the argument of \cs{lem}. Obviously, inserting such a command % in the apparatus criticus in print makes no sense and will lead to % an error. The solution is to insert in the value of the |alt| % optional argument of \cs{lem} a duplicate of the lemma text devoid % of that command, like so:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} This is some \app{ \lem[alt=dummy]{\note[type=fontium, labelb=bnote, labele=enote, lem=dummy... command]{Text of the note.} dummy} \rdg{pseudo}} text to demonstrate how to insert a note in the argument of the \emph{lem} command.\linelabel{enote} \end{minted} % \iffalse % % \fi % % PDF output:--- % \medskip % % \needspace{7\baselineskip} % \resetlinenumber % \begin{alignment}[flush,tcols=1,texts=specimen,apparatus=specimen] % \begin{specimen} % This is some \app{ % \lem[alt=dummy]{\note[type=fontium, labelb=bnote, labele=enote, % lem=dummy... command]{Text of the note.} % dummy} % \rdg{pseudo}} % text to demonstrate how to insert a note in the argument of the % \emph{lem} command.\linelabel{enote} % \end{specimen} % \end{alignment} % % \texttt{TEI xml} output:--- % % \iffalse %<*example> % \fi \begin{minted}{xml}

This is some dummy Text of the note. pseudo text to demonstrate how to insert a note in the argument of the lemcommand.

\end{minted} % \iffalse % % \fi % % As can be seen from the \texttt{TEI xml} output above, the span of % text the note is about has been carefully delimited by two anchors % (ll.~4 and 12), the first of which falls within || (l.~4), but % \pkg{ekdosis} has taken care of moving the note itself out of this % element (ll.~5--7). Otherwise, the \texttt{TEI} output would not be % valid. % % \subsection{Footnotes Combined Into a Single Paragraph} % \label{sec:footnotes} % % \needspace{4\baselineskip} % \section{Poetry} % \label{sec:poetry} % \subsection[The Standard \textsf{verse} Environment]{The Standard % \env{verse} Environment} % \label{sec:stand-verse-env} % % In order to typeset verse texts or poems, \LaTeX\ provides the % standard \env{verse} environment. Within this environment, |\\| is % normally used to end lines, with the exception of the last line. As % a result, stanzas are separated from one another by a blank line. % % \pkg{ekdosis} provides \env{ekdverse} which is recommended for use % in place of the standard \env{verse} environment. By default, % \env{ekdverse} produces the same result as \env{verse}. However, % \pkg{ekdosis} deviates a little from the standard usage for it needs % all lines of poetry to be ended by |\\| as a distinct marker. In the % following listing, stanzas are visually separated from one another % by an additional vertical space of \unit[2]{ex} (l.~5). Between % stanzas, |%| is used to prevent \TeX\ from % introducing a blank line. But a blank line\===or even no blank % line\===would produce the exact same result:--- % % \iffalse %<*example> % \fi \begin{minted}{latex} \begin{ekdverse} It is an ancient Mariner,\\ And he stoppeth one of three.\\ ‘By thy long grey beard and glittering eye,\\ Now wherefore stopp'st thou me?\\[2ex] % The Bridegroom's doors are opened wide,\\ And I am next of kin;\\ The guests are met, the feast is set:\\ May'st hear the merry din.’\\ \end{ekdverse} \end{minted} % \iffalse % % \fi % % PDF output:--- % \medskip % \SetLineation{vmodulo=0} % \begingroup % \needspace{7\baselineskip} % \resetlinenumber\resetvlinenumber % \begin{alignment}[flush,tcols=1,texts=coleridge,apparatus=coleridge] % \begin{coleridge} % \begin{verse} % It is an ancient Mariner,\\ % And he stoppeth one of three.\\ % ‘By thy long grey beard and glittering eye,\\ % Now wherefore stopp'st thou me?\\[2ex] % % The Bridegroom's doors are opened wide,\\ % And I am next of kin;\\ % The guests are met, the feast is set:\\ % May'st hear the merry din.’\\ % \end{verse} % \end{coleridge} % \end{alignment} % \endgroup % \SetLineation{vmodulo=1} % \medskip % % \indent\texttt{TEI xml} output:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml} It is an ancient Mariner, And he stoppeth one of three. ‘By thy long grey beard and glittering eye, Now wherefore stopp'st thou me? The Bridegroom's doors are opened wide, And I am next of kin; The guests are met, the feast is set: May'st hear the merry din.’ \end{minted} % \iffalse % % \fi % % One would have expected here the || element to be used as % delimiter to encode the stanzaic verse forms. But as can be seen, % only the outermost level of line group has been converted into % \texttt{TEI xml}, let alone the vertical spacing between stanzas % which has been ignored. This is because it is about as much as the % standard \env{verse} environment provides. % % \subsection[The \textsf{verse} Package]{The \pkg{verse} Package} % \label{sec:verse-package} % \newfeature[v1.2] % \pkg{ekdosis} can use the facilities offered by the excellent % \pkg{verse} package\footcite{verse} to which it adds a specific % environment for the encoding of line groups such as % stanzas. Furthermore, as the \pkg{verse} package provides its own % numbering mechanism, the lines can be numbered independently of % prose text.\footnote{See \vpageref{ref:verse-lineation} for % details.} % % \danger For what is described in this section to operate, % \pkg{ekdosis} must be loaded with the global option |poetry=verse| % as explained above \vpageref{ref:poetry-opt}. Simply loading the % \pkg{verse} package by means of \cs{usepackage} will have no effect. % % \danger The foregoing does not apply if the \cls{memoir} class be % used.\footcite{memoir} In this case, \pkg{ekdosis} automatically % uses the code provided by this class without the need to set % the global option |poetry=verse|. % % \paragraph{Compatible Verse Commands} % The reader is invited to refer to the documentation of the % \env{verse} package for detailed information. Within the % \env{ekdverse} environment, |\\| \emph{must be used} at the end of % each line, as follows:--- % \begin{enumerate} % \item |\\| is the standard command to be used at the end of each % line. % \item |\\!| must be used at the end of stanzas or line groups % instead of |\\|. % \item |\\*| does the same as |\\| except that it prohibits a page % break after the line. % \item |\\>| \label{ref:vlinebreak-indent}is for line breaks within a % verse line. % \item |\\+| \newfeature[v1.4] \label{ref:vlinebreak-noindent}does % the same as |\\>| but without indenting the subsequent line which % further complies to any already defined indent pattern. % \end{enumerate} % % All of these commands can take a dimension as optional argument, % like so: |\\[30pt]|, |\\![30pt]|, |\\*[30pt]|, |\\>[30pt]| or % |\\+[30pt]|. If |\\|, |\\!|, |\\*| or |\\+| be used, a vertical % space of the dimension specified is added between lines, whereas % |\\>[...]| adds an horizontal space after the line break. % % \DescribeMacro{\vin} \phts\label{ref:verse-vin}\cs{vin} indents a % verse line by a length which is by default \unit[1.5]{em}. This % length is stored as \cs{vgap} and can be changed by \cs{setlength} % or \cs{addtolength}. % % \paragraph{The \env{ekdverse} Environment} % \DescribeEnv{ekdverse} \cs{begin}|{ekdverse}|\oarg{options} \dots\ % \cs{end}|{ekdverse}|\phts\label{ref:ekdverse-syntax}\\ % This environment is used to hold verse lines as described above and % may receive an optional argument in which the following % \enquote{name$=$value} arguments are accepted:---\\ % \DescribeOption{width} |width|$=$\meta{length} % \hfill\tcboxverb{Default: \linewidth}\\ % If |width| be supplied, it is taken as a length in relation to which % the entire contents of the environment are to be horizontally % centered. If given, this dimension may correspond to an average line % or to the longest line of the line group. To this end, the standard % \LaTeX\ command \cs{settowidth} can be used, like so:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \settowidth{\versewidth}{This is the average line,} \begin{ekdverse}[width=\versewidth] ... \end{ekdverse} \end{minted} % \iffalse % % \fi % % \begin{remarks} % \item[\textsc{Rem.}] \cs{versewidth} is provided by the \env{verse} % package as a convenience and can be used by \env{ekdosis}. % \end{remarks} % \DescribeOption{type} |type|$=$\meta{type} % \hfill\tcboxverb{Default: not set}\\ % This named argument is used in the \texttt{TEI xml} output to % name the type of unit encoded within the || element, viz.\ % \enquote{sonnet}, \enquote{quatrain}, \enquote{couplet} and the % like. % % \danger Unlike the \texttt{TEI xml} element ||, \env{ekdverse} % may not nest hiearchichally. Within this environment, % \env{ekdstanza} must be used instead to encode stanzas as described % \vpageref[below][below]{ref:ekdstanza}. % % As an example, the first five lines of Homer's \emph{Odyssey} could % be encoded like so:\footcite{HomerMurray}--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \begin{alignment}[tcols=2, lcols=2, texts=homer[xml:lang="grc"];murray[xml:lang="en"], apparatus=homer] \begin{homer} \begin{ekdverse} Ἄνδρα μοι ἔννεπε, Μοῦσα, πολύτροπον, ὃς μάλα πολλὰ \\ πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν· \\ πολλῶν δ' ἀνθρώπων ἴδεν ἄστεα καὶ \app{\lem{νόον} \rdg[resp=Zen]{νόμον} \note{Cf. Schol.}} ἔγνω, \\ πολλὰ δ' ὅ γ' ἐν πόντῳ πάθεν ἄλγεα ὃν κατὰ θυμόν, \\ ἀρνύμενος ἥν τε ψυχὴν καὶ νόστον ἑταίρων. \\ \end{ekdverse} \end{homer} \begin{murray} Tell me, O Muse, of the man of many devices, who wandered full many ways after he had sacked the sacred citadel of Troy. Many were the men whose cities he saw and whose mind he learned, aye, and many the woes he suffered in his heart upon the sea, seeking to win his own life and the return of his comrades. \end{murray} \end{alignment} \end{minted} % \iffalse % % \fi % % PDF output:--- % \medskip % \begingroup % \setcolumnwidth{0.6\textwidth} % \setlength{\leftmargini}{0em} % \needspace{7\baselineskip} % \resetlinenumber\resetvlinenumber % \begin{alignment}[flush, % lcols=2, % texts=homer[xml:lang="grc"];murray[xml:lang="en"], % apparatus=homer] % \AtBeginEnvironment{homer}{\selectlanguage{greek}} % \setlength{\vrightskip}{0.25em} % \begin{homer} % \begin{ekdverse} % Ἄνδρα μοι ἔννεπε, Μοῦσα, πολύτροπον, ὃς μάλα πολλὰ \\ % πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν· \\ % πολλῶν δ' ἀνθρώπων ἴδεν ἄστεα καὶ % \app{\lem{νόον} % \rdg[resp=hZen]{νόμον} % \note{Cf. Schol.}} ἔγνω, \\ % πολλὰ δ' ὅ γ' ἐν πόντῳ πάθεν ἄλγεα ὃν κατὰ θυμόν, \\ % ἀρνύμενος ἥν τε ψυχὴν καὶ νόστον ἑταίρων. \\ % \end{ekdverse} % \end{homer} % \begin{murray} % Tell me, O Muse, of the man of many devices, who wandered full % many ways after he had sacked the sacred citadel of Troy. Many % were the men whose cities he saw and whose mind he learned, aye, % and many the woes he suffered in his heart upon the sea, seeking % to win his own life and the return of his comrades. % \end{murray} % \end{alignment} % \endgroup % \medskip % % \texttt{TEI xml} output:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml}
Ἄνδρα μοι ἔννεπε, Μοῦσα, πολύτροπον, ὃς μάλα πολλὰ πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν· πολλῶν δ' ἀνθρώπων ἴδεν ἄστεα καὶ νόον νόμον Cf. Schol. ἔγνω, πολλὰ δ' ὅ γ' ἐν πόντῳ πάθεν ἄλγεα ὃν κατὰ θυμόν, ἀρνύμενος ἥν τε ψυχὴν καὶ νόστον ἑταίρων.

Tell me, O Muse, of the man of many devices, who wandered full many ways after he had sacked the sacred citadel of Troy. Many were the men whose cities he saw and whose mind he learned, aye, and many the woes he suffered in his heart upon the sea, seeking to win his own life and the return of his comrades.

\end{minted} % \iffalse % % \fi % % \paragraph{Stanzas} % As can be seen above, the \LaTeX\ \env{ekdverse} environment is % translated into the \texttt{TEI xml} || element. The |type| % attribute may then be used to name the type of unit encoded by this % element. % % \DescribeEnv{ekdstanza} \cs{begin}|{ekdstanza}|\oarg{options} \dots\ % \cs{end}|{ekdstanza}| \phts\label{ref:ekdstanza}\\ % This environment is used within \env{ekdverse} to encode succeeding % stanzaic forms. Within \env{ekdstanza}, the last line is ended by % |\\!| or |\\| depending on whether an additional vertical space is % required between stanzas. This environment may receive an optional % argument in which the following \enquote{name$=$value} argument is % accepted:---\\ % \DescribeOption{type} |type|$=$\meta{type} % \hfill\tcboxverb{Default: not set}\\ % As in the case of \env{ekdverse}, this named argument is used in the % \texttt{TEI xml} output to name the type of unit encoded within the % || element, viz.\ \enquote{quatrain}, \enquote{couplet} and the % like. % % \paragraph{Indentation Patterns} % \pkg{ekdosis} can use the \env{patverse} environment and its % associated command \cs{indentpattern} that are provided by the % \pkg{verse} package. As described in the documentation of this % package,\footcite[6]{verse} the indentation pattern consists of an % array of digits, \emph{d\textsubscript{1}} to % \emph{d\textsubscript{n}}, where the \emph{n\textsuperscript{th}} % line is indented by \emph{d\textsubscript{n}} times the amount of % \cs{vgap} described above \vpageref{ref:verse-vin}. % % The overall structure of lines grouped into stanzas may look as % follows:--- % % \iffalse %<*example> % \fi \begin{minted}[escapeinside=++]{latex} \begin{ekdverse}[type={+\emph{overall type}+}] \identpattern{+\emph{digits}+} \begin{patverse} \begin{ekdstanza}[type={+\emph{stanza 1 type}+}] line 1 \\ line 2 \\ [...] final line \\! \end{ekdstanza} \end{patverse} \end{ekdverse} \end{minted} % \iffalse % % \fi % % Of course, if no indentation pattern be required or be only required % occasionally, \env{patverse} (ll.~3 and 10) and \cs{indentpattern} % (l.~2) are of no use:--- % % \iffalse %<*example> % \fi \begin{minted}[escapeinside=++]{latex} \begin{ekdverse}[type={+\emph{overall type}+}] \begin{ekdstanza}[type={+\emph{stanza 1 type}+}] line 1 \\ line 2 \\ \vin indented line 3 \\ [...] final line \\! \end{ekdstanza} \end{ekdverse} \end{minted} % \iffalse % % \fi % % A detailed example follows. It is taken from % \citename{McDonald1916}{editor}'s edition of Shakespeare's % \emph{Sonnets} from the Quarto of 1609 with variorum % readings.\footcite[Sonnet~1, \pno~15]{McDonald1916} Compared to % \citename{McDonald1916}{shorteditor}'s edition, an effort has been % made to use the typography and punctuation of the original edition % which can be consulted online at the British Library's % website.\footnote{Shake-speares \emph{Sonnets}. Neuer before % Imprinted. (A Louers Complaint. By William % Shake-speare.). \url{https://www.bl.uk/collection-items/first-edition-of-shakespeares-sonnets-1609}. % Call number \texttt{C.21.c.44}, fol.~B.} However, this typographical % refinement has been retained for the sonnet only. For the sake of % clarity, the line numbers and the apparatus criticus use modern % typography. The references to line numbers in the apparatus criticus % have been made consistent with % \citename{McDonald1916}{shorteditor}'s edition, as have the entries % in the apparatus criticus, namely the bare line number followed by a % dot, then the lemma text in bold face, then the variant in italic % shape:--- % % \captof{Poetry: Shakespeare's Sonnet~1}[\label{lst:shak-sonnet1}] % \iffalse %<*example> % \fi \begin{minted}{latex} \junicode % Use the Junicode font with 'hist' feature enabled for % long-s % MacDonald's style for numbers and entries in the apparatus % criticus: \SetHooks{ refnumstyle=\normalfont, postrefnum=.~, lemmastyle=\bfseries, readingstyle=\itshape, familysep={, } } % The lines are to be centered horizontally: \settowidth{\versewidth}{Feed'st thy lights flame with selfe substantiall fewell,} % Format of the outermost
element: \NewDocumentEnvironment{ekdcenter}{}{\par\centering}{\nobreak\par} \FormatDiv{1}{\begin{ekdcenter}}{\end{ekdcenter}} \begin{ekdosis} \ekddiv{type=sonnets, n=1, head=1} \begin{ekdverse}[type=sonnet, width=\versewidth] \indentpattern{00000000000011} \begin{patverse} \begin{ekdstanza}[type=quatrain] \ekdlettrine{F}{r}om fairest creatures we desire increase,\\ That thereby beauties \emph{Rose} \app{ \lem{might} \rdg[source={Gildon1710, Sewell1725, Ewing1771}]{may} } neuer die,\\ But as the riper should by time \app{ \lem{decease} \rdg[source=Hudson1856]{decrease} },\\ His tender heire might beare his memory:\\ \end{ekdstanza} \begin{ekdstanza}[type=quatrain] But thou contracted to thine owne bright eyes,\\ Feed'st thy \app{ \lem{lights} \rdg[source={Butler1899, Walsh1908}]{life's} } flame with \app{ \lem{selfe substantiall} \rdg[source=Gildon1714, alt={\textnormal{Hyphened by}}]{selfe-substantiall} \note{etc.}} fewell,\\ Making a famine where aboundance lies,\\ Thy selfe thy foe,to thy sweet selfe too cruell:\\ \end{ekdstanza} \begin{ekdstanza}[type=quatrain] Thou that art now the worlds fresh ornament,\\ And \app{ \lem{only} \rdg[resp=God, type=conjecture]{early} \note{conj.} } herauld to the gaudy spring,\\ Within thine owne bud buriest thy content,\\ And tender \app{ \lem{chorle} \rdg[source=Gildon1710]{churl} \note{etc.} } makst wast in niggarding:\\ \end{ekdstanza} \begin{ekdstanza}[type=couplet] Pitty the world,or else this glutton be,\\ To eate the worlds due,\app{ \lem{by the} \rdg[resp=Stee, type=conjecture]{be thy} \note{conj.} \rdg[resp=God, type=conjecture]{by thy} \note{conj.} } graue \app{ \lem{and} \rdg[resp=God, type=conjecture]{as} \note{conj.} } thee.\\! \end{ekdstanza} \end{patverse} \end{ekdverse} \end{ekdosis} \end{minted} % \iffalse % % \fi % % \begin{remarks} % \item |Gildon1710|, |Gildon1714|, |Sewell1725|, |Ewing1771|, % |Hudson1856|, |Butler1899| and |Walsh1908| have been declared as % sources.\footnote{See above \vpageref{ref:declare-source} and % below \vref{sec:references-cited-works}.} |God| and |Stee|, % resp.\ Godwin and Steevens, have been declared as % scholars.\footnote{See above \vpageref{ref:declare-scholar}.} % \item \cs{ekdlettrine} (l.~23) is a specific command for the % \pkg{lettrine} package does not work in list % environments. \cs{TeXtoTEIPat} has been used as described below % \vpageref{ref:textoteipat} to instruct \pkg{ekdosis} to convert % this command into an acceptable \texttt{TEI} equivalent. The % definition of \cs{ekdlettrine} follows:--- % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} % Preamble: \usepackage{adjustbox} % This basic command actually requires an adjustment of the vertical % space at the end of the current line (eg. \\[-1.875ex]) and \vin at % the beginning of the next line:--- \NewDocumentCommand{\ekdlettrine}{mm}{% \adjustbox{valign=t,raise=-0.75ex}{\Huge #1}\textsc{#2}% } \TeXtoTEIPat{\ekdlettrine {#1}{#2}}{#1#2} \end{minted} % \iffalse % % \fi % \end{remarks} % % PDF output:--- % \medskip % % \begingroup % \junicode % \SetHooks{ % refnumstyle=\normalfont, % postrefnum=.~, % lemmastyle=\bfseries, % readingstyle=\itshape, % familysep={, } % } % \renewcommand\thelinenumber{} % \settowidth{\versewidth}{Feed'st thy lights flame with selfe % substantiall fewell,} % \FormatDiv{1}{\begin{ekdcenter}}{\end{ekdcenter}} % \needspace{7\baselineskip} % \resetlinenumber\resetvlinenumber % \begin{alignment}[flush, % tcols=1, % texts=shakespeare[xml:lang="en"], % apparatus=shakespeare] % \setlength{\vrightskip}{-0.75in} % \begin{shakespeare} % \ekddiv{type=sonnets, n=1, head=1} % \begin{ekdverse}[type=sonnet, width=\versewidth] % \indentpattern{00000000000011} % \begin{patverse} % \begin{ekdstanza}[type=quatrain] % \ekdlettrine{F}{r}om fairest creatures we desire % increase,\\[-1.875ex] % \vin That thereby beauties \emph{Rose} % \app{ % \lem{might} % \rdg[source={shGildon1710, shSewell1725, shEwing1771}]{may} % } neuer die,\\ % But as the riper should by time % \app{ % \lem{decease} % \rdg[source=shHudson1856]{decrease} % },\\ % His tender heire might beare his memory:\\ % \end{ekdstanza} % \begin{ekdstanza}[type=quatrain] % But thou contracted to thine owne bright eyes,\\ % Feed'st thy % \app{ % \lem{lights} % \rdg[source={shButler1899, shWalsh1908}]{life's} % } flame with % \app{ % \lem{selfe substantiall} % \rdg[source=shGildon1714, % alt={\textnormal{Hyphened by}}]{selfe-substantiall} % \note{etc.}} fewell,\\ % Making a famine where aboundance lies,\\ % Thy selfe thy foe,to thy sweet selfe too cruell:\\ % \end{ekdstanza} % \begin{ekdstanza}[type=quatrain] % Thou that art now the worlds fresh ornament,\\ % And % \app{ % \lem{only} % \rdg[resp=shGod, type=conjecture]{early} % \note{conj.} % } herauld to the gaudy spring,\\ % Within thine owne bud buriest thy content,\\ % And tender % \app{ % \lem{chorle} % \rdg[source=shGildon1710]{churl} % \note{etc.} % } makst wast in niggarding:\\ % \end{ekdstanza} % \begin{ekdstanza}[type=couplet] % Pitty the world,or else this glutton be,\\ % To eate the worlds due,\app{ % \lem{by the} % \rdg[resp=shStee, type=conjecture]{be thy} % \note{conj.} % \rdg[resp=shGod, type=conjecture]{by thy} % \note{conj.} % } graue % \app{ % \lem{and} % \rdg[resp=shGod, type=conjecture]{as} % \note{conj.} % } thee.\\! % \end{ekdstanza} % \end{patverse} % \end{ekdverse} % \end{shakespeare} % \end{alignment} % \SetHooks{familysep=reset} % \endgroup % % \texttt{TEI xml} output:--- % \medskip % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml}
1 From fairest creatures we desire increase, That thereby beauties Rose might may neuer die, But as the riper should by time decease decrease , His tender heire might beare his memory: But thou contracted to thine owne bright eyes, Feed'st thy lights life's flame with selfe substantiall selfe-substantiall etc. fewell, Making a famine where aboundance lies, Thy selfe thy foe,to thy sweet selfe too cruell: Thou that art now the worlds fresh ornament, And only early conj. herauld to the gaudy spring, Within thine owne bud buriest thy content, And tender chorle churl etc. makst wast in niggarding: Pitty the world,or else this glutton be, To eate the worlds due, by the be thy conj. by thy conj. graue and as conj. thee.
\end{minted} % \iffalse % % \fi % % \subsection{Arabic Poetry} % \label{sec:arabic-poetry} % \newfeature[1.5] A short introduction to editing Arabic texts with % \pkg{ekdosis} and \pkg{arabluatex} is provided below, % \vnref{sec:using-arabluatex}. With regard to the technique of % typesetting Arabic poetry, the reader is invited to refer to the % relevant section of the documentation of % \pkg{arabluatex}.\footcite[\nopp see \enquote{Arabic % Poetry}]{arabluatex} % % \danger \pkg{ekdosis} \emph{must be loaded} with the |poetry=verse| % option as described \vpageref{ref:poetry-opt}. Then, the |arabverse| % environment is to be used instead of |ekdverse| to typeset the lines % of Arabic poetry. % % \DescribeMacro{\bayt+} % As of v1.21 of \pkg{arabluatex}, the % \cs{bayt}\marg{\arb[trans]{.sadr}}\oarg{\arb[trans]{tadwIr}}%^^A % \marg{\arb[trans]{`a^guz}} % command it provides accepts a |+| optional argument that is to be % used to let critical notes be inserted in lines of poetry, like % so:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} % Preamble: \usepackage[poetry=verse]{ekdosis} % Document: \begin{ekdosis} \begin{arabverse}[] \bayt{<ṣadr>}[]{<ʿaǧuz>}\\ % no critical notes [...] \bayt+{Arabic \app{ % example of \bayt+ with critical notes \lem{sample} \rdg{example} } text}{Arabic sample text}\\ [...] \bayt{<ṣadr>}[]{<ʿaǧuz>}\\! % last line (no critical notes) \end{arabverse} \end{ekdosis} \end{minted} % \iffalse % % \fi % % An example of how one could insert variant readings in \prname{imru' % al-qays}' \arb[trans]{\uc{mu`allaqaT}} (ll.~26--30) follows:--- % % \captof{Poetry: \prname{imru' al-qays}' % \arb[trans]{\uc{m}u`allaqaT}}[\label{lst:al-qays-muallaqah}] % \iffalse %<*example> % \fi \begin{minted}[escapeinside=||]{latex} \begin{alignment}[tcols=1, texts=specimen, apparatus=specimen] \resetlinenumber\resetvlinenumber[26] \begin{specimen} \begin{arabverse}[mode=fullvoc, width=0.25\columnwidth] \bayt+{\app{|\label{ln:arb:poetry:plusone}| \lem{ta^gAwaztu 'a.hrAsaN} \rdg{ta_ha.t.taytu 'abwAbaN} \rdg[subsep={:~}]{ta_ha.t.taytu 'ahwAlaN} } 'ilay-hA wa-ma`^saraN}{`alayya .hirA.saN law \app{ \lem[nonum]{yusirrUna}|\label{ln:arb:poetry:nonum}| \rdg{yu^sirrUna} } maqtalI}\\|\label{ln:arb:poetry:plusone:e}| \bayt{'i_dA mA 'l-_turayyA fI 'l-samA'i ta`arra.dat}{ta`arru.da 'a_tnA'i 'l-wi^sA.hi 'l-mufa.s.sali}\\ \bayt{fa-^gi'tu wa-qad na.d.dat li-nawmiN _tayAna-hA}{lad_A 'l-sitri 'illA libsaTa 'l-mutafa.d.dili}\\ \bayt{fa-qAlat yamInau 'l-l_ahi mA la-ka .hIlaTuN}{wa-mA 'in 'ar_A `an-ka 'l-.gawAyaTa tan^galI}\\ \bayt+{_hara^gtu bi-hA \app{|\label{ln:arb:poetry:plustwo}| \lem{tam^sI} \rdg{'am^sI} } ta^gurru wa-rA'a-nA}{`al_A 'a_trinA 'a_dyAla mir.tiN mura.h.hali}\\! \end{arabverse} \end{specimen} \end{alignment} \end{minted} % \iffalse % % \fi % % \begin{remarks} % \item[\textsc{Rem.}] |\bayt+| has been applied twice, at % lines~\lnref{ln:arb:poetry:plusone} % and~\lnref{ln:arb:poetry:plustwo}. In the first instance % (ll.~\lnref{ln:arb:poetry:plusone}--\lnref{ln:arb:poetry:plusone:e}), % variant readings have been inserted in both hemistichs. As the % hemistichs are technically enclosed in separate \TeX\ groups, % \pkg{ekdosis} naturally recalls in the apparatus criticus the line % number corresponding to the first entry of each one of the two % groups. An easy way to get around this is to apply the |nonum| % optional argument to the first \cs{lem} command used in the second % hemistich, as has been done here on % line~\lnref{ln:arb:poetry:nonum}. % \end{remarks} % % PDF output:--- % \medskip % % \begingroup % \SetHooks{refnumstyle=\bfseries} % \begin{alignment}[flush, tcols=1, texts=specimen, % apparatus=specimen] % \resetlinenumber\resetvlinenumber[26] % \setlength{\vrightskip}{-0.75in} % \begin{specimen} % \begin{arabverse}[mode=fullvoc, width=0.25\columnwidth] % \bayt+{\app[type=rtl]{ % \lem{ta^gAwaztu 'a.hrAsaN} % \rdg{ta_ha.t.taytu 'abwAbaN} % \rdg[subsep={:~}]{ta_ha.t.taytu 'ahwAlaN} % } 'ilay-hA wa-ma`^saraN}{`alayya % .hirA.saN law \app[type=rtl]{ % \lem[nonum]{yusirrUna} % \rdg{yu^sirrUna} % } maqtalI}\\ % \bayt{'i_dA mA 'l-_turayyA fI 'l-samA'i ta`arra.dat}{ta`arru.da % 'a_tnA'i 'l-wi^sA.hi 'l-mufa.s.sali}\\ % \bayt{fa-^gi'tu wa-qad na.d.dat li-nawmiN _tayAna-hA}{lad_A % 'l-sitri 'illA libsaTa 'l-mutafa.d.dili}\\ % \bayt{fa-qAlat yamInau 'l-l_ahi mA la-ka .hIlaTuN}{wa-mA 'in % 'ar_A `an-ka 'l-.gawAyaTa tan^galI}\\ % \bayt+{_hara^gtu bi-hA \app[type=rtl]{ % \lem{tam^sI} % \rdg{'am^sI} % } ta^gurru wa-rA'a-nA}{`al_A 'a_trinA % 'a_dyAla mir.tiN mura.h.hali}\\! % \end{arabverse} % \end{specimen} % \end{alignment} % \endgroup % % \texttt{TEI xml} output:--- % \medskip % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml} ta^gAwaztu 'a.hrAsaN ta_ha.t.taytu 'abwAbaN ta_ha.t.taytu 'ahwAlaN 'ilay-hA wa-ma`^saraN `alayya .hirA.saN law yusirrUna yu^sirrUna maqtalI 'i_dA mA 'l-_turayyA fI 'l-samA'i ta`arra.dat ta`arru.da 'a_tnA'i 'l-wi^sA.hi 'l-mufa.s.sali fa-^gi'tu wa-qad na.d.dat li-nawmiN _tayAna-hA lad_A 'l-sitri 'illA libsaTa 'l-mutafa.d.dili fa-qAlat yamInau 'l-l_ahi mA la-ka .hIlaTuN wa-mA 'in 'ar_A `an-ka 'l-.gawAyaTa tan^galI _hara^gtu bi-hA tam^sI 'am^sI ta^gurru wa-rA'a-nA `al_A 'a_trinA 'a_dyAla mir.tiN mura.h.hali \end{minted} % \iffalse % % \fi % % \section{Lineation Settings} % \label{sec:lineation} % \danger \pkg{ekdosis} uses \pkg{lineno} internally for line % numbering.\footcite{lineno} But it must be noted that \pkg{ekdosis} % strictly prohibits the \enquote{pagewise} mode of operation that is % provided by \pkg{lineno}. As a result of this hinderance, all % \enquote{margin switching} functions of \pkg{lineno} are disabled % within the environments that are specific to \pkg{ekdosis}, % viz. \env{ekdosis} and \env{alignment}. % % That said, \pkg{ekdosis} provides equivalents of its own to handle % the line numbers the same way as \pkg{lineno}'s \enquote{pagewise} % mode of operation does. % % \DescribeMacro{\SetLineation} \cs{SetLineation}\marg{csv list of % options} may be used in the preamble or at any point of the document % to set lineation preferences. Its argument processes the |key=value| % options that follow:---\\ % \textbf{General Options}\\ % \DescribeOption{lineation} |lineation|$=$\verb+page|document|none+ % \hfill\tcboxverb{Default: document}\\ % |lineation=document| has the lines numbered continuously throughout % the document while |lineation=page| instructs \pkg{ekdosis} that the % numbering should start afresh at the top of each page. |none| does % the same as |page| but prevents the numbers from being printed in % the margins while keeping them in use in the apparatus criticus.\\ % \DescribeOption{modulo} |modulo| \hfill\tcboxverb{Default: not set}\\ % |modulo| does not accept any value. When this option is set, every % fifth line is numbered.\\ % \DescribeOption{modulonum} |modulonum|$=$\emph{n} (where \emph{n} is % an integer)\hfill\tcboxverb{Default: not set}\\ % |modulonum| allows to modify the interval between the numbers that % are printed. |modulo| must be set for this option to have effect. As % examples, |modulo, modulonum=3| has every third line numbered and % |modulonum=1| disables modulo numbering.\\ % \DescribeOption{margin} |margin|$=$\verb+right|left|inner|outer+ % \hfill\tcboxverb{Default: left}\\ % |margin| sets the margin in which the line numbers are to be % printed.\\ % \DescribeOption{numbers} |numbers|$=$\verb+elided|full+ % \hfill\tcboxverb{Default: elided}\\ % This option only has effect on the numbers that are printed in the % apparatus criticus. |numbers=elided| applies on spans of numbers and % elides the last number of a range to the fewest number of figures % possible\---viz. 35--7, 129--31 \emph{\&c.}\---without eliding % digits in the group 10 to 19 in each hundred\---viz. 17--19, 115--18 % \emph{\&c.} |numbers=full| leaves the numbers untouched.\\ % \DescribeMacro{\innerlinenumbers} \DescribeMacro{\outerlinenumbers} % \cs{innerlinenumbers} and \cs{outerlinenumbers} are equivalent to % \cs{SetLineation}|{numb|\allowbreak|ers=outer}| and % \cs{SetLineation}|{numbers=inner}| respectively. Both commands are % complementary to \cs{rightlinenumbers} and \cs{leftlinenumbers} % already provided by the \pkg{lineno} package. % % \medskip\noindent\textbf{Limiting the Number of Lines per Page} % \phts\label{ref:gmaxlines}\\ % \DescribeOption{maxlines} |maxlines|$=$\emph{n} (where \emph{n} is % an integer $\geq 1$)\newfeature[v1.5] % \hfill\tcboxverb{Default: not set}\\ % |maxlines|$=$\emph{n} instructs \pkg{ekdosis} to break the pages of % numbered text every \emph{n} lines. This option is very useful for % building editions equipped with long and complex apparatus % criticus. The rationale is to start with a number of lines that will % allow all pages to pass just after a few runs of \LuaLaTeX, even at % the cost of showing blanks between the edition text and the % apparatus criticus. Adjusting further the number of lines will then % leave fewer blanks on display. Combined with the |fitapp| global % option\footnote{See above \vpageref{ref:fitapp-opt}.} or with % |maxentries|,\footnote{See above \vpageref{ref:maxentries}.} % |maxlines| can achieve excellent results. For more details on this % technique, see below \ref{sec:oscillating-problem}, % \enquote{\nameref{sec:oscillating-problem}} % \vpageref{ref:maxlines-trick}.\\ % \DescribeOption{nomaxlines} \newfeature[v1.5] % \hfill\tcboxverb{Default: not set}\\ % This no-value option unsets any limit previously set by |maxlines| % or \cs{setmaxlines}\\ % \DescribeMacro{\setmaxlines} \cs{setmaxlines}\marg{n} (where % \meta{n} $\geq 1$) has the same effect as the |maxlines| option just % described. This command can be used either in the preamble or at any % point of the document. \mansee \phts\label{ref:setmaxlines-hook} The % |maxlines| option operates globally, on any pages or columns of text % that are set to receive at least one layer of apparatus % criticus. The way of applying the limit to only one out of several % edition texts is therefore to append \cs{setmaxlines} as a hook to % the environment corresponding to this edition text as described % above \vpageref{sec:alignment-hooks}, like so:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \AtBeginEnvironment{latin}{\setmaxlines{}} \end{minted} % \iffalse % % \fi % % \DescribeMacro{\nomaxlines} \noindent\cs{nomaxlines} is an % argument-less command that operates as the |nomaxlines| option just % described. This command can be used either in the preamble or at any % point of the document. % % \medskip\noindent\textbf{Options Specific to the |poetry=verse| % Global Setting}\footnote{See above % \vref{sec:verse-package}.}\phts\label{ref:verse-lineation}\\ % \DescribeOption{vlineation} |vlineation|$=$\verb+page|document+ % \hfill\tcboxverb{Default: document}\\ % |vlineation| operates on verse texts in the same way as |lineation| % on prose texts.\\ % \DescribeOption{vmodulo} |vmodulo|$=$\emph{n} (where \emph{n} is % an integer)\hfill\tcboxverb{Initially: 1, Default: 5}\\ % |vmodulo|$=$\emph{n} has every \emph{n\textsuperscript{th}} lines of % verse printed in the margin. If used without value, this option is % equivalent to |vmodulo=5|. |vmodulo=0| prevents the % numbers from being printed.\\ % \DescribeOption{vnumbrokenlines} % |vnumbrokenlines|$=$\verb+true|false+ % % \hfill\tcboxverb{Initially: false}\\ % \newfeature[v1.4] This named argument does not need a value as it % defaults to |true| if used. |vnumbrokenlines| has both parts of lines % broken by |\\>| or |\\+|\footnote{See above % \vrefrange{ref:vlinebreak-indent}{ref:vlinebreak-noindent} for more % information.} numbered with the same number for disambiguation % purposes. By default, only the second part of broken lines is % numbered.\\ % \DescribeOption{vmargin} |vmargin|$=$\verb+right|left+ % \hfill\tcboxverb{Default: right}\\ % |vmargin| sets the margin in which the verse line numbers are to be % printed.\\ % \DescribeOption{continuousvnum}\hfill\tcboxverb{Default: not set}\\ % The |poetry=verse| global option has the succeeding lines of verse % numbered independently of prose text. |continuousvnum| has all lines % numbered continuously, irrespective of whether they are lines of % prose or poetry text. % % \paragraph{Useful Lineation Commands} % As implied above, pretty much all commands that are provided by the % \enquote{running} mode of operation of the \pkg{lineno} package will % work with \pkg{ekdosis}, notably the following:---\\ % \DescribeMacro{\modulolinenumbers} \cs{modulolinenumbers}\oarg{n} % can be used to enable or modify modulo line numbering as described % above.\\ % \DescribeMacro{\resetlinenumber} \cs{resetlinenumber}\oarg{n} resets % the line number to one or to \emph{n} if specified.\\ % \DescribeMacro{\linenumberfont} % \cs{renewcommand}|{\linenumberfont}|\marg{commands} can be used to % set the font used for the line numbers that are printed in the % margins. By default, the definition is % \cs{normalfont}\cs{footnotesize}.\\ % \DescribeMacro{\linenumbersep} \cs{linenumbersep} is the distance % between the numbers and the margin. By default, this distance is set % to \unit[10]{pt}. It can be redefined like so: % \cs{setlength}\cs{linenumbersep}\marg{length}. % % \paragraph{Poetry Lineation Commands} % In addition to these commands, if \pkg{ekdosis} be loaded with the % global option |poetry=verse| as described above in % \vref{sec:verse-package}, the commands dedicated to line numbering % that are provided by the \pkg{verse} package can be used.\\ % \DescribeMacro{\vmodulolinenumbers} \newfeature[v1.4] % \cs{vmodulolinenumbers}\oarg{n} can be used to enable or modify % verse modulo line numbering as described above.\\ % \DescribeMacro{\resetvlinenumber} \cs{resetvlinenumber}\oarg{n} has % for lines of verse the same effect as \cs{resetlinenumber} for % lines of prose text.\\ % \DescribeMacro{\verselinenumfont} % \cs{verselinenumfont}\marg{commands} can be used to set the font % used for lines of verse. By default, the definition is % |\normalfont\footnotesize|.\\ % \DescribeMacro{\vrightskip} The \pkg{verse} package prints the % numbers at the distance \cs{vrightskip} into the right margin. This % distance can be redefined by means of \cs{setlength} like so: % \cs{setlength}\cs{vrightskip}\allowbreak\marg{length}. % % % \paragraph{Labels} % \DescribeMacro{\linelabel} \DescribeMacro{\ref} In prose as well % as in poetry texts, \cs{linelabel}\marg{label} sets a line label % that can be referred to with \cs{ref}\marg{label}. % % As an example, what follows has every fifth line number printed in % the inner margins. Additionally, the numbering shall start afresh at % the top of each page:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \SetLineation{ lineation=page, modulo, margin=inner } \end{minted} % \iffalse % % \fi % % \section{Languages} % \label{sec:languages} % \danger \pkg{ekdosis} is fully compatible with \pkg{babel}. % \enquote{Fully compatible} means that all features provided by % \pkg{babel}, including language switching commands, are supported by % \pkg{ekdosis}. \pkg{ekdosis} is also compatible with % \pkg{polyglossia} with one notable exception: \pkg{luabidi}, which % \pkg{polyglossia} loads for languages written from right to left, is % not supported by \pkg{ekdosis}, and most probably never will % be. That said, as far as the author could see, single-layer % apparatus, as described in \vref{sec:single-layer-app}, can be % typeset within the Arabic environment that is provided by % \pkg{polyglossia}. Unfortunately, the same cannot be said for % multiple-layer apparatus. % % Whether \pkg{babel} or \pkg{polyglossia} is used, \pkg{ekdosis} % automatically applies the current language to the entries of the % apparatus criticus, including the fonts that may have been % associated to the languages in the preamble. In this respect, as % \pkg{polyglossia} can use the same language switching commands as % \pkg{babel},\footcite[See][3.2 \pno~14]{polyglossia} the general % advice given above in \vref{sec:alignment-hooks} applies in all % cases. As regards setting languages in the \texttt{TEI xml} output % file, the reader is invited to refer to point \vref{it:lang-subopt}, % and \vref{sec:teixml-output} including the example provided % \vpageref{ref:ancientgreek-ex}. % % \danger In some cases, it may be needed to apply in the apparatus % criticus a language different from the one that is selected in the % edition text. To this end, \pkg{ekdosis} provides a set of % facilities which are described % \vpagerefrange{ref:app-lang}{ref:app-lang-opt} for single-layer % apparatus and \vpageref{ref:apps-lang-opt} for multiple-layer % apparatus. % % \subsection{Languages Written From Right to Left} % \label{sec:rtl-languages} % As said above, \pkg{polyglossia} is not supported by \pkg{ekdosis} % for languages that are written and read from right to left, like % Arabic, Hebrew or Syriac. However, as \pkg{babel} is supported and % can be loaded concurrently with \pkg{polyglossia}, an easy way is to % use \pkg{babel} to print such languages. % % \danger The reader is invited to refer to and become acquainted with % the relevant parts of the documentation of the \pkg{babel} % package.\footcite{babel} % % \paragraph{\pkg{babel} Only} % In the following example, \pkg{babel} is used exclusively to set % three different languages: Arabic, ancient Greek and English:--- % % \captof{Multilingual editions with \pkg{babel} only} % \iffalse %<*example> % \fi \begin{minted}{latex} \usepackage{fontspec} \usepackage[greek.ancient,english]{babel} \babelprovide[onchar=fonts]{arabic} \babelfont{rm}{Old Standard} \babelfont[greek]{rm}[RawFeature={+ss05;+ss06}]{Old Standard} \babelfont[*arabic]{rm}{Amiri} \babeltags{ancientgreek = greek} \newcommand{\sg}[1]{\textancientgreek{#1}} \newcommand{\RL}[1]{\bgroup\textdir TRT#1\egroup} \newenvironment{Arabic}{\par\pardir TRT\textdir TRT}{\par} \end{minted} % \iffalse % % \fi % % \begin{remarks} % \item As can be seen, \pkg{fontspec} has been loaded before % \pkg{babel}. To the author's knowledge, this gives better results % when \cs{babelfont} is used. % \item Line~3 loads \pkg{babel} and instructs it to use English as % the default language and ancient Greek as a second optional % language. The built-in |bidi| mechanism provided by \pkg{babel} is % not enabled. As a result, specific language switching commands for % Arabic must be defined just as it must be for every other % language. % \item Line~4 does not load any Arabic, but instructs \pkg{babel} % that it should use the Arabic font that is set below with % \cs{babelfont} whenever an Arabic letter is encountered. % \item Lines~6--8 select the fonts: |Old Standard| is the default % font to be used for Roman shape (l.~6); the same font is used for % Greek, with some additional Open Type features enabled; finally, % the |Amiri| font is used for Arabic. % \item Lines~10--11 define so-called \enquote{tags} for easier access % to ancient Greek through \cs{begin}|{ancient|\allowbreak|greek}| % \dots\ \cs{end}|{ancientgreek}| for running paragraphs and % \cs{textancientgreek}\marg{text} for short insertions of Greek in % English text. \cs{sg}\marg{text} is just a shorthand for this % latter command. % \item Finally, lines~13--14 define simple language switching % commands for Arabic. As can be seen, no commands other than the % \LuaTeX\ primitives \cs{pardir} and \cs{textdir} have been used % for \pkg{babel} already takes care of selecting the Arabic % font. \cs{RL} is for short insertions of Arabic words in English % paragraphs while \cs{begin}|{Arabic}| \dots\ \cs{end}|{Arabic}| is % for running paragraphs of Arabic text. % \end{remarks} % % \paragraph{Changing the Writing Direction} % \DescribeMacro{\setRL} \DescribeMacro{\setLR} \cs{setRL} and % \cs{setLR} are two argument-less commands provided by \pkg{ekdosis} % that can be used to change the writing direction of running % paragraphs. The former sets the direction from right to left and the % latter form left to right. If \pkg{babel} be set as above, % \cs{setRL} \dots\ \cs{setLR} can be used in place of % \cs{begin}|{Arabic}| \dots\ \cs{end}|{Arabic}|. % % \paragraph{\pkg{polyglossia} Associated With \cs{babelprovide}} % What follows illustrates how \pkg{babel} can be used conjointly with % \pkg{polyglossia} for the same three languages as above without % having to load \pkg{luabidi}:--- % % \captof{Multilingual editions with \pkg{babel} and % \pkg{polyglossia}} % \iffalse %<*example> % \fi \begin{minted}{latex} \usepackage{fontspec} \usepackage{babel} \babelprovide[onchar=fonts]{arabic} \setmainfont{Old Standard} \newfontfamily\greekfont{Old Standard}[RawFeature={+ss05;+ss06}] \babelfont[*arabic]{rm}{Amiri} \usepackage{polyglossia} \setdefaultlanguage{english} \setotherlanguage[variant=ancient]{greek} \newcommand{\textarabic}[1]{\bgroup\textdir TRT#1\egroup} \newenvironment{Arabic}{\par\pardir TRT\textdir TRT}{\par} \end{minted} % \iffalse % % \fi % % \begin{remarks} % \item Line~3 just loads \pkg{babel} with no default language. % \item Lines~4 and 8 are used to have the Arabic font automatically % selected as above. % \item Lines~14--15 define the exact language switching commands that % would have been defined if \pkg{polyglossia} and \pkg{luabidi} had % been used for Arabic. % \end{remarks} % % As one can see, the important points about languages written from % right to left are to use \pkg{babel} only to select the Arabic % fonts, avoid using the bidirectional mechanism it provides and % define commands and environments that use only \LuaTeX\ primitives % to set the writing direction. Then, an Arabic edition text\---to % continue with this example\---can be entered as plainly as % follows:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false,escapeinside=++]{latex} \begin{ekdosis} \begin{Arabic} +\txarb{إِنَّ أَبِي كَانَ مِنَ}+ \app{ \lem{+\txarb{ٱلْمُقَاتِلَةِ}+} \rdg{+\txarb{ٱلْمُقَاتِلِينَ}+} } +\txarb{وَ كَانَتْ أُمِّي مِنْ عُظَمَآءِ بُيُوتِ ٱلزَّمَازِمَةِ۔}+ \end{Arabic} \end{ekdosis} \end{minted} % \iffalse % % \fi % % It should be reminded that the writing direction of the apparatus % criticus itself is independent of that of the edition text and must % be set either with \cs{Set(LTR{\textbar}RTL)app} or with the % |direction| optional argument of \cs{SetApparatus} for single-layer % apparatus criticus, or by means of \cs{DeclareApparatus} for % multiple-layer apparatus criticus.\footnote{See above % \vref{sec:single-layer-app} (single-layer apparatus criticus) and % \vref{sec:multilayer-apparatus} (multiple-layer apparatus % criticus).} % % The PDF output with left-to-right apparatus criticus follows:--- % \medskip % % \needspace{7\baselineskip} % \resetlinenumber % \begin{alignment}[flush,tcols=1,texts=specimen,apparatus=specimen] % \begin{specimen} % \begin{arab}[fullvoc] % 'inna 'abI kAna mina \app[type=ltr]{ % \lem{'l-muqAtilaTi} % \rdg{'l-muqAtilIna}} % wa-kAnat 'ummI min `u.zamA'i buyUti 'l-zamAzimaTi. % \end{arab} % \end{specimen} % \end{alignment} % % \needspace{5\baselineskip} % The PDF output with right-to-left apparatus criticus follows:--- % \medskip % % \needspace{7\baselineskip} % \resetlinenumber % \begin{alignment}[flush,tcols=1,texts=specimen,apparatus=specimen] % \begin{specimen} % \begin{arab}[fullvoc] % 'inna 'abI kAna mina \app[type=rtl]{ % \lem{'l-muqAtilaTi} % \rdg{'l-muqAtilIna}} % wa-kAnat 'ummI min `u.zamA'i buyUti 'l-zamAzimaTi. % \end{arab} % \end{specimen} % \end{alignment} % % \subsection{Using \pkg{arabluatex}} % \label{sec:using-arabluatex} % \pkg{arabluatex} is a \hologo{LuaLaTeX} package that provides % commands and environments which return Arabic writing from an ASCII % transliteration (either Arab\TeX\ or Buckwalter % scheme).\footcite{arabluatex} It is particularly well-suited for % complex documents such as critical editions where a lot of commands % intertwine with Arabic writing. \pkg{arabluatex} can output Unicode % Arabic in the same modes as \pkg{arabtex}\footcite{arabtex} or in % different accepted standards of romanization. It is also able to % produce a duplicate of the original |.tex| source file in which all % |arabtex| or |buckwalter| strings are replaced with Unicode % equivalents, either in Arabic script or in any accepted standard of % transliteration.\footcite[\mkbibquote{Exporting Unicode Arabic % to an External File}]{arabluatex} % % \pkg{arabluatex} is fully supported by \pkg{ekdosis}. The following % example illustrates how \pkg{arabluatex} and \pkg{ekdosis} interact % with each other to produce distinct \texttt{TEI xml} outputs from a % single |.tex| source file:--- % % \captof{\pkg{ekdosis} and \pkg{arabluatex}}[\label{lst:arabluatex-ekd}] % \iffalse %<*example> % \fi \begin{minted}{latex} % Preamble: % load ekdosis and ask for TEI xml output: \usepackage[teiexport]{ekdosis} % load arabluatex and request a LaTeX output with Unicode Arabic: \usepackage[export,fullvoc]{arabluatex} % document: \begin{arabexport} % export arabtex strings to Unicode Arabic \begin{ekdosis} \begin{arab} 'inna 'abI kAna mina \app{ \lem{'l-muqAtilaTi} \rdg{'l-muqAtilIna} } wa-kAnat 'ummI min `u.zamA'i buyUti 'l-zamAzimaTi. \end{arab} \end{ekdosis} \end{arabexport} \end{minted} % \iffalse % % \fi % % The PDF output with left-to-right apparatus criticus is of course % the same as above:--- % \medskip % % \needspace{7\baselineskip} % \resetlinenumber % \begin{alignment}[flush,tcols=1,texts=specimen,apparatus=specimen] % \begin{specimen} % \begin{arab}[fullvoc] % 'inna 'abI kAna mina \app[type=ltr]{ % \lem{'l-muqAtilaTi} % \rdg{'l-muqAtilIna}} % wa-kAnat 'ummI min `u.zamA'i buyUti 'l-zamAzimaTi. % \end{arab} % \end{specimen} % \end{alignment} % % However, assuming that the source file is called |source.tex|, % \pkg{ekdosis} produces as instructed from this file an additional % |source-tei.xml| as follows:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml}

'inna 'abI kAna mina 'l-muqAtilaTi 'l-muqAtilIna wa-kAnat 'ummI min `u.zamA'i buyUti 'l-zamAzimaTi.

\end{minted} % \iffalse % % \fi % % At the same time, \pkg{arabluatex} is instructed to produce on its % own from the same |source.tex| an additional |source_out.tex| in % which all |arabtex| strings found within \cs{begin}|{arabexport}| % \dots\ \cs{end}|{arabexport}| (see \vref{lst:arabluatex-ekd}, % ll.~9--19) are replaced with full-vocalized Arabic Unicode % script. Finally, compiling this latter file produces the following % |sample-arabic_out-tei.xml| an extract of which follows:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false,escapeinside=++]{xml}

+\txarb{إِنَّ أَبِي كَانَ مِنَ}+ +\txarb{ٱلْمُقَاتِلَةِ}+ +\txarb{ٱلْمُقَاتِلِينَ}+ +\txarb{وَكَانَتْ أُمِّي مِنْ عُظَمَآءِ بُيُوتِ}+ +\txarb{ٱلزَّمَازِمَةِ.}+

\end{minted} % \iffalse % % \fi % % The reader will find the full |arabic-sample.tex| source file with % instructions in \vref{sec:arabic-sample}, and is invited to refer to % the documentation of the \pkg{arabluatex} package for more % information on the way to use its Arabic environments and built-in % functions dedicated to export |arabtex| ASCII strings to % Unicode.\footcite{arabluatex} % % \section{Divisions of the Body} % \label{sec:body-divisions} % The features that are described in this section call for one general % remark. \pkg{ekdosis} is designed to figure out where any \LaTeX\ % command that is converted to a \texttt{TEI} opening element allowed % to nest recursively, such as |
|, || and the like, is to be % closed, even though there is no explicit indication of the point % where the closure occurs. Thoroughly scanning \LaTeX\ source files % with \textsf{Lua} functions which involve complex string matching % and recursions was required, as \LaTeX\ \enquote*{open} commands % such as \cs{chapter} or \cs{section} only act as milestones, % contrary to \texttt{TEI} elements. % % \danger It must be noted that the two styles described hereinafter % are mutually exclusive. \texttt{TEI xml} forbids that both be % combined within a single || element.\footnote{See % \url{https://tei-c.org/release/doc/tei-p5-doc/en/html/DS.html\#DSDIV}.} % As a result, \pkg{ekdosis} will disregard whichever one is not % selected. % \vskip\baselineskip % % \subsection{\LaTeX\ Standard Divisions} % \label{sec:latex-divs} % \pkg{ekdosis} can use the \LaTeX\ standard textual divisions, such % as \cs{book}, \cs{chapter}, \cs{section} and the like. % % \danger However, to have these divisions properly translated into % \texttt{TEI} numbered |
| elements, the |divs| general option % must be set to |latex| explicitly\---viz. |divs=latex|\---as % described above \vpageref{ref:divs-opt}. % % \danger As the \env{alignment} environment that is provided by % \pkg{ekdosis} places all aligned texts within \texttt{TEI xml} % un-numbered |
| elements and \LaTeX\ textual divisions are % converted into numbered || elements, % inserting such divisions in texts to be aligned will result in an % invalid \texttt{TEI xml} output. Instead, un-numbered divisions % through \cs{ekddiv} must be used as described below in % \vref{sec:ekddiv}. % % Once |divs| has been set to |latex|, \pkg{ekdosis} converts % \cs{book}, \cs{part}, \cs{chapter}, \cs{section}, \cs{subsection} % and \cs{subsubsection} into corresponding \texttt{TEI} % \enquote*{numbered} || elements, % where $1\leq n\leq 6$. % % \paragraph{Adjusting the Levels of Textual Subdivisions} % \DescribeMacro{\MkBodyDivs} % \cs{MkBodyDivs}\marg{div1}\marg{div2}\marg{div3}\allowbreak\marg{div4}\marg{div5}\marg{div6} % takes six mandatory arguments. This command can be used in the % preamble or at any point of the document to make the number of the % first-level subdivision of the edition text, viz.\ ||, match % to any \LaTeX\ command other than \cs{book}. For example, if % \cs{section} be the highest-level sectional command used, then % \cs{MkBodyDivs}|{section}{subsection}{subsubsection}{}{}|\allowbreak|{}| % will have \cs{section}, \cs{subsection} and \cs{subsubsection} % converted into ||, || and || respectively. % % \paragraph{Inserting Variants in Headings} % Variant readings can be inserted in headings. In this case, the % optional argument of the \LaTeX\ sectional command must naturally be % used to prevent variants from going into headers, footers or the % table of contents, like so:\footnote{On the use of \texttt{egomute} % (l.~13), see above \vref{it:egomute}.}--- % % \iffalse %<*example> % \fi \begin{minted}{latex} % Preamble: \usepackage[teiexport=tidy, divs=latex]{ekdosis} \MkBodyDivs{chapter}{section}{}{}{}{} % Document: \chapter[Ἱπποκράτους ἐπιδημιῶν βιβλίον δεύτερον]{Ἱπποκράτους ἐπιδημιῶν \app{ \lem[wit={I,R,H}]{βιβλίον δεύτερον} \rdg[wit=V]{λόγος β’}}} \section[Τμῆμα πρῶτον]{ \app{ \lem[resp=egomute, type=emendation, nosep, post=suppleui]{\supplied{Τμῆμα πρῶτον}} }} Ἄνθρακες θερινοὶ ἐν Κραννῶνι· [...] \end{minted} % \iffalse % % \fi % % \texttt{TEI xml} output:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml} Ἱπποκράτους ἐπιδημιῶν βιβλίον δεύτερον λόγος β’ Τμῆμα πρῶτον

Ἄνθρακες θερινοὶ ἐν Κραννῶνι· [...]

\end{minted} % \iffalse % % \fi % % \subsection{\texttt{TEI} Un-numbered Divisions} % \label{sec:ekddiv} % \danger As already described \vpageref{ref:divs-opt}, the % un-numbered style of division is the one that is set by default. It % is congruous to the general option |divs=ekdosis|. % % This style provides a flexible mechanism in which format and % presentation are separated from content. It is designed to meet the % requirements of classical and literary texts the divisions of which % may depend on many different received traditions. % % \DescribeMacro{\ekddiv} \cs{ekddiv}\marg{key-value arguments} is the % unique sectional command provided by \pkg{ekdosis}. This command % converts the divisions into un-numbered \texttt{TEI} |
| % elements allowed to nest recursively and takes one mandatory % argument in which the following |key-value| arguments are % accepted:---\\ % \DescribeOption{type} |type|$=$\meta{name} % \hfill\tcboxverb{Default: none}\\ % |type| corresponds to the \texttt{TEI} class |att.typed| and can be % used to classify the element in which it is found in any % way. Suitable values here can be |book|, |chapter|, |section| and % the like.\\ % \DescribeOption{n} |n|$=$\meta{value} \hfill % \tcboxverb{Default: none}\\ % |n| is meant to provide a number or any kind of label for the % division and does not have to be unique in the document.\\ % \DescribeOption{head} |head|$=$\meta{name} % \hfill\tcboxverb{Default: none}\\ % |head| holds the title of the division and may further contain % variant readings.\\ % \DescribeOption{barehead} |barehead|$=$\meta{name} % \hfill\tcboxverb{Default: none}\\ % |barehead| is supposed to be used to prevent unwanted commands from % going into such places as headers, footers and the table of % contents.\\ % \DescribeOption{depth} |depth|$=$\meta{n} where $1\leq n\leq 9$ % \hfill\tcboxverb{Default: 1}\\ % As \texttt{TEI} un-numbered divisions are simply |
| elements % allowed to nest recursively to indicate their hierarchic depth and % \cs{ekddiv} is an \enquote*{open} \LaTeX\ command, |n| is needed to % indicate the depth of the division within the hierarchy, the largest % being |1| and the smallest being |9|.\\ % \DescribeOption{toc} % |toc|$=$\verb+book|part|chapter|section|subsection|subsubsection|paragraph|+\\ % \phantom{|toc|$=$}|subparagraph|\hfill\tcboxverb{Default: not set}\\ % If |toc| be set, the title of the division goes into the table of % contents at the hierarchic level that is specified as value.\\ % \DescribeOption{mark} \newfeature[v1.3] |mark|$=$\meta{signpost} % \hfill\tcboxverb{Default: none}\\ % |mark| holds the signpost to be emitted as marker for headers and % footers. Its value is recalled by \cs{ekdmark} as described below in % \vref{sec:headers-footers}. % % \paragraph{Formatting the Titles} % \DescribeMacro{\FormatDiv} By design, \pkg{ekdosis} does % not format the titles. Instead, depending on what is needed for the % edition text, \cs{FormatDiv}\marg{n}\marg{code % before}\marg{code after} is provided to lay out the titles of any % hierarchic depth of division. This command takes three mandatory % arguments as follows: \meta{n}, which is the number referring to the % particular depth of division to be formatted and some \LaTeX\ % commands to go before and after the title itself. The following % example illustrates how the titles of the largest division can be % printed horizontally centered in a larger size:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \FormatDiv{1}{\begin{center}\Large}{\end{center}} \end{minted} % \iffalse % % \fi % % To elaborate on the example provided above in \vref{sec:latex-divs}, % here follows how the first three hierarchical levels could be % formatted as un-numbered divisions:--- % % \captof{Divisions of the body text}[\label{lst:ekddiv-ex}] % \iffalse %<*example> % \fi \begin{minted}{latex} % Preamble: \FormatDiv{1}{\begin{center}\Large}{\end{center}} \FormatDiv{2}{\begin{center}\large}{\end{center}} \FormatDiv{3}{\bfseries}{.} % Document: \begin{ekdosis} \ekddiv{ head={Ἱπποκράτους ἐπιδημιῶν \app{ \lem[wit={I,R,H}]{βιβλίον δεύτερον} \rdg[wit=V]{λόγος β’}}}, type=book, depth=1, n=II } \ekddiv{ head={\app{ \lem[resp=egomute, post=suppleui, type=emendation]{\supplied{Τμῆμα πρῶτον}} \rdg[wit=codd, alt=om.]{}}}, type=section, depth=2, n=II.1 } \ekddiv{head=1, type=paragraph, depth=3, n=II.1.1} Ἄνθρακες θερινοὶ ἐν Κραννῶνι· [...] \end{ekdosis} \end{minted} % \iffalse % % \fi % % PDF output:--- % \medskip % % \begingroup % \needspace{7\baselineskip} % \resetlinenumber % \FormatDiv{1}{\begin{center}\Large}{\end{center}} % \FormatDiv{2}{\begin{center}\large}{\end{center}} % \FormatDiv{3}{\bfseries}{.} % \begin{alignment}[flush, % tcols=1, % texts=hippocrates[xml:lang="grc"], % apparatus=hippocrates] % \AtBeginEnvironment{hippocrates}{\selectlanguage{greek}} % \begin{hippocrates} % \ekddiv{ % head={Ἱπποκράτους ἐπιδημιῶν % \app{ % \lem[wit={hI,hR,hH}]{βιβλίον δεύτερον} % \rdg[wit=hV]{λόγος β’}}}, % type=book, % depth=1, % n=II} % % \ekddiv{ % head={\app{ % \lem[resp=egomute, post=suppleui, % type=emendation]{\supplied{Τμῆμα πρῶτον}} % \rdg[wit=hcodd, alt=om.]{}}}, % type=section, % depth=2, % n=II.1 % } % % \ekddiv{head=1, type=paragraph, depth=3, n=II.1.1} Ἄνθρακες % θερινοὶ ἐν Κραννῶνι· [...] % \end{hippocrates} % \end{alignment} % \endgroup % % \texttt{TEI xml} output:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml}
Ἱπποκράτους ἐπιδημιῶν βιβλίον δεύτερον λόγος β’
Τμῆμα πρῶτον
1

Ἄνθρακες θερινοὶ ἐν Κραννῶνι· [...]

\end{minted} % \iffalse % % \fi % % \subsection{Headers and Footers} % \label{sec:headers-footers} % \newfeature[v1.3] \pkg{ekdosis} provides a mechanism of its own for % emitting header and footer marks. The first operation consists in % recording the information to be printed as signpost by means of the % |mark| optional argument of the \cs{ekddiv} command described above % in \vref{sec:ekddiv}. % % \DescribeMacro{\ekdmark} Once this is done, \cs{ekdmark} can be % inserted in commands used to make headers and footers where the mark % is to be printed. % % A common layout is that of headers in which one finds printed in % sequence on even pages the page number, then the author's name, and % on odd pages the title of the edited text, then the current % division, then the page number, like so:--- % % \needspace{5\baselineskip} % \begin{xltabular}{1.0\linewidth}{|XcX|} % \multicolumn{3}{l}{Even pages:}\\ % \hline % \cs{thepage} & Hippocratis & \\ % \hline % \multicolumn{3}{l}{Odd pages:}\\ % \hline % & Epidemiarum liber II, \cs{ekdmark} & \hfill\cs{thepage}\\ % \hline % \end{xltabular} % % To return to the example provided by \vref{lst:ekddiv-ex}, the mark % of the current division would be inserted in the third-level % \cs{ekddiv} command printed at line~28 like so:--- % % \iffalse %<*example> % \fi \begin{minted}[firstnumber=28,linenos]{latex} \ekddiv{head=1, type=paragraph, depth=3, n=II.1.1, mark={1, 1}} \end{minted} % \iffalse % % \fi % % The following example finally illustrates how the corresponding % headers and footers can be prepared in a straightforward way with % the help of the \pkg{titleps} package:\footcite{titleps}--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} % Preamble: \usepackage{titleps} \newpagestyle{edition}{ \sethead[\thepage][Hippocratis][] {}{Epidemiarum liber II, \ekdmark}{\thepage} } % Apply the page style: \pagestyle{edition} \end{minted} % \iffalse % % \fi % % \DescribeMacro{\endmark} It must be noted that \cs{ekdmark} is % designed to print the first mark that is emitted on a given page and % ignore the mark corresponding to any portion of text that may be % printed between the top of the page and the point where the first % mark is called. \cs{endmark} is an argument-less command that can be % used just at the end of that portion of text to instruct % \pkg{ekdosis} to print the last-emitted mark of the preceding page % instead of the first-emitted mark of the current page. % % \paragraph{Removing Headers and Footers} % Pages such as title pages must be printed with empty headers and % footers. \pkg{ekdosis} must be given control over every item of % information inserted in these areas beforehand. % % \DescribeMacro{\ekdprintmark} % \cs{ekdprintmark}\marg{selector}\marg{signpost} The signposts % printed in headers and footers must be passed as second argument of % \cs{ekdprintmark} so that \pkg{ekdosis} can remove them on pages % where printing them is not desirable. \meta{selector} refers to % three symbolic letters where the first can be either |H| or % |F|\===for \underLine{h}eader or \underLine{f}ooter\===, the second % |E| or |O|\===for \underLine{o}dd or \underLine{e}ven\===and the % third |L|, |C| or |R|\===for \underLine{l}eft, \underLine{c}enter or % \underLine{r}ight. The example provided above would then read as % follows:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} % Preamble: \usepackage{titleps} \newpagestyle{edition}{ \sethead[\ekdprintmark{HEL}{\thepage}] [\ekdprintmark{HEC}{Hippocratis}] [] {} {\ekdprintmark{HOC}{Epidemiarum liber II, \ekdmark}} {\ekdprintmark{HOR}{\thepage}} } % Apply the page style: \pagestyle{edition} \end{minted} % \iffalse % % \fi % % \paragraph{\enquote{Paired} facing pages} % \phts\label{sec:header-paired-pages} % As already described \vpageref{ref:paired-opt}\===the % \textooquote|paired|\textcoquote\ option\===\pkg{ekdosis} can % arrange texts on facing pages with every right-hand page number % unchanged, so that both facing pages hold the same number, as in the % \enquote{Budé} series. As a result of this layout, the distinction % between left- and right-hand pages does not apply and headers and % footers have to be set as if the whole edition text and the % translation were intended for single-sided printing. To return to % the example just given, the three optional arguments of \cs{sethead} % are inoperative, as are the symbolic letters |E| and |O| of % \cs{ekdprintmark}. Both letters must be omitted, which boils down to % using the following six selectors, instead of twelve: |HL|, |HC|, % |HR|, |FL|, |FC| and |FR|. % % \DescribeMacro{\ekdEOprint}\newfeature[v1.5] Finally, to make up for % commands and arguments designed to set headers and footers on % left-hand pages, \pkg{ekdosis} provides \cs{ekdEOprint}. This % command accepts two mandatory, self-evident arguments, like so: % \cs{ekdEOprint}\marg{left-hand mark}\marg{right-hand mark}. % % As an illustration, the example provided above would read as follows % for editions laid out on \enquote{paired} facing pages:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} % Preamble: \usepackage{titleps} \newpagestyle{edition}{ \sethead{\ekdprintmark{HL}{\ekdEOprint{\thepage}{}}} {\ekdprintmark{HC}{\ekdEOprint{Hippocratis}{% Epidemiarum liber II, \ekdmark}}} {\ekdprintmark{HR}{\ekdEOprint{}{\thepage}}} } % Apply the page style: \pagestyle{edition} \end{minted} % \iffalse % % \fi % % \paragraph{\enquote{Mirrored} paired facing pages} % \newfeature[v1.5] The \textooquote|paired|\textcoquote\ option just % described can give surprising results at first sight, in which % facing pages are arranged by succeeding pairs of left- or right-hand % pages. This is certainly not the desired layout for duplex % printing. However, this is not a redhibitory inconvenience for % professional printers can easily carry out the necessary corrections % by applying offsets to the horizontal margins. That being said, one % may also wish to have these horizontal offsets applied from the % outset in the PDF output that is produced by \LaTeX. % % \danger What follows assumes that the critical edition is printed on % facing pages and starts on a left-hand page. Furthermore, it must be % noted that the |paired| option must be either unset or set to % |false|. % % \DescribeMacro{\setpairedpage} \cs{setpairedpage} is provided to set % mirrored paired facing pages. This command takes no argument and is % meant to be issued in commands used to set headers and footers on % both sides, \emph{before any call} of the commands \cs{thepage} or % \cs{ekdmark}, like so:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos,highlightlines={4,8-10}, escapeinside=++]{latex} % Preamble: \usepackage{titleps} \newpagestyle{edition}{ \sethead[\setpairedpage\ekdprintmark{HEL}{\thepage}]+\label{ln:ekdpp:i}+ [\ekdprintmark{HEC}{Hippocratis}] [] {} {\setpairedpage\ekdprintmark{HOC}{Epidemiarum liber II,\+\label{ln:ekdpp:ii}+ \ekdmark}} {\ekdprintmark{HOR}{\thepage}}\+\label{ln:ekdpp:iii}+ } % Apply the page style: \pagestyle{edition} \end{minted} % \iffalse % % \fi % % \begin{remarks} % \item As can be seen from ll.~\lnref{ln:ekdpp:i} and % \lnref{ln:ekdpp:ii}, \cs{setpairedpage} must be issued % \emph{before} \cs{ekdprintmark} so that it can be processed on % pages where headers and footers are removed by \cs{ekdnohfmarks} % described below. % \item Additionally, ll.~\lnref{ln:ekdpp:ii}--\lnref{ln:ekdpp:iii} % show that \cs{setpairedpage} precedes both \cs{ekdmark} and % \cs{thepage}. % \item If there be no \cs{thepage} in headers or footers, % \cs{setpairedpage} must still be issued once on each side. % \end{remarks} % % \DescribeMacro{\setpairedpagenum} \cs{setpairedpagenum}\marg{number} % can be used just ahead of the alignment environment to set the % number of the first left-hand paired page to follow. The first % paired page number is initially set to |1|. % % \DescribeMacro{\resetpagenumber} Finally, \cs{resetpagenumber} % \emph{must} be used right out of the alignment environment so that % any numbering error on the page that follows the edition text can be % corrected. See below \vref{lst:mirrored-fp}, % l.~\lnref{ln:mirrored:fp:resetpn}. % % A schematic illustration of this technique follows:--- % % \captof{\enquote{Mirrored} paired facing % pages}[\label{lst:mirrored-fp}] % \iffalse %<*example> % \fi \begin{minted}[escapeinside=++,highlightlines={16}]{latex} \mainmatter \part{Edition text} \cleartoevenpage % this needs the 'nextpage' package. \pagestyle{edition} % apply the style where 'mirrored' paired facing % pages are defined as illustrated above. \begin{alignment} \begin{edition} ... \end{edition} \begin{translation} ... \end{translation} \end{alignment} \backmatter % or \cleartooddpage provided by the 'nextpage' % package. \resetpagenumber % this command is always required.+\label{ln:mirrored:fp:resetpn}+ \pagestyle{back} % apply a new page style. \end{minted} % \iffalse % % \fi % % \paragraph{Removing or Resetting Headers and Footers} % \DescribeMacro{\ekdnohfmarks} Once all signposts are marked with % \cs{ekdprintmark}, \cs{ekdnohfmarks} can be used at any point of the % document with the same effect as the \LaTeX\ standard command % \cs{thispagestyle}|{empty}|. % % \DescribeMacro{\ekdresethfmarks} Finally, \cs{ekdresethfmarks} is % provided in rare cases when it is needed to reset headers and % footers to their original, viz.\ printable state. % % \section{The Tricks of the Trade} % \label{sec:tricks-of-trade} % As the |.tex| source file is compiled, \pkg{ekdosis} has to compute % a tremendous amount of data. Most of this work is performed by % \textsf{Lua} functions. An edition text narrowed down to a single % page needs to be compiled at least three times. On the first run, % the apparatus criticus does not show. Instead, \pkg{ekdosis} % produces an auxiliary file named \cs{jobname}|.ekd| in which all the % entries of the apparatus criticus are collected. Then, on the second % run a test is performed on this auxiliary file to determine whether % there are entries\---and if so, which ones\---to be printed on the % current page. At the same time, references to the line numbers are % updated if necessary. Finally, on the third run, the apparatus % criticus is printed. % % Of course, every change made to the input may similarly require % \hologo{LuaLaTeX} to be run three more times to get everything to % the right place with the right numbers. % % \subsection{The Oscillating Problem} % \label{sec:oscillating-problem} % In some instances, notably when on a given page entries are very % abundant in number, specifically when the edition text is getting % close to the bottom of the page, \pkg{ekdosis} may oscillate % indefinitely between different sets of page decisions without being % able to settle down. The condition may be typically illustrated as % follows: after Lua\LaTeX\ has been run, an entry is attached to the % last line of the page. As said above, this entry does not show % yet. But when it does, should it result in an additional line being % printed in the apparatus criticus, the last line of the edition % text\---the one the entry was previously attached to\---goes to the % next page. As a result, this entry also moves to the next page with % the line it belongs to. This point is literally critical, because % unless a \cs{pagebreak} is inserted just here so as to keep the % contentious line on the next page, \pkg{ekdosis} enters a vicious % circle from which it cannot escape, not to mention that right % entries with right line numbers cannot come on pages that follow a % wrong page either. % % The alert reader may have guessed that inserting a \cs{pagebreak} is % a good way to get out of the vicious circle. And surely, if only a % few pages be at stake, this is the way to go. However, % \cs{pagebreak} commands should only be inserted when the whole % edition text is ready for any substantial change in the preceding % pages may result in pages that break just after they begin. % % \paragraph{Limiting the Number of Lines per Page} % \phts\label{ref:maxlines-trick} One way to avoid this inconvenience % is to use the |maxlines| option of \cs{SetLineation} as described % above \vpageref{ref:gmaxlines}. Depending on the abundance of % critical footnotes to be printed, the editor may start with a number % that will allow most, if not all, pages to pass. % % Furthermore, this technique can be combined with the |fitapp| global % option described below \vpageref{ref:fitapp-trick}. Once |maxlines| % has been applied, the \pkg{fgruler} package\footcite{fgruler} can be % used to gauge the respective heights of the edition text and the % apparatus criticus like so:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} % Preamble \usepackage[type=lowerleftT]{fgruler} \end{minted} % \iffalse % % \fi % % Based on the height corresponding to the last line of the edition % text limited by the value of |maxlines|, the height from which the % apparatus criticus block should stop growing and the characters % should be scaled down to allow for more entries can be % estimated.\footnote{To learn how the maximum height of the apparatus % criticus can be set, see \vpageref{ref:appheight}. The |fitapp| % global option is described \vpageref{ref:fitapp-opt}.} This ensures % that any contentious entries are included in the apparatus criticus % when the last line of text has been reached. % % In addition to the |maxlines| option of \cs{SetLineation} and the % \cs{setmaxlines} command,\footnote{See above % \vpageref{ref:gmaxlines}.} the following commands are provided:--- % % \DescribeMacro{\localmaxlines} \cs{localmaxlines}\marg{n}, where % \meta{n} $\geq 1$, can be used in the edition text to adjust the % number of lines on a given page. Of course, this command must be % issued before the line number corresponding to |maxlines| is % reached. \mansee \cs{localmaxlines}|{0}| can therefore be used to % remove the limit set by |maxlines| or \cs{setmaxlines} on a given % page. % % \DescribeMacro{\addtomaxlines} Unlike \cs{localmaxlines}, % \cs{addtomaxlines}\marg{n} takes as argument the number of lines one % wishes to add or substract from the number that has been set by % |maxlines| or \cs{setmaxlines}. As a result, \meta{n} can be a % positive or negative integer. % % \DescribeMacro{\nomaxlines} \cs{nomaxlines} is an argument-less % command that unsets any limit previously set by |maxlines| or % \cs{setmaxlines}. % % \paragraph{Conditional page breaks} % \phts\label{ref:ekdpb} \DescribeMacro{\ekdpb}\DescribeMacro{\ekdpb*} % \cs{ekdpb}\oarg{page no}\marg{line no} \cs{ekdpb*}|{}| \cs{ekdpb*} % \newfeature[v1.2]\\ % One other way is to use \cs{ekdpb} instead of the standard % \cs{pagebreak} command provided by \LaTeX\ to insert conditional % page breaks. \cs{ekdpb} takes as mandatory argument the line number, % as it is printed in the margin, where the page break should take % place. An optional argument allows to further specify the page % number where the page break should occur. The value that is expected % is the page number as it is printed\===e.g.\ an Arabic, Roman or % alphanumeric number. If the specified conditions be not met, then % the page break is not triggered. Finally, the \enquote{starred} % version of this command forces the page break, irrespective of the % values specified as page or line numbers. Unlike \cs{ekdpb}, which % requires the lines to be numbered, \cs{ekdpb*} is allowed at any % point of the document: as \cs{ekdpb*} disregards the number given as % argument, it is equivalent to the standard \LaTeX\ \cs{pagebreak} % command. Yet it can be used instead of the latter to have marks % further printed in the margins so as to spot with a fleeting glance % the locations where induced page breaks occur.\footnote{This % requires the |showpagebreaks| option to be set to |true| as % described above \vpageref{ref:showpagebreaks-opt}.} % % \paragraph{Using \texttt{maxentries}} % Another way\---should the edition text fall into the vicious circle % too often\---is to limit the number of entries per page that all % layers of critical notes taken together or a given layer of % apparatus criticus may accept as described above on % pages~\pageref{ref:glimit} and~\pageref{ref:maxentries}. As a result, % \pkg{ekdosis} will take care of inserting automatic breakpoints % between pages whenever the number of entries on a given page reaches % the value set as |maxentries|. % % |maxentries| must not be too small: otherwise offensive to look at % vertical spaces may come between the edition text and the apparatus % criticus. Conversely, |maxentries| must not be too big: otherwise, % should entries overflow on a given page, the edition text and the % apparatus criticus may clash again. As said above, a couple of % clashes can be managed with a couple of manually inserted page % breaks. But if there be too many of them, it is a good indication % that the selected value of |maxentries| is too high. % % Complex edition texts do have a magic number. An advisable way to % figure it out would be to start from a sample of only a few pages, % selected as evidence for the complexity of the whole. As only a few % pages would need to be compiled, the magic number should emerge % quite rapidly. % % \paragraph{Adding and Removing Entries} % \DescribeMacro{\addentries} \cs{addentries}\oarg{layer}\marg{n} % \newfeature[v1.1]\\ % If |maxentries| be set for a given layer of critical notes, % \cs{addentries}\oarg{layer}\marg{n}, where \meta{n} is an integer, % can be used to add \meta{n} to\---or remove it from if \meta{n} be % negative\---the number of accepted entries on the current % page. \cs{addentries} operates on the default layer of notes, but % any other declared layer can be specified in the optional argument % of the command. % % \danger Of course, \cs{addentries} must be issued before the % number of entries on a given page has reached the value set as % |maxentries|. % % Once a sensible value for |maxentries| has been found, % \cs{addentries} can further be used with a positive integer to allow % for more entries and more lines on some pages so that offending % vertical spaces are decreased. Conversely, \cs{addentries} with a % negative integer will remove entries on pages where there are too % many of them and \pkg{ekdosis} still oscillates between different % sets of page decisions. % % \paragraph{The \texttt{fitapp} Global Option} % \phts\label{ref:fitapp-trick} \newfeature[v1.3] The rationale of % this option is discussed above (see \vref{ref:fitapp-opt}). As this % mechanism has the characters of the apparatus block scaled down to % allow for more entries once a predefined height has been reached, % \pkg{ekdosis} should settle down in most of the contentious % cases.\footnote{That is, cases that arise \emph{after} the % predefined height has been reached.} However, it is advisable to use % |fitapp| conjointly with |maxlines| or |maxentries| to prevent the % number of allowed entries from being too high, which would result in % the characters being too small or even illegible. % % \newfeature[v1.5] As already seen \vpageref{ref:appheight}, once the % global option |layout=fitapp| has been set,\footnote{See above % \vpageref{ref:fitapp-opt}.} the default maximum height of the % apparatus criticus block is |0.5\textheight|, which can be changed % by assigning a new length to the |appheight| option of % \cs{SetHooks}. To more finely adjust this height on given pages, % \pkg{ekdosis} provides additional commands to be used in the edition % text:--- % % \DescribeMacro{\localappheight} % \cs{localappheight}\marg{dimen} can be used to change locally the % height up to which the apparatus block is allowed to % grow. \meta{dimen} must be a number followed by a unit % length. \danger This command operates only on the apparatus block % that follows it. Therefore, it must be issued \emph{before} the % first entry of the apparatus block on which it is intended to % operate, either on the current page or in the last lines of the % preceding page. % % \DescribeMacro{\addtoappheight} % As the name suggests, in contrast to \cs{localappheight}, % \cs{addtoappheight}\marg{dimen} is used to increase or decrease % locally the height of the apparatus typeblock. \meta{dimen} must be % a number followed by a unit length. Just as \cs{localappheight}, % this command operates only on the apparatus block that follows it. % % \subsection{Using \textsf{emacs}} % \label{sec:using-emacs} % \pkg{ekdosis} includes an AUC\TeX\ style file that can be used to % facilitate the insertion of the many commands it provides. % % \paragraph{Installation} % In what follows, it is assumed that both the \textsf{emacs} text % editor\footnote{\url{https://www.gnu.org/software/emacs}} and % AUC\TeX%^^A % \footnote{\url{https://www.gnu.org/software/auctex/download.html}} % have already been installed. % \begin{description} % \item[\pkg{ekdosis} Stable] % \begin{enumerate} % \item Download |ekdosis.el| from % CTAN: % \url{https://ctan.org/tex-archive/macros/luatex/latex/ekdosis} % \item Copy this file to % |$HOME/.emacs.d/auctex/style/|\footnote{This directory must be % created if need be.}\saveFN\fnAUCTeX\ where |$HOME| stands % for the directory of the current user. % \end{enumerate} % \item[\pkg{ekdosis} Development Version] % \begin{enumerate} % \item Download |ekdosis.el| from either % |git.robertaless|\allowbreak|i.net| % (\url{http://git.robertalessi.net/ekdosis/plain/ekdosis.el}) % or the |sourcehut| git % repository % (\url{https://git.sr.ht/~ralessi/ekdosis/blob/master/ekdosis.el}). % \item Copy this file to % |$HOME/.emacs.d/auctex/style/|\useFN\fnAUCTeX\ where |$HOME| % stands for the directory of the current user. % \end{enumerate} % \end{description} % % If desired, |ekdosis.el| can be compiled like so:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{bash} emacs --batch -f batch-byte-compile ekdosis.el &>/dev/null \end{minted} % \iffalse % % \fi % % This will produce |ekdosis.elc| which can be copied to the same % directory as |ekdosis.el|. % % \paragraph{Code Folding} % \phts\label{ref:code-folding} % The variant readings and the critical notes can grow in number to a % point where they may clutter the source text. As a result, the % edition text can become illegible. One way around this difficulty is % to use the \textsf{emacs} editor with |ekdosis.el|, the AUC\TeX\ % style file that is provided with \pkg{ekdosis}, to fold the code so % that only the edition text, exclusive of variants and notes, is % displayed on the screen. % % In order to hide all foldable items, |TeX-fold-mode| must first be % activated, like so: |C-c| |C-o| |C-f|.\footnote{Menu sequence: % \menu{LaTeX>Show/Hide>Fold Mode}} Then |C-c| |C-o| |C-b| can be used % to fold the code.\footnote{Menu sequence: \menu{LaTeX>Show/Hide>Hide % All in Current Buffer}} % % \DescribeMacro{\App} % \newfeature[v1.5]\cs{App}|[type=|\meta{type}|]|\marg{lemma % text}\marg{readings and notes}\phts\label{ref:App-cmd}\\ % \cs{App} allows for much more flexible code folding where notes and % variants are hidden to let only the base text appear on the screen. % \cs{App} is strictly equivalent to \cs{app}, except that the % apparatus entries are meant to be distributed in two different % arguments, like so:--- % % \iffalse %<*example> % \fi \begin{minted}[escapeinside=++]{latex} I saw my friend \App{\lem{Peter}}{\rdg{John}} yesterday. or: I saw my friend \App{\lem{Peter}}{+\label{ln:App:1}+ \rdg{John} } yesterday.+\label{ln:App:2}+ \end{minted} % \iffalse % % \fi % % \begin{remarks} % \item As can be seen, the first argument of \cs{App} is meant to % receive the lemma text while \cs{rdg}, \cs{note} and the like are % inserted in the second one. % \item As the second argument of \cs{App} is the foldable item, a % good practice is to keep the lemma text on the same line as the % opening brace (l.~\lnref{ln:App:1}) and to write the continuation % of the text just after the closing brace (l.~\lnref{ln:App:2}). % \end{remarks} % % Code folding, once applied, results in a clean source text with no % clutter as follows:--- % % \iffalse %<*example> % \fi \begin{minted}[escapeinside=++]{latex} I saw my friend +\textcolor{lavender}{Peter}+ yesterday. \end{minted} % \iffalse % % \fi % % \danger As there is no point in using this command for anything % other than this specific purpose, \cs{app} is used in the examples % throughout this document. % % \subsection{Variae Quaestiones} % \label{sec:variae-quaestiones} % This section is about issues that are not strictly speaking part of % the documentation of \pkg{ekdosis} but may nevertheless % circumstantially arise. % % \paragraph{Superfluous Dots} % \phts\label{sec:superfluous-dots} As said above % \vpageref{ref:ending-dot}, it is customary in some editions to have % a full stop printed at the end of the apparatus % criticus. \pkg{ekdosis} provides specific commands to achieve this % in a straightforward way, such as \cs{SetEndApparatus} and the % |ehook| optional argument of \cs{SetApparatus} and % \cs{DeclareApparatus}.\footnote{See above % \vpagerefrange{ref:setendapparatus}{sec:declaring-layers}.} However, % if the last word of the apparatus criticus on a given page be an % abbreviation followed by a dot, such a setting will have two dots % printed at the end of the apparatus instead of one. The solution is % to define a command to have a dot printed only if not followed by a % dot, and append this command to the abbreviated form of the word, % like so:--- % % \iffalse %<*example> % \fi \begin{minted}{latex} % Preamble: \usepackage{xspace} \usepackage{ekdosis} \makeatletter \newcommand{\ekddot}{% \ltx@ifnextchar@nospace{.}{\xspace}{.\xspace}} \makeatother \DeclareApparatus{default}[ehook=.] \DeclareScholar{Erm}{Erm\ekddot} \end{minted} % \iffalse % % \fi % % \begin{remarks} % \item Line~2: The \pkg{xspace} package is needed for \cs{xspace} is % used by the \cs{ekddot} command that is defined at l.~6. % \item Line~7: \cs{ltx@ifnextchar@nospace} is part of the % \pkg{ltxcmds} package which is loaded by \pkg{ekdosis}. As this % command uses a private control sequence, it must be found within % \cs{makeatletter} \dots\ \cs{makeatother}. % \item Line~10: \cs{ekddot} will only work with multiple-layer % apparatus criticus. Therefore, |\DeclareAppa|\allowbreak|ratus| % must be used even if only one layer of critical notes be needed. % \end{remarks} % % \paragraph{Backup of Essential Files} % Each time the |.tex| source file is compiled, \pkg{ekdosis} reads % the |.aux| corresponding \LaTeX\ auxiliary file and its own |.ekd| % auxiliary file so as to process labels and collect entries of the % apparatus criticus. If for whatever reason\---e.g.\ some unknown % command has been inserted\---the compilation be frozen and so must % be aborted, it may happen that most of the edition text has to be % reconstructed page after page. For large and complex editions, this % makes advisable to have current versions of those files backed up % each time a new compilation begins, which can be achieved by % inserting the following lines before the line that loads the % document class:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \RequirePackage{verbatimcopy} \IfFileExists{\jobname.aux}{% \OldVerbatimCopy{\jobname.aux}{\jobname.aux.bak}}{} \IfFileExists{\jobname.ekd}{% \OldVerbatimCopy{\jobname.ekd}{\jobname.ekd.bak}}{} \documentclass{book} \end{minted} % \iffalse % % \fi % % This way, both |.aux| and |.ekd| files can be recovered from % |.aux.bak| and |.ekd.bak| just after the compilation has been % aborted. Should this be needed, one must proceed carefully as % follows:--- % \begin{enumerate} % \item Just after the compilation has been aborted, move both % |aux.bak| and |ekd.bak| files to a safe place. % \item Remove or correct the offending command or lines that broke % the compilation and make sure that the issue is solved. % \item Restore the |.aux| and |.ekd| files from |aux.bak| and % |.ekd.bak| and resume work where it was left off. % \end{enumerate} % % \section{\texttt{TEI xml} Output} % \label{sec:teixml-output} % Several examples of \texttt{TEI xml} output have been provided % hitherto. Before proceeding, the reader is invited to return to % every one of them. In this respect, it may be of interest to review % carefully the excerpt of Caesar's \emph{Gallic War} of which the % \LaTeX\ source file and its corresponding \texttt{TEI xml} output % are printed in full below in \vref{sec:caesar-gw-6-1-13}. Once % \pkg{ekdosis} has been instructed to convert the edition text into % \texttt{TEI xml} (l.~11), the preamble of this file shows how to set % languages and fonts to be used in the document (ll.~2--6), format % the titles (l.~16) and lay out the alignment of an edition text % associated with two translations (ll.~18--25) in modern % languages. Furthermore, it shows how information related to each % language (Latin, English and French) is to be found in two different % places, namely for \texttt{TEI xml} output (ll.~21--3) and for PDF % output through \LaTeX\ (ll.~27--9). Finally, it provides examples of % declaring witnesses, hands and shorthands (ll.~31--60). As to the % document itself, it shows how to lay out a conspectus siglorum in a % table (ll.~64--80), before giving detailed examples of how the % edition text is entered (ll.~85--101) and sectional commands % provided by \pkg{ekdosis} are used (ll.~86, 103 and % 110).\footnote{The PDF output is available as % \href{samples/Caesar_BG-6-13-1.pdf}{a separate file}.} % % \subsection{Requesting \texttt{TEI xml} Output} % \label{sec:request-tei-output} % \texttt{TEI xml} output is requested by means of the |teiexport| % global option as described above % \vpageref{ref:teiexport-option}. Once instructed to output % \texttt{TEI}, \pkg{ekdosis} converts and exports in sequence the % contents of \env{ekdosis} environments (see above % \vref{sec:single-text-editing}). As regards the contents of % \env{alignment} environments (see above \vref{sec:alignment-basic}), % \pkg{ekdosis} first collates the contents of the environments that % have been declared as values of the |texts| optional argument of % \env{alignment} or \cs{SetAlignment},\footnote{See above % \vref{sec:multiple-alignment}.} then places each of the % corresponding \texttt{TEI xml} outputs within distinct |
| % elements named after the declared environments themselves. For % example, to return to Caesar's text, the Latin edition text is found % between a \cs{begin}|{latin}| \dots\ \cs{end}|{latin}| environment % (see the |.tex| source file, \vref{sec:caesar-gw-tex}, ll.~85--101) % which is declared at l.~21. Then, the corresponding \texttt{xml} % output is found within a |
| element, the |xml:id| of which has % been given by \pkg{ekdosis} the value |div-latin_1| (see % \vref{sec:caesar-gw-tei}, ll.~176--200). % % \paragraph{\texttt{TEI} File Name} \DescribeMacro{\SetTEIFilename} % \cs{SetTEIFilename}\marg{basename} is a preamble-only command. It % can be used to set the base name of the \texttt{TEI xml} output % file, to which the suffix |.xml| is appended. By default, the base % name is \cs{jobname}|-tei|. % % \subsection{General Principles} % \label{sec:totei-general-principles} % \paragraph{Validation of the \texttt{TEI xml} Structure} % The reference tool that the author relies on is that provided by the % \emph{\texttt{TEI} by Example Project}.\footnote{\cite{TBE}. % The \texttt{TEI} validator is here: % \url{http://teibyexample.com/xquery/TBEvalidator.xq}.} As for % \pkg{ekdosis}, it is designed to produce on request, in addition to % an edition in print, a \texttt{TEI xml}-compliant output file. That % said, one must keep in mind that the \LaTeX\ packages that are part % of {\TeX}Live can be counted in thousands, and the commands they % provide in tens of thousands. There may even be grounds in asserting % that the possibilities offered by \TeX\ and \LaTeX\ quite exceed % what can be afforded by \texttt{TEI xml}. On another hand, many % \LaTeX\ commands make no sense in \texttt{TEI}. Therefore, a % sensible choice is to keep them out of the environments the contents % of which are to be translated into \texttt{xml} elements, as will be % illustrated by the following. % % Converting a \LaTeX\ document into \texttt{TEI xml} can be quite an % intricate business. In many cases, however, \LaTeX\ strings are % found within environments or groups that are easy to convert into % \texttt{TEI} equivalents: unless instructed otherwise, whether such % groups are delimited by opening and closing braces or by explicit % \cs{begin} \dots\ \cs{end} commands, \pkg{ekdosis} translates them % into |xml| so that for example \cs{emph}|{word}| and % \cs{begin}|{quote}| \meta{quoted words} \cs{end}|{quote}| become % || \meta{word} || and || \meta{quoted words} % || respectively. % % But \LaTeX\ does not place everything into groups or % environments. To take here but a few examples, sectional divisions % are marked in \LaTeX\ with \enquote{open} commands such as % \cs{chapter} or \cs{section} with no clear indication where the % closure of divisions occurs, contrary to \texttt{TEI xml} markup % with numbered or un-numbered |
| elements allowed to nest % recursively. As regards running paragraphs of text, the situation is % even worse than in the latter case, as the following simple example % shows:--- % % \iffalse %<*example> % \fi \begin{minted}{latex} \begin{document} \begin{ekdosis} ... ... These are the final words of some section in the body text. \section{New Section} Here is how some new section begins... ... Final words. \section{Other Section} Opening words of the section... ... Final words \section{Other Section} Opening words... ... Final words. \end{ekdosis} \end{document} \end{minted} % \iffalse % % \fi % % Obviously, construing this \LaTeX\ source file into \texttt{TEI xml} % is a fairly complex task. For example, line~6 only closes a % paragraph for line~7 opens a division (hence |

|), line~8 % only opens a paragraph just after the heading of the section (hence % |

|) while line~14 both closes the foregoing paragraph and % opens a new one (hence |

|), contrary to line~16 which both % closes a paragraph and a sectional division (hence |

|), % not to mention lines~20--1, where notwithstanding the absence of % blank line or any other indication, % |

| is needed. % % \pkg{ekdosis} has been designed to implement this task through % \textsf{Lua} functions which involve string matching (both forward % and reverse matching) and recursions. % % \paragraph{\texttt{TEI xml} Export Settings} % \label{ref:setteixmlexport} % \DescribeMacro{\SetTEIxmlExport} \cs{SetTEIxmlExport}\marg{csv list % of options} can be used in the preamble or at any point of the % document, except inside environments set to receive an apparatus % criticus, namely the \env{ekdosis} environment or any other similar % environment declared by means of the \env{alignment} environment or % \cs{SetAlignment}.\footnote{See above % \vref{sec:multiple-alignment}.} At the time of writing, there is % only one option, as follows:---\\ % \DescribeOption{autopar} |autopar|$=$\verb+true|false+ % \hfill\tcboxverb{Default: true}\\ % The algorithm described above applies for edition texts composed in % running paragraphs or lines of poetry, but it may fail to produce a % valid \texttt{TEI xml} output with other arrangements, such as % performance texts or transcriptions of speech for which the % \texttt{TEI} Guidelines define specific rules. |autopar=false| % instructs \pkg{ekdosis} to ignore blank lines in the |.tex| source % file as markers for paragraph boundaries. As a result, each % paragraph of the edition text must be found within an environment % associated with the \texttt{xml} element |

|, such as \env{ekdpar} % or any other environment declared as such by means of \cs{EnvtoTEI} % described below in \vref{sec:new-cmds-envs}. A typical use case of % |autopar=false| is provided below in % \vref{sec:specific-tei-modules}. % % \DescribeEnv{ekdpar} \cs{begin}|{ekdpar}| \dots\ \cs{end}|{ekdpar}| % is a simple environment that does nothing but insert \cs{par} % primitives. It can be used to instruct \pkg{ekdosis} to place % paragraphs within |

| elements when |autopar| has been set to % |false| by means of \cs{SetTEIxmlExport} described above. % % \paragraph{The \texttt{xml:id} Attribute} % \phts\label{ref:xmlid} As a general rule, the |xml:id| global % attribute must be unique for the element that bears the % attribute. Furthermore, it must begin with a letter or an underscore % and contain no characters other than letters of the Latin % alphabet\--- from |a| to |z|, either upper or lower case\---digits, % hyphens, underscores and full stops. \pkg{ekdosis} issues a warning % when it finds that any \meta{unique id} of \meta{unique label} % expected in the first argument of \cs{DeclareWitness}, % \cs{DeclareHand}, \cs{DeclareSource} or \cs{DeclareScholar} is not % unique or breaks the rules just described, but does not prevent the % |.tex| source file from compiling. Instead, it prints the string % || in place of the expected formatted siglum so that the error % in the |.tex| source file can be easily spotted and corrected. % % \danger As the \meta{unique id} declared with \cs{DeclareShorthand} % is not to be exported in the \texttt{TEI xml} output file, % \pkg{ekdosis} checks neither its uniqueness nor its validness. % % \danger It must be noted that \LaTeX\ labels that are provided in % commands such as \cs{label}, \cs{cite} and the like must also be % unique in the document. As \LaTeX\ will issue warnings if duplicates % be found, \cs{ekdosis} does not check their uniqueness but will % issue warnings if such labels contain invalid strings. % % \subsection{Routine \LaTeX\ Commands and Environments} % \label{sec:routine-cmds} % The list of \LaTeX\ commands known by \pkg{ekdosis} at the time of % writing follows. To this list must be added the \LaTeX\ standard % commands that are used for sectional divisions as described above in % \vref{sec:latex-divs} and most of the commands provided by the % \pkg{arabluatex} and \pkg{icite}\footcite{icite} packages. Standard % citation commands are also supported as will be described below in % \vref{sec:citation-cmds}:--- % % \begin{xltabular}{0.825\linewidth}{XX} % \toprule % \LaTeX\ command & \texttt{TEI xml} element\\ % \midrule\endhead % \cs{textsuperscript}|{}| & || \\ % \cs{textsubscript}|{}| & || \\ % \cs{textbf}|{}| & || \\ % \cs{textit}|{}| & || \\ % \cs{textsc}|{}| & || \\ % \cs{textsf}|{}| & || \\ % \cs{footnote}|{}| & || \\ % \cs{marginpar}|{}| & || \\ % \cs{enquote}\meta{*}|{}| & || \\ % \cs{label}|{label}| & || \\ % \cs{linelabel}|{label}| & || \\ % \cs{ref}|{label}| & || \\ % \cs{pageref}|{label}| & || \\ % \cs{vref}|{label}| & || \\ % \cs{vpageref}|{label}| & || \\ % \cs{pagebreak}\meta{\oarg{1-4}} & no output \\ % \cs{mbox}\marg{text} & \meta{text} \\ % \midrule % \multicolumn{2}{c}{From the \pkg{marginnote}\footcite{marginnote} % package:}\\ % \cs{marginnote}|{}| & || \\ % \midrule % \multicolumn{2}{c}{From the \pkg{extdash}\footcite{extdash} % package:}\\ % \cs{---} or \cs{===} & --- \\ % \cs{--} or \cs{==} & -- \\ % \cs{-/} or \cs{=/} & ‐ \\ % \bottomrule % \end{xltabular} % % As for environments:--- % % \begin{xltabular}{0.825\linewidth}{XX} % \toprule % \LaTeX\ environment & \texttt{TEI xml} element\\ % \midrule\endhead % |flushright| & |

| \\ % |flushleft| & |

| \\ % |center| & |

| \\ % |quotation| & || \\ % |quoting| & || \\ % |verse| & || \\ % \bottomrule % \end{xltabular} % % Regarding other, very frequently used commands or environments, some % do not need to be inserted in the translation tables: as already % said above, \pkg{ekdosis} converts by default the original names of % these into \texttt{xml} elements. For instance, \cs{emph}|{}| and % \cs{begin}|{quote}| \dots\ \cs{end}|{quote}| will result in % || and || respectively. % % For the same simple reason, should one wish to have words within a % \texttt{TEI xml} element that does not have any \LaTeX\ equivalent, % all is needed is to define an inoperative \LaTeX\ command named % after the \texttt{TEI} element, like so:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} % Preamble: \newcommand{\mentioned}[1]{#1} % Document: Our usage corresponds to the \mentioned{aggregate} of many mathematical writings and to the sense of \mentioned{class} found in older logical writings. \end{minted} % \iffalse % % \fi % % \texttt{TEI xml} output:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml}

Our usage corresponds to the aggregate of many mathematical writings and to the sense of class found in older logical writings.

\end{minted} % \iffalse % % \fi % % Of course, it is also possible to have the \enquote{mentioned} words % printed in a different font family:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \newcommand{\mentioned}[1]{\textsf{#1}} \end{minted} % \iffalse % % \fi % % This command will print them in a sans serif font family, with the % exact same \texttt{TEI xml} output as above. % % \subsection{Processing New Commands or Environments} % \label{sec:new-cmds-envs} % The following three commands are provided to instruct \pkg{ekdosis} % how to convert unknown or unusual \hologo{(La)TeX} commands or % environments into \texttt{TEI xml} equivalents. % % \DescribeMacro{\TeXtoTEI} \cs{TeXtoTEI}\marg{csname}\marg{TEI % element}\oarg{TEI attribute(s)}\\ % \cs{TeXtoTEI} takes two mandatory arguments and one optional % argument, namely: the control sequence name to be converted, the % \texttt{TEI} element it is to be converted into and any additional % \texttt{xml} attributes to be appended to the opening \texttt{TEI} % element. For example, the \cs{sidenote} command that is provided by % the \pkg{sidenotes} package can be processed like so:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} % Preamble: \TeXtoTEI{sidenote}{note}[place="margin"] % Document: \begin{ekdosis} \begin{ekdverse} The self-same moment I could pray;\sidenote{The spell begins to break}\footnote{The turning point of the poem...} \end{ekdverse} \end{ekdosis} \end{minted} % \iffalse % % \fi % % \texttt{TEI xml} output:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml} The self-same moment I could pray; The spell begins to break The turning point of the poem... \end{minted} % \iffalse % % \fi % % Even more subtly, provided that the code |#STC| points to some more % information identifying the agency concerned:\footnote{At the time % of writing, \enquote*{sources} can be declared with % \cs{DeclareSource} as described above % \vpageref{ref:declare-source}. Then the unique identifier used in % the first argument of this command can point to the list of % references inserted by \pkg{ekdosis} in the back matter section of % the \texttt{TEI} output file. See below % \vref{sec:references-cited-works} for more information on how to do % this. Scholars can also be referred to as individuals by means of % the \cs{DeclareScholar} command. See above % \vpageref{ref:declare-source}.}--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} % Preamble: \usepackage{sidenotes} \usepackage[teiexport=tidy]{ekdosis} \TeXtoTEI{sidenote}{note}[place="margin"] \newcommand{\STCsnote}[1]{\sidenote{#1}} \TeXtoTEI{STCsnote}{note}[place="margin" resp="#STC"] % Document: \begin{ekdosis} \begin{ekdverse} The self-same moment I could pray;\STCsnote{The spell begins to break}\footnote{The turning point of the poem...} \end{ekdverse} \end{ekdosis} \end{minted} % \iffalse % % \fi % % \texttt{TEI xml} output:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml} The self-same moment I could pray; The spell begins to break The turning point of the poem... \end{minted} % \iffalse % % \fi % % \DescribeMacro{\EnvtoTEI} \DescribeMacro{\EnvtoTEI*} % \cs{EnvtoTEI}\meta{*}\marg{env name}\marg{TEI element}\oarg{TEI % attribute(s)}\\ % \cs{EnvtoTEI} instructs \pkg{ekdosis} how to convert \LaTeX\ % environments into \texttt{TEI xml} equivalents. It takes two % mandatory arguments and one optional argument, namely the name of % the \LaTeX\ environment to be converted, the \texttt{TEI} element it % is to be converted into and any additional attributes to be appended % to the \texttt{TEI} opening element. \cs{EnvtoTEI*} is restricted to % \texttt{TEI} elements that must never appear within |

| elements, % such as |

| itself, |

|, || and the like. The following % example illustrates how \cs{EnvtoTEI} can be used conjointly with % \pkg{babel} to convey information about the languages used from % \LaTeX\ to \texttt{TEI}:--- % % \phts\label{ref:ancientgreek-ex} % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} % Preamble: % Use babel and babeltags: \usepackage[greek.ancient, english]{babel} \babeltags{ancientgreek = greek} \EnvtoTEI{ancientgreek}{p}[xml:lang="grc"] % Document: \begin{ekdosis} \begin{ancientgreek} περὶ πολλοῦ ἂν ποιησαίμην, ὦ ἄνδρες, τὸ τοιούτους ὑμᾶς ἐμοὶ δικαστὰς περὶ τούτου τοῦ πράγματος γενέσθαι, οἷοίπερ ἂν ὑμῖν αὐτοῖς εἴητε τοιαῦτα πεπονθότες... \end{ancientgreek} \end{ekdosis} \end{minted} % \iffalse % % \fi % % \texttt{TEI xml} output:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml}

περὶ πολλοῦ ἂν ποιησαίμην, ὦ ἄνδρες, τὸ τοιούτους ὑμᾶς ἐμοὶ δικαστὰς περὶ τούτου τοῦ πράγματος γενέσθαι, οἷοίπερ ἂν ὑμῖν αὐτοῖς εἴητε τοιαῦτα πεπονθότες...

\end{minted} % \iffalse % % \fi % % \DescribeMacro{\TeXtoTEIPat} % \phts\label{ref:textoteipat} % \cs{TeXtoTEIPat}\marg{\TeX\ pattern}\marg{TEI pattern}\\ % Finally, this more flexible\---and more delicate to % handle\---command uses pattern matching to instruct \pkg{ekdosis} % how to convert \hologo{(La)TeX} commands into \texttt{TEI} % equivalents. In the first mandatory argument, strings to be captured % are marked in sequence with numbers prefixed by |#|, like so: |#1|, % |#2|, |#3| and so forth. Then, in the second mandatory argument, the % strings captured are inserted where each of them is expected in % the \texttt{TEI} element. % % \danger If the entire string to be captured be enclosed in square or % curly brackets, it is advisable to use |@b|\texttt{\emph{n}} (for % curly brackets) or |@s|\texttt{\emph{n}} (for square brackets) % instead of |#|\texttt{\emph{n}}, where \texttt{\emph{n}} is the % number that is expected in the sequence. This will prevent any % brackets that may be found in the captured string from being % interpreted. % % \danger Strings must be entered exactly as \pkg{ekdosis} will find % them as the |.tex| source file is compiled. Specifically, % \emph{control sequences}, namely the coded commands immediately % preceded by `\verb+\+' are always found followed by a space. For % instance, |\emph{}| will be seen and processed by \pkg{ekdosis} as % \verb*|\emph {}|. % % The following example illustrates how \pkg{ekdosis} can be % instructed to process the % \cs{textcolor}\allowbreak\marg{color}\marg{text} command:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos]{latex} \TeXtoTEIPat{\textcolor␣{#1}@b2}{@b2} Sample text with a \textcolor{red}{word} in red. \end{minted} % \iffalse % % \fi % % \begin{remarks} % \item[\textsc{Rem.}] As can be seen from l.~1, it is safe to use % |#1| for the first string for color names are naturally formed of % letters without braces. However, |@b2| is preferable to capture % the whole second argument of \cs{textcolor} for it may contain % words within braces. % \end{remarks} % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml}

Sample text with a wordin red.

\end{minted} % \iffalse % % \fi % % \paragraph{Inserting \texttt{xml:id}\emph{s} in \texttt{TEI} Patterns} % \DescribeMacro{\getTEIxmlid} \newfeature[v1.5] In some instances, it % may be useful to retrieve the |xml| formatted pointers corresponding % to unique identifiers declared in commands such as % \cs{DeclareWitness}\footnote{See above % \vpageref{ref:declarewitness}.} and the like so as to insert them in % the second argument\===\meta{TEI pattern}\===of \cs{TeXtoTEIPat}. As % an illustration, what follows creates a new \LaTeX\ command % \cs{witStart} which prints nothing in the PDF ouput but inserts % || elements in the \texttt{TEI xml} file. This commands % accepts an optional argument to make clear which are the fragmentary % witnesses involved:--- % % \iffalse %<*example> % \fi \begin{minted}[escapeinside=++]{latex} \NewDocumentCommand{\witStart}{O{}}{\ignorespaces} \TeXtoTEIPat{\witStart [wit=@b1]}{}+\label{ln:getxml:a}+ \TeXtoTEI{witStart}{witStart} \end{minted} % \iffalse % % \fi % % \begin{remarks} % \item On the use of \cs{NewDocumentCommand} to create new commands, % the reader is invited to refer to the documentation of the % \pkg{xparse} package.\footcite{xparse} % \item As can be seen from l.~\lnref{ln:getxml:a}, \cs{getTEIxmlid} % is used to process the csv-list of unique identifiers that matches % the string captured between the braces after |wit=|, as implied by % |@b1|. As a consequence, \cs{witStart}|[]| is expected as follows: % \mintinline{latex}|\witStart[wit={X,Y}]|. Braces must exist for % pattern matching. % \item Finally, |\TeXtoTEI{witStart}{witStart}| is used so that the % argument-less form of the command can be processed as well. % \end{remarks} % % \subsection{Inserting Code in the \texttt{TEI xml} Ouput File} % \label{sec:inserting-code-tei} % It may be needed to insert code in the \texttt{TEI xml} output file % only, for example when clear enough information is written in the % apparatus criticus by means of such optional arguments as |pre|, % |post|, |prewit| or |postwit| that are not processed for \texttt{TEI % xml} ouput.\footnote{See above \vref{sec:single-text-editing}.} % % \needspace{2\baselineskip} % \DescribeMacro{\teidirect} \newfeature[v1.3] \cs{teidirect}\oarg{xml % attributes}\marg{xml element}\marg{code}\\ % Two mandatory arguments are expected by \cs{teidirect}, namely the % \texttt{TEI xml} element followed by the contents to be found in the % ouput file between the opening and closing tags. Additionally, % attribute-value pairs to be found inside the start-tag of the % element can be specified in the optional argument of the command. % % \DescribeMacro{\teidirectE} \newfeature[v1.5] % \cs{teidirectE}\oarg{xml attributes}\marg{xml element}\\ % \cs{teidirectE}\===where |E| stands for \enquote{\underLine{e}mpty % element}\===is strictly equivalent to % \cs{teidirect}\allowbreak\oarg{xml attributes}\marg{xml % element}|{}|. Compared to the latter command, it only eliminates the % need to insert the ending pair of empty braces. % % An example follows: % % \iffalse %<*example> % \fi \begin{minted}[linenos]{latex} % Preamble: \DeclareWitness{GalE1.M}{Gal.E1(M)}{\emph{Monacencis Gr.} 231}[origDate=s. XVI] \DeclareWitness{GalE1.Q}{Gal.E1(Q)}{\emph{Parisinus Gr.} 2174}[origDate=s. XIV] \DeclareShorthand{GalE1.M.Q}{Gal.E1(MQ)}{GalE1.M,GalE1.Q} % Document: ἐν \app{ \lem[wit=codd]{καύμασιν} \rdg[wit=GalE1.M.Q, postwit=\unskip(23.16)]{καύματι} \teidirect{note}{p. 23, l. 16 Wenkebach}} \end{minted} % \iffalse % % \fi % % \begin{remarks} % \item |GalE1.M.Q| (l.~11) has been defined as a shorthand to denote % the agreement of two otherwise defined manuscripts by means of % \cs{DeclareWitness}: |GalE1.M| and |GalE1.Q|. (See ll.~2--6.) % \item The |postwit| optional argument has been used to further % specify the location where this variant reading can be found in % the critical edition of Galen's Commentary on Hippocrates' % \emph{Epidemics}, Book~1 (l.~11). But as the effect of |postwit| % is limited to the PDF output, \cs{teidirect} has been used to % convey this item of information to the \texttt{TEI xml} ouput file % (l.~12). % \end{remarks} % % PDF output:--- % \medskip % % \needspace{7\baselineskip} % \resetlinenumber % \begin{alignment}[flush,tcols=1,texts=specimen,apparatus=specimen] % \begin{specimen} % \begin{ancientgreek} % ἐν \app{ % \lem[wit=hcodd]{καύμασιν} % \rdg[wit=hGalE1.M.Q, postwit=\unskip(23.16)]{καύματι} % \teidirect{note}{p. 23, l. 16 Wenkebach}} % \end{ancientgreek} % \end{specimen} % \end{alignment} % % \texttt{TEI xml} output:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos]{xml}

ἐν καύμασιν καύματι p. 23, l. 16 Wenkebach

\end{minted} % \iffalse % % \fi % % \subsection{Specific \texttt{TEI} Modules} % \label{sec:specific-tei-modules} % The following example illustrates how \pkg{ekdosis} can be adapted % in a straightforward way to modules provided by the \texttt{TEI} for % encoding specific texts such as transcriptions of % speech.\footnote{See % \url{https://tei-c.org/release/doc/tei-p5-doc/en/html/TS.html}.} The % technique applied below uses \cs{EnvtoTEI} conjointly with % \cs{SetTEIxmlExport}|{autopar=|\allowbreak|false}| described above % \vpageref{ref:setteixmlexport}:--- % % \iffalse %<*example> % \fi \begin{minted}{latex} % Preamble: \newenvironment{speech}{\par}{\par} \newcommand{\speaker}[1]{\textbf{#1}\par} \EnvtoTEI{speech}{sp} \SetTEIxmlExport{autopar=false} % Document: \begin{ekdosis} \begin{speech} \speaker{Σωκράτης} \begin{ekdpar} κατέβην χθὲς εἰς Πειραιᾶ μετὰ Γλαύκωνος τοῦ Ἀρίστωνος προσευξόμενός τε τῇ θεῷ καὶ ἅμα τὴν ἑορτὴν βουλόμενος θεάσασθαι τίνα τρόπον ποιήσουσιν ἅτε νῦν πρῶτον ἄγοντες. καλὴ μὲν οὖν μοι καὶ ἡ τῶν ἐπιχωρίων πομπὴ ἔδοξεν εἶναι, οὐ μέντοι ἧττον ἐφαίνετο πρέπειν ἣν οἱ Θρᾷκες ἔπεμπον. \end{ekdpar} \end{speech} \end{ekdosis} \end{minted} % \iffalse % % \fi % % \begin{remarks} % \item Lines~2--3 define a basic environment meant to contain % individual speeches and a command to hold the name of the % speaker. This name is printed in bold face and followed by a new % paragraph in the PDF output. % \item Line~4 instructs \pkg{ekdosis} to convert \env{speech} \LaTeX\ % environments into || \texttt{TEI xml} elements. % \item Line~6 disables the |autopar| algorithm that \pkg{ekdosis} % provides by default for running paragraphs of text. As a % consequence, \env{ekdpar} is used to mark the paragraphs. % \end{remarks} % % PDF output:--- % \medskip % % \needspace{7\baselineskip} % \SetTEIxmlExport{autopar=false} % \begingroup % \newenvironment{speech}{\par\selectlanguage{greek}}{\par} % \newcommand{\speaker}[1]{\textbf{#1}\par} % \EnvtoTEI{speech}{sp} % \resetlinenumber % \begin{alignment}[flush,tcols=1,texts=specimen,apparatus=specimen] % \begin{specimen} % \begin{speech} % \speaker{Σωκράτης} % \begin{ekdpar} % κατέβην χθὲς εἰς Πειραιᾶ μετὰ Γλαύκωνος τοῦ Ἀρίστωνος % προσευξόμενός τε τῇ θεῷ καὶ ἅμα τὴν ἑορτὴν βουλόμενος θεάσασθαι % τίνα τρόπον ποιήσουσιν ἅτε νῦν πρῶτον ἄγοντες. καλὴ μὲν οὖν μοι % καὶ ἡ τῶν ἐπιχωρίων πομπὴ ἔδοξεν εἶναι, οὐ μέντοι ἧττον ἐφαίνετο % πρέπειν ἣν οἱ Θρᾷκες ἔπεμπον. % \end{ekdpar} % \end{speech} % \end{specimen} % \end{alignment} % \endgroup % \SetTEIxmlExport{autopar=true} % % \texttt{TEI xml} output:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml} Σωκράτης

κατέβην χθὲς εἰς Πειραιᾶ μετὰ Γλαύκωνος τοῦ Ἀρίστωνος προσευξόμενός τε τῇ θεῷ καὶ ἅμα τὴν ἑορτὴν βουλόμενος θεάσασθαι τίνα τρόπον ποιήσουσιν ἅτε νῦν πρῶτον ἄγοντες. καλὴ μὲν οὖν μοι καὶ ἡ τῶν ἐπιχωρίων πομπὴ ἔδοξεν εἶναι, οὐ μέντοι ἧττον ἐφαίνετο πρέπειν ἣν οἱ Θρᾷκες ἔπεμπον.

\end{minted} % \iffalse % % \fi % % \subsection{References to Cited Works} % \label{sec:references-cited-works} % A full example of what is technically called a \emph{Conspectus % Siglorum} can be found above in \vref{sec:print-witnesses}. Such a % list of manuscript sigla should be found immediately before the % edition text. Traditionally, this section is followed by a list of % other sources used to establish the text, so that the edited text is % in the end established both from manuscript evidence (the % \enquote{witnesses}) and other works based on a scholarly approach % of the text (the \enquote{sources}) which are called in Latin % \emph{Editiones uel Studia}. As a consequence of this classification % as \enquote{witness} or \enquote{source}, the former must go within % the || element of the \texttt{TEI} header, whereas the % latter is to be found within the || element. % % \DescribeMacro{\AddxmlBibResource} % \cs{AddxmlBibResource}\marg{basename or name.xml} is a preamble-only % command. If a base name (either suffixed with |.xml| or not) for a % \texttt{TEI xml}-compliant bibliographical database be provided, % \pkg{ekdosis} will use it and insert formatted data in the back % matter section of its own \texttt{TEI xml} output file, as % || elements within a |listBibl| section. % % As an example, the following Bib\hologo{(La)TeX} entry and its % \texttt{TEI} equivalent are provided:\footnote{\label{fn:zotero}To % the author's knowledge, \textsf{Zotero} % (\url{https://www.zotero.org}) provides excellent \texttt{TEI xml} % output from Bib\hologo{(La)TeX} input files.}--- % % \iffalse %<*example> % \fi \begin{minted}{bibtex} @Book{Drak, title = {Punicorum Libri Septemdecim}, author = {Silius Italicus, Tiberius Catius}, editor = {Drakenborch, Arnold}, date = {1717}, publisher = {Trajecti ad Rhenum}, location = {Utrecht} } \end{minted} % \iffalse % % \fi % % \iffalse %<*example> % \fi \begin{minted}{xml} Punicorum libri septemdecim Tiberius Catius Silius Italicus Arnold Drakenborch Utrecht Trajecti ad Rhenum 1717 \end{minted} % \iffalse % % \fi % % \danger As can be seen, the same string |Drak| is used as a label in % the Bib\hologo{(La)TeX} file (l.~1) and an |xml:id| in the % \texttt{TEI} file (l.~3). This same label must be used again in the % preamble of the |.tex| source file to declare Arnold Drakenborch as a % source,\footnote{See above \vpageref{ref:declare-source}.} like % so:--- % % \iffalse %<*example> % \fi \begin{minted}{latex} % Use 'bibl.xml' as a TEI xml bibliographical database: \AddxmlBibResource{bibdata.xml} % Declare A. Drakenborch as source: \DeclareSource{Drak}{\emph{Drakenborch}} \end{minted} % \iffalse % % \fi % % \phts\label{ref:ekdverse-ex} % Finally, an extract of Silius Italicus' \emph{Punica}, Book~9, % ll.~30-2 follows (|.tex| source file, PDF output and \texttt{TEI} % output files):--- % % \iffalse %<*example> % \fi \begin{minted}{latex} % Preamble: \usepackage[style=oxnotes]{biblatex} \addbibresource{bibdata.bib} \usepackage[teiexport=tidy]{ekdosis} % basename of the .xml bibliographical database: \AddxmlBibResource{bibdata.xml} % Witnesses: \DeclareWitness{L}{L}{Laurentianus, plut, XXXVII, cod. 16}[ origDate=s. XV] % Other witnesses [...] % Sources: \DeclareSource{Drak}{\emph{Drakenborch}} % Alternatively, use BibLaTeX for the rendition: % \DeclareSource{Drak}{\citename{Drak}{editor}} % Other sources [...] % Document: \begin{ekdosis} \begin{ekdverse} Sed uos, quorum oculos atque ora humentia uidi,\\ uertere cum consul terga et remeare iuberet,\\ \app{ \lem[source=Drak, type=emendation]{ne morem} \rdg[wit={L, F}]{me morem} \rdg[wit={O, V}]{memorem} } et pugnae signum exspectate petendae:\\ \end{ekdverse} \end{ekdosis} \end{minted} % \iffalse % % \fi % % PDF output:--- % \medskip % % \needspace{7\baselineskip} % \begin{alignment}[flush,tcols=1,texts=specimen,apparatus=specimen] % \resetlinenumber\resetvlinenumber[30] % \setlength{\vrightskip}{-1.5in} % \begin{specimen} % \begin{ekdverse} % Sed uos, quorum oculos atque ora humentia uidi,\\ % uertere cum consul terga et remeare iuberet,\\ % \app{ % \lem[source=sDrak, type=emendation]{ne morem} % \rdg[wit={sL, sF}]{me morem} % \rdg[wit={sO, sV}]{memorem} % } et pugnae signum exspectate petendae:\\ % \end{ekdverse} % \end{specimen} % \end{alignment} % % \texttt{TEI xml} output file produced by \pkg{ekdosis} (narrowed % down to the || element):--- % % \iffalse %<*example> % \fi \begin{minted}{xml} Sed uos, quorum oculos atque ora humentia uidi, uertere cum consul terga et remeare iuberet, ne morem me morem memorem et pugnae signum exspectate petendae: Punicorum libri septemdecim Tiberius Catius Silius Italicus Arnold Drakenborch Utrecht Trajecti ad Rhenum 1717 \end{minted} % \iffalse % % \fi % % \subsection{Citation Commands} % \label{sec:citation-cmds} % \pkg{ekdosis} can also convert into \texttt{TEI xml} references to % cited works. Depending on the optional arguments used in the % citation command, references will be converted into || or % || elements with the appropriate identifier supplied by means % of the |target| or |corresp| attributes. % % Of course, for this mechanism to work, Bib\TeX\ or Bib\LaTeX\ must % be used and connected to some |.bib| bibliographical database % file. Additionally, this |.bib| file must have been converted into a % \texttt{TEI xml}-compliant file where all the Bib\hologo{(La)TeX} % entries that are used in the document are found within % || elements.\footnote{See above n.~\vref{fn:zotero} for % information on how to do this.} Finally, this |.xml| bibliographical % database must have been connected to the |.tex| source file by means % of \cs{AddxmlBibResource} described above in % \vref{sec:references-cited-works}. % % As an example, the following |sample.bib| file is used:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{bibtex} @Book{ReynoldsWilson1991, author = {Reynolds, L. D. and Wilson, N. G.}, title = {Scribes and Scholars}, year = {1991}, subtitle = {A Guide to the Translation of Greek and Latin Literature}, edition = {3}, publisher = {Clarendon Press}, location = {Oxford} } \end{minted} % \iffalse % % \fi % % It has been converted into |sample.xml| as follows:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml} Scribes and Scholars L. D. Reynolds N. G. Wilson 3 Oxford Clarendon Press 1991 \end{minted} % \iffalse % % \fi % % Once both files have been prepared, inserting references and % exporting them into the \texttt{TEI xml} output file can be achieved % in a straightforward way. (The full |sample.tex| is provided % below.)--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} \documentclass{article} \usepackage[teiexport=tidy]{ekdosis} \AddxmlBibResource{sample.xml} \usepackage[style=oxnotes]{biblatex} \addbibresource{sample.bib} \begin{document} \begin{ekdosis} On textual criticism, see \cite[207--241]{ReynoldsWilson1991}. \end{ekdosis} \end{document} \end{minted} % \iffalse % % \fi % % PDF output:--- % \medskip % % \needspace{7\baselineskip} % \resetlinenumber % \begin{alignment}[flush,tcols=1,texts=specimen,apparatus=specimen] % \begin{specimen} % On textual criticism, see \cite[207--241]{ReynoldsWilson1991}. % \end{specimen} % \end{alignment} % % \medskip % \texttt{TEI xml} output narrowed down to the contents of the || % element:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{xml}

On textual criticism, see 207--241 .

Scribes and Scholars L. D. Reynolds N. G. Wilson 3 Oxford Clarendon Press 1991
\end{minted} % \iffalse % % \fi % % At the time of writing, the following citation commands are % converted into \texttt{TEI xml} by \pkg{ekdosis}:--- % \begin{enumerate} % \item % \cs{icite}\oarg{prenote}\oarg{postnote}\marg{key}\footnote{From the % \pkg{icite} package. \cs{icite} can be used in place of almost any % standard citation command. See \cite{icite}.} % \item \cs{cite}\oarg{prenote}\oarg{postnote}\marg{key} % \item \cs{Cite}\oarg{prenote}\oarg{postnote}\marg{key} % \item \cs{cite*}\oarg{prenote}\oarg{postnote}\marg{key} % \item \cs{parencite}\oarg{prenote}\oarg{postnote}\marg{key} % \item \cs{Parencite}\oarg{prenote}\oarg{postnote}\marg{key} % \item \cs{parencite*}\oarg{prenote}\oarg{postnote}\marg{key} % \item \cs{footcite}\oarg{prenote}\oarg{postnote}\marg{key} % \item \cs{footcitetext}\oarg{prenote}\oarg{postnote}\marg{key} % \item \cs{textcite}\oarg{prenote}\oarg{postnote}\marg{key} % \item \cs{Textcite}\oarg{prenote}\oarg{postnote}\marg{key} % \item \cs{smartcite}\oarg{prenote}\oarg{postnote}\marg{key} % \item \cs{Smartcite}\oarg{prenote}\oarg{postnote}\marg{key} % \item \cs{autocite}\oarg{prenote}\oarg{postnote}\marg{key} % \item \cs{Autocite}\oarg{prenote}\oarg{postnote}\marg{key} % \item \cs{autocite*}\oarg{prenote}\oarg{postnote}\marg{key} % \item \cs{Autocite*}\oarg{prenote}\oarg{postnote}\marg{key} % \end{enumerate} % % The next release of \pkg{ekdosis} will include all citation commands % with the exception of so-called \enquote{qualified citation lists}. % % \section{Future Work} % \label{sec:future-work} % A short, un-commented list of what is planned in the versions of % \pkg{ekdosis} to come follows:--- % \begin{enumerate} % \item Very short-term (weeks):--- % \begin{enumerate} % \item Text structure: milestone elements. % \item Marginal edition texts: It may happen that the marginalia of % manuscripts contain texts worth editing in addition to and along % the main text to which they are linked by reference signs. % \end{enumerate} % \item Short-term (months):--- % \begin{enumerate} % \item Poetry: \pkg{ekdosis} is now able to load and use the % facilities provided by the \pkg{verse} package. Refined options % will be added, such as metrical analysis. Arabic poetry through % the environments and commands provided by the \pkg{arabluatex} % package will also be supported. Other packages will also be % considered for inclusion, such as \pkg{poetry} or % \pkg{teubner}. In the end, \pkg{ekdosis} will provide a way for % the typesetting of poetry which will allow for more flexibility % and compatibility with \texttt{TEI xml}. % \item Correspondence and alignment, segmentation: The functions % are being tested at the time of writing and will be included in % \pkg{ekdosis}. % \end{enumerate} % \item Medium-term: Indexing, commands and environments for specific % modules of the \texttt{TEI}. % \end{enumerate} % % \begin{comment} % \section{Correspondence and Alignment} % \end{comment} % \label{sec:correspondence-alignment} % % \label{ref:segmentation} % % \section{References} % \label{sec:references} % \subsection*{Texts Used} % \printbibliography[heading=none, subtype=primary] % \subsection*{References} % \printbibliography[heading=none, notsubtype=primary] % % \section{Sample: C. J. Caesar, \emph{Gallic War}, % VI, XIII.1} % \label{sec:caesar-gw-6-1-13} % \subsection{\texttt{.tex} Source File} % \label{sec:caesar-gw-tex} % \inputminted[linenos=true]{latex}{samples/Caesar_BG-6-13-1.tex} % \subsection{\texttt{TEI xml} Output} % \label{sec:caesar-gw-tei} % \inputminted[linenos=true]{xml}{samples/Caesar_BG-6-13-1-tei.xml} % % \section{Arabic Sample File} % \label{sec:arabic-sample} % |arabic-sample.tex|:--- % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} % Instructions: % 1. Compile this file three times. % - Open arabic-sample.pdf and arabic-sample-tei.xml and see the % result. % 2. Compile arabic-sample_out.tex three times. % - Open arabic-sample_out.pdf and arabic-sample-out-tei.xml and % see the result. % \documentclass{article} % The following three lines are only needed by the % 'arabic-sample_out.tex' that arabluatex is instructed to produce: \usepackage{babel} \babelprovide[onchar=fonts]{arabic} \babelfont[*arabic]{rm}{Amiri} % instruct ekdosis to output TEI xml (arabic-sample-tei.xml): \usepackage[teiexport=tidy]{ekdosis} % instruct arabluatex to output sample-arabic_out.tex with Unicode % Arabic strings in place of arabtex ASCII scheme: \usepackage[fullvoc,export]{arabluatex} \begin{document} \begin{arabexport} % export arabtex strings to Unicode Arabic \begin{ekdosis} \begin{arab} 'inna 'abI kAna mina \app{ \lem{'l-muqAtilaTi} \rdg{'l-muqAtilIna} } wa-kAnat 'ummI min `u.zamA'i buyUti 'l-zamAzimaTi. \end{arab} \end{ekdosis} \end{arabexport} \end{document} \end{minted} % \iffalse % % \fi % % \StopEventually{} % % \section{Implementation} % \label{sec:implementation} % % \iffalse %<*package> % \fi % % \pkg{ekdosis} relies on Lua functions and tables. Read the % |.lua| files that accompany \pkg{ekdosis} for more % information. % \begin{macrocode} \RequirePackage{iftex} % \end{macrocode} % Of course, \pkg{ekdosis} requires {\LuaLaTeX}. Issue an error % if the document is processed with another engine. % \begin{macrocode} \RequireLuaTeX % \end{macrocode} % Set global options:--- % \begin{macrocode} \RequirePackage{expkv-opt} \RequirePackage{expkv-def} \newif\if@pkg@float \newif\if@pkg@footins \newif\if@pkg@keyfloat \newif\if@pkg@fitapp \newif\if@pkg@breakable \newif\if@pkg@ekddivs \newif\if@parnotesroman \newif\if@pkg@parnotes \newif\iftei@export \newif\if@pkg@poetry@verse \ekvdefinekeys{ekdosis}{ choice layout = {float = {\@pkg@floattrue}, footins = {\@pkg@floatfalse\@pkg@footinstrue}, keyfloat = {\@pkg@floatfalse\@pkg@keyfloattrue}, fitapp = {\@pkg@floatfalse\@pkg@fitapptrue}, breakable = {\@pkg@floatfalse\@pkg@fitapptrue\@pkg@breakabletrue}}, initial layout = float, unknown-choice layout = \PackageError{ekdosis}{unknown layout=#1}{`layout' must be either `float', `footins', `keyfloat', `fitapp' or `breakable'.}, choice divs = {ekdosis = {\@pkg@ekddivstrue}, latex = {\@pkg@ekddivsfalse \AtBeginDocument{\luadirect{ekdosis.setekddivsfalse()}}}}, initial divs = ekdosis, unknown-choice divs = \PackageError{ekdosis}{unknown divs=#1}{`divs' must be either `ekdosis' or `latex'.}, choice poetry = {verse = {\@pkg@poetry@versetrue}}, unknown-choice poetry = \PackageError{ekdosis}{unknown poetry=#1}{`poetry' must be `verse' for now.}, choice parnotes = {false = {}, true = {\@pkg@parnotestrue}, roman = {\@pkg@parnotestrue\@parnotesromantrue}}, default parnotes = true, unknown-choice parnotes = \PackageError{ekdosis}{unknown parnotes=#1}{`parnotes' must be either `true', or `false' or `roman'.}, choice teiexport = {false = {}, true = {\tei@exporttrue \AtBeginDocument{\luadirect{ekdosis.openteistream()}}% \AtEndDocument{\luadirect{ekdosis.closeteistream()}}}, tidy = {\tei@exporttrue \AtBeginDocument{\luadirect{ekdosis.openteistream()}}% \AtEndDocument{\luadirect{ekdosis.closeteistream("tidy")}}}}, default teiexport = true, unknown-choice teiexport = \PackageError{ekdosis}{unknown teiexport=#1}{`teiexport' must be either `true', `false' or `tidy'.} } \ekvoProcessLocalOptions{ekdosis} \newif\ifekd@memoir@loaded \@ifclassloaded{memoir}{% \ekd@memoir@loadedtrue\@pkg@poetry@versetrue}{} % \end{macrocode} % \paragraph{Required Packages} \label{ref:ekdrequirements} In % addition to \pkg{iftex}, \pkg{expkv-opt} and \pkg{expkv-def}, a list % of the packages that are required by \pkg{ekdosis} follows:--- % \begin{macrocode} % \RequirePackage{iftex} % already loaded above % \RequirePackage{expkv-opt} % already loaded above % \RequirePackage{expkv-def} % already loaded above \RequirePackage{luacode} \RequirePackage{paracol} \RequirePackage{etoolbox} \RequirePackage{lineno} \if@pkg@float \RequirePackage{trivfloat} \trivfloat{ekdapparatus} \fi \if@pkg@keyfloat \RequirePackage{keyfloat} \def\ekd@keyparopts#1{% \def\ekd@insert@keyparapp{% \keyparbox[!b]{#1}{\ekd@insert@apparatus}}} \ekd@keyparopts{} \fi \if@pkg@fitapp \RequirePackage{tcolorbox} \tcbuselibrary{fitting,skins} \fi \if@pkg@breakable \RequirePackage{tcolorbox} \tcbuselibrary{fitting,skins,breakable} \fi \RequirePackage{refcount} \RequirePackage{zref-user} \RequirePackage{zref-abspage} \RequirePackage{ltxcmds} \RequirePackage{pdftexcmds} \RequirePackage{ifoddpage} \if@pkg@poetry@verse \RequirePackage{verse} \fi \if@pkg@parnotes \RequirePackage{parnotes} \fi % \end{macrocode} % \paragraph{Lua} Here begins the real work: load |ekdosis.lua|:--- % \begin{macrocode} \luadirect{dofile(kpse.find_file("ekdosis.lua"))} % \end{macrocode} % \begin{macrocode} \AtEndDocument{ \luadirect{ekdosis.closestream()} } % \end{macrocode} % \paragraph{\textsf{ekdosis} Symbol} % \begin{macro}{\eKd} % \changes{v1.5}{2023/06/22}{Prints \textsf{ekdosis} indentifying % symbol} As of v1.5, \pkg{ekdosis} has its own identifying % symbol. It is produced by \cs{eKd} and best printed with the Old % Standard Greek font. % \begin{macrocode} \def\eKd{% ε\kern -.4em\raise 1.15ex\hbox{κ}\kern -.105emδ% \ifdefined\xspace\xspace\fi } % \end{macrocode} % \end{macro} % \paragraph{Setup} % \begin{macro}{\ekdsetup} % \changes{v1.3}{2021/08/18}{new command for global options} % \cs{ekdsetup} is used to specify options that affect the general % behavior of \pkg{ekdosis}. It is a preamble-only command. % \begin{macrocode} \ekvdefinekeys{ekd@setup}{ bool showpagebreaks = \ifekd@showpb, store spbmk = \ekd@spbmk, initial spbmk = spb, store hpbmk = \ekd@hpbmk, initial hpbmk = hpb } \NewDocumentCommand{\ekdsetup}{m}{\ekvset{ekd@setup}{#1}} \@onlypreamble\ekdsetup % \end{macrocode} % \end{macro} % \begin{macro}{\SetHooks} \cs{SetHooks} is used to set % hooks meant to be shared by all declared apparatuses, such as the % font size, the format of numerals, \emph{\&c.} This command can be % used in the preamble or at any point of the document. % \changes{v1.2}{2021/04/02}{general hooks: new option % \texttt{lemmastyle}} % \changes{v1.2}{2021/04/02}{general hooks: new option % \texttt{readingstyle}} % \changes{v1.3}{2021/08/18}{general hooks: new options % \texttt{keyparopts} and \texttt{appheight}} % \begin{macrocode} \ekvdefinekeys{ekd@hooks}{ store appfontsize = \ekd@appfontsize, store refnumstyle = \ekd@refnumstyle, store postrefnum = \ekd@postrefnum, code familysep = \luadirect{ekdosis.setfamilysep(\luastringN{#1})}, store lemmastyle = \ekd@lemmastyle, store readingstyle = \ekd@readingstyle, code initialrule = \def\ekd@initial@rule{#1\NLS}, default initialrule = \rule{0.4\columnwidth}{0.4pt}, noval noinitialrule = \undef\ekd@initial@rule, code maxentries = \luadirect{ekdosis.setglimit(\luastringN{#1})}, nmeta nomaxentries = {maxentries=none}, code keyparopts = \if@pkg@keyfloat\ekd@keyparopts{#1}\fi, dimen appheight = \ekd@app@height, initial appheight = .5\textheight, choice fitalgorithm = {fontsize = \def\ekd@fit@algorithm{fontsize}, hybrid = \def\ekd@fit@algorithm{hybrid}, areasize = \def\ekd@fit@algorithm{areasize}, squeeze = \def\ekd@fit@algorithm{squeeze}}, initial fitalgorithm = fontsize, unknown-choice fitalgorithm = \PackageError{ekdosis}{unknown fitalgorithm=#1}{`fitalgorithm' must be either `fontsize', `hybrid', `areasize' or `squeeze'.}, initial appfontsize = \footnotesize, initial refnumstyle = \bfseries, initial postrefnum = ~, initial lemmastyle = {}, initial readingstyle = {} } \NewDocumentCommand{\SetHooks}{m}{\ekvset{ekd@hooks}{#1}} % \end{macrocode} % \end{macro} % Build and process the list of witnesses and hands:--- % \begin{macrocode} \ekvdefinekeys{ekd@witness}{ store settlement = \settlement@value, store institution = \institution@value, store repository = \repository@value, store collection = \collection@value, store idno = \idno@value, store msName = \msName@value, store origDate = \origDate@value, store locus = \locus@value } % \end{macrocode} % \begin{macro}{\DeclareWitness} \cs{DeclareWitness} is a % preamble-only command. It takes three mandatory arguments and one % optional argument. It is meant to collect data related to % witnesses to be used in the edition text. Data are stored in |Lua| % tables and are used to encode the || part of the |TEI| % header as well as the Conspectus Siglorum in the edition in print. % \begin{macrocode} \NewDocumentCommand{\DeclareWitness}{m m m O{}}{% \bgroup \ekvset{ekd@witness}{#4} \luadirect{ekdosis.newwitness( \luastringN{#1}, \luastringN{#2}, \luastringN{#3}, \luastringO{\settlement@value}, \luastringO{\institution@value}, \luastringO{\repository@value}, \luastringO{\collection@value}, \luastringO{\idno@value}, \luastringO{\msName@value}, \luastringO{\origDate@value}, \luastringO{\locus@value})} \egroup } \@onlypreamble\DeclareWitness % \end{macrocode} % \end{macro} % \begin{macro}{\DeclareHand} As \cs{DeclareWitness}, \cs{DeclareHand} % is a preamble-only command meant to collect data and store them in % |Lua| tables. It takes three mandatory arguments and one optional % argument. The second argument is used to connect the hand to a % declared witness it is related to. Then the table in which this % witness is recorded can be fed with new data. % \begin{macrocode} \NewDocumentCommand{\DeclareHand}{m m m +O{}}{ \luadirect{ekdosis.newhand(\luastringN{#1}, \luastringN{#2}, \luastringN{#3}, \luastringN{#4})} } \@onlypreamble\DeclareHand % \end{macrocode} % \end{macro} % Build and process the list of scholars:--- % \begin{macrocode} \ekvdefinekeys{ekd@scholar}{ store rawname = \rawname@value, store forename = \forename@value, store surname = \surname@value, store addname = \addname@value, store note = \note@value } % \end{macrocode} % \begin{macro}{\DeclareScholar} % \changes{v1.1}{2020/11/04}{nows builds a list of persons} % \cs{DeclareScholar} is used to build a list of persons within the % || element. It takes two mandatory arguments to specify % consecutively a unique identifier and the rendition to be used in % the apparatus criticus in print, and one optional argument used to % collect the name parts components and further items of information % from |key-value| \enquote*{named} arguments. % \begin{macrocode} \NewDocumentCommand{\DeclareScholar}{m m O{}}{% \bgroup \ekvset{ekd@scholar}{#3} \luadirect{ekdosis.newscholar( \luastringN{#1}, \luastringN{#2}, \luastringO{\rawname@value}, \luastringO{\forename@value}, \luastringO{\surname@value}, \luastringO{\addname@value}, \luastringO{\note@value})} \egroup } \@onlypreamble\DeclareScholar % \end{macrocode} % \end{macro} % \begin{macro}{\DeclareSource} % \changes{v1.1}{2020/11/04}{new command added}There is also a table in % which are collected data related to sources to be used in the % apparatus criticus. \cs{DeclareSource} is a preamble-only % command and takes two mandatory arguments: a unique id and a % shorthand (preferably a Bib\hologo{(La)TeX} label) to be used in % the apparatus criticus which can be extracted from a bibliographic % database. % \begin{macrocode} \NewDocumentCommand{\DeclareSource}{m m}{ \luadirect{ekdosis.newsource(\luastringN{#1}, \luastringN{#2})} } \@onlypreamble\DeclareSource % \end{macrocode} % \end{macro} % \begin{macro}{\DeclareShorthand} \cs{DeclareShorthand} is a % preamble-only command that can be used to record manuscript % families or any kind of shorthand to be used to refer to % previously declared ids, for example the shorthand |codd| can be % used to point to all declared witnesses. This command takes three % mandatory arguments: a unique id, its rendition in print and a % csv-list of previously declared ids. % \begin{macrocode} \NewDocumentCommand{\DeclareShorthand}{m m m}{ \luadirect{ekdosis.newshorthand(\luastringN{#1}, \luastringN{#2}, \luastringN{#3})} } \@onlypreamble\DeclareShorthand % \end{macrocode} % \end{macro} % \begin{macro}{\getsiglum} % \cs{getsiglum}\marg{csv list} takes a comma-separated list of % declared ids by means of \cs{DeclareWitness}, \cs{DeclareHand}, % \cs{DeclareShorthand} or \cs{DeclareSource} and returns their % respective renditions. % \begin{macrocode} \NewDocumentCommand{\getsiglum}{m}{% \luadirect{tex.sprint(ekdosis.getsiglum(\luastringN{#1}))}% } % \end{macrocode} % \end{macro} % \begin{macro}{\SigLine} % \cs{Sigline}\marg{unique id} takes the unique id of any declared % witness by means of \cs{DeclareWitness} as argument and returns a % line ready to be inserted in a table set to print a Conspectus % Siglorum. \cs{SigLine} returns three fields separated by the symbol % |&| that is used in tables as follows: the siglum referring to the % witness, the contents of the |description| field and the contents of % the optional |origDate| field. % \begin{macrocode} \NewDocumentCommand{\SigLine}{m}{% \luadirect{tex.sprint(ekdosis.basic_cs(\luastringN{#1}))} } % \end{macrocode} % \end{macro} % \paragraph{\TeX\ to \texttt{TEI xml}} % Here follow the |key-value| options to be used by \cs{SetTEIxmlExport} % below:--- % \begin{macrocode} \ekvdefinekeys{tei@settings}{ choice autopar = {true = \luadirect{ekdosis.setteiautopar("yes")}, false = {\luadirect{ekdosis.setteiautopar("no")}}}, initial autopar = true, unknown-choice autopar = \PackageError{ekdosis}{unknown autopar=#1}{`autopar' must be either `true' or `false'.} } % \end{macrocode} % \begin{macro}{\SetTEIxmlExport} % \cs{SetTEIxmlExport} collects the settings to be applied % to \texttt{TEI xml} export. For now, there is only one option. This % command can be used at any point of the document, except inside % environments meant to receive an apparatus criticus. % \begin{macrocode} \NewDocumentCommand{\SetTEIxmlExport}{m}{ \unless\ifekd@state\ekvset{tei@settings}{#1}\fi } % \end{macrocode} % \end{macro} % The following three commands can be used to instruct \pkg{ekdosis} % how to convert unknown or unusual \hologo{(La)TeX} commands into % \texttt{TEI xml} equivalents. % \begin{macro}{\TeXtoTEI} % \cs{TeXtoTEI}\marg{csname}\marg{TEI element}\oarg{TEI attribute(s)} % takes two mandatory arguments and one optional argument, namely: the % control sequence name to be converted, the \texttt{TEI} element it % is to be converted into and any additional \texttt{xml} attributes % to be appended to the opening \texttt{TEI} element:--- % \begin{macrocode} \NewDocumentCommand{\TeXtoTEI}{m m O{}}{% \luadirect{ekdosis.newcmdtotag(\luastringN{#1}, \luastringN{#2}, \luastringN{#3})} } % \end{macrocode} % \end{macro} % \begin{macro}{\teidirect} % \begin{macro}{\teidirectE} % \changes{v1.3}{2021/08/18}{direct insertion of elements in the % \texttt{TEI xml} file} % \changes{v1.5}{2023/06/22}{direct insertion of empty elements in the % \texttt{TEI xml} file} % \cs{teidirect}\oarg{xml attributes}\marg{xml element}\marg{code} % does nothing in \LaTeX. It is only used to insert elements in the % \texttt{TEI xml} output file. \cs{teidirectE}\oarg{xml % attributes}\marg{xml element} is strictly equivalent to % \cs{teidirect}\oarg{xml attributes}\marg{xml element}|{}| and can be % used to insert empty \texttt{TEI} elements. % \begin{macrocode} \NewDocumentCommand{\teidirect}{O{} m m}{\ignorespaces} \NewDocumentCommand{\teidirectE}{O{} m}{\ignorespaces} % \end{macrocode} % \end{macro} % \end{macro} % \begin{macro}{\getTEIxmlid} % \changes{v1.5}{2023/06/22}{returns \texttt{TEI xml:ids} from a % csv-list of ids} This command returns from a csv-list of unique % identifiers declared in commands such as \cs{DeclareWitness} and the % like a space-separated list of their corresponding |xml:id|s, each % preceded by the octothorpe (the |#| sign). % \begin{macrocode} \NewDocumentCommand{\getTEIxmlid}{m}{% \luadirect{tex.sprint(ekdosis.getsiglum(\luastringN{#1}, "TEI"))}% } % \end{macrocode} % \end{macro} % \begin{macro}{\EnvtoTEI} % \begin{macro}{\EnvtoTEI*} % \cs{EnvtoTEI}\meta{*}\marg{env name}\marg{TEI element}\oarg{TEI % attribute(s)} instructs how to convert \LaTeX{} environments into % \texttt{TEI xml} equivalents. It takes two mandatory arguments and % one optional argument, namely the name of the \LaTeX{} environment % to be converted, the \texttt{TEI} element it is to be converted into % and any additional attributes to be appended to the \texttt{TEI} % opening element. \cs{EnvtoTEI*} is restricted to \texttt{TEI} % elements that must never appear within |

| elements, such as % |

|, || and the like. % \begin{macrocode} \NewDocumentCommand{\EnvtoTEI}{s m m O{}}{% \IfBooleanTF{#1}{% \luadirect{ekdosis.newenvtotag(\luastringN{#2}, \luastringN{#3}, \luastringN{#4}, "yes")} }{% \luadirect{ekdosis.newenvtotag(\luastringN{#2}, \luastringN{#3}, \luastringN{#4})} } } % \end{macrocode} % \end{macro} % \end{macro} % \begin{macro}{\TeXtoTEIPat} % \changes{v1.1}{2020/11/04}{renamed, formerly \cs{TeXtoTEIPatt}} % Finally, the more flexible\---and more delicate to % handle\---\cs{TeXtoTEIPat}\marg{\TeX\ % pattern}\allowbreak\marg{\texttt{TEI} pattern} uses pattern matching % to instruct \pkg{ekdosis} how to convert \hologo{(La)TeX} commands % into \texttt{TEI} equivalents. % \begin{macrocode} \NewDocumentCommand{\TeXtoTEIPat}{m m}{% \luadirect{ekdosis.newpatttotag(\luastringN{#1}, \luastringN{#2})} } % \end{macrocode} % \end{macro} % \begin{macro}{\SetTEIFilename} \cs{SetTEIFilename}\marg{basename} is % a preamble-only command. It is used to set the base name of the % |TEI xml| output file, to which the suffix |.xml| is appended. By % default, the base name is |\jobname-tei|:--- % \begin{macrocode} \NewDocumentCommand{\SetTEIFileName}{m}{ \luadirect{ekdosis.setteifilename(\luastringN{#1})} } \@onlypreamble\SetTEIFileName % \end{macrocode} % \end{macro} % \begin{macro}{\AddxmlBibResource} This is a preamble-only command. % If a base name (either suffixed with |.xml| or not) for a % \texttt{TEI xml}-compliant bibliographical database file be % provided with \cs{AddxmlBibResource}\marg{basename or name.xml}, % \pkg{ekdosis} will use it and insert formatted data in the back % matter section of its own \texttt{TEI xml} output file, as % || elements within a || section. % \begin{macrocode} \NewDocumentCommand{\AddxmlBibResource}{m}{ \luadirect{ekdosis.addxmlbibresource(\luastringN{#1})} } \@onlypreamble\AddxmlBibResource % \end{macrocode} % \end{macro} % \begin{macro}{\ekd@test@lang} % \cs{ekd@test@lang} is used internally by \pkg{ekdosis}. This command % returns \cs{ekd@lang@pkgtrue} if either \pkg{babel} or % \pkg{polyglossia} be used so that \cs{languagename} can be inserted % when and where needed in the apparatus criticus. % \begin{macrocode} \newif\ifekd@lang@pkg \NewDocumentCommand{\ekd@test@lang}{}{% \ltx@ifpackageloaded{babel}{\ekd@lang@pkgtrue}{}% \ltx@ifpackageloaded{polyglossia}{\ekd@lang@pkgtrue}{}% } % \end{macrocode} % \end{macro} % \paragraph{Multiple-layer apparatuses} % \pkg{ekdosis} must know if an entry is to be processed in a single- % or multiple-layer context:--- % \begin{macrocode} \newif\ifekd@mapps % \end{macrocode} % Now the key-value options can be defined:--- % \begin{macrocode} \ekvdefinekeys{ekd@newapp}{ choice direction = {LR = \def\direction@val{LR}, RL = \def\direction@val{RL}}, unknown-choice direction = \PackageError{ekdosis}{unknown direction=#1}{`direction' must be either `LR' or `RL'.}, store rule = \rule@val, nmeta norule = {rule=none}, code delim = \def\delim@val{\unexpanded{#1}}, store sep = \sep@val, store subsep = \subsep@val, store bhook = \bhook@val, store ehook = \ehook@val, store maxentries = \limit@val, store lang = \lang@val, store notelang = \notelang@val, initial direction = LR, initial delim = {}, initial ehook = {\csname ekd@end@apparatus\endcsname} } % \end{macrocode} % \begin{macro}{\DeclareApparatus} % \cs{DeclareApparatus}\marg{apparatus name}\oarg{options} is a % preamble-only command. As a mandatory argument, it takes the name of % the new layer of notes to be inserted in the apparatus block. Then, % the following seven key-value options can be used to lay out the % layer: \verb+direction=LR|RL+, |rule|, |delim| (the delimiter between % entries), |sep| (the separator between lemma part and readings or % notes), |bhook| (\LaTeX{} code inserted as the layer begins), % |ehook| (\LaTeX{} code inserted as the layer ends), |maxentries| % (if set and |maxentries >= 10|, the number of entries at which a % \cs{pagebreak} is issued):--- % \begin{macrocode} \NewDocumentCommand{\DeclareApparatus}{m O{}}{ \newbool{subsq@unit@#1} \booltrue{subsq@unit@#1} \unless\ifekd@mapps\global\ekd@mappstrue\fi \bgroup \ekvset{ekd@newapp}{#2} \luadirect{ekdosis.newapparatus( \luastringN{#1}, \luastring{\direction@val}, \luastringO{\rule@val}, \luastringO{\delim@val}, \luastringO{\sep@val}, \luastringO{\subsep@val}, \luastringO{\bhook@val}, \luastringO{\ehook@val}, \luastringO{\limit@val}, \luastringO{\lang@val}, \luastringO{\notelang@val} )} \egroup } \@onlypreamble\DeclareApparatus % \end{macrocode} % \end{macro} % \begin{macro}{\addentries} % \changes{v1.1}{2020/11/04}{modifies the number of accepted entries % on the current page.} % If |maxentries| be set for a given layer of critical notes, % \cs{addentries}\oarg{layer}\marg{n}, where \meta{n} is an integer, % can be used to add \meta{n} to\---or remove it from if \meta{n} be % negative\---the number of accepted entries on the current % page. \cs{addentries} operates on the default layer of notes, but % any other declared layer can be specified in the optional argument % of the command. % \begin{macrocode} \NewDocumentCommand{\addentries}{O{\ekdan@type} m}{% \luadirect{ekdosis.addto_bagunits(\luastringO{#1}, \luastringN{#2})}% \ignorespaces } % \end{macrocode} % \end{macro} % \begin{macro}{\ekdpb} % \changes{v1.2}{2021/04/02}{conditional page breaks} % \cs{ekdpb}\oarg{page no}\marg{line no} is used to insert conditional % page breaks by specifying that the page break should occur only on a % given line and optionally a given page. If the specified conditions % be met then this command triggers \cs{pagebreak}. % \begin{macrocode} \newcounter{ekd@pb} \globalcounter{ekd@pb} \NewDocumentCommand{\ekdpb}{s o m}{% \IfBooleanTF{#1} {\ifekd@showpb\marginpar{\ekd@hpbmk}\fi \pagebreak \@ifnextchar\bgroup{}{#3}% } {% \def\@tmpoarg{#2}% \def\@tmpmarg{#3}% \stepcounter{ekd@pb}% \linelabel{ekdpb:\theekd@pb}% \def\tmp@ln{% \getrefnumber{ekdpb:\theekd@pb}}% \def\tmp@pg{% \getpagerefnumber{ekdpb:\theekd@pb}}% \IfNoValueTF{#2} {\ifnum \pdf@strcmp{\@tmpmarg}{\tmp@ln} = 0 \ifekd@showpb\marginpar{\ekd@spbmk}\fi \pagebreak \else \ifekd@showpb\marginpar{[\ekd@spbmk]}\fi \fi} {\ifnum \pdf@strcmp{\@tmpoarg}{\tmp@pg} = 0 \ifnum \pdf@strcmp{\@tmpmarg}{\tmp@ln} = 0 \ifekd@showpb\marginpar{\ekd@spbmk}\fi \pagebreak \else \ifekd@showpb\marginpar{[\ekd@spbmk]}\fi \fi \fi }% }\ignorespaces } % \end{macrocode} % \end{macro} % Apparatus-related settings and functions. Some booleans to check if % an apparatus should be inserted and what is the current environment. % \begin{macrocode} \newbool{do@app} \newif\ifekd@state \newif\ifekd@isinapp \newif\ifekd@isinlem \newif\ifekd@appinapp % \end{macrocode} % The next boolean is shared with \pkg{arabluatex}. \cs{LRnum} is used % internally to ensure that numerals referring to line spans are % displayed in the right order. % \begin{macrocode} \providebool{al@rlmode} \@ifpackageloaded{arabluatex}{}{% \def\setRL{\booltrue{al@rlmode}\pardir TRT\textdir TRT} \def\setLR{\boolfalse{al@rlmode}\pardir TLT \textdir TLT} } \protected\def\LRnum#1{\bgroup\textdir TLT#1\egroup} % \end{macrocode} % Set a counter referring to line numbers and make it global. % \begin{macrocode} \newcounter{ekd@lab} \globalcounter{ekd@lab} % \end{macrocode} % This command inserts words in the apparatus criticus without % checking if both |ekd@isinapp| and |ekd@state| are set to |true|. % \begin{macrocode} \NewDocumentCommand{\unconditional@appin}{o m}{% \IfNoValueTF{#1} {\luadirect{ekdosis.appin(\luastringO{#2})}} {\luadirect{ekdosis.appin(\luastringO{#2}, \luastringO{#1})}}% } % \end{macrocode} % \begin{macro}{\blfootnote} \cs{blfootnote}\marg{footnote} is used % internally to insert the apparatus in the footnote block should the % global optional argument |layout| be set to |footins|. Therefore, it % is not documented. % \begin{macrocode} \def\blfootnote{\gdef\@thefnmark{\relax}\@footnotetext} % \def\blfootnote{\gdef\@thefnmark{}\@blfootnotetext} \long\def\@blfootnotetext#1{\insert\footins{% \reset@font\footnotesize \interlinepenalty\interfootnotelinepenalty \splittopskip\footnotesep \splitmaxdepth \dp\strutbox \floatingpenalty \@MM \hsize\columnwidth \@parboxrestore \protected@edef\@currentlabel{% \csname p@footnote\endcsname\@thefnmark }% \color@begingroup \@makeblfntext{% \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% \color@endgroup}}% \newcommand\@makeblfntext[1]{% \parindent 1em% \noindent \hb@xt@0em{\hss\@makefnmark}#1} % \end{macrocode} % \end{macro} % \paragraph{Single-layer apparatus} The following commands are for % general settings. All of them can be used in the preamble or at any % point of the document. The keys to be used follow:--- % \begin{macrocode} \newif\ifrtl@app \def\ekdsep{] } \def\ekdsubsep{} \ekvdefinekeys{default@app}{ choice direction = {LR = \rtl@appfalse, RL = \rtl@apptrue}, unknown-choice direction = \PackageError{ekdosis}{unknown direction=#1}{`direction' must be either `LR' or `RL'.}, code sep = \def\ekdsep{#1}, code subsep = \def\ekdsubsep{#1}, store bhook = \ekd@begin@apparatus, initial bhook = {}, store ehook = \ekd@end@apparatus, initial ehook = {}, store delim = \ekd@unit@delim, initial delim = {}, store rule = \ekd@default@rule, initial rule = \rule{0.4\columnwidth}{0.4pt}, noval norule = \def\ekd@default@rule{\mbox{}}, store lang = \ekd@singleapp@lang, initial lang = \ltx@ifpackageloaded{babel}{\languagename}{% \ltx@ifpackageloaded{polyglossia}{\languagename}{}}, store notelang = \ekd@singleapp@note@lang, initial notelang = \ltx@ifpackageloaded{babel}{\languagename}{% \ltx@ifpackageloaded{polyglossia}{\languagename}{}} } % \end{macrocode} % \begin{macro}{\SetApparatus} % All settings can also be defined as |key-value| options within the % argument of \cs{SetApparatus}:--- % \begin{macrocode} \NewDocumentCommand{\SetApparatus}{m}{ \ekvset{default@app}{#1} } % \end{macrocode} % \end{macro} % \begin{macro}{\SetLTRapp} % \begin{macro}{\SetRTLapp} % \cs{SetLTRapp} and \cs{SetRTLapp} are two argument-less commands to % set the direction of single-layer apparatus criticus, either LTR or % RTL:--- % \begin{macrocode} \NewDocumentCommand{\SetRTLapp}{}{\rtl@apptrue} \NewDocumentCommand{\SetLTRapp}{}{\rtl@appfalse} % \end{macrocode} % \end{macro} % \end{macro} % \begin{macro}{\SetSeparator} % \cs{SetSeparator}\marg{separator} allows to change the separator % between lemma texts and variant readings, which is by default % a closing square bracket followed by a space (\verb*+] +):--- % \begin{macrocode} \NewDocumentCommand{\SetSeparator}{m}{\def\ekdsep{#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\SetSubseparator} % \changes{v1.4}{2021/11/21}{New command for subseparators} % \cs{SetSubseparator}\marg{sub-separator} allows to change the % \enquote{subseparator} between variant readings. By default, % no subseparator is set:--- % \begin{macrocode} \NewDocumentCommand{\SetSubseparator}{m}{\def\ekdsubsep{#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\SetBeginApparatus} % \cs{SetBeginApparatus}\marg{characters} can be used to append % characters at the beginning of the apparatus block. By default, % nothing is appended:--- % \begin{macrocode} \NewDocumentCommand{\SetBeginApparatus}{m}{\def\ekd@begin@apparatus{#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\SetEndApparatus} % \cs{SetEndApparatus}\marg{characters} can be used to append % characters at the end of the apparatus block\---such as a period, % as it is customary in some editions. By default, nothing is % appended:--- % \begin{macrocode} \NewDocumentCommand{\SetEndApparatus}{m}{\def\ekd@end@apparatus{#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\SetUnitDelimiter} % \cs{SetUnitDelimiter}\marg{delimiter} can be used to set the % delimiter between entries in the apparatus criticus. By default, % there is no delimiter except a simple space. \cs{SetUnitDelimiter} % can be used to insert a broad space (with |\hskip| for instance, as % in the OCT series) or the divider-sign (‖, as in the Budé series):--- % \begin{macrocode} \NewDocumentCommand{\SetUnitDelimiter}{m}{\def\ekd@unit@delim{#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\SetApparatusLanguage} % \changes{v1.2}{2021/04/02}{defines an alternate language to be % applied in apparatus entries} % \cs{SetApparatusLang}\marg{languagename} can be used when % it is needed to apply in the apparatus criticus a language % different from the one that is selected in the edition text. % \begin{macrocode} \NewDocumentCommand{\SetApparatusLanguage}{m}{% \def\ekd@singleapp@lang{#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\SetApparatusNoteLanguage} % \changes{v1.3}{2021/08/18}{defines an alternate language to be % applied in note apparatus entries} % \cs{SetApparatusNoteLang}\marg{languagename} can be used when % it is needed to apply in entries introduced by the \cs{note} command % a language different from the one that is selected in the edition % text. % \begin{macrocode} \NewDocumentCommand{\SetApparatusNoteLanguage}{m}{% \def\ekd@singleapp@note@lang{#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\footnoteruletrue} % \begin{macro}{\footnoterulefalse} % As \pkg{ekdosis} takes care of drawing a rule separating the main % text from the apparatus block as well as layers of notes from each % other inside this block, it may not be desirable to have % the standard \LaTeX{} \enquote{footnoterule} printed on every page % of the edition text. \cs{footnoterulefalse} removes it while % \cs{footnoteruletrue} leaves it untouched. The latter is set by % default. % \begin{macrocode} \newif\iffootnoterule \footnoteruletrue \let\dflt@footnoterule\footnoterule \let\dflt@pcol@footnoterule\pcol@footnoterule \renewcommand\footnoterule{% \iffootnoterule \dflt@footnoterule% \fi } \renewcommand\pcol@footnoterule{% \iffootnoterule \dflt@pcol@footnoterule% \fi } % \end{macrocode} % \end{macro} % \end{macro} % \begin{macro}{\SetDefaultRule} % By default, \pkg{ekdosis} draws separating rules the definition of % which is |\rule{0.4\columnwid|\allowbreak|th}{0.4pt}|. This can be % changed in the preamble or at any point of the document with % \cs{SetDefaultRule}\marg{\allowbreak{}rule definition}. Leaving % this argument empty as in \cs{SetDefaultRule}|{}| removes the % rule. % \begin{macrocode} \NewDocumentCommand{\SetDefaultRule}{m}{% \def\@tempa{#1} \ifx\@tempa\empty\def\ekd@default@rule{\mbox{}}% \else% \def\ekd@default@rule{#1}% \fi} % \end{macrocode} % \end{macro} % \begin{macro}{\NLS} % \cs{NLS} was previously adapted from a snippet written by Heiko % Oberdiek. It is used by \pkg{ekdosis} internally to prevent page % breaks between separating rules and subsequent notes. Therefore, it % is not documented. % \begin{macrocode} \newcommand*{\NLS}{% \nobreak\@normalcr\relax % \par % \nobreak % \vspace{-\parskip}% % \leavevmode % \noindent % \ignorespaces } % \end{macrocode} % \end{macro} % This boolean is used to test if a given entry is to be preceded by a % numeral referring to the line of the edition text. % \begin{macrocode} \newif\ifsubsq@unit \subsq@unittrue % \end{macrocode} % \cs{add@@apparatus} inserts the apparatus block on a given page % either in the footnote floating block or in a float of its own, % depending on the value set in the |layout| global option. As some % commands need to know whether they are called from inside the % apparatus criticus, two conditionals are first defined. % \begin{macrocode} \newif\ifekd@inside@app \newif\ifekd@keepinapp % \end{macrocode} % \cs{ekd@app@localheight} is used to set the maximum height of the % apparatus block locally:--- % \begin{macrocode} \newlength{\ekd@app@localheight} % \end{macrocode} % \begin{macro}{\localappheight} % \changes{v1.5}{2023/06/22}{changes the height of the apparatus % criticus} % \cs{localappheight}\marg{dimen} can be used to change locally the % length of \cs{ekd@app@height} set by the |appheight| option of % \cs{SetHooks}, namely the height up to which the apparatus block is % allowed to grow. \meta{dimen} must be a number followed by a unit % length. This command operates only on the apparatus block that % follows it. % \begin{macrocode} \def\localappheight#1{% \if@pkg@fitapp \luadirect{ekdosis.changeappheight()}% \setlength{\ekd@app@localheight}{#1}% \fi \ignorespaces } % \end{macrocode} % \end{macro} % \begin{macro}{\addtoappheight} % \changes{v1.5}{2023/06/22}{increases or decreases the height of the % apparatus criticus} % As the name suggests, in contrast to \cs{localappheight}, % \cs{addtoappheight}\marg{dimen} is used to increase or decrease % locally the length of \cs{ekd@app@height}. \meta{dimen} must be a % number followed by a unit length. This command operates only on the % apparatus block that follows it. % \begin{macrocode} \def\addtoappheight#1{% \if@pkg@fitapp \luadirect{ekdosis.changeappheight()}% \setlength{\ekd@app@localheight}{\ekd@app@height}% \addtolength{\ekd@app@localheight}{#1}% \fi \ignorespaces } % \end{macrocode} % \end{macro} % Then \cs{ekd@fitapp} is defined for |layout=fitapp|:--- % \begin{macrocode} \if@pkg@fitapp \newtcboxfit{\ekd@fitapp}{% blankest, \if@pkg@breakable breakable\fi, fit basedim = \f@size pt, fit fontsize macros, fit height from=0pt to \ekd@app@height, fit algorithm = \ekd@fit@algorithm, float=!b} \fi % \end{macrocode} % Then \cs{ekd@breakable} for |layout=breakable|:--- % \begin{macrocode} % \if@pkg@breakable % \newtcboxfit{\ekd@breakable}{% % blankest, % breakable, % float=!b} % \fi % \end{macrocode} % Finally two commands are used to actually insert the apparatus % depending on the value set in the |layout| global option. % \begin{macrocode} \long\def\ekd@insert@apparatus{% \unless\ifekd@mapps \ifrtl@app\pardir TRT\leavevmode\textdir TRT\else \pardir TLT\leavevmode\textdir TLT\fi \fi \if@pkg@parnotes \if@parnotesroman \renewcommand*{\theparnotemark}{\roman{parnotemark}}\fi \parnoteclear\fi \ekd@inside@apptrue \ekd@appfontsize \ifekd@mapps \ifdefined\ekd@initial@rule \ekd@initial@rule \fi \fi \apparatus\unless\ifekd@mapps\ekd@end@apparatus\fi \ekd@inside@appfalse \if@pkg@parnotes\parnotes\parnotereset\fi } % \end{macrocode} % Depending on what is instructed, either of the following two % commands is inserted by the Lua function % |ekdosis.setheightandprintapparatus()| that is used in % \cs{add@apparatus} below:--- % \begin{macrocode} \def\ekd@insert@fitapparatus@tmpheight{% \let\ekd@app@savedheight\ekd@app@height \let\ekd@app@height\ekd@app@localheight \ekd@fitapp{\ekd@insert@apparatus}% \let\ekd@app@height\ekd@app@savedheight} \def\ekd@insert@fitapparatus{% \ekd@fitapp{\ekd@insert@apparatus}% } \def\add@@apparatus{% \if@pkg@parnotes\parnotes\else\fi \if@pkg@footins \bgroup \unless\ifekd@mapps \ifrtl@app\pardir TRT\leavevmode\textdir TRT\else \pardir TLT\leavevmode\textdir TLT\fi \fi \blfootnote{% \if@pkg@parnotes \if@parnotesroman \renewcommand*{\theparnotemark}{\roman{parnotemark}}\else\fi \parnoteclear\else\fi \ekd@inside@apptrue \ekd@appfontsize \ifekd@mapps \ifdefined\ekd@initial@rule \ekd@initial@rule \fi \fi \apparatus\unless\ifekd@mapps\ekd@end@apparatus\fi \ekd@inside@appfalse \if@pkg@parnotes\parnotes\parnotereset\else\fi }% \egroup \fi \if@pkg@float \begin{ekdapparatus}[!b]% \ekd@insert@apparatus \end{ekdapparatus}% \fi \if@pkg@keyfloat \ekd@insert@keyparapp \fi \if@pkg@fitapp \luadirect{tex.sprint(ekdosis.setheightandprintapparatus())}% \fi % \if@pkg@breakable % \ekd@breakable{\ekd@insert@apparatus}% % \fi } % \end{macrocode} % Before inserting any new entry, \cs{add@apparatus} calls % \cs{test@apparatus} to decide whether a new apparatus block must be % created on a given page. % \begin{macrocode} \def\add@apparatus{% \test@apparatus% \ifbool{do@app}{\subsq@unitfalse\add@@apparatus}{}% } % \end{macrocode} % \cs{append@app} inserts a bare (sub)entry in the apparatus... % \begin{macrocode} \NewDocumentCommand{\append@app}{o +m}{% \ifekd@isinapp% \ifekd@state% \IfNoValueTF{#1}% {\luadirect{ekdosis.appin(\luastringO{#2})}}% {\luadirect{ekdosis.appin(\luastringO{#2}, \luastringO{#1})}}% \fi% \fi} % \end{macrocode} % while \cs{append@ln@app} inserts a (sub)entry possibly preceded by a % line number. % \begin{macrocode} \NewDocumentCommand{\append@ln@app}{o o +m}{% \IfNoValueTF{#2} {\IfNoValueTF{#1} {\luadirect{tex.sprint(ekdosis.mdvappend(\luastringO{#3}))}} {\luadirect{tex.sprint(ekdosis.mdvappend(\luastringO{#3}, \luastringO{#1}))}}% } {\IfNoValueTF{#1} {\luadirect{tex.sprint(ekdosis.mdvappend(\luastringO{#3}, nil, \luastringO{#2}))}} {\luadirect{tex.sprint(ekdosis.mdvappend(\luastringO{#3}, \luastringO{#1}, \luastringO{#2}))}}% }% } % \end{macrocode} % \paragraph{Lineation Settings} % \begin{macro}{\outerlinenumbers} % \begin{macro}{\innerlinenumbers} % \pkg{ekdosis} does not use the \enquote{pagewise} numbering mode % that is provided by \pkg{lineno}. Therefore, % \cs{outerlinenumbers} and \cs{innerlinenumbers} are defined in % addition to |\rightlinenum|\allowbreak|bers| and % \cs{leftlinenumbers}. % \begin{macrocode} \def\outerlinenumbers{% \def\makeLineNumberRunning{% \checkoddpage \ifoddpage \linenumberfont\hskip\linenumbersep\hskip\textwidth \hbox to\linenumberwidth{\hss\LineNumber}\hss \else \hss\linenumberfont\LineNumber\hskip\linenumbersep \fi }% } \def\innerlinenumbers{% \def\makeLineNumberRunning{% \checkoddpage \ifoddpage \hss\linenumberfont\LineNumber\hskip\linenumbersep \else \linenumberfont\hskip\linenumbersep\hskip\textwidth \hbox to\linenumberwidth{\hss\LineNumber}\hss \fi }% } % \end{macrocode} % \end{macro} % \end{macro} % The keys to be used for lineation settings follow. A conditional is % defined beforehand so that \pkg{ekdosis} may know whether the % numbering should start afresh at the top of each page. % \begin{macrocode} \newif\ifekd@pagelineation \newif\ifekd@hidelinenumbers \newif\ifekd@pagevlineation % \end{macrocode} % Two counters (|ekd@lnperpage| and |ekd@locallnperpage|) are defined % here and will be used below to allow \pkg{ekdosis} to have control % over the maximum number of lines to be printed per page. % \begin{macrocode} \newcounter{ekd@lnperpage} \newcounter{ekd@locallnperpage} \NewDocumentCommand{\ekdatbegshihook}{}{% \ifekd@pagelineation\resetlinenumber\fi \setcounter{ekd@lnperpage}{0}% } \AddToHook{shipout/before}{\ekdatbegshihook} \newif\ifekd@elidednumbers \ekvdefinekeys{ekd@lineation}{ choice lineation = {page = \ekd@pagelineationtrue, document = \ekd@pagelineationfalse, none = \ekd@pagelineationtrue \ekd@hidelinenumberstrue}, unknown-choice lineation = \PackageError{ekdosis}{unknown lineation=#1}{`lineation' must be either `page' or `document'.}, choice vlineation = {page = \ekd@pagevlineationtrue, document = \ekd@pagevlineationfalse}, unknown-choice vlineation = \PackageError{ekdosis}{unknown vlineation=#1}{`vlineation' must be either `page' or `document'.}, code modulonum = \chardef\c@linenumbermodulo#1\relax, noval modulo = \modulolinenumbers, code vmodulo = \ifekd@memoir@loaded\linenumberfrequency{#1} \else\if@pkg@poetry@verse\poemlines{#1}\fi\fi, initial vmodulo = 1, default vmodulo = 5, bool vnumbrokenlines = \ifnum@brokenline, bool continuousvnum = \if@continuous@vnum, choice numbers = {elided = \ekd@elidednumberstrue, full = \ekd@elidednumbersfalse}, unknown-choice numbers = \PackageError{ekdosis}{unknown numbers=#1}{`numbers' must be either `elided' or `full'.}, initial numbers = elided, choice margin = {right = \rightlinenumbers, left = \leftlinenumbers, inner = \innerlinenumbers, outer = \outerlinenumbers}, unknown-choice margin = \PackageError{ekdosis}{unknown margin=#1}{`margin' must be either `left', `right', \MessageBreak `inner' or `outer'}, choice vmargin = { right = \if@pkg@poetry@verse\verselinenumbersright\fi, left = \if@pkg@poetry@verse\verselinenumbersleft\fi}, unknown-choice vmargin = \PackageError{ekdosis}{unknown vmargin=#1}{`margin' must be either `left' ot `right'}, code maxlines = \def\maxlines@value{#1}, code nomaxlines = \undef\maxlines@value } % \end{macrocode} % \begin{macro}{\SetLineation} % Then \cs{SetLineation}\marg{options} can be used in the preamble or % at any point of the document to set lineation preferences. Its % argument processes the |key-value| options that are defined just % above. % \begin{macrocode} \NewDocumentCommand{\SetLineation}{m}{ \ekvset{ekd@lineation}{#1} } % \end{macrocode} % \end{macro} % \begin{macro}{\vmodulolinenumbers} % \changes{v1.4}{2021/11/21}{New command to adjust modulo verse line % numbering} % \begin{macrocode} \NewDocumentCommand{\vmodulolinenumbers}{O{5}}{% \ifekd@memoir@loaded \linenumberfrequency{#1}% \else \if@pkg@poetry@verse \poemlines{#1}% \fi \fi \ignorespaces } % \end{macrocode} % \end{macro} % Use |\normalfont| for line numbers:--- % \begin{macrocode} \renewcommand\linenumberfont{\normalfont\footnotesize} % \end{macrocode} % \paragraph{Limiting the Number of Lines per Page} % The following commands are provided to set and control the maximum % number of lines printed on each page. % \begin{macro}{\setmaxlines} % \changes{v1.5}{2023/06/22}{limits the number of lines per page} % \cs{setmaxlines}\marg{n}, where \meta{n} is a positive integer % $\geq 1$, can be used either in the preamble or at any point of the % document to set the maximum number of lines to be printed on each % page. This command has the same effect as the |maxlines| option % of \cs{SetLineation}. % \begin{macrocode} \def\setmaxlines#1{\def\maxlines@value{#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\localmaxlines} % \changes{v1.5}{2023/06/22}{changes the maximum number of lines % locally} % Once a maximum number of lines per page has been set, % \cs{localmaxlines}\marg{n} can be used to adjust this number on a % given page. As for \cs{setmaxlines}, \meta{n} must be a positive % integer $\geq 1$. % \begin{macrocode} \def\localmaxlines#1{% \luadirect{tex.sprint(ekdosis.setlocalmaxlines(\luastringN{#1}))}% \ignorespaces} % \end{macrocode} % \end{macro} % \begin{macro}{\addtomaxlines} % \changes{v1.5}{2023/06/22}{adds or subtracts lines from a given page} % Unlike \cs{localmaxlines}, \cs{addtomaxlines}\meta{n} takes as % argument the number of lines one wishes to add or substract from the % number that has been set by \cs{setmaxlines}. As a result, \meta{n} % can be a positive or negative integer. % \begin{macrocode} \def\addtomaxlines#1{% \luadirect{tex.sprint(ekdosis.addtomaxlines( \luastringO{\maxlines@value}, \luastringN{#1}))}% \ignorespaces} % \end{macrocode} % \end{macro} % \begin{macro}{\nomaxlines} % \changes{v1.5}{2023/06/22}{unsets \cs{setmaxlines}} % \cs{nomaxlines} unsets any limit previously set by \cs{setmaxlines}. % \begin{macrocode} \def\nomaxlines{\luadirect{tex.sprint(ekdosis.resetlocalmaxlines())}} % \end{macrocode} % \end{macro} % Finally, the \cs{MakeLineNo} command provided by the \pkg{lineno} % package is patched so as to trigger the insertion of \cs{pagebreak} % when the number of lines set by \cs{setmaxlines} has been % reached:--- % \begin{macrocode} \AddToHook{cmd/MakeLineNo/after}{% \ifdefined\maxlines@value \stepcounter{ekd@lnperpage}% \ifnum\value{ekd@locallnperpage} = 1 \ifnumcomp{\theekd@lnperpage}{=}{% \luadirect{tex.sprint(ekdosis.getlocalmaxlines())}}{% \setcounter{ekd@locallnperpage}{0}% \setcounter{ekd@lnperpage}{0}\pagebreak}{}% \else \ifnumcomp{\theekd@lnperpage}{=}{\maxlines@value}{% \setcounter{ekd@lnperpage}{0}\pagebreak}{}% \fi \fi } % \end{macrocode} % \begin{macro}{\SetDefaultApparatus} % By default, \pkg{ekdosis} defines one layer of critical notes which % is called |default|. This name can be changed at any point of the % document with \cs{SetDefaultApparatus}\marg{name}. % \begin{macrocode} \ekvdefinekeys{appnote}{ store type = \ekdan@type, initial type = default } \NewDocumentCommand{\SetDefaultApparatus}{m}{% \ekvset{appnote}{type=#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\app} % \cs{app}|[type=|\meta{type}|]|\marg{apparatus entries} takes one % mandatory argument and accepts one optional argument. |type=| refers % to the layer the note must go into and \meta{apparatus entries} % contains commands used to insert the entries, either \cs{lem}, % \cs{rdg} or \cs{note}:--- % \begin{macrocode} \NewDocumentCommand{\app}{O{} > { \TrimSpaces } +m}{% \leavevmode \begingroup \ekvset{appnote}{#1}% \ifekd@isinapp\ekd@appinapptrue\fi \ekd@isinapptrue \stepcounter{ekd@lab}% \zlabel{ekd:\theekd@lab}% \luadirect{ekdosis.storeabspg( \luastring{\zref@extract{ekd:\theekd@lab}{abspage}})}% \ifekd@state\add@apparatus\fi \luadirect{tex.sprint(ekdosis.removesp(\luastringN{#2}))}% \ekd@isinappfalse \ekd@appinappfalse \endgroup} % \end{macrocode} % \end{macro} % \begin{macro}{\App} % \changes{v1.5}{2023/06/22}{To be used conjointly with % \texttt{ekdosis.el}} % In contrast to \cs{app}, \cs{App} takes two mandatory arguments and % accepts one optional argument like so: % \cs{App}|[type=|\meta{type}|]|\marg{lemma text}\marg{variants and % notes}. As just described above, |type=| refers to the layer the % note must go into. \cs{App} is strictly equivalent to \cs{app}, % except that lemmas, variants and notes are split into two different % arguments, which allows for more flexible code folding. \meta{lemma % text} is meant to receive \cs{lem}, while \cs{rdg} and \cs{note} go % into \meta{variants and notes}. % \begin{macrocode} \NewDocumentCommand{\App}{omm}{% \IfNoValueTF{#1} {\app{#2#3}} {\app[#1]{#2#3}}% } % \end{macrocode} % \end{macro} % \begin{macro}{\ekdpage} % \changes{v1.4}{2021/11/21}{prints page marks used internally by % \textsf{ekdosis} to generate the apparatus blocks on pages} % Instead of absolute page numbers, \pkg{ekdosis} now marks the % entries of the apparatus with its own page numbering % scheme. \cs{ekdpage} can be used at any point of the document to % retrieve and print the current number. % \begin{macrocode} \NewDocumentCommand{\ekdpage}{}{% \luadirect{tex.sprint(ekdosis.getekdabspg())}% } % \end{macrocode} % \end{macro} % \cs{current@ref@arg} is used outside \cs{app} by \cs{note}. It takes % two mandatory arguments: the beginning line label and the ending % line label\---which are manually inserted---and returns the formatted % reference to be inserted in the apparatus criticus. % \begin{macrocode} \def\current@ref@arg#1#2{{%\textdir TLT% \unexpanded\expandafter{\ekd@refnumstyle}% \ifnum% \pdf@strcmp{\getpagerefnumber{#1}}{\getpagerefnumber{#2}} = 0 \ifnum% \pdf@strcmp{\getrefnumber{#1}}{\getrefnumber{#2}} = 0 % \ifekd@mapps% \ifbool{subsq@unit@\ekdan@type}{% \ifnum% \pdf@strcmp{\getrefnumber{#1}}{% \getrefnumber{\luadirect{tex.sprint(ekdosis.getprevnotelab())}}} = 0 \else \LRnum{\getrefnumber{#1}}\unexpanded\expandafter{\ekd@postrefnum}% issue the no \fi% }% {\LRnum{\getrefnumber{#1}}\unexpanded\expandafter{\ekd@postrefnum}}% issue the no \else \ifsubsq@unit% % \ifnum% \pdf@strcmp{\getrefnumber{#1}}{% \getrefnumber{\luadirect{tex.sprint(ekdosis.getprevnotelab())}}} = 0 \else \LRnum{\getrefnumber{#1}}\unexpanded\expandafter{\ekd@postrefnum}% issue the no \fi % \else \LRnum{\getrefnumber{#1}}\unexpanded\expandafter{\ekd@postrefnum}% issue the no \fi \fi % \else \ifekd@elidednumbers \luadirect{tex.sprint(ekdosis.numrange(\luastring{\getrefnumber{#1}}, \luastring{\getrefnumber{#2}}))}% \unexpanded\expandafter{\ekd@postrefnum}% issue the nos \else \LRnum{\getrefnumber{#1}}--% \LRnum{\getrefnumber{#2}}\unexpanded\expandafter{\ekd@postrefnum}% issue the nos \fi \fi% \else \ifboolexpr{bool {ekd@pagelineation} or bool {ekd@pagevlineation}} {\LRnum{\getrefnumber{#1}}--% \LRnum{\getpagerefnumber{#2}}.% \LRnum{\getrefnumber{#2}}\unexpanded\expandafter{\ekd@postrefnum}}% issue pg and ln nos {\LRnum{\getrefnumber{#1}}--% \LRnum{\getrefnumber{#2}}\unexpanded\expandafter{\ekd@postrefnum}}% issue the nos \fi% \ifekdn@forcenum \LRnum{\getrefnumber{#1}}\unexpanded\expandafter{\ekd@postrefnum}% force the no \fi }% } % \end{macrocode} % \cs{current@ref} is pretty much the same as \cs{current@reg@arg}, % but takes no argument. It is used by commands such as \cs{lem} when % references to page and line numbers can be returned by \textsf{Lua}. % \begin{macrocode} \def\current@ref{{%\textdir TLT% \unexpanded\expandafter{\ekd@refnumstyle}% \ifnum% \pdf@strcmp{% \getpagerefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% {\getpagerefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}} = 0 \ifnum% \pdf@strcmp{% \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% {\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}} = 0 % \ifekd@mapps% \ifbool{subsq@unit@\ekdan@type}{% \ifnum% \pdf@strcmp{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% {\getrefnumber{\luadirect{tex.sprint(ekdosis.getprevlnlab())}-b}} = 0 %%%begin \ifnum% \pdf@strcmp{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}% {\getrefnumber{\luadirect{tex.sprint(ekdosis.getprevlnlab())}-e}} = 0 \ifekd@appinapp \ifnum% \pdf@strcmp{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% {\getrefnumber{\luadirect{tex.sprint(ekdosis.getprevprevlnlab())}-b}} = 0 \else \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% \unexpanded\expandafter{\ekd@postrefnum}% issue the no \fi \fi \else \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% \unexpanded\expandafter{\ekd@postrefnum}% issue the no \fi %%% end \else \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% \unexpanded\expandafter{\ekd@postrefnum}% issue the no \fi% }{\LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% \unexpanded\expandafter{\ekd@postrefnum}}% issue the no \else \ifsubsq@unit% % \ifnum% \pdf@strcmp{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% {\getrefnumber{\luadirect{tex.sprint(ekdosis.getprevlnlab())}-b}} = 0 %%%begin \ifnum% \pdf@strcmp{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}% {\getrefnumber{\luadirect{tex.sprint(ekdosis.getprevlnlab())}-e}} = 0 \ifekd@appinapp \ifnum% \pdf@strcmp{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% {\getrefnumber{\luadirect{tex.sprint(ekdosis.getprevprevlnlab())}-b}} = 0 \else \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% \unexpanded\expandafter{\ekd@postrefnum}% issue the no \fi \fi \else \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% \unexpanded\expandafter{\ekd@postrefnum}% issue the no \fi %%% end \else \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% \unexpanded\expandafter{\ekd@postrefnum}% issue the no \fi % \else \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% \unexpanded\expandafter{\ekd@postrefnum}% issue the no \fi \fi % \else \ifekd@elidednumbers \luadirect{tex.sprint(ekdosis.numrange( \luastring{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}, \luastring{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}))}% \unexpanded\expandafter{\ekd@postrefnum}% issue the nos \else \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}--% \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}% \unexpanded\expandafter{\ekd@postrefnum}% issue the nos \fi \fi% \else \ifboolexpr{bool {ekd@pagelineation} or bool {ekd@pagevlineation}} {\LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}--% \LRnum{\getpagerefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}.% \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}% \unexpanded\expandafter{\ekd@postrefnum}}% issue pg and ln nos {\LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}--% \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}% \unexpanded\expandafter{\ekd@postrefnum}}% issue the nos \fi% \ifekdl@forcenum \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% \unexpanded\expandafter{\ekd@postrefnum}% force the no \fi }% } % \end{macrocode} % Define keys to be used by the optional arguments of \cs{lem} and % \cs{rdg}:--- % \begin{macrocode} \newif\ifekdl@forcenum \newif\ifekdl@nonum \newif\ifekdl@nodelim \newif\ifekdl@forcedelim \newif\ifekdl@ilabel \ekvdefinekeys{lem}{ code wit = \def\ekdlr@wit{#1}, code source = \def\ekdlr@source{#1}, code resp = \def\ekdlr@resp{#1}, code alt = \def\ekdlr@alt{#1}, code pre = \def\ekdlr@pre{#1}, code post = \def\ekdlr@post{#1}, code prewit = \def\ekdlr@prewit{#1}, code postwit = \def\ekdlr@postwit{#1}, code ilabel = \ekdl@ilabeltrue\def\ilabel@val{#1}, store type = \ekdlr@type, store sep = \ekdl@sep, noval nonum = \ekdl@nonumtrue, noval num = \ekdl@forcenumtrue, noval nodelim = \ekdl@nodelimtrue, noval delim = \ekdl@forcedelimtrue, bool nolem = \ifekdl@nolem, nmeta Nolem = {nodelim, nonum, nolem}, bool nosep = \ifekdl@nosep, initial sep = \ekdsep } \ekvdefinekeys{rdg}{ code wit = \def\ekdlr@wit{#1}, code source = \def\ekdlr@source{#1}, code resp = \def\ekdlr@resp{#1}, code alt = \def\ekdlr@alt{#1}, code pre = \def\ekdlr@pre{#1}, code post = \def\ekdlr@post{#1}, code prewit = \def\ekdlr@prewit{#1}, code postwit = \def\ekdlr@postwit{#1}, store subsep = \ekdr@subsep, initial subsep = \ekdsubsep, bool nosubsep = \ifekdr@nosubsep, store type = \ekdlr@type, bool nordg = \ifekdr@nordg } % \end{macrocode} % \begin{macro}{\rdgGrp} % \changes{v1.1}{2020/11/04}{new macro for grouping readings} % \cs{rdgGrp}\oarg{option}\marg{lemma and/or readings} may be used to % group readings so as to indicate subvariation in apparatus % entries. This command is expected inside \cs{app}|{}|, and takes as % argument readings to be grouped introduced by means of \cs{lem} % and/or \cs{rdg} commands. It further accepts |type| as an optional % key-value argument to describe the type of grouping. % \begin{macrocode} \NewDocumentCommand{\rdgGrp}{O{} > {\TrimSpaces } m}{% \luadirect{tex.sprint(ekdosis.removesp(\luastringN{#2}))}% } % \end{macrocode} % \end{macro} % \begin{macro}{\app@lang} % \begin{macro}{\app@note@lang} % \cs{app@lang} is used internally by \cs{lem} and \cs{rdg} to set the % language for apparatus entries. \cs{note} uses \cs{\app@note@lang}. % \begin{macrocode} \def\app@lang{% \ifekd@mapps \luadirect{tex.sprint(ekdosis.getapplang(\luastring{\ekdan@type}))}% \else \ekd@singleapp@lang \fi } \def\app@note@lang{% \ifekd@mapps \luadirect{tex.sprint(ekdosis.getappnotelang(\luastring{\ekdan@type}))}% \else \ekd@singleapp@note@lang \fi } % \end{macrocode} % \end{macro} % \end{macro} % \begin{macro}{\lem} % \cs{lem}\oarg{options}\marg{lemma text} inserts \meta{lemma text} % both in the edition text and in the apparatus criticus by default, % preceded by the reference to the line number or a space if it is the % same number as the one of the previous entry. This command accepts % the optional key-value arguments just defined above. % \begin{macrocode} \NewDocumentCommand{\lem}{O{} m}{% \ifekd@appinapp \let\ekdlr@wit\@undefined \let\ekdlr@source\@undefined \let\ekdlr@resp\@undefined \let\ekdlr@alt\@undefined \let\ekdlr@pre\@undefined \let\ekdlr@post\@undefined \let\ekdlr@prewit\@undefined \let\ekdlr@postwit\@undefined \fi \ekd@isinlemtrue \bgroup \ekdl@forcenumfalse \ekdl@nonumfalse \ekdl@ilabelfalse \ekvset{lem}{#1}% \ifekdl@ilabel \luadirect{ekdosis.dolnlab(\luastringN{#2}, \luastringO{\ilabel@val})}% \else \luadirect{ekdosis.dolnlab(\luastringN{#2})}% \fi \null \ekd@test@lang \ifekd@mapps% \ifnum% \luadirect{tex.sprint(ekdosis.get_bagunits(\luastringO{\ekdan@type}))} = 1 \boolfalse{subsq@unit@\ekdan@type}% \fi% \luadirect{ekdosis.increment_bagunits(\luastringO{\ekdan@type})}% \def\ekd@munit@delim{% \luadirect{tex.sprint(ekdosis.getappdelim(\luastringO{\ekdan@type}))}}% \luadirect{tex.sprint(ekdosis.limit_bagunits(\luastringO{\ekdan@type}))}% \fi% \ifekdl@nolem \edef\lem@app{% % \hskip .75em \ifekd@mapps \unless\ifekdl@nodelim \ifbool{subsq@unit@\ekdan@type}% {\ekd@munit@delim}{\ifekdl@forcedelim\ekd@munit@delim\fi}% \fi \else \unless\ifekdl@nodelim \ifsubsq@unit \unexpanded\expandafter{\ekd@unit@delim}% \else \ifekdl@forcedelim\unexpanded\expandafter{\ekd@unit@delim}\fi \fi \fi \fi% \unless\ifekdl@nonum\current@ref\fi }%\hskip .25em}% \else% \ifbool{al@rlmode}{% \edef\lem@app{% % \hskip .75em \ifekd@mapps \unless\ifekdl@nodelim \ifbool{subsq@unit@\ekdan@type}% {\ekd@munit@delim}{\ifekdl@forcedelim\ekd@munit@delim\fi}% \fi \else \unless\ifekdl@nodelim \ifsubsq@unit \unexpanded\expandafter{\ekd@unit@delim}% \else \ifekdl@forcedelim\unexpanded\expandafter{\ekd@unit@delim}\fi \fi \fi \fi% \unless\ifekdl@nonum\current@ref\fi%\hskip .25em \ifdefined\ekdlr@alt% \ifdefined\ekdlr@post% \space\unexpanded\expandafter{\ekdlr@post}\space\else\fi {\textdir TRT\unexpanded\expandafter{\ekd@lemmastyle}% \unexpanded\expandafter{\ekdlr@alt}}% \ifdefined\ekdlr@pre% \space\unexpanded\expandafter{\ekdlr@pre}\space\else\fi \else \ifdefined\ekdlr@post% \space\unexpanded\expandafter{\ekdlr@post}\space\else\fi {\textdir TRT\unexpanded\expandafter{\ekd@lemmastyle}% \unexpanded{#2}}% \ifdefined\ekdlr@pre% \space\unexpanded\expandafter{\ekdlr@pre}\space\else\fi \fi \ifdefined\ekdlr@postwit% \space\unexpanded\expandafter{\ekdlr@postwit}\else\fi \ifdefined\ekdlr@resp\space\getsiglum{\ekdlr@resp}\else\fi \ifdefined\ekdlr@source\space\getsiglum{\ekdlr@source}\else\fi \ifdefined\ekdlr@wit\space\getsiglum{\ekdlr@wit}\else\fi \ifdefined\ekdlr@prewit% \space\unexpanded\expandafter{\ekdlr@prewit}\space\else\fi \ifekdl@nosep\else\unexpanded\expandafter{\ekdl@sep}\fi }% }% {% \edef\lem@app{% % \hskip .75em \ifekd@mapps \unless\ifekdl@nodelim \ifbool{subsq@unit@\ekdan@type}% {\ekd@munit@delim}{\ifekdl@forcedelim\ekd@munit@delim\fi}% \fi \else \unless\ifekdl@nodelim \ifsubsq@unit \unexpanded\expandafter{\ekd@unit@delim}% \else \ifekdl@forcedelim\unexpanded\expandafter{\ekd@unit@delim}\fi \fi \fi \fi% \unless\ifekdl@nonum\current@ref\fi%\hskip .25em \ifdefined\ekdlr@alt% \ifdefined\ekdlr@pre% \space\unexpanded\expandafter{\ekdlr@pre}\space\else\fi \ifbool{ekd@lang@pkg}% {{\unexpanded\expandafter{\ekd@lemmastyle}% \noexpand\selectlanguage{\app@lang}% \unexpanded\expandafter{\ekdlr@alt}}}% {\unexpanded\expandafter{\ekd@lemmastyle}% \unexpanded\expandafter{\ekdlr@alt}}% \ifdefined\ekdlr@post% \space\unexpanded\expandafter{\ekdlr@post}\space\else\fi \else \ifdefined\ekdlr@pre% \space\unexpanded\expandafter{\ekdlr@pre}\space\else\fi \ifbool{ekd@lang@pkg}% {{\unexpanded\expandafter{\ekd@lemmastyle}% \noexpand\selectlanguage{\app@lang}% \unexpanded{#2}}}{% {\unexpanded\expandafter{\ekd@lemmastyle}\unexpanded{#2}}}% \ifdefined\ekdlr@post% \space\unexpanded\expandafter{\ekdlr@post}\space\else\fi \fi \ifdefined\ekdlr@prewit% \space\unexpanded\expandafter{\ekdlr@prewit}\space\else\fi \ifdefined\ekdlr@wit\space\getsiglum{\ekdlr@wit}\else\fi \ifdefined\ekdlr@source\space\getsiglum{\ekdlr@source}\else\fi \ifdefined\ekdlr@resp\space\getsiglum{\ekdlr@resp}\else\fi \ifdefined\ekdlr@postwit% \space\unexpanded\expandafter{\ekdlr@postwit}\else\fi \ifekdl@nosep\else\unexpanded\expandafter{\ekdl@sep}\fi }% }% \fi \ifekd@mapps \ifekdl@ilabel \append@ln@app[\ekdan@type][\ilabel@val]{\lem@app}% \else \append@ln@app[\ekdan@type]{\lem@app}% \fi \else \ifekdl@ilabel \append@ln@app[][\ilabel@val]{\lem@app} \else \append@ln@app{\lem@app}% \fi \fi% \egroup% \ekd@isinlemfalse% \subsq@unittrue% } % \end{macrocode} % \end{macro} % \begin{macro}{\rdg} % \cs{rdg}\oarg{options}\marg{variant reading} inserts \meta{variant % reading} in the second part of the entry, after the lemma text and % the separator, in the apparatus criticus. This command accepts the % optional key-value arguments defined above. This command sets % \cs{ifekd@subsq@rdg} to true, which instructs \pkg{ekdosis} that % \enquote{subseparators} may be used for subsequent entries. % \begin{macrocode} \newif\ifekd@subsq@rdg \NewDocumentCommand{\rdg}{O{} m}{% \bgroup% \ekvset{rdg}{#1}% \ekd@test@lang % \ifekdr@nordg\append@app{}\else% do we need \append@app{} here? If % % so, keep in mind \ifekd@mapps, % like so: \unless\ifekdr@nordg \ifbool{al@rlmode}{% \edef\rdg@app{% \ifekd@subsq@rdg \unless\ifekdr@nosubsep\unexpanded\expandafter{\ekdr@subsep}\fi \fi \ifdefined\ekdlr@alt% \ifdefined\ekdlr@post% \space\unexpanded\expandafter{\ekdlr@post}\space\else\fi {\textdir TRT\unexpanded\expandafter{\ekd@readingstyle}% \unexpanded\expandafter{\ekdlr@alt}}% \ifdefined\ekdlr@pre% \space\unexpanded\expandafter{\ekdlr@pre}\space\else\fi \else \ifdefined\ekdlr@post% \space\unexpanded\expandafter{\ekdlr@post}\space\else\fi {\textdir TRT\unexpanded\expandafter{\ekd@readingstyle}% \unexpanded{#2}}% \ifdefined\ekdlr@pre% \space\unexpanded\expandafter{\ekdlr@pre}\space\else\fi \fi \ifdefined\ekdlr@postwit% \space\unexpanded\expandafter{\ekdlr@postwit}\else\fi \ifdefined\ekdlr@resp\space\getsiglum{\ekdlr@resp}\else\fi \ifdefined\ekdlr@source\space\getsiglum{\ekdlr@source}\else\fi \ifdefined\ekdlr@wit\space\getsiglum{\ekdlr@wit}\else\fi \ifdefined\ekdlr@prewit% \space\unexpanded\expandafter{\ekdlr@prewit}\space\else\fi }% }% {% \edef\rdg@app{% \ifekd@subsq@rdg \unless\ifekdr@nosubsep\unexpanded\expandafter{\ekdr@subsep}\fi \fi \ifdefined\ekdlr@alt% \ifdefined\ekdlr@pre% \space\unexpanded\expandafter{\ekdlr@pre}\space\else\fi \ifbool{ekd@lang@pkg}% {{\unexpanded\expandafter{\ekd@readingstyle}% \noexpand\selectlanguage{\app@lang}% \unexpanded\expandafter{\ekdlr@alt}}}% {\unexpanded\expandafter{\ekd@readingstyle}% \unexpanded\expandafter{\ekdlr@alt}}% \ifdefined\ekdlr@post% \space\unexpanded\expandafter{\ekdlr@post}\space\else\fi \else \ifdefined\ekdlr@pre% \space\unexpanded\expandafter{\ekdlr@pre}\space\else\fi \ifbool{ekd@lang@pkg}% {{\unexpanded\expandafter{\ekd@readingstyle}% \noexpand\selectlanguage{\app@lang}\unexpanded{#2}}}{% {\unexpanded\expandafter{\ekd@readingstyle}\unexpanded{#2}}}% \ifdefined\ekdlr@post% \space\unexpanded\expandafter{\ekdlr@post}\space\else\fi \fi \ifdefined\ekdlr@prewit% \space\unexpanded\expandafter{\ekdlr@prewit}\space\else\fi \ifdefined\ekdlr@wit\space\getsiglum{\ekdlr@wit}\else\fi \ifdefined\ekdlr@source\space\getsiglum{\ekdlr@source}\else\fi \ifdefined\ekdlr@resp\space\getsiglum{\ekdlr@resp}\else\fi \ifdefined\ekdlr@postwit% \space\unexpanded\expandafter{\ekdlr@postwit}\else\fi }% }% \ifekd@mapps \append@app[\ekdan@type]{\rdg@app}% \else \append@app{\rdg@app}% \fi \fi \egroup \ekd@subsq@rdgtrue } % \end{macrocode} % \end{macro} % Define keys to be used by the optional argument of \cs{note} when % this command is found outside \cs{app}:--- % \begin{macrocode} \newif\ifekdn@forcenum \ekvdefinekeys{note}{ store type = \ekdan@type, store lem = \ekdn@lem, code labelb = \def\ekdn@labelb{#1}, code labele = \def\ekdn@labele{#1}, bool nodelim = \ifekdn@nodelim, store sep = \ekdn@sep, bool nosep = \ifekdn@nosep, initial type = default, initial sep = \ekdsep, bool nonum = \ifekdn@nonum, noval num = \ekdn@forcenumtrue } % \end{macrocode} % \cs{note@noapp} is used internally when a \cs{note} command is found % outside \cs{app}. This command is mostly used to insert short % comments or references to texts quoted or cited in the edition text % to go into additional layers of the apparatus criticus, e.g.\ the % \emph{apparatus testium}. It accepts the optional key-value % arguments just defined above. It must be noted that |labelb| must be % specified; otherwise \pkg{ekdosis} will issue an error message. % \begin{macrocode} \NewDocumentCommand{\note@noapp}{O{} +m}{% \leavevmode \bgroup% \ekvset{note}{#1}% \ekd@test@lang \stepcounter{ekd@lab}% \zlabel{ekd:\theekd@lab}% \luadirect{ekdosis.storeabspg( \luastring{\zref@extract{ekd:\theekd@lab}{abspage}})}% \ifekd@state\add@apparatus\fi% \ifekd@mapps% \ifnum% \luadirect{tex.sprint(ekdosis.get_bagunits(\luastringO{\ekdan@type}))} = 1 \boolfalse{subsq@unit@\ekdan@type}% \fi% \luadirect{ekdosis.increment_bagunits(\luastringO{\ekdan@type})}% \def\ekd@munit@delim{% \luadirect{tex.sprint(ekdosis.getappdelim(\luastringO{\ekdan@type}))}}% \luadirect{tex.sprint(ekdosis.limit_bagunits(\luastringO{\ekdan@type}))}% \fi% \ifdefined\ekdn@labelb% \luadirect{tex.sprint(ekdosis.setnotelab(\luastringO{\ekdn@labelb}))}% \ifdefined\ekdn@labele\else\def\ekdn@labele{\ekdn@labelb}\fi% \else\PackageError{ekdosis}{missing labelb}{`labelb' must be set.}\fi% \ifbool{al@rlmode}% {\edef\note@contents{% % \hskip .75em \ifekd@mapps \unless\ifekdn@nodelim \ifbool{subsq@unit@\ekdan@type}% {\ekd@munit@delim}{}% \fi \else \unless\ifekdn@nodelim \ifsubsq@unit\unexpanded\expandafter{\ekd@unit@delim}\fi \fi \fi% \unless\ifekdn@nonum\current@ref@arg{\ekdn@labelb}{\ekdn@labele}\fi%\hskip .25em \ifdefined\ekdn@lem% {\textdir TRT\unexpanded\expandafter{\ekd@lemmastyle}% \unexpanded\expandafter{\ekdn@lem}}% \unless\ifekdn@nosep \unexpanded\expandafter{\ekdn@sep}\fi \else\fi% {\textdir TRT\unexpanded{#2}}}}% {\edef\note@contents{% % \hskip .75em \ifekd@mapps \unless\ifekdn@nodelim \ifbool{subsq@unit@\ekdan@type}% {\ekd@munit@delim}{}% \fi \else \unless\ifekdn@nodelim \ifsubsq@unit\unexpanded\expandafter{\ekd@unit@delim}\fi \fi \fi% \unless\ifekdn@nonum\current@ref@arg{\ekdn@labelb}{\ekdn@labele}\fi%\hskip .25em \ifdefined\ekdn@lem \ifbool{ekd@lang@pkg}% {{\unexpanded\expandafter{\ekd@lemmastyle}% \noexpand\selectlanguage{\app@lang}% \unexpanded\expandafter{\ekdn@lem}}}% {\unexpanded\expandafter{\ekd@lemmastyle}% \unexpanded\expandafter{\ekdn@lem}}% \unless\ifekdn@nosep \unexpanded\expandafter{\ekdn@sep}\fi \else\fi% \ifbool{ekd@lang@pkg}% {{\noexpand\selectlanguage{\app@note@lang}\unexpanded{#2}}}{% {\unexpanded{#2}}}}}% \ifekd@mapps \unconditional@appin[\ekdan@type]{\note@contents}% \else \unconditional@appin{\note@contents}% \fi \luadirect{ekdosis.setprevnotelab(\luastringO{\ekdn@labelb})}% \egroup \subsq@unittrue \ignorespaces } % \end{macrocode} % Define keys to be used by the optional argument of \cs{note} when % this command is found inside \cs{app}:--- % \begin{macrocode} \ekvdefinekeys{ekd@note}{ store pre = \pre@value, store post = \post@value, nmeta sep = {post=\ekdsep}, nmeta subsep = {pre=\ekdsubsep} } % \end{macrocode} % The following three commands, \cs{note@app}, \cs{ekd@note} and % \cs{ekd@note@star} are used internally when a \cs{note} command is % found inside \cs{app}. These commands are used to insert short % comments after the lemma text or after any variant reading in the % apparatus criticus. \cs{note@app} and subsequently \cs{ekd@note} and % \cs{ekd@note@star} accept the optional key-value arguments just % defined above. % \begin{macrocode} \NewDocumentCommand{\ekd@note}{O{} m}{% \bgroup \ekvset{ekd@note}{#1}% \edef\note@contents{% \ekvifdefinedNoVal{ekd@note}{pre}{}{% \unexpanded\expandafter{\pre@value}}% \unexpanded{#2}% \ekvifdefinedNoVal{ekd@note}{post}{}{% \unexpanded\expandafter{\post@value}}% }% \ifekd@mapps% \append@app[\ekdan@type]{\note@contents}% \else% \append@app{\note@contents}% \fi% \egroup } \NewDocumentCommand{\ekd@note@star}{O{} m}{% \bgroup \ekvset{ekd@note}{#1}% \edef\note@contents{% \ekvifdefinedNoVal{ekd@note}{pre}{}{% \unexpanded\expandafter{\pre@value}}% \if@pkg@parnotes \unskip\noexpand\parnote{\unexpanded{#2}}% \else \unskip\noexpand\footnote{\unexpanded{#2}}% \fi \ekvifdefinedNoVal{ekd@note}{post}{}{% \unexpanded\expandafter{\post@value}}% }% \ifekd@mapps \append@app[\ekdan@type]{\note@contents}% \else \append@app{\note@contents}% \fi \egroup } \NewDocumentCommand{\note@app}{s O{} +m}{% \ifbool{al@rlmode}{% \IfBooleanTF{#1}{\ekd@note@star[#2]{% {\textdir TRT#3}}} {\ekd@note[#2]{{\textdir TRT#3}}}% }{% \IfBooleanTF{#1}{\ekd@note@star[#2]{#3}} {\ekd@note[#2]{#3}}% }% } % \end{macrocode} % \begin{macro}{\note} % Finally, \cs{note} is a simple command designed to check whether % \cs{note} itself is called inside or outside \cs{app}. Then, unless % it is found inside \cs{lem}, it calls \cs{note@app} in the former % case and \cs{note@noapp} in the latter case:--- % \begin{macrocode} \NewDocumentCommand{\note}{s O{} +m}{% \ifekd@state% \ifekd@isinapp% \ifekd@isinlem% \note@noapp[#2]{#3}% \else% \IfBooleanTF{#1}{\note@app*[#2]{#3}}{\note@app[#2]{#3}}% \fi% \else% \note@noapp[#2]{#3}% \fi% \fi% } % \end{macrocode} % \end{macro} % \paragraph{Combining Footnotes Into a Single Paragraph} % Footnotes combined as one paragraph are inserted with the standard % \cs{footnote} command which is redirected to % \cs{unconditional@appin} when |ekd@parafootnotes| is set to % |true|:--- % \begin{macrocode} \newif\ifekd@parafootnotes % \end{macrocode} % The keys to be used by \cs{SetFootnotes} are defined below:--- % \begin{macrocode} \ekvdefinekeys{ekd@footnotes}{ choice layout = { default = \relax, paragraph = \ekd@parafootnotestrue }, initial layout = default, unknown-choice layout = \PackageError{ekdosis}{unknown layout=#1}{`layout' must be either `default' or `paragraph'.}, store type = \ekdfn@type, initial type = default, code textfnmark = \protected\def\ekd@around@fnmark##1{#1}, initial textfnmark = \textsuperscript{#1}, code appfnmark = \protected\def\ekdappfnmark##1{#1}, initial appfnmark = \textsuperscript{#1} } \newif\ifekd@fnmark \ekvdefinekeys{ekd@infootnotes}{ store type = \ekdfn@type, initial type = default, code mark = \ekd@fnmarktrue \protected\def\ekd@fnmark@value{#1} } % \end{macrocode} % \begin{macro}{\SetFootnotes} % \changes{v1.5}{2023/06/22}{footnotes combined into a single % paragraph} \cs{SetFootnotes}\marg{options} can be used in the % preamble or at any point of the document. |layout=paragraph| % instructs \pkg{ekdosis} to combine all footnotes into a single % paragraph. Then the other |key-value| options that are defined % just above allow to format the marks and specify the layer where % the notes are to be printed. % \begin{macrocode} \ekvsetdef\SetFootnotes{ekd@footnotes} % \end{macrocode} % \end{macro} % \begin{macro}{\ekd@parafootnote} % \cs{ekd@parafootnote}\oarg{layer}\marg{contents} holds the new % definition of \cs{footnote}. This command accepts an optional % argument that can be used to specify the layer in which the % contents of the footnote is to be printed. % \begin{macrocode} \NewDocumentCommand{\ekd@parafootnote}{O{} m}{% \ifekd@state \bgroup \ekvset{ekd@infootnotes}{#1}% \ifekd@fnmark \edef\ekd@parafn@mark{% \LRnum{\unexpanded\expandafter{\ekd@fnmark@value}}}% \edef\ekd@inparafn@mark{% \ekdappfnmark{\LRnum{\unexpanded\expandafter{\ekd@fnmark@value}}}}% \else \refstepcounter{footnote}% \edef\ekd@parafn@mark{\LRnum{\thefootnote}}% \edef\ekd@inparafn@mark{\ekdappfnmark{\LRnum{\thefootnote}}}% \fi \leavevmode \stepcounter{ekd@lab}% \zlabel{ekd:\theekd@lab}% \luadirect{ekdosis.storeabspg( \luastring{\zref@extract{ekd:\theekd@lab}{abspage}})}% \add@apparatus \luadirect{ekdosis.increment_bagunits(\luastringO{\ekdfn@type})}% \luadirect{tex.sprint(ekdosis.limit_bagunits(\luastringO{\ekdan@type}))}% \ekd@around@fnmark{\ekd@parafn@mark}% \ifekd@mapps \unconditional@appin[\ekdfn@type]{\ekd@inparafn@mark #2}% \else \unconditional@appin{\ekd@inparafn@mark #2}% \fi \egroup \else \footnote{#2}% \fi } % \end{macrocode} % \end{macro} % \paragraph{Emendations and Conjectures} % Here follows the |key-value| options to be used by % \cs{SetCritSymbols} below:--- % \begin{macrocode} \ekvdefinekeys{ekd@corr}{ store suppbegin = \suppb@value, store suppend = \suppe@value, store delbegin = \delb@value, store delend = \dele@value, store sicbegin = \sicb@value, store sicend = \sice@value, store gapmark = \gapm@value, initial suppbegin = \ifbool{al@rlmode}{>}{<}, initial suppend = \ifbool{al@rlmode}{<}{>}, initial delbegin = \ifbool{al@rlmode}{\}}{\{}, initial delend = \ifbool{al@rlmode}{\{}{\}}, initial sicbegin = \dag, initial sicend = \dag, initial gapmark = ***, bool keepinapp = \ifekd@keepinapp } % \end{macrocode} % \begin{macro}{\supplied} % \changes{v1.1}{2020/11/04}{new macro for editorial additions} % \cs{supplied}\marg{text} takes as mandatory argument the text added % or supplied by conjecture. % \begin{macrocode} \NewDocumentCommand{\supplied}{m}{% \ifekd@inside@app \ifekd@keepinapp \suppb@value #1\suppe@value \else #1% \fi \else \suppb@value #1\suppe@value \fi } % \end{macrocode} % \end{macro} % \begin{macro}{\surplus} % \changes{v1.1}{2020/11/04}{new macro for editorial deletions} % \cs{surplus}\marg{text} takes as mandatory argument the text % considered by the editor to be inauthentic, but nevertheless % retained between braces in the edition text as it is transmitted by % all witnesses. % \begin{macrocode} \NewDocumentCommand{\surplus}{m}{% \ifekd@inside@app \ifekd@keepinapp \delb@value #1\dele@value \else #1% \fi \else \delb@value #1\dele@value \fi } % \end{macrocode} % \end{macro} % \begin{macro}{\sic} % \changes{v1.1}{2020/11/04}{new macro for text deemed to be not % understandable} % \cs{sic}\marg{text} takes as mandatory argument the text deemed by % the editor to be readable but not understandable. \cs{sic} insert % \meta{text} between cruces while \cs{sic*} prints only one crux % before \meta{text}. % \begin{macrocode} \NewDocumentCommand{\sic}{s m}{% \ifekd@inside@app \ifekd@keepinapp \IfBooleanTF{#1} {\sicb@value #2} {\sicb@value #2\sice@value}% \else #2% \fi \else \IfBooleanTF{#1} {\sicb@value #2} {\sicb@value #2\sice@value}% \fi } % \end{macrocode} % \end{macro} % \begin{macro}{\gap} % \changes{v1.1}{2020/11/04}{new macro for lacunae} % \cs{gap}\marg{options} indicates that some amount of text has fallen % away from the entire tradition. It takes as mandatory argument a % comma-separated list of options that can be used to further specify % the reason for omission, the unit of measurement, the quantity and % extent. % \begin{macrocode} \NewDocumentCommand{\gap}{m}{% \gapm@value } % \end{macrocode} % \end{macro} % \begin{macro}{\SetCritSymbols} % \changes{v1.1}{2020/11/04}{new macro to set the symbols to be % used to mark the corrections} \cs{SetCritSymbols}\marg{csv list of % options} is used to change the symbols that \pkg{ekdosis} uses by % default for representing emendations, lacunae, omissions, gaps and % editorial deletions. % \begin{macrocode} \NewDocumentCommand{\SetCritSymbols}{m}{ \ekvset{ekd@corr}{#1} } % \end{macrocode} % \end{macro} % \paragraph{Lacunae} % \begin{macro}{\ilabel} % \changes{v1.5}{2023/06/22}{recalls and sets the ending label of % lemmas used to mark lacunae in witnesses} When \cs{lem} has been % used with the optional argument |ilabel=
)$", "%1") else end -- collect used depth numbers for i in string.gmatch(str, "
") do i = string.match(i, "depth=\"%d\"") i = string.match(i, "%d") if isintable(used_ndivs, i) then else table.insert(used_ndivs, {a = i} ) end end if next(used_ndivs) ~= nil then table.sort(used_ndivs, function(a ,b) return(#a.a > #b.a) end) else end local firstdiv = string.match(str, "
") or "" firstdiv = string.match(firstdiv, "depth%=\"%d\"") or "" firstdiv = string.match(firstdiv, "%d") or "" local lastdiv = string.match(string.reverse(str), ">.-\"%d\"%=htped.- vid<") or "" lastdiv = string.match(lastdiv, "\"%d\"%=htped") or "" lastdiv = string.match(lastdiv, "%d") or "" local firstdivindex = get_a_index(firstdiv, used_ndivs) local lastdivindex = get_a_index(lastdiv, used_ndivs) firstdivindex = tonumber(firstdivindex) lastdivindex = tonumber(lastdivindex) local closedivs = "" if isintable(used_ndivs, firstdiv) then while lastdivindex >= firstdivindex do closedivs = closedivs.."
" lastdivindex = lastdivindex - 1 end end if isdiv then return str..closedivs.."
" else return str..closedivs end end local function close_ndivs_at_end(str) local isdiv = false if string.find(str, "
$") then isdiv = true str = string.gsub(str, "(.*)(
)$", "%1") else end -- collect used div numbers for i in string.gmatch(str, " #b.a) end) else end local firstdiv = string.match(str, "= firstdivindex do closedivs = closedivs.."" lastdivindex = lastdivindex - 1 end end if isdiv then return str..closedivs.."
" else return str..closedivs end end local function close_ekddivs_in_between(str) local maxdepth = 1 for i in string.gmatch(str, "", "%1") do if tonumber(i) > tonumber(maxdepth) then maxdepth = i else end end for ndivi = 1, maxdepth do str = string.gsub(str, "(
]-[Dd]epth%=\")("..ndivi..")(\".->)(.-)(
]-depth%=\")(%d)(\".->)", function(bdivi, ndivi, edivi, between, bdivii, ndivii, edivii) local firstdiv = ndivi local lastdiv = ndivii local firstdivindex = get_a_index(firstdiv, used_ndivs) local lastdivindex = get_a_index(lastdiv, used_ndivs) firstdivindex = tonumber(firstdivindex) lastdivindex = tonumber(lastdivindex) local closedivs = "" if firstdivindex >= lastdivindex then while firstdivindex >= lastdivindex do closedivs = closedivs.."
" firstdivindex = firstdivindex - 1 bdivii = string.gsub(bdivii, "depth", "Depth") end end return string.format("%s%s%s%s%s%s%s%s", bdivi, ndivi, edivi, between, closedivs, bdivii, ndivii, edivii) end) end return str end local function clean_ekddivs(str) str = string.gsub(str, "()", "%1%3") used_ndivs = {} return str end local function close_ndivs_in_between(str) for ndivi = 1, 6 do str = string.gsub(str, "(<[Dd]iv)("..ndivi..")(.->)(.-)()", function(bdivi, ndivi, edivi, between, bdivii, ndivii, edivii) local firstdiv = ndivi local lastdiv = ndivii local firstdivindex = get_a_index(firstdiv, used_ndivs) local lastdivindex = get_a_index(lastdiv, used_ndivs) firstdivindex = tonumber(firstdivindex) lastdivindex = tonumber(lastdivindex) local closedivs = "" if firstdivindex >= lastdivindex then while firstdivindex >= lastdivindex do closedivs = closedivs.."" firstdivindex = firstdivindex - 1 bdivii = string.gsub(bdivii, "div", "Div") end end return string.format("%s%s%s%s%s%s%s%s", bdivi, ndivi, edivi, between, closedivs, bdivii, ndivii, edivii) end) end return str end local function clean_latexdivs(str) str = string.gsub(str, "()", "', "\n") f:write("", "\n") f:write("", "\n") f:write("", "\n") f:write("", "\n") f:write("<!-- Title -->", "\n") f:write("", "\n") f:write("", "\n") f:write("", "\n") f:write("", "\n") f:write("", "\n") f:write("", "\n") f:write("", "\n") f:write("", "\n") f:write("", "\n") if next(listWit) == nil and next(listPerson) == nil then f:write("

No source, born digital

", "\n") else if next(listWit) ~= nil then f:write("", "\n") for i = 1,#listWit do f:write('", "\n") f:write('', textotei(listWit[i].abbr), "", "\n") f:write(textotei(listWit[i].detailsDesc), "\n") f:write("", "\n") if listWit[i].msIdentifier.settlement == "" and listWit[i].msIdentifier.institution == "" and listWit[i].msIdentifier.repository == "" and listWit[i].msIdentifier.collection == "" and listWit[i].msIdentifier.idno == "" and listWit[i].msIdentifier.msName == "" then f:write("", "\n") else f:write("", "\n") if listWit[i].msIdentifier.settlement ~= "" then f:write("", textotei(listWit[i].msIdentifier.settlement), "", "\n") else end if listWit[i].msIdentifier.institution ~= "" then f:write("", textotei(listWit[i].msIdentifier.institution), "", "\n") else end if listWit[i].msIdentifier.repository ~= "" then f:write("", textotei(listWit[i].msIdentifier.repository), "", "\n") else end if listWit[i].msIdentifier.collection ~= "" then f:write("", textotei(listWit[i].msIdentifier.collection), "", "\n") else end if listWit[i].msIdentifier.idno ~= "" then f:write("", textotei(listWit[i].msIdentifier.idno), "", "\n") else end if listWit[i].msIdentifier.msName ~= "" then f:write("", textotei(listWit[i].msIdentifier.msName), "", "\n") else end f:write("", "\n") end if listWit[i].handDesc ~= nil then f:write("", "\n") f:write("", "\n") local j = 1 while listWit[i].handDesc[j] do f:write("", "\n") f:write('', textotei(listWit[i].handDesc[j].abbr), "", "\n") f:write("

", textotei(listWit[i].handDesc[j].detailsDesc), "

", "\n") f:write("
", "\n") j = j + 1 end f:write("
", "\n") f:write("
", "\n") else end if listWit[i].msContents ~= nil then f:write("", "\n") f:write("", "\n") f:write("", textotei(listWit[i].msContents.msItemStruct.locus), "", "\n") f:write("", "\n") f:write("", "\n") end if listWit[i].history ~= nil then f:write("", "\n") f:write("", "\n") f:write("", textotei(listWit[i].history.origin.origDate), "", "\n") f:write("", "\n") f:write("", "\n") end f:write("
", "\n") f:write("
", "\n") end f:write("
", "\n") end if next(listPerson) ~= nil then f:write("", "\n") for i = 1,#listPerson do f:write('", "\n") f:write('', "\n") f:write('', textotei(listPerson[i].abbr), "", "\n") if listPerson[i].persName.name ~= nil then f:write(textotei(listPerson[i].persName.name)) else if listPerson[i].persName.forename ~= "" then f:write("", textotei(listPerson[i].persName.forename), "", "\n") else f:write("", "\n") end if textotei(listPerson[i].persName.surname) ~= "" then f:write("", textotei(listPerson[i].persName.surname), "", "\n") else f:write("", "\n") end if textotei(listPerson[i].persName.addName) ~= "" then f:write("", textotei(listPerson[i].persName.addName), "", "\n") end end if listPerson[i].note ~= "" then f:write("", textotei(listPerson[i].note), "", "\n") end f:write('', "\n") f:write('', "\n") end f:write("", "\n") end end f:write("
", "\n") f:write("
", "\n") f:write("", "\n") f:write('', "\n") f:write("", "\n") f:write("
", "\n") f:write("", "\n") f:write("", "\n") f:close() return true end local tidy = nil local function cleanup_tei() local f = assert(io.open(teifilename.."_tmp.xml", "r")) t = f:read("*a") t = string.gsub(t, "%%s?%", "") t = string.gsub(t, "^\n", "") f:close() local fw = assert(io.open(teifilename.."_tmp.xml", "w")) fw:write(t) fw:close() return true end function ekdosis.closeteistream(opt) local f = io.open(teifilename.."_tmp.xml", "a+") f:write("\n", "", "\n") if xmlbibresource ~= nil then bibf = assert(io.open(xmlbibresource, "r")) t = bibf:read("*a") t = string.gsub(t, "%s+corresp%=%b\"\"", "") t = string.gsub(t, "\n\n", "\n") f:write("", "\n") f:write("", "\n") for i in string.gmatch(t, ".-") do f:write(i, "\n") end f:write("", "\n") f:write("", "\n") bibf:close() else end f:write("", "\n") f:write("
", "\n") f:close() cleanup_tei() os.remove(teifilename..".xml") os.rename(teifilename.."_tmp.xml", teifilename..".xml") if opt == "tidy" then os.execute("tidy -qmi -xml --output-xml yes "..teifilename..".xml") else end return true end function ekdosis.exporttei(str) local f = io.open(teifilename.."_tmp.xml", "a+") -- f:write("\n

") str = textotei(str) f:write(str) f:close() return true end -- end totei functions -- begin basic TeX Conspectus siglorum function ekdosis.basic_cs(msid) local indexwit = getindex(msid, listWit) siglum = listWit[indexwit].abbr -- if listWit[indexwit].detailsDesc == "" -- then -- name = listWit[indexwit].msIdentifier.msName -- else -- name = listWit[indexwit].msIdentifier.msName -- .."\\thinspace\\newline\\bgroup\\footnotesize{}".. -- listWit[indexwit].detailsDesc -- .."\\egroup{}" -- end name = listWit[indexwit].detailsDesc if listWit[indexwit].history ~= nil and listWit[indexwit].history.origin ~= nil then date = listWit[indexwit].history.origin.origDate else date = "" end if listWit[indexwit].msContents ~= nil and listWit[indexwit].msContents.msItemStruct ~= nil then locus = listWit[indexwit].msContents.msItemStruct.locus else locus = "" end return siglum.."&"..name.." "..locus.."&"..date end -- end basic TeX Conspectus siglorum function ekdosis.removesp(str) str = gsub(str, cmd * cmdargs * spcenc^-1, "%1%2") return str end function ekdosis.closestream() os.remove(tex.jobname..".ekd") os.rename(tex.jobname.."_tmp.ekd", tex.jobname..".ekd") return true end local cur_abs_pg = 0 local ekd_abs_pg = 0 local pg_i = nil local pg_ii = nil local prevcol = nil local curcol = "x" local check_resetlineno = {} function ekdosis.update_abspg(n) -- not used cur_abs_pg = n return true end function ekdosis.storeabspg(n, pg) if tonumber(n) > tonumber(cur_abs_pg) then ekd_abs_pg = ekd_abs_pg + 1 end cur_abs_pg = n n = ekd_abs_pg if pg == "pg_i" then pg_i = n elseif pg == "pg_ii" then pg_ii = n table.insert(check_resetlineno, curcol.."-"..pg_ii) end return true end function ekdosis.getekdabspg() return ekd_abs_pg end function ekdosis.checkresetlineno() if isfound(check_resetlineno, curcol.."-"..pg_i) then return "" else return "\\resetlinenumber" end end -- -- Build environments to be aligned -- local cur_alignment = "-" local cur_alignment_patt = "%-" local cur_alignment_cnt = 1 local newalignment = false function ekdosis.newalignment(str) if str == "set" then newalignment = true cur_alignment = "-"..cur_alignment_cnt.."-" cur_alignment_patt = "%-"..cur_alignment_cnt.."%-" cur_alignment_cnt = cur_alignment_cnt + 1 elseif str == "reset" then newalignment = false cur_alignment = "-" cur_alignment_patt = "%-" end return true end local aligned_texts = {} local texts_w_apparatus = {} local coldata_totei = {} local function sanitize_envdata(str) -- look for a better way to achieve this str = string.gsub(str, "(%a+)%s+(%b[])", "%1%2") str = string.gsub(str, "(%a+)(%b[])%s+", "%1%2") str = string.gsub(str, "%s+(%a+)(%b[])", "%1%2") str = gsub(str, lpeg.Cs(letters^1) * spcenc^-1 * -bsqbrackets * lpeg.Cs(";"), "%1[]%2") str = string.gsub(str, "%s+(%a+)(%b[])", "%1%2") return str end function ekdosis.mkenvdata(str, opt) if not string.find(str, "%;", -1) then str = str .. ";" else end -- str = str ..";" -- str = string.gsub(str, "%s+", "") local fieldstart = 1 local col = 0 if opt == "texts" then str = sanitize_envdata(str) repeat local _s, nexti = string.find(str, "%b[]%s-%;", fieldstart) local namediv = string.gsub(string.sub(str, fieldstart, nexti-1), "(%a+)%s-(%b[])", "%1") local attr = string.gsub(string.sub(str, fieldstart, nexti-1), "(%a+)%s-(%b[])", "%2") attr = string.sub(attr, 2, -2) if forbid_xmlid then attr = string.gsub(attr, "xml:id", "n") -- xml:id is not allowed here else end table.insert(aligned_texts, { text = namediv, attribute = attr, column = col }) table.insert(coldata_totei, { environment = namediv, data = {} }) col = col + 1 fieldstart = nexti + 1 until fieldstart > string.len(str) return aligned_texts elseif opt == "apparatus" then repeat local nexti = string.find(str, "%;", fieldstart) table.insert(texts_w_apparatus, string.sub(str, fieldstart, nexti-1)) fieldstart = nexti +1 until fieldstart > string.len(str) return texts_w_apparatus end end -- Reminder: the following two variables are already set above -- local prevcol = nil -- local curcol = "x" function ekdosis.storecurcol(n) curcol = n return true end function ekdosis.flushcolnums() prevcol = nil curcol = "x" return true end function ekdosis.flushenvdata() aligned_texts = {} texts_w_apparatus = {} coldata_totei = {} return true end function ekdosis.storecoldata(nthcol, chunk) local tindex = tonumber(nthcol) + 1 table.insert(coldata_totei[tindex].data, chunk) return true end local environment_div = {} local function build_envdiv(str) if not environment_div[str] then environment_div[str] = 1 else environment_div[str] = environment_div[str] + 1 end local div = "div-"..str.."_"..environment_div[str] if xmlidfound(div) then tex.print("\\unexpanded{\\PackageWarning{ekdosis}{\"" ..div.. "\" already exists as an xml:id. " .. "ekdosis has generated some random id.}}") return "div-"..math.random(1000,9999) elseif not checkxmlid(div) then tex.print("\\unexpanded{\\PackageWarning{ekdosis}{\"" ..div.. "\" is not a valid xml:id. \\MessageBreak " .. "Please pick another id.}}") else table.insert(xmlids, {xmlid = div}) table.sort(xmlids, function(a ,b) return(#a.xmlid > #b.xmlid) end) return div end end function ekdosis.mkenv() local environments = {} for i = 1,#aligned_texts do if isfound(texts_w_apparatus, aligned_texts[i].text) then table.insert(environments, "\\NewDocumentEnvironment{".. aligned_texts[i].text.."}{+b}" .."{\\begin{nthcolumn}{".. aligned_texts[i].column.."}" .."\\csname if@pkg@breakable\\endcsname\\raggedbottom\\fi" .."\\par" .."\\EkdosisColStart" .."\\EkdosisOn#1" .."}{\\EkdosisOff" .."\\EkdosisColStop" .."\\end{nthcolumn}" .."\\csname iftei@export\\endcsname\\luadirect{ekdosis.storecoldata(" .. aligned_texts[i].column ..", \\luastringN{\\par#1\\par})}\\fi" .."}") table.insert(environments, "\\NewDocumentEnvironment{".. aligned_texts[i].text.."*}{+b}" .."{\\begin{nthcolumn*}{".. aligned_texts[i].column.."}[]" .."\\par" .."\\EkdosisColStart" .."\\EkdosisOn#1" .."}{\\EkdosisOff" .."\\EkdosisColStop" .."\\end{nthcolumn*}" .."\\csname iftei@export\\endcsname\\luadirect{ekdosis.storecoldata(" .. aligned_texts[i].column ..", \\luastringN{\\par#1\\par})}\\fi" .."}") else table.insert(environments, "\\NewDocumentEnvironment{".. aligned_texts[i].text.."}{+b}" .."{\\begin{nthcolumn}{".. aligned_texts[i].column.."}" .."\\par" .."#1" .."}{\\end{nthcolumn}" .."\\csname iftei@export\\endcsname\\luadirect{ekdosis.storecoldata(" .. aligned_texts[i].column ..", \\luastringN{\\par#1\\par})}\\fi" .."}") table.insert(environments, "\\NewDocumentEnvironment{".. aligned_texts[i].text.."*}{+b}" .."{\\begin{nthcolumn*}{"..aligned_texts[i].column.."}[]" .."\\par" .."#1" .."}{" .."\\end{nthcolumn*}" .."\\csname iftei@export\\endcsname\\luadirect{ekdosis.storecoldata(" .. aligned_texts[i].column ..", \\luastringN{\\par#1\\par})}\\fi" .."}") end forbid_xmlid = false if aligned_texts[i].attribute ~= "" then ekdosis.newenvtotag(aligned_texts[i].text, "div", "xml:id=\"" ..build_envdiv(aligned_texts[i].text) .."\" " ..aligned_texts[i].attribute) else ekdosis.newenvtotag(aligned_texts[i].text, "div", "xml:id=\"" ..build_envdiv(aligned_texts[i].text) .."\"") end forbid_xmlid = true end str = table.concat(environments) return str end function ekdosis.export_coldata_totei() for i = 1,#coldata_totei do ekdosis.exporttei("\\begin{".. coldata_totei[i].environment .."}" .. table.concat(coldata_totei[i].data) .. "\\end{".. coldata_totei[i].environment .."}") end end -- maxlines -- local localmaxlines = nil function ekdosis.resetlocalmaxlines() localmaxlines = nil return "\\setcounter{ekd@locallnperpage}{0}" end function ekdosis.setlocalmaxlines(n) n = tonumber(n) if math.type(n) == "integer" then localmaxlines = n end return "\\setcounter{ekd@locallnperpage}{1}" end function ekdosis.addtomaxlines(ni, nii) ni = tonumber(ni) nii = tonumber(nii) if math.type(ni) == "integer" and math.type(nii) == "integer" then localmaxlines = ni + nii end return "\\setcounter{ekd@locallnperpage}{1}" end function ekdosis.getlocalmaxlines() if localmaxlines then return localmaxlines end end -- apparatus height -- local appheightchanged = false function ekdosis.changeappheight() appheightchanged = true end function ekdosis.setheightandprintapparatus() if appheightchanged == true then appheightchanged = false return "\\csname ekd@insert@fitapparatus@tmpheight\\endcsname" else return "\\csname ekd@insert@fitapparatus\\endcsname" end end -- handle multiple layers in apparatuses -- local apparatuses = {} local bagunits = {} local glimit = nil local gunits = 0 function ekdosis.newapparatus(teitype, appdir, apprule, appdelim, appsep, appsubsep, appbhook, appehook, applimit, applang, appnotelang) if isintable(apparatuses, teitype) then tex.print("\\unexpanded{\\PackageWarning{ekdosis}{\"" ..teitype.. "\" already exists.}}") else table.insert(apparatuses, {a = teitype, direction = appdir, rule = apprule, delim = appdelim, sep = appsep, subsep = appsubsep, bhook = appbhook, ehook = appehook, limit = applimit, lang = applang, notelang = appnotelang}) end bagunits[teitype] = 1 return true end function ekdosis.getapplang(teitype) i = get_a_index(teitype, apparatuses) if apparatuses[i].lang ~= "" then return apparatuses[i].lang else return "\\languagename" end end function ekdosis.getappnotelang(teitype) i = get_a_index(teitype, apparatuses) if apparatuses[i].notelang ~= "" then return apparatuses[i].notelang else return "\\languagename" end end function ekdosis.getappdelim(str) for i = 1,#apparatuses do if apparatuses[i].a == str then delimfound = apparatuses[i].delim break end end return delimfound end function ekdosis.get_bagunits(teitype) return bagunits[teitype] end local function getapplimit(teitype) for i = 1,#apparatuses do if apparatuses[i].a == teitype then limitfound = apparatuses[i].limit break end end if tonumber(limitfound) ~= nil then if tonumber(limitfound) < 10 then return 0 else return limitfound end else return 0 end end function ekdosis.limit_bagunits(teitype) local limit = tonumber(getapplimit(teitype)) if glimit then glimit = tonumber(glimit) gunits = tonumber(gunits) if glimit >= 10 and gunits >= glimit then bagunits[teitype] = 2 gunits = 0 return "\\pagebreak" else if limit >= 10 and bagunits[teitype] >= limit then bagunits[teitype] = 2 gunits = 0 return "\\pagebreak" else return "" end end else if limit >= 10 and bagunits[teitype] >= limit then bagunits[teitype] = 2 gunits = 1 return "\\pagebreak" else return "" end end end function ekdosis.addto_bagunits(teitype, n) n = tonumber(n) if glimit then gunits = gunits - n end if tonumber(getapplimit(teitype)) ~= 0 then bagunits[teitype] = bagunits[teitype] - n end end function ekdosis.increment_bagunits(teitype) if glimit then gunits = gunits + 1 end bagunits[teitype] = (bagunits[teitype] or 0) + 1 end function ekdosis.setglimit(n) if math.tointeger(n) then glimit = math.tointeger(math.abs(n)) else glimit = nil end end local function reset_bagunits() if glimit then gunits = 0 end for i = 1,#apparatuses do bagunits[apparatuses[i].a] = 1 end end function ekdosis.appin(str, teitype) local f = io.open(tex.jobname.."_tmp.ekd", "a+") if next(apparatuses) == nil then f:write("<", ekd_abs_pg, cur_alignment, curcol, "-0>", str, "\n") else for i = 1,#apparatuses do if apparatuses[i].a == teitype then appno = i break end end f:write("<", ekd_abs_pg, cur_alignment, curcol, "-", appno, ">", str, "\n") end f:close() return true end function ekdosis.appout() local file = io.open(tex.jobname..".ekd", "r") if file ~= nil then io.close(file) f = assert(io.open(tex.jobname..".ekd", "r")) t = f:read("*a") local output = {} if next(apparatuses) == nil then -- table.insert(output, "BEGIN") table.insert(output, "\\csname ekd@default@rule\\endcsname\\NLS") table.insert(output, "\\csname ekd@begin@apparatus\\endcsname\\ignorespaces") -- table.insert(output, "\\noindent ") for i in string.gmatch(t, "<"..ekd_abs_pg ..cur_alignment_patt ..curcol.."%-0>.-") do table.insert(output, i) end -- table.insert(output, "END") else local appinserted = false local n = 1 while apparatuses[n] do if string.match(t, "<"..ekd_abs_pg ..cur_alignment_patt ..curcol.."%-"..n..">.-") then -- table.insert(output, "BEGIN") table.insert(output, "\\bgroup{}") if apparatuses[n].direction == "LR" then table.insert(output, "\\pardir TLT\\leavevmode\\textdir TLT{}") elseif apparatuses[n].direction == "RL" then table.insert(output, "\\pardir TRT\\leavevmode\\textdir TRT{}") end if apparatuses[n].rule == "none" then if n > 1 then if appinserted then table.insert(output, "\\NLS{}") end else table.insert(output, "\\noindent ") end elseif apparatuses[n].rule ~= "" then if n > 1 then if appinserted then table.insert(output, "\\NLS{}" .. apparatuses[n].rule .. "\\NLS{}") else table.insert(output, apparatuses[n].rule .. "\\NLS{}") end else -- table.insert(output, "\\noindent ") table.insert(output, apparatuses[n].rule .. "\\NLS{}") end else if n > 1 then if appinserted then table.insert(output, "\\NLS\\csname ekd@default@rule\\endcsname\\NLS{}") else table.insert(output, "\\csname ekd@default@rule\\endcsname\\NLS{}") end else -- table.insert(output, "\\noindent ") table.insert(output, "\\csname ekd@default@rule\\endcsname\\NLS{}") end end if apparatuses[n].sep ~= "" then table.insert(output, "\\def\\ekdsep{" .. apparatuses[n].sep .. "}") else end if apparatuses[n].subsep ~= "" then table.insert(output, "\\def\\ekdsubsep{" .. apparatuses[n].subsep .. "}") end if apparatuses[n].bhook ~= "" then table.insert(output, apparatuses[n].bhook) else table.insert(output, "\\relax") end for i in string.gmatch(t, "<"..ekd_abs_pg ..cur_alignment_patt ..curcol.."%-"..n..">.-") do table.insert(output, i) appinserted = true end if apparatuses[n].ehook ~= "" then table.insert(output, apparatuses[n].ehook) else end table.insert(output, "\\egroup{}") -- table.insert(output, "END") end n = n + 1 end end f:close() str = table.concat(output) str = string.gsub(str, "", "") str = string.gsub(str, "<"..ekd_abs_pg..cur_alignment_patt..curcol.."%-[0-9]>", " ") return str else end end function ekdosis.appin_out(str, nl) local f = io.open(tex.jobname.."_tmp.ekd", "a+") if nl == "yes" then f:write(str, "\n") else f:write(str) end f:close() return true end local curcol_curabspg = {} function ekdosis.testapparatus() if isfound(curcol_curabspg, curcol.."-"..ekd_abs_pg) then if newalignment then if next(apparatuses) ~= nil then reset_bagunits() end newalignment = false return "\\booltrue{do@app}" else return "\\boolfalse{do@app}" end else table.insert(curcol_curabspg, curcol.."-"..ekd_abs_pg) if next(apparatuses) ~= nil then reset_bagunits() end newalignment = false return "\\booltrue{do@app}" end end local function get_ln_prefix(x, y) for index = 1, string.len(x) do if string.sub(x, index, index) ~= string.sub(y, index, index) then return string.sub(x, 1, index - 1) end end end function ekdosis.numrange(x, y) xstr = tostring(x) ystr = tostring(y) if x == y -- which will never apply then return "\\LRnum{" .. xstr .. "}" elseif string.len(xstr) ~= string.len(ystr) then return "\\LRnum{" .. xstr .. "}--\\LRnum{" .. ystr .. "}" else common = get_ln_prefix(xstr, ystr) if string.len(common) == 0 then return "\\LRnum{" .. xstr .. "}--\\LRnum{" .. ystr .. "}" elseif string.sub(xstr, -2, -2) == "1" then return "\\LRnum{" .. string.sub(common, 1, -2) .. string.sub(xstr, string.len(common), -1) .. "}--\\LRnum{" .. string.sub(ystr, string.len(common), -1) .. "}" else return "\\LRnum{" .. string.sub(common, 1, -1) .. string.sub(xstr, string.len(common) + 1, -1) .. "}--\\LRnum{" .. string.sub(ystr, string.len(common) + 1, -1) .. "}" end end end local lnlabs = {} local lnlab_salt = 0 local current_lnlab = nil local prev_lnlab = nil local prev_prev_lnlab = nil local indexed_labs = {} local notelabs = {} local current_notelab = nil local prev_notelab = nil local current_lemma = nil local salt = 0 local function mdvisintable(table, value) for _, v in pairs(table) do if v == value then return true end end return false end function ekdosis.dolnlab(str, indexlab) if prev_lnlab ~= nil then prev_prev_lnlab = prev_lnlab end prev_lnlab = current_lnlab current_lemma = str i = md5.sumhexa(str) if not mdvisintable(lnlabs, i) then table.insert(lnlabs, i) if indexlab ~= nil then indexed_labs[indexlab] = i end else i = i..salt table.insert(lnlabs, i) if indexlab ~= nil then indexed_labs[indexlab] = i end salt = salt + 1 end current_lnlab = i return true end function ekdosis.getlnlab() return current_lnlab end function ekdosis.getprevlnlab() return prev_lnlab end function ekdosis.getprevprevlnlab() return prev_prev_lnlab end function ekdosis.getindexedlab(str) if indexed_labs[str] == nil then return "\\csname ekd@wrong@ilabel\\endcsname" else return "\\linelabel{" .. indexed_labs[str] .. "-e}" end end function ekdosis.setnotelab(str) current_notelab = str if isfound(notelabs, current_notelab) then return "" else table.insert(notelabs, current_notelab) return "\\linelabel{" .. current_notelab .. "}" end end function ekdosis.getnotelab() return current_notelab end function ekdosis.setprevnotelab(str) prev_notelab = str return true end function ekdosis.getprevnotelab() return prev_notelab end local cmdstorm = lpeg.P(lpeg.P("note") + lpeg.P("milestone") + lpeg.P("linelabel") + lpeg.P("ilabel") + lpeg.P("index")) local function remove_from_app(str) str = gsub(str, dblbkslash * cmdstorm * cmdargs, "") return str end function ekdosis.mdvappend(str, teitype, ilabel) if current_lemma == "" then current_lemma = "\\ekdunspace" end local labelbegin = "\\linelabel{" .. current_lnlab .. "-b}\\wordboundary{}" local labelend = "\\linelabel{" .. current_lnlab .. "-e}" if ilabel ~= nil then labelend = "" end if teitype == nil then return labelbegin .. current_lemma .. labelend .. "\\csname append@app\\endcsname{" .. remove_from_app(str) .. "}" else return labelbegin .. current_lemma .. labelend .. "\\csname append@app\\endcsname" .. "[" .. teitype .. "]{" .. remove_from_app(str) .. "}" end end % \end{ekdlua} % \end{comment} % \iffalse % % \fi % \endinput