aboutsummaryrefslogtreecommitdiff
path: root/ekdosis.el
diff options
context:
space:
mode:
Diffstat (limited to 'ekdosis.el')
-rw-r--r--ekdosis.el113
1 files changed, 96 insertions, 17 deletions
diff --git a/ekdosis.el b/ekdosis.el
index 69c14d1..291e022 100644
--- a/ekdosis.el
+++ b/ekdosis.el
@@ -2,24 +2,26 @@
2;; This file is part of the `ekdosis' package 2;; This file is part of the `ekdosis' package
3 3
4;; ekdosis -- TEI xml compliant critical editions 4;; ekdosis -- TEI xml compliant critical editions
5;; Copyright (C) 2020--2021 Robert Alessi 5;; Copyright (C) 2020, 2021, 2022, 2023 Robert Alessi
6;; <alessi@robertalessi.net>
6 7
7;; Please send error reports and suggestions for improvements to Robert 8;; Permission to use, copy, modify, and distribute this software for
8;; Alessi <alessi@robertalessi.net> 9;; any purpose with or without fee is hereby granted, provided that
10;; the above copyright notice and this permission notice appear in all
11;; copies.
9 12
10;; This program is free software: you can redistribute it and/or modify 13;; THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11;; it under the terms of the GNU General Public License as published by 14;; WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12;; the Free Software Foundation, either version 3 of the License, or 15;; WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13;; (at your option) any later version. 16;; AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
17;; CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
18;; OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
19;; NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
20;; CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14 21
15;; This program is distributed in the hope that it will be useful, but 22;; Please send error reports and suggestions for improvements to Robert
16;; WITHOUT ANY WARRANTY; without even the implied warranty of 23;; Alessi <alessi@robertalessi.net>
17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18;; General Public License for more details.
19 24
20;; You should have received a copy of the GNU General Public License
21;; along with this program. If not, see
22;; <http://www.gnu.org/licenses/>.
23 25
24(defvar LaTeX-ekdosis-preamble-options 26(defvar LaTeX-ekdosis-preamble-options
25 '(("parnotes" ("true" "false" "roman")) 27 '(("parnotes" ("true" "false" "roman"))
@@ -90,9 +92,13 @@
90 ("postwit") 92 ("postwit")
91 ("sep") 93 ("sep")
92 ("type") 94 ("type")
95 ("ilabel")
96 ("delim")
97 ("nodelim")
93 ("num") 98 ("num")
94 ("nonum") 99 ("nonum")
95 ("nolem" ("true" "false")) 100 ("nolem" ("true" "false"))
101 ("Nolem")
96 ("nosep" ("true" "false"))) 102 ("nosep" ("true" "false")))
97 "Local options for lem macro") 103 "Local options for lem macro")
98 104
@@ -154,6 +160,8 @@
154 ("familysep") 160 ("familysep")
155 ("initialrule") 161 ("initialrule")
156 ("noinitialrule") 162 ("noinitialrule")
163 ("maxentries")
164 ("nomaxentries")
157 ("keyparopts") 165 ("keyparopts")
158 ("appheight") 166 ("appheight")
159 ("fitalgorithm" ("fontsize" "hybrid" "areasize" "squeeze"))) 167 ("fitalgorithm" ("fontsize" "hybrid" "areasize" "squeeze")))
@@ -200,6 +208,8 @@
200 ("modulonum") 208 ("modulonum")
201 ("margin" ("right" "left" "inner" "outer")) 209 ("margin" ("right" "left" "inner" "outer"))
202 ("numbers" ("elided" "full")) 210 ("numbers" ("elided" "full"))
211 ("maxlines")
212 ("nomaxlines")
203 ("vlineation" ("page" "document")) 213 ("vlineation" ("page" "document"))
204 ("vmodulo") 214 ("vmodulo")
205 ("vnumbrokenlines" ("true" "false")) 215 ("vnumbrokenlines" ("true" "false"))
@@ -232,6 +242,20 @@
232 ("lineation" ("page" "document"))) 242 ("lineation" ("page" "document")))
233 "Local options for alignment env.") 243 "Local options for alignment env.")
234 244
245(defvar LaTeX-ekdosis-footnotes-key-val-options
246 '(("arrangement" ("column" "page" "merge"))
247 ("reset")
248 ("paragraph" ("true" "false"))
249 ("type")
250 ("textfnmark")
251 ("appfnmark"))
252 "Local options for footnotes combined in a single paragraph.")
253
254(defvar LaTeX-ekdosis-footnote-options
255 '(("type")
256 ("mark"))
257 "Local options for footnote macro.")
258
235(defvar LaTeX-ekdosis-ekdverse-key-val-options 259(defvar LaTeX-ekdosis-ekdverse-key-val-options
236 '(("width") 260 '(("width")
237 ("type")) 261 ("type"))
@@ -244,8 +268,17 @@
244(TeX-add-style-hook 268(TeX-add-style-hook
245 "ekdosis" 269 "ekdosis"
246 (lambda () 270 (lambda ()
271 ;; Do not append an empty group to the following macros:
272 (setq TeX-insert-braces-alist (append TeX-insert-braces-alist
273 '(("modulolinenumbers" . nil)
274 ("vmodulolinenumbers" . nil)
275 ("resetlinenumber" . nil)
276 ("resetvlinenumber" . nil))))
247 ;; Folding features: 277 ;; Folding features:
248 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list) 278 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list)
279 '("{1}" ("App"))
280 t)
281 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list)
249 '("{1}" ("app")) 282 '("{1}" ("app"))
250 t) 283 t)
251 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list) 284 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list)
@@ -258,16 +291,25 @@
258 '("[n]" ("note")) 291 '("[n]" ("note"))
259 t) 292 t)
260 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list) 293 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list)
294 '("[n]" ("note*"))
295 t)
296 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list)
261 '("[l]" ("linelabel")) 297 '("[l]" ("linelabel"))
262 t) 298 t)
263 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list) 299 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list)
300 '("[l]" ("ilabel"))
301 t)
302 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list)
264 '("{{1}}" ("surplus")) 303 '("{{1}}" ("surplus"))
265 t) 304 t)
266 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list) 305 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list)
267 '("<{1}>" ("supplied")) 306 '("<{1}>" ("supplied"))
268 t) 307 t)
269 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list) 308 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list)
270 '("{1}" ("sic")) 309 '("†{1}†" ("sic"))
310 t)
311 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list)
312 '("†{1}" ("sic*"))
271 t) 313 t)
272 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list) 314 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list)
273 '("[g]" ("gap")) 315 '("[g]" ("gap"))
@@ -284,9 +326,25 @@
284 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list) 326 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list)
285 '("[t]" ("teidirect")) 327 '("[t]" ("teidirect"))
286 t) 328 t)
329 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list)
330 '("[t]" ("teidirectE"))
331 t)
332 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list)
333 '("[ml]" ("localmaxlines"))
334 t)
335 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list)
336 '("[ml]" ("addtomaxlines"))
337 t)
338 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list)
339 '("[h]" ("localappheight"))
340 t)
341 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list)
342 '("[h]" ("addtoappheight"))
343 t)
287 ;; This package relies on lualatex, so check for it: 344 ;; This package relies on lualatex, so check for it:
288 (TeX-check-engine-add-engines 'luatex) 345 (TeX-check-engine-add-engines 'luatex)
289 (TeX-add-symbols 346 (TeX-add-symbols
347 '("eKd" 0)
290 '("ekdsetup" (TeX-arg-key-val LaTeX-ekdosis-ekdsetup-options)) 348 '("ekdsetup" (TeX-arg-key-val LaTeX-ekdosis-ekdsetup-options))
291 '("DeclareWitness" "xml:id" "rendition" "description" 349 '("DeclareWitness" "xml:id" "rendition" "description"
292 [ LaTeX-ekdosis-long-key-val LaTeX-ekdosis-declarewitness-options ] 350 [ LaTeX-ekdosis-long-key-val LaTeX-ekdosis-declarewitness-options ]
@@ -307,6 +365,10 @@
307 0) 365 0)
308 '("linelabel" "label" 366 '("linelabel" "label"
309 0) 367 0)
368 '("ilabel" "indexed label"
369 0)
370 '("App" [ TeX-arg-key-val LaTeX-ekdosis-app-options ]
371 2)
310 '("app" [ TeX-arg-key-val LaTeX-ekdosis-app-options ] 372 '("app" [ TeX-arg-key-val LaTeX-ekdosis-app-options ]
311 t) 373 t)
312 '("lem" [ LaTeX-ekdosis-long-key-val LaTeX-ekdosis-lem-options ] 374 '("lem" [ LaTeX-ekdosis-long-key-val LaTeX-ekdosis-lem-options ]
@@ -352,11 +414,19 @@
352 '("SetDefaultApparatus" "apparatus name" 0) 414 '("SetDefaultApparatus" "apparatus name" 0)
353 '("DeclareApparatus" "apparatus name" 415 '("DeclareApparatus" "apparatus name"
354 [ TeX-arg-key-val LaTeX-ekdosis-declareapparatus-options ] 0) 416 [ TeX-arg-key-val LaTeX-ekdosis-declareapparatus-options ] 0)
417 '("footnote" [ TeX-arg-key-val LaTeX-ekdosis-footnote-options ]
418 t)
355 '("indentpattern" "pattern" 0) 419 '("indentpattern" "pattern" 0)
356 '("vin" 0) 420 '("vin" 0)
421 '("SetFootnotes"
422 (TeX-arg-key-val LaTeX-ekdosis-footnotes-key-val-options))
357 '("SetLineation" (TeX-arg-key-val LaTeX-ekdosis-setlineation-options)) 423 '("SetLineation" (TeX-arg-key-val LaTeX-ekdosis-setlineation-options))
358 '("innerlinenumbers" 0) 424 '("innerlinenumbers" 0)
359 '("outerlinenumbers" 0) 425 '("outerlinenumbers" 0)
426 '("setmaxlines" "number" 0)
427 '("localmaxlines" "number" 0)
428 '("addtomaxlines" "number" 0)
429 '("nomaxlines" 0)
360 '("modulolinenumbers" [ "number" ] ) 430 '("modulolinenumbers" [ "number" ] )
361 '("vmodulolinenumbers" [ "number" ] ) 431 '("vmodulolinenumbers" [ "number" ] )
362 '("resetlinenumber" [ "number" ] ) 432 '("resetlinenumber" [ "number" ] )
@@ -367,19 +437,27 @@
367 '("MkBodyDivs" "div1" "div2" "div3" "div4" "div5" "div6" 0) 437 '("MkBodyDivs" "div1" "div2" "div3" "div4" "div5" "div6" 0)
368 '("ekddiv" (LaTeX-ekdosis-long-key-val LaTeX-ekdosis-ekddiv-options)) 438 '("ekddiv" (LaTeX-ekdosis-long-key-val LaTeX-ekdosis-ekddiv-options))
369 '("FormatDiv" "number" "code before" "code after" 0) 439 '("FormatDiv" "number" "code before" "code after" 0)
440 '("ekdpage" 0)
370 '("ekdmark" 0) 441 '("ekdmark" 0)
371 '("endmark" 0) 442 '("endmark" 0)
372 '("ekdprintmark" 443 '("ekdprintmark"
373 (TeX-arg-eval completing-read 444 (TeX-arg-eval completing-read
374 (TeX-argument-prompt nil nil "selector") 445 (TeX-argument-prompt nil nil "selector")
375 '("HEL" "HEC" "HER" "HOL" "HOC" "HOR" 446 '("HEL" "HEC" "HER" "HOL" "HOC" "HOR"
376 "FEL" "FEC" "FER" "FOL" "FOC" "FOR")) 447 "FEL" "FEC" "FER" "FOL" "FOC" "FOR"
448 "HL" "HC" "HR" "FL" "FC" "FR"))
377 "signpost" 0 ) 449 "signpost" 0 )
378 '("ekdnohfmark" 0) 450 '("ekdEOprint" "even page" "odd page" 0)
451 '("setpairedpagenum" "page number" 0)
452 '("setpairedpage" 0)
453 '("resetpagenumber" 0)
454 '("ekdnohfmarks" 0)
379 '("ekdresethfmarks" 0) 455 '("ekdresethfmarks" 0)
380 '("ekdpb" [ "page number" ] "line number" 0) 456 '("ekdpb" [ "page number" ] "line number" 0)
381 '("ekdpb*") 457 '("ekdpb*")
382 '("addentries" [ "layer" ] "number" 0) 458 '("addentries" [ "layer" ] "number" 0)
459 '("localappheight" "dimension" 0)
460 '("addtoappheight" "dimension" 0)
383 '("SetTEIFilename" "base name" 0) 461 '("SetTEIFilename" "base name" 0)
384 '("SetTEIxmlExport" (TeX-arg-key-val 462 '("SetTEIxmlExport" (TeX-arg-key-val
385 LaTeX-ekdosis-setteixmlexport-options)) 463 LaTeX-ekdosis-setteixmlexport-options))
@@ -388,6 +466,7 @@
388 '("EnvtoTEI*" "env name" "TEI element" [ "TEI attributes" ] 0) 466 '("EnvtoTEI*" "env name" "TEI element" [ "TEI attributes" ] 0)
389 '("TeXtoTEIPat" "TeX pattern" "TEI pattern" 0) 467 '("TeXtoTEIPat" "TeX pattern" "TEI pattern" 0)
390 '("teidirect" [ "xml attributes" ] "xml element" "code" 0) 468 '("teidirect" [ "xml attributes" ] "xml element" "code" 0)
469 '("teidirectE" [ "xml attributes" ] "xml element" 0)
391 '("AddxmlBibResource" "basename or name.xml" 0) 470 '("AddxmlBibResource" "basename or name.xml" 0)
392 ) 471 )
393 (LaTeX-add-environments 472 (LaTeX-add-environments