diff options
-rw-r--r-- | Makefile | 34 | ||||
-rw-r--r-- | ekdosis.dtx | 113 |
2 files changed, 122 insertions, 25 deletions
@@ -11,6 +11,10 @@ SAMPLES := samples | |||
11 | exts := md html ins dtx el | 11 | exts := md html ins dtx el |
12 | findopts := $(foreach ext,$(exts),-or -iname "*.$(ext)") | 12 | findopts := $(foreach ext,$(exts),-or -iname "*.$(ext)") |
13 | 13 | ||
14 | define do_documentation | ||
15 | $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx >/dev/null | ||
16 | endef | ||
17 | |||
14 | all: sty $(NAME).pdf | 18 | all: sty $(NAME).pdf |
15 | 19 | ||
16 | testsamples: | 20 | testsamples: |
@@ -23,24 +27,26 @@ sty: clean | |||
23 | 27 | ||
24 | $(NAME).pdf: testsamples $(NAME).dtx | 28 | $(NAME).pdf: testsamples $(NAME).dtx |
25 | @ echo "Making the sample files first..." | 29 | @ echo "Making the sample files first..." |
26 | $(MAKE) --directory=$(SAMPLES) | 30 | @ $(MAKE) --directory=$(SAMPLES) >/dev/null |
27 | @ echo "Building the documentation of $(NAME)..." | 31 | @ echo "Done making samples" |
28 | $(CMP) --shell-escape --recorder --interaction=batchmode $(NAME).dtx >/dev/null | 32 | @ echo "Building the documentation of $(NAME). Please be patient..." |
29 | biber $(NAME) >/dev/null | 33 | @ $(do_documentation) |
30 | $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null | 34 | @ echo "Now calling biber" |
31 | $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null | 35 | @ biber $(NAME) >/dev/null |
32 | $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null | 36 | @ echo "Returning to lualatex..." |
33 | $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null | 37 | @ for run in {1..4}; do $(do_documentation); done |
34 | if [ -f $(NAME).glo ]; then makeindex -q -s gglo.ist -o $(NAME).gls $(NAME).glo; fi | 38 | @ echo "Building indexes..." |
35 | if [ -f $(NAME).idx ]; then makeindex -q -s gind.ist -o $(NAME).ind $(NAME).idx; fi | 39 | @ if [ -f $(NAME).glo ]; then makeindex -q -s gglo.ist -o $(NAME).gls $(NAME).glo; fi |
36 | $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null | 40 | @ if [ -f $(NAME).idx ]; then makeindex -q -s gind.ist -o $(NAME).ind $(NAME).idx; fi |
37 | $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null | 41 | @ echo "Final runs of lualatex..." |
38 | $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null | 42 | @ for run in {1..3}; do $(call do_documentation); done |
43 | @ echo "Done" | ||
39 | 44 | ||
40 | samples: clean sty | 45 | samples: clean sty |
41 | $(MAKE) --directory=$(SAMPLES) | 46 | $(MAKE) --directory=$(SAMPLES) |
42 | 47 | ||
43 | clean: testsamples | 48 | clean: testsamples |
49 | @ echo "Cleaning $(NAME) directory" | ||
44 | rm -rf auto | 50 | rm -rf auto |
45 | rm -f $(NAME).bib $(PWD)/TMP/*.bib | 51 | rm -f $(NAME).bib $(PWD)/TMP/*.bib |
46 | rm -rf .backup | 52 | rm -rf .backup |
@@ -66,12 +72,14 @@ uninst: | |||
66 | rm -rf $(HOMEDIR)/.emacs.d/auctex/auto/$(NAME).{el,elc} | 72 | rm -rf $(HOMEDIR)/.emacs.d/auctex/auto/$(NAME).{el,elc} |
67 | 73 | ||
68 | inst: uninst auctex all | 74 | inst: uninst auctex all |
75 | @ echo "Installing $(NAME) locally" | ||
69 | mkdir -p $(UTREE)/{tex,source,doc}/lualatex/$(NAME) | 76 | mkdir -p $(UTREE)/{tex,source,doc}/lualatex/$(NAME) |
70 | cp $(NAME).dtx $(UTREE)/source/lualatex/$(NAME) | 77 | cp $(NAME).dtx $(UTREE)/source/lualatex/$(NAME) |
71 | cp $(NAME).sty $(UTREE)/tex/lualatex/$(NAME) | 78 | cp $(NAME).sty $(UTREE)/tex/lualatex/$(NAME) |
72 | cp $(NAME).lua $(UTREE)/tex/lualatex/$(NAME) | 79 | cp $(NAME).lua $(UTREE)/tex/lualatex/$(NAME) |
73 | cp $(NAME).pdf $(UTREE)/doc/lualatex/$(NAME) | 80 | cp $(NAME).pdf $(UTREE)/doc/lualatex/$(NAME) |
74 | cp -r samples/ $(UTREE)/doc/lualatex/$(NAME) | 81 | cp -r samples/ $(UTREE)/doc/lualatex/$(NAME) |
82 | @ echo "Installation complete. Happy TeXing!" | ||
75 | 83 | ||
76 | local: uninst auctex | 84 | local: uninst auctex |
77 | $(CMP) $(NAME).ins | 85 | $(CMP) $(NAME).ins |
diff --git a/ekdosis.dtx b/ekdosis.dtx index 6f85753..36d6e8c 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx | |||
@@ -145,6 +145,16 @@ along with this program. If not, see | |||
145 | publisher = {Harper \& Brothers}, | 145 | publisher = {Harper \& Brothers}, |
146 | location = {New York}} | 146 | location = {New York}} |
147 | 147 | ||
148 | @MVBook{HomerMurray, | ||
149 | author = {{Homer}}, | ||
150 | title = {The Odyssey}, | ||
151 | date = 1919, | ||
152 | editor = {Murray, A.T\adddot}, | ||
153 | volumes = 2, | ||
154 | publisher = {Harvard University Press -- William Heinemann}, | ||
155 | location = {Cambridge, MA. -- London} | ||
156 | } | ||
157 | |||
148 | @Book{ReynoldsWilson1991, | 158 | @Book{ReynoldsWilson1991, |
149 | author = {Reynolds, L. D. and Wilson, N. G}, | 159 | author = {Reynolds, L. D. and Wilson, N. G}, |
150 | title = {Scribes and Scholars}, | 160 | title = {Scribes and Scholars}, |
@@ -245,6 +255,15 @@ along with this program. If not, see | |||
245 | version = {3.47} | 255 | version = {3.47} |
246 | } | 256 | } |
247 | 257 | ||
258 | @Software{verse, | ||
259 | title = {The Verse package}, | ||
260 | subtitle = {Aids for typesetting simple verse}, | ||
261 | author = {Wilson, Peter R. and Robertson, Will}, | ||
262 | url = {http://www.ctan.org/pkg/verse}, | ||
263 | date = {2014-05-10}, | ||
264 | version = {2.4b} | ||
265 | } | ||
266 | |||
248 | @Software{arabluatex, | 267 | @Software{arabluatex, |
249 | title = {The Arabluatex package}, | 268 | title = {The Arabluatex package}, |
250 | titleaddon = {ArabTeX for LuaLaTeX}, | 269 | titleaddon = {ArabTeX for LuaLaTeX}, |
@@ -358,6 +377,8 @@ along with this program. If not, see | |||
358 | \DeclareWitness{sV}{V}{Vaticanus lat. 1652}[ | 377 | \DeclareWitness{sV}{V}{Vaticanus lat. 1652}[ |
359 | origDate=s. XV] | 378 | origDate=s. XV] |
360 | \DeclareSource{sDrak}{\emph{Drakenborch}} | 379 | \DeclareSource{sDrak}{\emph{Drakenborch}} |
380 | % Homer, Odyssey | ||
381 | \DeclareScholar{Zen}{Zen.}[rawname=Zenodotus] | ||
361 | \end{filecontents} | 382 | \end{filecontents} |
362 | \documentclass{ltxdoc} | 383 | \documentclass{ltxdoc} |
363 | %\usepackage[letterpaper,margin=25mm,left=50mm,nohead]{geometry} | 384 | %\usepackage[letterpaper,margin=25mm,left=50mm,nohead]{geometry} |
@@ -988,7 +1009,17 @@ along with this program. If not, see | |||
988 | % | 1009 | % |
989 | % \danger It must be noted that the two styles are mutually exclusive. | 1010 | % \danger It must be noted that the two styles are mutually exclusive. |
990 | % \vskip\baselineskip | 1011 | % \vskip\baselineskip |
991 | % | 1012 | % |
1013 | % \DescribeOption{verse}\label{ref:verse-opt} | ||
1014 | % |verse|$=$\verb+true|false+ | ||
1015 | % \hfill\tcboxverb{Default: false}\\ | ||
1016 | % This named argument does not need a value as it defaults to |true| | ||
1017 | % if it is used. |verse| instructs \pkg{ekdosis} to load and use the | ||
1018 | % facilites supplied by the \pkg{verse} package for typesetting lines | ||
1019 | % of poetry. The \env{ekdverse} environment must then be used instead | ||
1020 | % of the \env{verse} environment that is provided by the \pkg{verse} | ||
1021 | % package as described below in \vref{sec:poetry}. | ||
1022 | % | ||
992 | % \DescribeOption{parnotes}\label{ref:parnotes-opt} | 1023 | % \DescribeOption{parnotes}\label{ref:parnotes-opt} |
993 | % |parnotes|$=$\verb+true|false|roman+% | 1024 | % |parnotes|$=$\verb+true|false|roman+% |
994 | % \hfill\tcboxverb{Default: not set}\\ | 1025 | % \hfill\tcboxverb{Default: not set}\\ |
@@ -2981,7 +3012,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ | |||
2981 | % | 3012 | % |
2982 | % \DescribeMacro{\SetApparatusLanguage} | 3013 | % \DescribeMacro{\SetApparatusLanguage} |
2983 | % \label{ref:app-lang}\newfeature[v1.2] | 3014 | % \label{ref:app-lang}\newfeature[v1.2] |
2984 | % \cs{SetApparatusLang}\marg{languagename} can be used when it is | 3015 | % \cs{SetApparatusLanguage}\marg{languagename} can be used when it is |
2985 | % needed to apply in the apparatus criticus a language different from | 3016 | % needed to apply in the apparatus criticus a language different from |
2986 | % the one that is selected in the edition text. | 3017 | % the one that is selected in the edition text. |
2987 | % | 3018 | % |
@@ -3019,7 +3050,8 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ | |||
3019 | % |norule| does not accept any value and has the same effect as | 3050 | % |norule| does not accept any value and has the same effect as |
3020 | % |rule=none|.\label{ref:apparatus-settings-e}\\ | 3051 | % |rule=none|.\label{ref:apparatus-settings-e}\\ |
3021 | % \DescribeOption{lang} |lang|$=$\meta{languagename} | 3052 | % \DescribeOption{lang} |lang|$=$\meta{languagename} |
3022 | % \newfeature[v1.2]\hfill\tcboxverb{Default: not set}\\ | 3053 | % \newfeature[v1.2]\label{ref:app-lang-opt} |
3054 | % \hfill\tcboxverb{Default: not set}\\ | ||
3023 | % |lang=<languagename>| is used as described \vpageref{ref:app-lang} | 3055 | % |lang=<languagename>| is used as described \vpageref{ref:app-lang} |
3024 | % when it is needed to apply in the apparatus criticus a language | 3056 | % when it is needed to apply in the apparatus criticus a language |
3025 | % different from the one that is selected in the edition | 3057 | % different from the one that is selected in the edition |
@@ -3119,7 +3151,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ | |||
3119 | % \DescribeOption{ehook} | 3151 | % \DescribeOption{ehook} |
3120 | % \DescribeOption{rule} | 3152 | % \DescribeOption{rule} |
3121 | % \DescribeOption{norule} | 3153 | % \DescribeOption{norule} |
3122 | % \DescribeOption{lang} | 3154 | % \DescribeOption{lang}\label{ref:apps-lang-opt} |
3123 | % With regard to layout, any declared layer inherits the default values | 3155 | % With regard to layout, any declared layer inherits the default values |
3124 | % described above in \vref{sec:single-layer-app}. That said, as the | 3156 | % described above in \vref{sec:single-layer-app}. That said, as the |
3125 | % optional argument of \cs{DeclareApparatus} accepts the exact same | 3157 | % optional argument of \cs{DeclareApparatus} accepts the exact same |
@@ -3470,6 +3502,40 @@ argument of the | |||
3470 | % \section{Poetry} | 3502 | % \section{Poetry} |
3471 | % \label{sec:poetry} | 3503 | % \label{sec:poetry} |
3472 | % | 3504 | % |
3505 | % \begingroup | ||
3506 | % \setcolumnwidth{0.6\textwidth} | ||
3507 | % \setlength{\leftmargini}{0em} | ||
3508 | % \needspace{7\baselineskip} | ||
3509 | % \resetlinenumber | ||
3510 | % \begin{alignment}[flush, | ||
3511 | % lcols=2, | ||
3512 | % texts=homer[xml:lang="grc"];murray, | ||
3513 | % apparatus=homer] | ||
3514 | % \AtBeginEnvironment{homer}{\selectlanguage{greek}} | ||
3515 | % \setlength{\vrightskip}{0.25em} | ||
3516 | % \setverselinenums{1}{0} | ||
3517 | % \begin{homer} | ||
3518 | % \begin{ekdverse} | ||
3519 | % Ἄνδρα μοι ἔννεπε, Μοῦσα, πολύτροπον, ὃς μάλα πολλὰ \\ | ||
3520 | % πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν· \\ | ||
3521 | % πολλῶν δ' ἀνθρώπων ἴδεν ἄστεα καὶ | ||
3522 | % \app{\lem{νόον} | ||
3523 | % \rdg[resp=Zen]{νόμον} | ||
3524 | % \note{Cf. Schol.}} ἔγνω, \\ | ||
3525 | % πολλὰ δ' ὅ γ' ἐν πόντῳ πάθεν ἄλγεα ὃν κατὰ θυμόν, \\ | ||
3526 | % ἀρνύμενος ἥν τε ψυχὴν καὶ νόστον ἑταίρων. \\ | ||
3527 | % \end{ekdverse} | ||
3528 | % \end{homer} | ||
3529 | % \begin{murray} | ||
3530 | % Tell me, O Muse, of the man of many devices, who wandered full | ||
3531 | % many ways after he had sacked the sacred citadel of Troy. Many | ||
3532 | % were the men whose cities he saw and whose mind he learned, aye, | ||
3533 | % and many the woes he suffered in his heart upon the sea, seeking | ||
3534 | % to win his own life and the return of his | ||
3535 | % comrades.\footcite{HomerMurray} | ||
3536 | % \end{murray} | ||
3537 | % \end{alignment} | ||
3538 | % \endgroup | ||
3473 | % | 3539 | % |
3474 | % \section{Lineation Settings} | 3540 | % \section{Lineation Settings} |
3475 | % \label{sec:lineation} | 3541 | % \label{sec:lineation} |
@@ -3591,6 +3657,14 @@ argument of the | |||
3591 | % file, the reader is invited to refer to point \vref{it:lang-subopt} | 3657 | % file, the reader is invited to refer to point \vref{it:lang-subopt} |
3592 | % and \vref{sec:teixml-output}. | 3658 | % and \vref{sec:teixml-output}. |
3593 | % | 3659 | % |
3660 | % \danger In some cases, it may be needed to apply in the apparatus | ||
3661 | % criticus a language different from the one that is selected in the | ||
3662 | % edition text. To this end, \pkg{ekdosis} provides a set of | ||
3663 | % facilities which are described | ||
3664 | % \vpagerefrange{ref:app-lang}{ref:app-lang-opt} for single-layer | ||
3665 | % apparatus and \vpageref{ref:apps-lang-opt} for multiple-layer | ||
3666 | % apparatus. | ||
3667 | % | ||
3594 | % \subsection{Languages Written From Right to Left} | 3668 | % \subsection{Languages Written From Right to Left} |
3595 | % \label{sec:rtl-languages} | 3669 | % \label{sec:rtl-languages} |
3596 | % As said above, \pkg{polyglossia} is not supported by \pkg{ekdosis} | 3670 | % As said above, \pkg{polyglossia} is not supported by \pkg{ekdosis} |
@@ -6856,9 +6930,9 @@ Sample text with a \textcolor{red}{word} in red. | |||
6856 | lineation=#1}{`lineation' must be either `page' or `document'.}, | 6930 | lineation=#1}{`lineation' must be either `page' or `document'.}, |
6857 | code modulonum = \chardef\c@linenumbermodulo#1\relax, | 6931 | code modulonum = \chardef\c@linenumbermodulo#1\relax, |
6858 | noval modulo = \modulolinenumbers, | 6932 | noval modulo = \modulolinenumbers, |
6859 | code vmodulonum = \if@pkg@verse\poemlines{#1}\fi, | 6933 | code vmodulo = \if@pkg@verse\poemlines{#1}\fi, |
6860 | initial vmodulonum = 1, | 6934 | initial vmodulo = 1, |
6861 | noval vmodulo = \if@pkg@verse\poemlines{5}\fi, | 6935 | default vmodulo = 5, |
6862 | bool continuousvnum = \if@continuous@vnum, | 6936 | bool continuousvnum = \if@continuous@vnum, |
6863 | choice numbers = {elided = \ekd@elidednumberstrue, | 6937 | choice numbers = {elided = \ekd@elidednumberstrue, |
6864 | full = \ekd@elidednumbersfalse}, | 6938 | full = \ekd@elidednumbersfalse}, |
@@ -7915,6 +7989,17 @@ Sample text with a \textcolor{red}{word} in red. | |||
7915 | \fi | 7989 | \fi |
7916 | % \end{macrocode} | 7990 | % \end{macrocode} |
7917 | % \end{environment} | 7991 | % \end{environment} |
7992 | % \begin{macro}{\resetvlinenumber} | ||
7993 | % \changes{v1.2}{2021/03/06}{resets line numbers in poetry environments} | ||
7994 | % This command is the equivalent of \cs{resetlinenumber} for lines of | ||
7995 | % poetry. It takes an integer (which is |1| by default) as optional | ||
7996 | % argument. | ||
7997 | % \begin{macrocode} | ||
7998 | \NewDocumentCommand{\resetvlinenumber}{O{1}}{% | ||
7999 | \setverselinenums{#1}{0}% | ||
8000 | } | ||
8001 | % \end{macrocode} | ||
8002 | % \end{macro} | ||
7918 | % \begin{environment}{ekdpar} | 8003 | % \begin{environment}{ekdpar} |
7919 | % When |autopar| is set to |false| by means of \cs{SetTEIxmlExport}, | 8004 | % When |autopar| is set to |false| by means of \cs{SetTEIxmlExport}, |
7920 | % \env{ekdpar}\---or any other environment set to be inserted within | 8005 | % \env{ekdpar}\---or any other environment set to be inserted within |
@@ -7965,7 +8050,8 @@ local app = lpeg.Cs("app") | |||
7965 | local lemrdg = lpeg.Cs(lpeg.Cs("lem") + lpeg.Cs("rdg")) | 8050 | local lemrdg = lpeg.Cs(lpeg.Cs("lem") + lpeg.Cs("rdg")) |
7966 | local note = lpeg.Cs("note") | 8051 | local note = lpeg.Cs("note") |
7967 | local lnbrk = lpeg.Cs("\\\\") | 8052 | local lnbrk = lpeg.Cs("\\\\") |
7968 | local poemline = lpeg.Cs(lnbrk * bsqbrackets^-1) | 8053 | local poemline = lpeg.Cs(lnbrk * spcenc^-1 * lpeg.S("*!")^-1 * bsqbrackets^-1) |
8054 | local poemlineb = lpeg.Cs(lnbrk * spcenc^-1 * lpeg.P(">") * bsqbrackets^-1) | ||
7969 | local endpoem = lpeg.Cs(lnbrk * lpeg.S("*!") * bsqbrackets^-1) | 8055 | local endpoem = lpeg.Cs(lnbrk * lpeg.S("*!") * bsqbrackets^-1) |
7970 | local sections = lpeg.Cs(lpeg.P("book") + lpeg.P("part") + lpeg.P("chapter") | 8056 | local sections = lpeg.Cs(lpeg.P("book") + lpeg.P("part") + lpeg.P("chapter") |
7971 | + lpeg.P("section") + lpeg.P("subsection") | 8057 | + lpeg.P("section") + lpeg.P("subsection") |
@@ -8314,6 +8400,8 @@ local texpatttotags = { | |||
8314 | {a="\\addentries%s+%[(.-)%]{(.-)}", b=""}, | 8400 | {a="\\addentries%s+%[(.-)%]{(.-)}", b=""}, |
8315 | {a="\\addentries%s+{(.-)}", b=""}, | 8401 | {a="\\addentries%s+{(.-)}", b=""}, |
8316 | {a="\\setverselinenums%s+{(.-)}{(.-)}", b=""}, | 8402 | {a="\\setverselinenums%s+{(.-)}{(.-)}", b=""}, |
8403 | {a="\\resetvlinenumber%s+%[(.-)%]", b=""}, | ||
8404 | {a="\\resetvlinenumber%s+", b=""}, | ||
8317 | {a="\\resetlinenumber%s+%[(.-)%]", b=""}, | 8405 | {a="\\resetlinenumber%s+%[(.-)%]", b=""}, |
8318 | {a="\\resetlinenumber%s+", b=""}, | 8406 | {a="\\resetlinenumber%s+", b=""}, |
8319 | {a="\\poemlines%s+{(.-)}", b=""}, | 8407 | {a="\\poemlines%s+{(.-)}", b=""}, |
@@ -8559,11 +8647,12 @@ local function relocate_notes(str) | |||
8559 | end | 8647 | end |
8560 | 8648 | ||
8561 | local function linestotei(str) | 8649 | local function linestotei(str) |
8562 | -- str = "\n<l>"..str | 8650 | str = "\n<l>"..str |
8563 | str = string.gsub(str, "^%s?(.-)\\\\[%!%*]?%s?$", "\n<l>%1</l>\n") | 8651 | -- str = string.gsub(str, "^%s?(.-)\\\\[%!%*]?%s?$", "\n<l>%1</l>\n") |
8652 | str = gsub(str, poemline * spcenc^-1 * -1, "</l>\n") | ||
8564 | -- str = gsub(str, endpoem, "</l>\n") | 8653 | -- str = gsub(str, endpoem, "</l>\n") |
8565 | str = gsub(str, poemline * spcenc^-1 * lpeg.P(">"), "\n<lb/>") | 8654 | str = gsub(str, poemlineb, "\n<lb/>") |
8566 | str = gsub(str, poemline * spcenc^-1, "</l>\n<l>") | 8655 | str = gsub(str, poemline, "</l>\n<l>") |
8567 | -- str = str.."</l>\n" | 8656 | -- str = str.."</l>\n" |
8568 | return str | 8657 | return str |
8569 | end | 8658 | end |