diff options
Diffstat (limited to 'ekdosis.dtx')
-rw-r--r-- | ekdosis.dtx | 66 |
1 files changed, 56 insertions, 10 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx index 6b3d97d..f0dc576 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx | |||
@@ -1111,7 +1111,8 @@ yesterday. | |||
1111 | % the edition text and as the first part of a new entry in the | 1111 | % the edition text and as the first part of a new entry in the |
1112 | % apparatus criticus, preceded by the line number where it occurs or a | 1112 | % apparatus criticus, preceded by the line number where it occurs or a |
1113 | % broad space if the entry refers to the same line as the preceding | 1113 | % broad space if the entry refers to the same line as the preceding |
1114 | % entry. The optional argument of \cs{lem} accepts the following | 1114 | % entry. \dummy\label{ref:lem-opts-b}The optional argument of \cs{lem} |
1115 | % accepts the following | ||
1115 | % comma-separated list of \enquote{name$=$value} arguments:---\\ | 1116 | % comma-separated list of \enquote{name$=$value} arguments:---\\ |
1116 | % \DescribeOption{wit} |wit|$=$\meta{csv list of witnesses}\\ | 1117 | % \DescribeOption{wit} |wit|$=$\meta{csv list of witnesses}\\ |
1117 | % While a single witness may be recorded as in |wit=A|, | 1118 | % While a single witness may be recorded as in |wit=A|, |
@@ -1120,12 +1121,11 @@ yesterday. | |||
1120 | % |wit={A,B,C}|. \dummy\label{ref:mss-sep-families}It must be noted | 1121 | % |wit={A,B,C}|. \dummy\label{ref:mss-sep-families}It must be noted |
1121 | % that witnesses can be grouped by using spaces as separators, like | 1122 | % that witnesses can be grouped by using spaces as separators, like |
1122 | % so: \verb*|wit={A,B,C, D,E,F}|.\\ | 1123 | % so: \verb*|wit={A,B,C, D,E,F}|.\\ |
1123 | % \label{ref:lem-opts-b} | ||
1124 | % \DescribeOption{alt} |alt|$=$\meta{alternate lemma}\\ | 1124 | % \DescribeOption{alt} |alt|$=$\meta{alternate lemma}\\ |
1125 | % While the mandatory argument of \cs{lem}, \meta{lemma text}, is | 1125 | % While the mandatory argument of \cs{lem}, \meta{lemma text}, is |
1126 | % always used to print the edition text in the upper part of the page, | 1126 | % always used to print the edition text in the upper part of the page, |
1127 | % \meta{alternate lemma}, if specified, supersedes what is printed in | 1127 | % \meta{alternate lemma}, if specified, supersedes what is printed in |
1128 | % the related unit of the apparatus criticus. This mechanism is useful | 1128 | % the related entry of the apparatus criticus. This mechanism is useful |
1129 | % in more than one respect. For instance, it can be used to insert | 1129 | % in more than one respect. For instance, it can be used to insert |
1130 | % abbreviated lemmata in the apparatus criticus, or to introduce an | 1130 | % abbreviated lemmata in the apparatus criticus, or to introduce an |
1131 | % alternate way of writing entries with Latin technical terms in the | 1131 | % alternate way of writing entries with Latin technical terms in the |
@@ -2114,12 +2114,12 @@ yesterday. | |||
2114 | % \begin{macrocode} | 2114 | % \begin{macrocode} |
2115 | \RequirePackage{iftex} | 2115 | \RequirePackage{iftex} |
2116 | % \end{macrocode} | 2116 | % \end{macrocode} |
2117 | % \pkg{ekdosis} requires {\LuaLaTeX} of course. Issue an error | 2117 | % Of course, \pkg{ekdosis} requires {\LuaLaTeX}. Issue an error |
2118 | % if the document is processed with another engine. | 2118 | % if the document is processed with another engine. |
2119 | % \begin{macrocode} | 2119 | % \begin{macrocode} |
2120 | \RequireLuaTeX | 2120 | \RequireLuaTeX |
2121 | % \end{macrocode} | 2121 | % \end{macrocode} |
2122 | % Packages that are required by \pkg{ekdosis}: | 2122 | % Set global options:--- |
2123 | % \begin{macrocode} | 2123 | % \begin{macrocode} |
2124 | \RequirePackage{xkeyval} | 2124 | \RequirePackage{xkeyval} |
2125 | \newif\if@pkg@float | 2125 | \newif\if@pkg@float |
@@ -2173,6 +2173,9 @@ yesterday. | |||
2173 | \else\fi\fi\fi} | 2173 | \else\fi\fi\fi} |
2174 | \ExecuteOptionsX{layout,divs} | 2174 | \ExecuteOptionsX{layout,divs} |
2175 | \ProcessOptionsX\relax | 2175 | \ProcessOptionsX\relax |
2176 | % \end{macrocode} | ||
2177 | % Packages that are required by \pkg{ekdosis}:--- | ||
2178 | % \begin{macrocode} | ||
2176 | \RequirePackage{luacode} | 2179 | \RequirePackage{luacode} |
2177 | \RequirePackage{paracol} | 2180 | \RequirePackage{paracol} |
2178 | \RequirePackage{expkv-def} | 2181 | \RequirePackage{expkv-def} |
@@ -2187,7 +2190,7 @@ yesterday. | |||
2187 | \RequirePackage{parnotes} | 2190 | \RequirePackage{parnotes} |
2188 | \fi | 2191 | \fi |
2189 | % \end{macrocode} | 2192 | % \end{macrocode} |
2190 | % Here begins the real work: load |ekdosis.lua|: | 2193 | % Here begins the real work: load |ekdosis.lua|:--- |
2191 | % \begin{macrocode} | 2194 | % \begin{macrocode} |
2192 | \luadirect{dofile(kpse.find_file("ekdosis.lua"))} | 2195 | \luadirect{dofile(kpse.find_file("ekdosis.lua"))} |
2193 | % \end{macrocode} | 2196 | % \end{macrocode} |
@@ -2196,11 +2199,14 @@ yesterday. | |||
2196 | \luadirect{ekdosis.closestream()} | 2199 | \luadirect{ekdosis.closestream()} |
2197 | } | 2200 | } |
2198 | % \end{macrocode} | 2201 | % \end{macrocode} |
2199 | % General settings | 2202 | % General settings:--- |
2200 | % \begin{macrocode} | 2203 | % \begin{macrocode} |
2201 | \renewcommand\linenumberfont{\normalfont\footnotesize} | 2204 | \renewcommand\linenumberfont{\normalfont\footnotesize} |
2202 | % \end{macrocode} | 2205 | % \end{macrocode} |
2203 | % Hooks | 2206 | % \begin{macro}{\SetEkdosisHooks} \cs{SetEkdosisHooks} is used to set |
2207 | % hooks meant to be shared by all declared apparatuses, such as the | ||
2208 | % font size, the format of numerals, \emph{\&c.} This command can be | ||
2209 | % used in the preamble or at any point of the document. | ||
2204 | % \begin{macrocode} | 2210 | % \begin{macrocode} |
2205 | \ekvdefinekeys{ekd@hooks}{ | 2211 | \ekvdefinekeys{ekd@hooks}{ |
2206 | store appfontsize = \ekd@appfontsize, | 2212 | store appfontsize = \ekd@appfontsize, |
@@ -2212,7 +2218,8 @@ yesterday. | |||
2212 | } | 2218 | } |
2213 | \NewDocumentCommand{\SetEkdosisHooks}{m}{\ekvset{ekd@hooks}{#1}} | 2219 | \NewDocumentCommand{\SetEkdosisHooks}{m}{\ekvset{ekd@hooks}{#1}} |
2214 | % \end{macrocode} | 2220 | % \end{macrocode} |
2215 | % Build and process the list of witnesses and hands. | 2221 | % \end{macro} |
2222 | % Build and process the list of witnesses and hands:--- | ||
2216 | % \begin{macrocode} | 2223 | % \begin{macrocode} |
2217 | \ekvdefinekeys{ekd@witness}{ | 2224 | \ekvdefinekeys{ekd@witness}{ |
2218 | store settlement = \settlement@value, | 2225 | store settlement = \settlement@value, |
@@ -2223,6 +2230,14 @@ yesterday. | |||
2223 | store msName = \msName@value, | 2230 | store msName = \msName@value, |
2224 | store origDate = \origDate@value | 2231 | store origDate = \origDate@value |
2225 | } | 2232 | } |
2233 | % \end{macrocode} | ||
2234 | % \begin{macro}{\DeclareWitness} \cs{DeclareWitness} is a | ||
2235 | % preamble-only command. It takes three mandatory arguments and one | ||
2236 | % optional argument. It is meant to collect data related to | ||
2237 | % witnesses to be used in the edition text. Data are stored in |Lua| | ||
2238 | % tables and are used to encode the |<listWit>| part of the |TEI| | ||
2239 | % header as well as the Conspectus Siglorum in the edition in print. | ||
2240 | % \begin{macrocode} | ||
2226 | \NewDocumentCommand{\DeclareWitness}{m m m O{}}{% | 2241 | \NewDocumentCommand{\DeclareWitness}{m m m O{}}{% |
2227 | \bgroup | 2242 | \bgroup |
2228 | \ekvset{ekd@witness}{#4} | 2243 | \ekvset{ekd@witness}{#4} |
@@ -2240,6 +2255,15 @@ yesterday. | |||
2240 | \egroup | 2255 | \egroup |
2241 | } | 2256 | } |
2242 | \@onlypreamble\DeclareWitness | 2257 | \@onlypreamble\DeclareWitness |
2258 | % \end{macrocode} | ||
2259 | % \end{macro} | ||
2260 | % \begin{macro}{\DeclareHand} As \cs{DeclareWitness}, \cs{DeclareHand} | ||
2261 | % is a preamble-only command meant to collect data and store them in | ||
2262 | % |Lua| tables. It takes three mandatory arguments and one optional | ||
2263 | % argument. The second argument is used to connect the hand to a | ||
2264 | % declared witness it is related to. Then the table in which this | ||
2265 | % witness is recorded can be fed with new data. | ||
2266 | % \begin{macrocode} | ||
2243 | \NewDocumentCommand{\DeclareHand}{m m m +O{}}{ | 2267 | \NewDocumentCommand{\DeclareHand}{m m m +O{}}{ |
2244 | \luadirect{ekdosis.newhand(\luastringN{#1}, | 2268 | \luadirect{ekdosis.newhand(\luastringN{#1}, |
2245 | \luastringN{#2}, | 2269 | \luastringN{#2}, |
@@ -2247,17 +2271,39 @@ yesterday. | |||
2247 | \luastringN{#4})} | 2271 | \luastringN{#4})} |
2248 | } | 2272 | } |
2249 | \@onlypreamble\DeclareHand | 2273 | \@onlypreamble\DeclareHand |
2274 | % \end{macrocode} | ||
2275 | % \end{macro} | ||
2276 | % \begin{macro}{\DeclareScholar} There is also a table in which are | ||
2277 | % collected data related to scholars' names to be used in the | ||
2278 | % apparatus criticus. \cs{DeclareScholar} is a preamble-only command | ||
2279 | % and takes two mandatory arguments: a unique id and a shorthand to | ||
2280 | % be used in the apparatus criticus which can be extracted from a | ||
2281 | % bibliographic database. | ||
2282 | % \begin{macrocode} | ||
2250 | \NewDocumentCommand{\DeclareScholar}{m m}{ | 2283 | \NewDocumentCommand{\DeclareScholar}{m m}{ |
2251 | \luadirect{ekdosis.newscholar(\luastringN{#1}, | 2284 | \luadirect{ekdosis.newscholar(\luastringN{#1}, |
2252 | \luastringN{#2})} | 2285 | \luastringN{#2})} |
2253 | } | 2286 | } |
2254 | \@onlypreamble\DeclareScholar | 2287 | \@onlypreamble\DeclareScholar |
2288 | % \end{macrocode} | ||
2289 | % \end{macro} | ||
2290 | % \begin{macro}{\DeclareShorthand} \cs{DeclareShorthand} is a | ||
2291 | % preamble-only command that can be used to record manuscript | ||
2292 | % families or any kind of shorthand to be used to refer to | ||
2293 | % previously declared ids, for example the shorthand |codd| can be | ||
2294 | % used to point to all declared witnesses. This command takes three | ||
2295 | % mandatory arguments: a unique id, its rendition in print and a | ||
2296 | % csv-list of previously declared ids. | ||
2297 | % \begin{macrocode} | ||
2255 | \NewDocumentCommand{\DeclareShorthand}{m m m}{ | 2298 | \NewDocumentCommand{\DeclareShorthand}{m m m}{ |
2256 | \luadirect{ekdosis.newshorthand(\luastringN{#1}, | 2299 | \luadirect{ekdosis.newshorthand(\luastringN{#1}, |
2257 | \luastringN{#2}, | 2300 | \luastringN{#2}, |
2258 | \luastringN{#3})} | 2301 | \luastringN{#3})} |
2259 | } | 2302 | } |
2260 | \@onlypreamble\DeclareShorthand | 2303 | \@onlypreamble\DeclareShorthand |
2304 | % \end{macrocode} | ||
2305 | % \end{macro} | ||
2306 | % \begin{macrocode} | ||
2261 | \NewDocumentCommand{\getsiglum}{m}{% | 2307 | \NewDocumentCommand{\getsiglum}{m}{% |
2262 | \luadirect{tex.sprint(ekdosis.getsiglum(\luastringN{#1}))}% | 2308 | \luadirect{tex.sprint(ekdosis.getsiglum(\luastringN{#1}))}% |
2263 | } | 2309 | } |
@@ -4729,7 +4775,7 @@ end | |||
4729 | % \iffalse | 4775 | % \iffalse |
4730 | %<*examples> | 4776 | %<*examples> |
4731 | % \fi | 4777 | % \fi |
4732 | % \begin{minted}[firstnumber=last]{latex} | 4778 | % \begin{minted}{latex} |
4733 | \documentclass[12pt]{article} | 4779 | \documentclass[12pt]{article} |
4734 | \usepackage{fontspec} | 4780 | \usepackage{fontspec} |
4735 | \usepackage[english]{babel} | 4781 | \usepackage[english]{babel} |