aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile3
-rw-r--r--ekdosis.dtx194
-rw-r--r--ekdosis.el16
3 files changed, 182 insertions, 31 deletions
diff --git a/Makefile b/Makefile
index 0772401..2dc72eb 100644
--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,7 @@ SAMPLES := samples
11 11
12exts := md html ins dtx el 12exts := md html ins dtx el
13files := AUTHORS.md LICENSE 13files := AUTHORS.md LICENSE
14zfiles := {AUTHORS.md,LICENSE}
14findopts := $(foreach ext,$(exts),-or -iname "*.$(ext)") 15findopts := $(foreach ext,$(exts),-or -iname "*.$(ext)")
15findfiles := $(foreach file,$(files), -or -iname "$(file)") 16findfiles := $(foreach file,$(files), -or -iname "$(file)")
16 17
@@ -107,7 +108,7 @@ uninstall:
107 108
108zip: all 109zip: all
109 ln -sf . $(NAME) 110 ln -sf . $(NAME)
110 zip -Drq $(PWD)/$(NAME)-$(VERS).zip $(NAME)/{$(files),samples,README.md,$(NAME).{pdf,sty,lua,el}} 111 zip -Drq $(PWD)/$(NAME)-$(VERS).zip $(NAME)/{$(zfiles),samples,README.md,$(NAME).{pdf,sty,lua,el}}
111 rm $(NAME) 112 rm $(NAME)
112 113
113hal: clean 114hal: clean
diff --git a/ekdosis.dtx b/ekdosis.dtx
index 203415b..8230ead 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -59,7 +59,7 @@ Alessi <alessi@robertalessi.net>
59%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] 59%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
60%<package>\ProvidesPackage{ekdosis} 60%<package>\ProvidesPackage{ekdosis}
61%<*package> 61%<*package>
62 [2023/06/17 v1.5-dev Typesetting TEI xml-compliant critical editions] 62 [2023/06/22 v1.5-dev Typesetting TEI xml-compliant critical editions]
63%</package> 63%</package>
64%<*driver> 64%<*driver>
65\begin{filecontents}[noheader,overwrite]{bibdata.xml} 65\begin{filecontents}[noheader,overwrite]{bibdata.xml}
@@ -372,6 +372,15 @@ Alessi <alessi@robertalessi.net>
372 version = {1.0} 372 version = {1.0}
373} 373}
374 374
375@Software{footmisc,
376 title = {The Footmisc package},
377 titleaddon = {A range of footnote options},
378 author = {Mittelbach, Frank and Fairbairns, Robin},
379 url = {https://ctan.org/pkg/footmisc},
380 date = {2022-05-26},
381 version = {6.0e},
382}
383
375@Software{keyfloat, 384@Software{keyfloat,
376 title = {The Keyfloat package}, 385 title = {The Keyfloat package},
377 titleaddon = {Provides a key/value interface for generating 386 titleaddon = {Provides a key/value interface for generating
@@ -3618,6 +3627,13 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
3618% just loading the \pkg{fnpos} package in the 3627% just loading the \pkg{fnpos} package in the
3619% preamble.\footcite{fnpos} 3628% preamble.\footcite{fnpos}
3620% 3629%
3630% \danger The \pkg{footmisc} package\footcite{footmisc} is not
3631% compatible with \pkg{ekdosis}. More precisely, \pkg{footmisc} is
3632% incompatible with the way the \cs{footnote} command is defined
3633% inside the |alignment| environment. Therefore, \pkg{footmisc} can
3634% only be used on the condition that no regular \cs{footnote} be
3635% inserted in the |alignment| environment.
3636%
3621% \section{Laying Out the Apparatus Criticus} 3637% \section{Laying Out the Apparatus Criticus}
3622% \label{sec:apparatus-layout} 3638% \label{sec:apparatus-layout}
3623% 3639%
@@ -4392,6 +4408,9 @@ argument of the
4392% element (ll.~5--7). Otherwise, the \texttt{TEI} output would not be 4408% element (ll.~5--7). Otherwise, the \texttt{TEI} output would not be
4393% valid. 4409% valid.
4394% 4410%
4411% \subsection{Footnotes Combined Into a Single Paragraph}
4412% \label{sec:footnotes}
4413%
4395% \needspace{4\baselineskip} 4414% \needspace{4\baselineskip}
4396% \section{Poetry} 4415% \section{Poetry}
4397% \label{sec:poetry} 4416% \label{sec:poetry}
@@ -8225,7 +8244,7 @@ Sample text with a \textcolor{red}{word} in red.
8225% \end{macrocode} 8244% \end{macrocode}
8226% \paragraph{\textsf{ekdosis} Symbol} 8245% \paragraph{\textsf{ekdosis} Symbol}
8227% \begin{macro}{\eKd} 8246% \begin{macro}{\eKd}
8228% \changes{v1.5}{2023/06/17}{Prints \textsf{ekdosis} indentifying 8247% \changes{v1.5}{2023/06/22}{Prints \textsf{ekdosis} indentifying
8229% symbol} As of v1.5, \pkg{ekdosis} has its own identifying 8248% symbol} As of v1.5, \pkg{ekdosis} has its own identifying
8230% symbol. It is produced by \cs{eKd} and best printed with the Old 8249% symbol. It is produced by \cs{eKd} and best printed with the Old
8231% Standard Greek font. 8250% Standard Greek font.
@@ -8488,7 +8507,7 @@ Sample text with a \textcolor{red}{word} in red.
8488% \begin{macro}{\teidirectE} 8507% \begin{macro}{\teidirectE}
8489% \changes{v1.3}{2021/08/18}{direct insertion of elements in the 8508% \changes{v1.3}{2021/08/18}{direct insertion of elements in the
8490% \texttt{TEI xml} file} 8509% \texttt{TEI xml} file}
8491% \changes{v1.5}{2023/06/17}{direct insertion of empty elements in the 8510% \changes{v1.5}{2023/06/22}{direct insertion of empty elements in the
8492% \texttt{TEI xml} file} 8511% \texttt{TEI xml} file}
8493% \cs{teidirect}\oarg{xml attributes}\marg{xml element}\marg{code} 8512% \cs{teidirect}\oarg{xml attributes}\marg{xml element}\marg{code}
8494% does nothing in \LaTeX. It is only used to insert elements in the 8513% does nothing in \LaTeX. It is only used to insert elements in the
@@ -8503,7 +8522,7 @@ Sample text with a \textcolor{red}{word} in red.
8503% \end{macro} 8522% \end{macro}
8504% \end{macro} 8523% \end{macro}
8505% \begin{macro}{\getTEIxmlid} 8524% \begin{macro}{\getTEIxmlid}
8506% \changes{v1.5}{2023/06/17}{returns \texttt{TEI xml:ids} from a 8525% \changes{v1.5}{2023/06/22}{returns \texttt{TEI xml:ids} from a
8507% csv-list of ids} This command returns from a csv-list of unique 8526% csv-list of ids} This command returns from a csv-list of unique
8508% identifiers declared in commands such as \cs{DeclareWitness} and the 8527% identifiers declared in commands such as \cs{DeclareWitness} and the
8509% like a space-separated list of their corresponding |xml:id|s, each 8528% like a space-separated list of their corresponding |xml:id|s, each
@@ -8979,7 +8998,7 @@ Sample text with a \textcolor{red}{word} in red.
8979\newlength{\ekd@app@localheight} 8998\newlength{\ekd@app@localheight}
8980% \end{macrocode} 8999% \end{macrocode}
8981% \begin{macro}{\localappheight} 9000% \begin{macro}{\localappheight}
8982% \changes{v1.5}{2023/06/17}{changes the height of the apparatus 9001% \changes{v1.5}{2023/06/22}{changes the height of the apparatus
8983% criticus} 9002% criticus}
8984% \cs{localappheight}\marg{dimen} can be used to change locally the 9003% \cs{localappheight}\marg{dimen} can be used to change locally the
8985% length of \cs{ekd@app@height} set by the |appheight| option of 9004% length of \cs{ekd@app@height} set by the |appheight| option of
@@ -8998,7 +9017,7 @@ Sample text with a \textcolor{red}{word} in red.
8998% \end{macrocode} 9017% \end{macrocode}
8999% \end{macro} 9018% \end{macro}
9000% \begin{macro}{\addtoappheight} 9019% \begin{macro}{\addtoappheight}
9001% \changes{v1.5}{2023/06/17}{increases or decreases the height of the 9020% \changes{v1.5}{2023/06/22}{increases or decreases the height of the
9002% apparatus criticus} 9021% apparatus criticus}
9003% As the name suggests, in contrast to \cs{localappheight}, 9022% As the name suggests, in contrast to \cs{localappheight},
9004% \cs{addtoappheight}\marg{dimen} is used to increase or decrease 9023% \cs{addtoappheight}\marg{dimen} is used to increase or decrease
@@ -9285,7 +9304,7 @@ Sample text with a \textcolor{red}{word} in red.
9285% The following commands are provided to set and control the maximum 9304% The following commands are provided to set and control the maximum
9286% number of lines printed on each page. 9305% number of lines printed on each page.
9287% \begin{macro}{\setmaxlines} 9306% \begin{macro}{\setmaxlines}
9288% \changes{v1.5}{2023/06/17}{limits the number of lines per page} 9307% \changes{v1.5}{2023/06/22}{limits the number of lines per page}
9289% \cs{setmaxlines}\marg{n}, where \meta{n} is a positive integer 9308% \cs{setmaxlines}\marg{n}, where \meta{n} is a positive integer
9290% $\geq 1$, can be used either in the preamble or at any point of the 9309% $\geq 1$, can be used either in the preamble or at any point of the
9291% document to set the maximum number of lines to be printed on each 9310% document to set the maximum number of lines to be printed on each
@@ -9296,7 +9315,7 @@ Sample text with a \textcolor{red}{word} in red.
9296% \end{macrocode} 9315% \end{macrocode}
9297% \end{macro} 9316% \end{macro}
9298% \begin{macro}{\localmaxlines} 9317% \begin{macro}{\localmaxlines}
9299% \changes{v1.5}{2023/06/17}{changes the maximum number of lines 9318% \changes{v1.5}{2023/06/22}{changes the maximum number of lines
9300% locally} 9319% locally}
9301% Once a maximum number of lines per page has been set, 9320% Once a maximum number of lines per page has been set,
9302% \cs{localmaxlines}\marg{n} can be used to adjust this number on a 9321% \cs{localmaxlines}\marg{n} can be used to adjust this number on a
@@ -9309,7 +9328,7 @@ Sample text with a \textcolor{red}{word} in red.
9309% \end{macrocode} 9328% \end{macrocode}
9310% \end{macro} 9329% \end{macro}
9311% \begin{macro}{\addtomaxlines} 9330% \begin{macro}{\addtomaxlines}
9312% \changes{v1.5}{2023/06/17}{adds or subtracts lines from a given page} 9331% \changes{v1.5}{2023/06/22}{adds or subtracts lines from a given page}
9313% Unlike \cs{localmaxlines}, \cs{addtomaxlines}\meta{n} takes as 9332% Unlike \cs{localmaxlines}, \cs{addtomaxlines}\meta{n} takes as
9314% argument the number of lines one wishes to add or substract from the 9333% argument the number of lines one wishes to add or substract from the
9315% number that has been set by \cs{setmaxlines}. As a result, \meta{n} 9334% number that has been set by \cs{setmaxlines}. As a result, \meta{n}
@@ -9322,7 +9341,7 @@ Sample text with a \textcolor{red}{word} in red.
9322% \end{macrocode} 9341% \end{macrocode}
9323% \end{macro} 9342% \end{macro}
9324% \begin{macro}{\nomaxlines} 9343% \begin{macro}{\nomaxlines}
9325% \changes{v1.5}{2023/06/17}{unsets \cs{setmaxlines}} 9344% \changes{v1.5}{2023/06/22}{unsets \cs{setmaxlines}}
9326% \cs{nomaxlines} unsets any limit previously set by \cs{setmaxlines}. 9345% \cs{nomaxlines} unsets any limit previously set by \cs{setmaxlines}.
9327% \begin{macrocode} 9346% \begin{macrocode}
9328\def\nomaxlines{\luadirect{tex.sprint(ekdosis.resetlocalmaxlines())}} 9347\def\nomaxlines{\luadirect{tex.sprint(ekdosis.resetlocalmaxlines())}}
@@ -9386,7 +9405,7 @@ Sample text with a \textcolor{red}{word} in red.
9386% \end{macrocode} 9405% \end{macrocode}
9387% \end{macro} 9406% \end{macro}
9388% \begin{macro}{\App} 9407% \begin{macro}{\App}
9389% \changes{v1.5}{2023/06/17}{To be used conjointly with 9408% \changes{v1.5}{2023/06/22}{To be used conjointly with
9390% \texttt{ekdosis.el}} 9409% \texttt{ekdosis.el}}
9391% In contrast to \cs{app}, \cs{App} takes two mandatory arguments and 9410% In contrast to \cs{app}, \cs{App} takes two mandatory arguments and
9392% accepts one optional argument like so: 9411% accepts one optional argument like so:
@@ -9950,13 +9969,13 @@ Sample text with a \textcolor{red}{word} in red.
9950 }% 9969 }%
9951 }% 9970 }%
9952 \ifekd@mapps 9971 \ifekd@mapps
9953 \append@app[\ekdan@type]{\rdg@app}% 9972 \append@app[\ekdan@type]{\rdg@app}%
9954 \else 9973 \else
9955 \append@app{\rdg@app}% 9974 \append@app{\rdg@app}%
9956 \fi 9975 \fi
9957 \fi 9976\fi
9958 \egroup 9977\egroup
9959 \ekd@subsq@rdgtrue 9978\ekd@subsq@rdgtrue
9960} 9979}
9961% \end{macrocode} 9980% \end{macrocode}
9962% \end{macro} 9981% \end{macro}
@@ -10059,11 +10078,11 @@ Sample text with a \textcolor{red}{word} in red.
10059 \ifbool{ekd@lang@pkg}% 10078 \ifbool{ekd@lang@pkg}%
10060 {{\noexpand\selectlanguage{\app@note@lang}\unexpanded{#2}}}{% 10079 {{\noexpand\selectlanguage{\app@note@lang}\unexpanded{#2}}}{%
10061 {\unexpanded{#2}}}}}% 10080 {\unexpanded{#2}}}}}%
10062 \ifekd@mapps% 10081 \ifekd@mapps
10063 \unconditional@appin[\ekdan@type]{\note@contents}% 10082 \unconditional@appin[\ekdan@type]{\note@contents}%
10064 \else% 10083 \else
10065 \unconditional@appin{\note@contents}% 10084 \unconditional@appin{\note@contents}%
10066 \fi% 10085 \fi
10067 \luadirect{ekdosis.setprevnotelab(\luastringO{\ekdn@labelb})}% 10086 \luadirect{ekdosis.setprevnotelab(\luastringO{\ekdn@labelb})}%
10068 \egroup 10087 \egroup
10069 \subsq@unittrue 10088 \subsq@unittrue
@@ -10158,6 +10177,92 @@ Sample text with a \textcolor{red}{word} in red.
10158} 10177}
10159% \end{macrocode} 10178% \end{macrocode}
10160% \end{macro} 10179% \end{macro}
10180% \paragraph{Combining Footnotes Into a Single Paragraph}
10181% Footnotes combined as one paragraph are inserted with the standard
10182% \cs{footnote} command which is redirected to
10183% \cs{unconditional@appin} when |ekd@parafootnotes| is set to
10184% |true|:---
10185% \begin{macrocode}
10186\newif\ifekd@parafootnotes
10187% \end{macrocode}
10188% The keys to be used by \cs{SetFootnotes} are defined below:---
10189% \begin{macrocode}
10190\ekvdefinekeys{ekd@footnotes}{
10191 choice layout = {
10192 default = \relax,
10193 paragraph = \ekd@parafootnotestrue
10194 },
10195 initial layout = default,
10196 unknown-choice layout = \PackageError{ekdosis}{unknown
10197 layout=#1}{`layout' must be either `default' or `paragraph'.},
10198 store type = \ekdfn@type,
10199 initial type = default,
10200 code textfnmark = \protected\def\ekd@around@fnmark##1{#1},
10201 initial textfnmark = \textsuperscript{#1},
10202 code appfnmark = \protected\def\ekdappfnmark##1{#1},
10203 initial appfnmark = \textsuperscript{#1}
10204}
10205\newif\ifekd@fnmark
10206\ekvdefinekeys{ekd@infootnotes}{
10207 store type = \ekdfn@type,
10208 initial type = default,
10209 code mark = \ekd@fnmarktrue
10210 \protected\def\ekd@fnmark@value{#1}
10211}
10212% \end{macrocode}
10213% \begin{macro}{\SetFootnotes}
10214% \changes{v1.5}{2023/06/22}{footnotes combined into a single
10215% paragraph} \cs{SetFootnotes}\marg{options} can be used in the
10216% preamble or at any point of the document. |layout=paragraph|
10217% instructs \pkg{ekdosis} to combine all footnotes into a single
10218% paragraph. Then the other |key-value| options that are defined
10219% just above allow to format the marks and specify the layer where
10220% the notes are to be printed.
10221% \begin{macrocode}
10222\ekvsetdef\SetFootnotes{ekd@footnotes}
10223% \end{macrocode}
10224% \end{macro}
10225% \begin{macro}{\ekd@parafootnote}
10226% \cs{ekd@parafootnote}\oarg{layer}\marg{contents} holds the new
10227% definition of \cs{footnote}. This command accepts an optional
10228% argument that can be used to specify the layer in which the
10229% contents of the footnote is to be printed.
10230% \begin{macrocode}
10231\NewDocumentCommand{\ekd@parafootnote}{O{} m}{%
10232 \ifekd@state
10233 \bgroup
10234 \ekvset{ekd@infootnotes}{#1}%
10235 \ifekd@fnmark
10236 \edef\ekd@parafn@mark{%
10237 \LRnum{\unexpanded\expandafter{\ekd@fnmark@value}}}%
10238 \edef\ekd@inparafn@mark{%
10239 \ekdappfnmark{\LRnum{\unexpanded\expandafter{\ekd@fnmark@value}}}}%
10240 \else
10241 \refstepcounter{footnote}%
10242 \edef\ekd@parafn@mark{\LRnum{\thefootnote}}%
10243 \edef\ekd@inparafn@mark{\ekdappfnmark{\LRnum{\thefootnote}}}%
10244 \fi
10245 \leavevmode
10246 \stepcounter{ekd@lab}%
10247 \zlabel{ekd:\theekd@lab}%
10248 \luadirect{ekdosis.storeabspg(
10249 \luastring{\zref@extract{ekd:\theekd@lab}{abspage}})}%
10250 \add@apparatus
10251 \luadirect{ekdosis.increment_bagunits(\luastringO{\ekdfn@type})}%
10252 \luadirect{tex.sprint(ekdosis.limit_bagunits(\luastringO{\ekdan@type}))}%
10253 \ekd@around@fnmark{\ekd@parafn@mark}%
10254 \ifekd@mapps
10255 \unconditional@appin[\ekdfn@type]{\ekd@inparafn@mark #2}%
10256 \else
10257 \unconditional@appin{\ekd@inparafn@mark #2}%
10258 \fi
10259 \egroup
10260 \else
10261 \footnote{#2}%
10262 \fi
10263}
10264% \end{macrocode}
10265% \end{macro}
10161% \paragraph{Emendations and Conjectures} 10266% \paragraph{Emendations and Conjectures}
10162% Here follows the |key-value| options to be used by 10267% Here follows the |key-value| options to be used by
10163% \cs{SetCritSymbols} below:--- 10268% \cs{SetCritSymbols} below:---
@@ -10270,7 +10375,7 @@ Sample text with a \textcolor{red}{word} in red.
10270% \end{macro} 10375% \end{macro}
10271% \paragraph{Lacunae} 10376% \paragraph{Lacunae}
10272% \begin{macro}{\ilabel} 10377% \begin{macro}{\ilabel}
10273% \changes{v1.5}{2023/06/17}{recalls and sets the ending label of 10378% \changes{v1.5}{2023/06/22}{recalls and sets the ending label of
10274% lemmas used to mark lacunae in witnesses} When \cs{lem} has been 10379% lemmas used to mark lacunae in witnesses} When \cs{lem} has been
10275% used with the optional argument |ilabel=<label>|, 10380% used with the optional argument |ilabel=<label>|,
10276% \cs{ilabel}\marg{label} must be used to mark the point where the 10381% \cs{ilabel}\marg{label} must be used to mark the point where the
@@ -10313,7 +10418,11 @@ Sample text with a \textcolor{red}{word} in red.
10313% Start and stop |ekdosis|: 10418% Start and stop |ekdosis|:
10314% \begin{macrocode} 10419% \begin{macrocode}
10315\NewDocumentCommand{\EkdosisOn}{}{% 10420\NewDocumentCommand{\EkdosisOn}{}{%
10316 \ekd@statetrue} 10421 \ekd@statetrue
10422 \ifekd@parafootnotes
10423 \RenewCommandCopy\footnote\ekd@parafootnote
10424 \fi
10425}
10317\NewDocumentCommand{\EkdosisOff}{}{% 10426\NewDocumentCommand{\EkdosisOff}{}{%
10318 \ekd@statefalse% 10427 \ekd@statefalse%
10319} 10428}
@@ -10413,6 +10522,9 @@ Sample text with a \textcolor{red}{word} in red.
10413 \ifekd@hidelinenumbers 10522 \ifekd@hidelinenumbers
10414 \def\thelinenumber{}% 10523 \def\thelinenumber{}%
10415 \fi 10524 \fi
10525 \ifekd@parafootnotes
10526 \RenewCommandCopy\footnote\ekd@parafootnote
10527 \fi
10416} 10528}
10417\NewDocumentCommand{\EkdosisColStop}{}{% 10529\NewDocumentCommand{\EkdosisColStop}{}{%
10418 \stepcounter{ekd@lab}% 10530 \stepcounter{ekd@lab}%
@@ -10592,7 +10704,7 @@ Sample text with a \textcolor{red}{word} in red.
10592% \end{macrocode} 10704% \end{macrocode}
10593% \end{macro} 10705% \end{macro}
10594% \begin{macro}{\ekdEOprint} 10706% \begin{macro}{\ekdEOprint}
10595% \changes{v1.5}{2023/06/17}{Sets headers and footers on 10707% \changes{v1.5}{2023/06/22}{Sets headers and footers on
10596% \enquote{paired} facing pages} 10708% \enquote{paired} facing pages}
10597% To set headers and footers on \enquote{paired} facing pages, 10709% To set headers and footers on \enquote{paired} facing pages,
10598% \cs{ekdEOprint} accepts two mandatory, self-evident arguments, like 10710% \cs{ekdEOprint} accepts two mandatory, self-evident arguments, like
@@ -10632,7 +10744,7 @@ Sample text with a \textcolor{red}{word} in red.
10632% counter to set the value of the page numbers. This counter should be 10744% counter to set the value of the page numbers. This counter should be
10633% incremented every two pages. 10745% incremented every two pages.
10634% \begin{counter}{pairedpage} 10746% \begin{counter}{pairedpage}
10635% \changes{v1.5}{2023/06/17}{A counter incremented every two pages} 10747% \changes{v1.5}{2023/06/22}{A counter incremented every two pages}
10636% |pairedpage| is first set as a global counter:--- 10748% |pairedpage| is first set as a global counter:---
10637% \begin{macrocode} 10749% \begin{macrocode}
10638\newcounter{pairedpage} 10750\newcounter{pairedpage}
@@ -10640,19 +10752,19 @@ Sample text with a \textcolor{red}{word} in red.
10640% \end{macrocode} 10752% \end{macrocode}
10641% \end{counter} 10753% \end{counter}
10642% \begin{macro}{\setpairedpagenum} 10754% \begin{macro}{\setpairedpagenum}
10643% \changes{v1.5}{2023/06/17}{sets the same page number on paired 10755% \changes{v1.5}{2023/06/22}{sets the same page number on paired
10644% pages} \cs{setpairedpagenum}\marg{number} is used just ahead of 10756% pages} \cs{setpairedpagenum}\marg{number} is used just ahead of
10645% the alignment environment to set the number of the first left-hand 10757% the alignment environment to set the number of the first left-hand
10646% paired page. 10758% paired page.
10647% \begin{macro}{\setpairedpage} 10759% \begin{macro}{\setpairedpage}
10648% \changes{v1.5}{2023/06/17}{sets the page number of the first paired 10760% \changes{v1.5}{2023/06/22}{sets the page number of the first paired
10649% page} \cs{setpairedpage} is an argument-less command meant to be 10761% page} \cs{setpairedpage} is an argument-less command meant to be
10650% issued in commands used to set headers or footers before 10762% issued in commands used to set headers or footers before
10651% \cs{thepage}. This command has the counter |pairedpage| 10763% \cs{thepage}. This command has the counter |pairedpage|
10652% incremented on right-hand pages only, and sets |page| $\leftarrow$ 10764% incremented on right-hand pages only, and sets |page| $\leftarrow$
10653% |pairedpage| on every page. 10765% |pairedpage| on every page.
10654% \begin{macro}{\resetpagenumber} 10766% \begin{macro}{\resetpagenumber}
10655% \changes{v1.5}{2023/06/17}{resets normal running page numbers} 10767% \changes{v1.5}{2023/06/22}{resets normal running page numbers}
10656% \cs{resetpagenumber} must be used right out of \enquote{mirrored} 10768% \cs{resetpagenumber} must be used right out of \enquote{mirrored}
10657% paired pages alignment environments. This argument-less command 10769% paired pages alignment environments. This argument-less command
10658% corrects any numbering error on the page following the edition 10770% corrects any numbering error on the page following the edition
@@ -11031,7 +11143,8 @@ local aftercmd = lpeg.Cs(lpeg.S("*[{,.?;:'`\"") + dblbkslash)
11031local cmdargs = lpeg.Cs(spce^-1 * bsqbracketsii * bcbracesii * bsqbrackets^-1) 11143local cmdargs = lpeg.Cs(spce^-1 * bsqbracketsii * bcbracesii * bsqbrackets^-1)
11032local app = lpeg.Cs("app") 11144local app = lpeg.Cs("app")
11033local lemrdg = lpeg.Cs(lpeg.Cs("lem") + lpeg.Cs("rdg")) 11145local lemrdg = lpeg.Cs(lpeg.Cs("lem") + lpeg.Cs("rdg"))
11034local note = lpeg.Cs("note") 11146local footnote = lpeg.Cs(lpeg.P("footnote"))
11147local note = lpeg.Cs(lpeg.P("note"))
11035local inlem = lpeg.Cs{ "<lem" * ((1 - (lpeg.P"<lem" + lpeg.P"</lem>")) + lpeg.V(1))^0 * "</lem>" } 11148local inlem = lpeg.Cs{ "<lem" * ((1 - (lpeg.P"<lem" + lpeg.P"</lem>")) + lpeg.V(1))^0 * "</lem>" }
11036local inanchor = lpeg.Cs{ "<anchor" * ((1 - (lpeg.P"<" + lpeg.P">")) + lpeg.V(1))^0 * ">" } 11149local inanchor = lpeg.Cs{ "<anchor" * ((1 - (lpeg.P"<" + lpeg.P">")) + lpeg.V(1))^0 * ">" }
11037local inopeningnote = lpeg.Cs{ "<note" * ((1 - (lpeg.P"<" + lpeg.P">")) + lpeg.V(1))^0 * ">" } 11150local inopeningnote = lpeg.Cs{ "<note" * ((1 - (lpeg.P"<" + lpeg.P">")) + lpeg.V(1))^0 * ">" }
@@ -11403,7 +11516,7 @@ local cmdtotags = {
11403 {a="RLfootnote", b="note", c=" place=\"bottom\""}, 11516 {a="RLfootnote", b="note", c=" place=\"bottom\""},
11404 {a="enquote *", b="quote", c=""}, 11517 {a="enquote *", b="quote", c=""},
11405 {a="marginpar", b="note", c=" place=\"margin\""}, 11518 {a="marginpar", b="note", c=" place=\"margin\""},
11406 {a="footnote", b="note", c=" place=\"bottom\""}, 11519 -- {a="footnote", b="note", c=" place=\"bottom\""},
11407 {a="enquote", b="quote", c=""}, 11520 {a="enquote", b="quote", c=""},
11408 {a="prname *", b="span", 11521 {a="prname *", b="span",
11409 c=" xml:lang=\"ar-Latn\" type=\"transliterated\""}, 11522 c=" xml:lang=\"ar-Latn\" type=\"transliterated\""},
@@ -11578,6 +11691,26 @@ local function xml_entities(str)
11578 return str 11691 return str
11579end 11692end
11580 11693
11694local function footnote_totei(str)
11695 str = gsub(str, dblbkslash * footnote * spce^-1 * bcbraces, "%1%2%3[]%4")
11696 str = gsub(str,
11697 dblbkslash *
11698 footnote *
11699 spcenc^-1 *
11700 bsqbrackets *
11701 bcbraces *
11702 spcenc^-1,
11703 function(bkslash, cmd, opt, arg)
11704 opt = string.sub(opt, 2, -2)
11705 arg = string.sub(arg, 2, -2)
11706 teitype = get_attr_value(opt, "type")
11707 cmd = "note"
11708 if teitype ~= "" then teitype = " type=\""..teitype.."\"" else end
11709 return string.format("<%s%s place=\"bottom\">%s</%s>", cmd, teitype, arg, cmd)
11710 end)
11711 return str
11712end
11713
11581local function note_totei(str) 11714local function note_totei(str)
11582 str = gsub(str, 11715 str = gsub(str,
11583 dblbkslash * 11716 dblbkslash *
@@ -12509,6 +12642,7 @@ end
12509local function textotei(str) 12642local function textotei(str)
12510 str = xml_entities(str) 12643 str = xml_entities(str)
12511 str = texpatttotei(str) 12644 str = texpatttotei(str)
12645 str = footnote_totei(str)
12512 str = note_totei(str) 12646 str = note_totei(str)
12513 str = remove_extra_anchors(str) 12647 str = remove_extra_anchors(str)
12514 str = app_totei(str) 12648 str = app_totei(str)
diff --git a/ekdosis.el b/ekdosis.el
index 37ac9f4..ccc1853 100644
--- a/ekdosis.el
+++ b/ekdosis.el
@@ -242,6 +242,18 @@
242 ("lineation" ("page" "document"))) 242 ("lineation" ("page" "document")))
243 "Local options for alignment env.") 243 "Local options for alignment env.")
244 244
245(defvar LaTeX-ekdosis-footnotes-key-val-options
246 '(("layout" ("default" "paragraph"))
247 ("type")
248 ("textfnmark")
249 ("appfnmark"))
250 "Local options for footnotes combined in a single paragraph.")
251
252(defvar LaTeX-ekdosis-footnote-options
253 '(("type")
254 ("mark"))
255 "Local options for footnote macro.")
256
245(defvar LaTeX-ekdosis-ekdverse-key-val-options 257(defvar LaTeX-ekdosis-ekdverse-key-val-options
246 '(("width") 258 '(("width")
247 ("type")) 259 ("type"))
@@ -400,8 +412,12 @@
400 '("SetDefaultApparatus" "apparatus name" 0) 412 '("SetDefaultApparatus" "apparatus name" 0)
401 '("DeclareApparatus" "apparatus name" 413 '("DeclareApparatus" "apparatus name"
402 [ TeX-arg-key-val LaTeX-ekdosis-declareapparatus-options ] 0) 414 [ TeX-arg-key-val LaTeX-ekdosis-declareapparatus-options ] 0)
415 '("footnote" [ TeX-arg-key-val LaTeX-ekdosis-footnote-options ]
416 t)
403 '("indentpattern" "pattern" 0) 417 '("indentpattern" "pattern" 0)
404 '("vin" 0) 418 '("vin" 0)
419 '("SetFootnotes"
420 (TeX-arg-key-val LaTeX-ekdosis-footnotes-key-val-options))
405 '("SetLineation" (TeX-arg-key-val LaTeX-ekdosis-setlineation-options)) 421 '("SetLineation" (TeX-arg-key-val LaTeX-ekdosis-setlineation-options))
406 '("innerlinenumbers" 0) 422 '("innerlinenumbers" 0)
407 '("outerlinenumbers" 0) 423 '("outerlinenumbers" 0)