aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ekdosis.dtx215
1 files changed, 202 insertions, 13 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx
index 030fd8c..0d3ce2b 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -124,6 +124,10 @@ along with this program. If not, see
124\end{filecontents} 124\end{filecontents}
125\begin{filecontents}[overwrite]{\jobname-cfg.tex} 125\begin{filecontents}[overwrite]{\jobname-cfg.tex}
126\footnotelayout{m} 126\footnotelayout{m}
127\DeclareApparatus{fontium}[
128 delim=\hskip0.75em,
129 bhook=\textbf{Sources:},
130 ehook=.]
127\DeclareApparatus{default}[ 131\DeclareApparatus{default}[
128 delim=\hskip0.75em, 132 delim=\hskip0.75em,
129 ehook=.] 133 ehook=.]
@@ -1818,18 +1822,17 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
1818% \cs{SetBeginApparatus}\marg{characters\textbar commands} can be used 1822% \cs{SetBeginApparatus}\marg{characters\textbar commands} can be used
1819% to append \meta{characters} or \meta{commands} at the beginning of 1823% to append \meta{characters} or \meta{commands} at the beginning of
1820% the apparatus block. By default, nothing is appended. For instance, 1824% the apparatus block. By default, nothing is appended. For instance,
1821% \mintinline{latex}|\SetBeginApparatus{\textbf{Apparatus:}}| will 1825% |\SetBeginApparatus{\textbf{Apparatus:}}| will append
1822% append \enquote{\textbf{Apparatus:}} at the beginning of the 1826% \enquote{\textbf{Apparatus:}} at the beginning of the apparatus
1823% apparatus block, while % 1827% block, while |\SetBeginApparatus{\hskip 1em}| will set an
1824% \mintinline{latex}|\SetBeginApparatus{\hskip 1em}| will set an
1825% indentation of one em. 1828% indentation of one em.
1826% 1829%
1827% \DescribeMacro{\SetEndApparatus} 1830% \DescribeMacro{\SetEndApparatus}
1828% \cs{SetEndApparatus}\marg{characters} can be used to append 1831% \cs{SetEndApparatus}\marg{characters} can be used to append
1829% \meta{characters} at the end of the apparatus block. By default, 1832% \meta{characters} at the end of the apparatus block. By default,
1830% nothing is appended. As an example of use, 1833% nothing is appended. As an example of use, |\SetEndApparatus{.}|
1831% \mintinline{latex}|\SetEndApparatus{.}| will have a period printed 1834% will have a period printed at the end of the apparatus as it is
1832% at the end of the apparatus as it is customary in some editions. 1835% customary in some editions.
1833% 1836%
1834% \DescribeMacro{\SetUnitDelimiter} 1837% \DescribeMacro{\SetUnitDelimiter}
1835% \cs{SetUnitDelimiter}\marg{delimiter} can be used to set the 1838% \cs{SetUnitDelimiter}\marg{delimiter} can be used to set the
@@ -2095,11 +2098,11 @@ Some \app[type=rec2]{
2095% 2098%
2096% \subsection{Other Notes, Comments, Sources, Testimonia} 2099% \subsection{Other Notes, Comments, Sources, Testimonia}
2097% \label{ref:type-note} 2100% \label{ref:type-note}
2098% Additional layers of notes may be used to print short comments or to 2101% Additional layers of notes can be used to print short comments or to
2099% record references to texts quoted by the author of the edited text 2102% record references to texts quoted by the author of the edited text
2100% or references to the edited text by other authors or 2103% or references to the edited text by other authors or
2101% translators. The former is called an \emph{apparatus fontium} while 2104% translators. The former set is called an \emph{apparatus fontium}
2102% the latter is called an \emph{apparatus testium}. 2105% while the latter is called an \emph{apparatus testium}.
2103% 2106%
2104% \danger From a technical standpoint, these notes are very different 2107% \danger From a technical standpoint, these notes are very different
2105% from the short editorial notes inserted between lemma texts and 2108% from the short editorial notes inserted between lemma texts and
@@ -2116,7 +2119,188 @@ Some \app[type=rec2]{
2116% to \cs{note} are ignored. 2119% to \cs{note} are ignored.
2117% 2120%
2118% \DescribeMacro{\note} \cs{note}\oarg{options}\marg{text}\\ 2121% \DescribeMacro{\note} \cs{note}\oarg{options}\marg{text}\\
2119% As said above, \cs{note} when found outside \cs{app}|{}|, 2122% As said above, \cs{note}, when found outside \cs{app}|{}|, is used
2123% to insert in additional layers of the apparatus short comments or
2124% references to texts quoted or cited in the edition text. It accepts
2125% the following comma-separated list of |key-value| optional
2126% arguments:---\\
2127% \DescribeOption{type} |type|$=$\meta{type}\\
2128% |type| is used to specify the name of the layer where the note is to
2129% be printed.\footnote{See \vref{sec:declaring-layers} to learn how to
2130% declare and lay out new layers of notes.}\\
2131% \DescribeOption{sep} |sep|$=$\meta{csname \textbar\ chars}\\
2132% The separator between the lemma text and the contents of the note.\\
2133% \DescribeOption{nosep} |nosep|$=$\verb+true|false+\\
2134% This named argument does not need a value as it defaults to |true|
2135% if it is used. Obviously, |nosep| removes the separator mentioned
2136% above.\\
2137% \DescribeOption{lem} |lem|$=$\meta{lemma text}\\
2138% |lem| is the span of text the note is about. It may consist of one
2139% or more words, or of an abbreviated lemma text.\\
2140% \DescribeOption{labelb} |labelb|$=$\meta{label}
2141% \hfill\tcboxverb{Mandatory}\\
2142% |labelb| is the unique label to serve as a reference for the point
2143% immediately preceding the lemma text. \danger |labelb| is used by
2144% \pkg{ekdosis} to print the line numbers in the apparatus criticus
2145% and to set the |left()| XPointer should \texttt{TEI} output be
2146% required. Therefore, it must be
2147% specified. Otherwise, \pkg{ekdosis} will issue an error message.\\
2148% \DescribeOption{labele} |labele|$=$\meta{label}\\
2149% |labele| is the unique label to serve as a reference for the point
2150% immediately following the lemma text. Contrary to |labelb|, |labele|
2151% may be left unspecified if the note is only about one word. If it is
2152% about a span, then |labele| ought to be specified.\\
2153% \DescribeMacro{\linelabel} \cs{linelabel}\marg{label}\\
2154% If |labele|$=$\meta{some\_label} be specified in the optional
2155% argument of \cs{note}, \cs{linelabel}\marg{some\allowbreak\_label}
2156% must be inserted immediately after the lemma text so that
2157% \pkg{ekdosis} can locate the exact point where the lemma text
2158% addressed by the note ends, like so:---
2159%
2160% \iffalse
2161%<*example>
2162% \fi
2163\begin{minted}[linenos=false]{latex}
2164% Preamble:
2165% \DeclareApparatus{fontium}[
2166% delim=\hskip0.75em,
2167% bhook=\textbf{Sources:},
2168% ehook=.]
2169% \DeclareApparatus{default}[
2170% delim=\hskip0.75em,
2171% ehook=.]
2172% Document:
2173\begin{ekdosis}
2174 The oldest monument of the Germans is their language, which, before
2175 untold centuries, was the companion of their travels from central
2176 Asia; a language, copious, elastic, inviting self-explaining
2177 combinations and independent development; lending itself alike to
2178 daily life and imagination, to description and abstract thought.
2179 \note[type=fontium, labelb=61e, labele=62a, lem={They
2180 had... slave}]{Waitz, \emph{Deutsche Verfassungs Geschichte},
2181 i. 86} They had a class of nobles, but their tongue knew no word
2182 for slave.\linelabel{62a}\footnote{George Bancroft, \emph{History of
2183 the United States from the Discovery of the American Continent},
2184 II.61--2.}
2185\end{ekdosis}
2186\end{minted}
2187% \iffalse
2188%</example>
2189% \fi
2190%
2191% PDF output:---
2192% \medskip
2193% \resetlinenumber
2194% \begin{alignment}[tcols=1,texts=specimen,apparatus=specimen]
2195% \begin{specimen}
2196% The oldest monument of the Germans is their language, which,
2197% before untold centuries, was the companion of their travels from
2198% central Asia; a language, copious, elastic, inviting
2199% self-explaining combinations and independent development;
2200% lending itself alike to daily life and imagination, to
2201% description and abstract thought. \note[type=fontium,
2202% labelb=61e, labele=62a, lem={They had... slave}]{Waitz,
2203% \emph{Deutsche Verfassungs Geschichte}, i. 86} They had a class
2204% of nobles, but their tongue knew no word for
2205% slave.\linelabel{62a}\footnote{George Bancroft, \emph{History of
2206% the United States from the Discovery of the American Continent},
2207% II.61--2.}
2208% \end{specimen}
2209% \end{alignment}
2210%
2211% \texttt{TEI xml} output:---
2212%
2213% \iffalse
2214%<*example>
2215% \fi
2216\begin{minted}[linenos=false]{xml}
2217<p>The oldest monument of the Germans is their language,
2218which, before untold centuries, was the companion of their
2219travels from central Asia; a language, copious, elastic,
2220inviting self-explaining combinations and independent
2221development; lending itself alike to daily life and
2222imagination, to description and abstract thought.
2223<note type="fontium" target="#range(right(61e),left(62a))">Waitz,
2224<emph>Deutsche Verfassungs Geschichte</emph>, i. 86</note>
2225<anchor xml:id="61e" />They had a class of nobles, but
2226their tongue knew no word for slave.
2227<anchor xml:id="#62a" />
2228<note place="bottom">George Bancroft,
2229<emph>History of the United States from the Discovery of
2230the American Continent</emph>, II.61--2.</note></p>
2231\end{minted}
2232% \iffalse
2233%</example>
2234% \fi
2235%
2236% \paragraph{\cs{note} or \cs{linelabel} inside \cs{lem}}
2237% It may happen that \cs{note} or \cs{linelabel} commands be found
2238% inside the argument of \cs{lem}. Obviously, inserting such commands
2239% in the apparatus criticus in print makes no sense and will lead to
2240% an error. The solution is to insert in the value of the |alt|
2241% optional argument of \cs{lem} a duplicate of the lemma text devoid
2242% of those commands, like so:---
2243%
2244% \iffalse
2245%<*example>
2246% \fi
2247\begin{minted}[linenos=false]{latex}
2248This is some \app{
2249 \lem[alt=dummy]{\note[type=fontium, labelb=bnote, labele=enote,
2250 lem=dummy... command]{Text of the note}
2251 dummy}
2252 \rdg{pseudo}}
2253text to demonstrate how to insert a note in the argument of the
2254\emph{lem} command.\linelabel{enote}
2255\end{minted}
2256% \iffalse
2257%</example>
2258% \fi
2259%
2260% PDF output:---
2261% \medskip
2262% \resetlinenumber
2263% \begin{alignment}[flush,tcols=1,texts=specimen,apparatus=specimen]
2264% \begin{specimen}
2265% This is some \app{
2266% \lem[alt=dummy]{\note[type=fontium, labelb=bnote, labele=enote,
2267% lem=dummy... command]{Text of the note}
2268% dummy}
2269% \rdg{pseudo}}
2270% text to demonstrate how to insert a note in the argument of the
2271% \emph{lem} command.\linelabel{enote}
2272% \end{specimen}
2273% \end{alignment}
2274%
2275% \texttt{TEI xml} output:---
2276%
2277% \iffalse
2278%<*example>
2279% \fi
2280\begin{minted}{xml}
2281<p>This is some
2282<app>
2283 <lem>
2284 <anchor xml:id="bnote" />dummy</lem>
2285 <note type="fontium"
2286 target="#range(right(bnote),left(enote))">Text of the
2287 note</note>
2288 <rdg>pseudo</rdg>
2289</app>text to demonstrate how to insert a note in the
2290argument of the
2291<emph>lem</emph>command.
2292<anchor xml:id="#enote" /></p>
2293\end{minted}
2294% \iffalse
2295%</example>
2296% \fi
2297%
2298% As can be seen from the \texttt{TEI xml} output above, the span of
2299% text the note is about has been carefully delimited by two anchors
2300% (ll.~4 and 12), the first of which falls within |<lem>| (l.~4), but
2301% \pkg{ekdosis} has taken care of moving the note itself out of this
2302% element (ll.~5--7). Otherwise, the \texttt{TEI} output would not be
2303% valid.
2120% 2304%
2121% \section{To Be Continued...} 2305% \section{To Be Continued...}
2122% v1.0 of \pkg{ekdosis}, which should be available by the end of July 2306% v1.0 of \pkg{ekdosis}, which should be available by the end of July
@@ -3707,6 +3891,7 @@ Some \app[type=rec2]{
3707 code labelb = \def\ekdn@labelb{#1}, 3891 code labelb = \def\ekdn@labelb{#1},
3708 code labele = \def\ekdn@labele{#1}, 3892 code labele = \def\ekdn@labele{#1},
3709 store sep = \ekdn@sep, 3893 store sep = \ekdn@sep,
3894 bool nosep = \ifekdn@nosep,
3710 initial type = default, 3895 initial type = default,
3711 initial sep = \ekdsep 3896 initial sep = \ekdsep
3712} 3897}
@@ -3755,7 +3940,9 @@ Some \app[type=rec2]{
3755 \current@ref@arg{\ekdn@labelb}{\ekdn@labele}%\hskip .25em 3940 \current@ref@arg{\ekdn@labelb}{\ekdn@labele}%\hskip .25em
3756 \ifdefined\ekdn@lem% 3941 \ifdefined\ekdn@lem%
3757 {\textdir TRT\unexpanded\expandafter{\ekdn@lem}}% 3942 {\textdir TRT\unexpanded\expandafter{\ekdn@lem}}%
3758 \unexpanded\expandafter{\ekdn@sep}\else\fi% 3943 \unless\ifekdn@nosep
3944 \unexpanded\expandafter{\ekdn@sep}\fi
3945 \else\fi%
3759 {\textdir TRT\unexpanded{#2}}}}% 3946 {\textdir TRT\unexpanded{#2}}}}%
3760 {\edef\note@contents{% 3947 {\edef\note@contents{%
3761 % \hskip .75em 3948 % \hskip .75em
@@ -3771,7 +3958,9 @@ Some \app[type=rec2]{
3771 {\noexpand\selectlanguage{\languagename}% 3958 {\noexpand\selectlanguage{\languagename}%
3772 \unexpanded\expandafter{\ekdn@lem}}% 3959 \unexpanded\expandafter{\ekdn@lem}}%
3773 {\unexpanded\expandafter{\ekdn@lem}}% 3960 {\unexpanded\expandafter{\ekdn@lem}}%
3774 \unexpanded\expandafter{\ekdn@sep}\else\fi% 3961 \unless\ifekdn@nosep
3962 \unexpanded\expandafter{\ekdn@sep}\fi
3963 \else\fi%
3775 \ltx@ifpackageloaded{babel}% 3964 \ltx@ifpackageloaded{babel}%
3776 {{\noexpand\selectlanguage{\languagename}\unexpanded{#2}}}{% 3965 {{\noexpand\selectlanguage{\languagename}\unexpanded{#2}}}{%
3777 {\unexpanded{#2}}}}}% 3966 {\unexpanded{#2}}}}}%