aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2022-08-26 15:44:26 +0200
committerRobert Alessi <alessi@robertalessi.net>2022-08-26 15:44:26 +0200
commit7f6d19adb83a2e81312a69208876c360f1848d7d (patch)
tree5913514432f8aeb9ea1ee984927f383112903e87
parent2266cff7baf502a2f570fbcf38f67c2f0d3611fa (diff)
downloadekdosis-7f6d19adb83a2e81312a69208876c360f1848d7d.tar.gz
new alternate command \App to allow for better code folding with ekdosis.el
-rw-r--r--Makefile1
-rw-r--r--ekdosis.dtx108
-rw-r--r--ekdosis.el8
3 files changed, 96 insertions, 21 deletions
diff --git a/Makefile b/Makefile
index ef74a9e..a7e1910 100644
--- a/Makefile
+++ b/Makefile
@@ -51,6 +51,7 @@ clean: testsamples
51 @ echo "Cleaning $(NAME) directory" 51 @ echo "Cleaning $(NAME) directory"
52 rm -f $(NAME).bib $(PWD)/TMP/*.bib 52 rm -f $(NAME).bib $(PWD)/TMP/*.bib
53 rm -rf .backup 53 rm -rf .backup
54 rm -rf auto
54 find -iname "*~" -or -iname "*.pdf" -or -iname "*_out*.tex" | xargs rm -rf 55 find -iname "*~" -or -iname "*.pdf" -or -iname "*_out*.tex" | xargs rm -rf
55 find ./* -type f -iname "Makefile" $(findopts) $(findfiles) > ls-R 56 find ./* -type f -iname "Makefile" $(findopts) $(findfiles) > ls-R
56 find ./* -type f -iname "*.tex" | grep '/samples/' >> ls-R 57 find ./* -type f -iname "*.tex" | grep '/samples/' >> ls-R
diff --git a/ekdosis.dtx b/ekdosis.dtx
index 18bc279..db99e5c 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -61,7 +61,7 @@ along with this program. If not, see
61%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] 61%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
62%<package>\ProvidesPackage{ekdosis} 62%<package>\ProvidesPackage{ekdosis}
63%<*package> 63%<*package>
64 [2022/05/15 v1.5-dev Typesetting TEI xml-compliant critical editions] 64 [2022/08/26 v1.5-dev Typesetting TEI xml-compliant critical editions]
65%</package> 65%</package>
66%<*driver> 66%<*driver>
67\begin{filecontents}[noheader,overwrite]{bibdata.xml} 67\begin{filecontents}[noheader,overwrite]{bibdata.xml}
@@ -685,9 +685,11 @@ along with this program. If not, see
685\newbool{nocolordoc} 685\newbool{nocolordoc}
686\definecolor{ekdcolor}{RGB}{243,241,235} 686\definecolor{ekdcolor}{RGB}{243,241,235}
687\definecolor{cinnamon}{rgb}{0.82, 0.41, 0.12} 687\definecolor{cinnamon}{rgb}{0.82, 0.41, 0.12}
688\definecolor{lavender}{RGB}{152,115,172}
688\ifbool{nocolordoc}{ 689\ifbool{nocolordoc}{
689 \colorlet{ekdcolor}{white} 690 \colorlet{ekdcolor}{white}
690 \colorlet{cinnamon}{black}}{} 691 \colorlet{cinnamon}{black}
692 \colorlet{lavender}{gray}}{}
691\definecolor{gainsboro}{RGB}{222,222,222} 693\definecolor{gainsboro}{RGB}{222,222,222}
692\PassOptionsToPackage{bookmarks=true}{hyperref} 694\PassOptionsToPackage{bookmarks=true}{hyperref}
693\usepackage[numbered]{hypdoc} 695\usepackage[numbered]{hypdoc}
@@ -1927,11 +1929,53 @@ yesterday.
1927% option}. For more information about inserting notes in 1929% option}. For more information about inserting notes in
1928% multiple-layer apparatus, see \vref{sec:notes-in-multilayer-app}. 1930% multiple-layer apparatus, see \vref{sec:notes-in-multilayer-app}.
1929% 1931%
1930% \paragraph{Base text and variants} As can be seen in the example 1932% \paragraph{Alternate Command}
1931% above, there are two kinds of individual readings: the \emph{lemma}, 1933% \DescribeMacro{\App}
1932% which contains the base text accepted by the editor, and the 1934% \newfeature[v1.5]\cs{App}|[type=|\meta{type}|]|\marg{lemma
1933% \emph{reading}, which contains deviant readings rejected by the 1935% text}\marg{readings and notes}\phts\label{ref:App-cmd}\\
1934% editor. 1936% \cs{App} is strictly equivalent to \cs{app}, except that the
1937% apparatus entries are meant to be distributed in two different
1938% arguments, like so:---
1939%
1940% \iffalse
1941%<*example>
1942% \fi
1943\begin{minted}[linenos=false]{latex}
1944I saw my friend \App{\lem{Peter}}{\rdg{John}} yesterday.
1945or:
1946I saw my friend \App{\lem{Peter}}{
1947 \rdg{John}
1948 } yesterday.
1949\end{minted}
1950% \iffalse
1951%</example>
1952% \fi
1953%
1954% Used in the \textsf{emacs} editor conjointly with the AUC\TeX\ style
1955% file that is provided by \pkg{ekdosis}, this command allows for much
1956% more flexible code folding where notes and variants are hidden to
1957% let only the base text appear on the screen. Code folding, once
1958% applied, results in a clean source text with no clutter as
1959% follows:---
1960%
1961% \iffalse
1962%<*example>
1963% \fi
1964\begin{minted}[escapeinside=++]{latex}
1965I saw my friend +\textcolor{lavender}{Peter}+ yesterday.
1966\end{minted}
1967% \iffalse
1968%</example>
1969% \fi
1970%
1971% \danger There is no point in using this command for anything other
1972% than this specific purpose.
1973%
1974% \paragraph{Base text and variants} As can be seen in \vref{lst:pj1}
1975% and the examples provided above, there are two kinds of individual
1976% readings: the \emph{lemma}, which contains the base text accepted by
1977% the editor, and the \emph{reading}, which contains deviant readings
1978% rejected by the editor.
1935% 1979%
1936% \danger What follows refers to the notions of \enquote{witness}, 1980% \danger What follows refers to the notions of \enquote{witness},
1937% \enquote{source} and \enquote{scholar} as defined above 1981% \enquote{source} and \enquote{scholar} as defined above
@@ -6287,7 +6331,7 @@ subtype="arabtex">'inna 'abI kAna mina
6287% command uses a private control sequence, it must be found within 6331% command uses a private control sequence, it must be found within
6288% \cs{makeatletter} \dots\ \cs{makeatother}. 6332% \cs{makeatletter} \dots\ \cs{makeatother}.
6289% \item Line~10: \cs{ekddot} will only work with multiple-layer 6333% \item Line~10: \cs{ekddot} will only work with multiple-layer
6290% apparatus criticus. Therefore, \cs{DeclareAppa{\allowbreak}ratus} 6334% apparatus criticus. Therefore, |\DeclareAppa|\allowbreak|ratus|
6291% must be used even if only one layer of critical notes be needed. 6335% must be used even if only one layer of critical notes be needed.
6292% \end{remarks} 6336% \end{remarks}
6293% 6337%
@@ -8270,7 +8314,7 @@ Sample text with a \textcolor{red}{word} in red.
8270% \end{macrocode} 8314% \end{macrocode}
8271% \paragraph{\textsf{ekdosis} Symbol} 8315% \paragraph{\textsf{ekdosis} Symbol}
8272% \begin{macro}{\eKd} 8316% \begin{macro}{\eKd}
8273% \changes{v1.5}{2022/05/15}{Prints \textsf{ekdosis} indentifying 8317% \changes{v1.5}{2022/08/26}{Prints \textsf{ekdosis} indentifying
8274% symbol} As of v1.5, \pkg{ekdosis} has its own identifying 8318% symbol} As of v1.5, \pkg{ekdosis} has its own identifying
8275% symbol. It is produced by \cs{eKd} and best printed with the Old 8319% symbol. It is produced by \cs{eKd} and best printed with the Old
8276% Standard Greek font. 8320% Standard Greek font.
@@ -8533,7 +8577,7 @@ Sample text with a \textcolor{red}{word} in red.
8533% \begin{macro}{\teidirectE} 8577% \begin{macro}{\teidirectE}
8534% \changes{v1.3}{2021/08/18}{direct insertion of elements in the 8578% \changes{v1.3}{2021/08/18}{direct insertion of elements in the
8535% \texttt{TEI xml} file} 8579% \texttt{TEI xml} file}
8536% \changes{v1.5}{2022/05/15}{direct insertion of empty elements in the 8580% \changes{v1.5}{2022/08/26}{direct insertion of empty elements in the
8537% \texttt{TEI xml} file} 8581% \texttt{TEI xml} file}
8538% \cs{teidirect}\oarg{xml attributes}\marg{xml element}\marg{code} 8582% \cs{teidirect}\oarg{xml attributes}\marg{xml element}\marg{code}
8539% does nothing in \LaTeX. It is only used to insert elements in the 8583% does nothing in \LaTeX. It is only used to insert elements in the
@@ -8548,7 +8592,7 @@ Sample text with a \textcolor{red}{word} in red.
8548% \end{macro} 8592% \end{macro}
8549% \end{macro} 8593% \end{macro}
8550% \begin{macro}{\getTEIxmlid} 8594% \begin{macro}{\getTEIxmlid}
8551% \changes{v1.5}{2022/05/15}{returns \texttt{TEI xml:ids} from a 8595% \changes{v1.5}{2022/08/26}{returns \texttt{TEI xml:ids} from a
8552% csv-list of ids} This command returns from a csv-list of unique 8596% csv-list of ids} This command returns from a csv-list of unique
8553% identifiers declared in commands such as \cs{DeclareWitness} and the 8597% identifiers declared in commands such as \cs{DeclareWitness} and the
8554% like a space-separated list of their corresponding |xml:id|s, each 8598% like a space-separated list of their corresponding |xml:id|s, each
@@ -9150,7 +9194,7 @@ Sample text with a \textcolor{red}{word} in red.
9150% \pkg{ekdosis} does not use the \enquote{pagewise} numbering mode 9194% \pkg{ekdosis} does not use the \enquote{pagewise} numbering mode
9151% that is provided by \pkg{lineno}. Therefore, 9195% that is provided by \pkg{lineno}. Therefore,
9152% \cs{outerlinenumbers} and \cs{innerlinenumbers} are defined in 9196% \cs{outerlinenumbers} and \cs{innerlinenumbers} are defined in
9153% addition to \cs{rightlinenum{\allowbreak}bers} and 9197% addition to |\rightlinenum|\allowbreak|bers| and
9154% \cs{leftlinenumbers}. 9198% \cs{leftlinenumbers}.
9155% \begin{macrocode} 9199% \begin{macrocode}
9156\def\outerlinenumbers{% 9200\def\outerlinenumbers{%
@@ -9275,8 +9319,8 @@ Sample text with a \textcolor{red}{word} in red.
9275% \cs{app}|[type=|\meta{type}|]|\marg{apparatus entries} takes one 9319% \cs{app}|[type=|\meta{type}|]|\marg{apparatus entries} takes one
9276% mandatory argument and accepts one optional argument. |type=| refers 9320% mandatory argument and accepts one optional argument. |type=| refers
9277% to the layer the note must go into and \meta{apparatus entries} 9321% to the layer the note must go into and \meta{apparatus entries}
9278% contains command used to insert the entries, either \cs{lem}, 9322% contains commands used to insert the entries, either \cs{lem},
9279% \cs{rdg} or \cs{note}\meta{*}:--- 9323% \cs{rdg} or \cs{note}:---
9280% \begin{macrocode} 9324% \begin{macrocode}
9281\NewDocumentCommand{\app}{O{} > { \TrimSpaces } +m}{% 9325\NewDocumentCommand{\app}{O{} > { \TrimSpaces } +m}{%
9282 \leavevmode 9326 \leavevmode
@@ -9295,6 +9339,26 @@ Sample text with a \textcolor{red}{word} in red.
9295 \endgroup} 9339 \endgroup}
9296% \end{macrocode} 9340% \end{macrocode}
9297% \end{macro} 9341% \end{macro}
9342% \begin{macro}{\App}
9343% \changes{v1.5}{2022/08/26}{To be used conjointly with
9344% \texttt{ekdosis.el}}
9345% In contrast to \cs{app}, \cs{App} takes two mandatory arguments and
9346% accepts one optional argument like so:
9347% \cs{App}|[type=|\meta{type}|]|\marg{lemma text}\marg{variants and
9348% notes}. As just described above, |type=| refers to the layer the
9349% note must go into. \cs{App} is strictly equivalent to \cs{app},
9350% except that lemmas, variants and notes are split into two different
9351% arguments, which allows for more flexible code folding. \meta{lemma
9352% text} is meant to receive \cs{lem}, while \cs{rdg} and \cs{note} go
9353% into \meta{variants and notes}.
9354% \begin{macrocode}
9355\NewDocumentCommand{\App}{omm}{%
9356 \IfNoValueTF{#1}
9357 {\app{#2#3}}
9358 {\app[#1]{#2#3}}%
9359}
9360% \end{macrocode}
9361% \end{macro}
9298% \begin{macro}{\ekdpage} 9362% \begin{macro}{\ekdpage}
9299% \changes{v1.4}{2021/11/21}{prints page marks used internally by 9363% \changes{v1.4}{2021/11/21}{prints page marks used internally by
9300% \textsf{ekdosis} to generate the apparatus blocks on pages} 9364% \textsf{ekdosis} to generate the apparatus blocks on pages}
@@ -10149,7 +10213,7 @@ Sample text with a \textcolor{red}{word} in red.
10149% \end{macro} 10213% \end{macro}
10150% \paragraph{Lacunae} 10214% \paragraph{Lacunae}
10151% \begin{macro}{\ilabel} 10215% \begin{macro}{\ilabel}
10152% \changes{v1.5}{2022/05/15}{recalls and sets the ending label of 10216% \changes{v1.5}{2022/08/26}{recalls and sets the ending label of
10153% lemmas used to mark lacunae in witnesses} When \cs{lem} has been 10217% lemmas used to mark lacunae in witnesses} When \cs{lem} has been
10154% used with the optional argument |ilabel=<label>|, 10218% used with the optional argument |ilabel=<label>|,
10155% \cs{ilabel}\marg{label} must be used to mark the point where the 10219% \cs{ilabel}\marg{label} must be used to mark the point where the
@@ -10465,7 +10529,7 @@ Sample text with a \textcolor{red}{word} in red.
10465% \end{macrocode} 10529% \end{macrocode}
10466% \end{macro} 10530% \end{macro}
10467% \begin{macro}{\ekdEOprint} 10531% \begin{macro}{\ekdEOprint}
10468% \changes{v1.5}{2022/05/15}{Sets headers and footers on 10532% \changes{v1.5}{2022/08/26}{Sets headers and footers on
10469% \enquote{paired} facing pages} 10533% \enquote{paired} facing pages}
10470% To set headers and footers on \enquote{paired} facing pages, 10534% To set headers and footers on \enquote{paired} facing pages,
10471% \cs{ekdEOprint} accepts two mandatory, self-evident arguments, like 10535% \cs{ekdEOprint} accepts two mandatory, self-evident arguments, like
@@ -10505,7 +10569,7 @@ Sample text with a \textcolor{red}{word} in red.
10505% counter to set the value of the page numbers. This counter should be 10569% counter to set the value of the page numbers. This counter should be
10506% incremented every two pages. 10570% incremented every two pages.
10507% \begin{counter}{pairedpage} 10571% \begin{counter}{pairedpage}
10508% \changes{v1.5}{2022/05/15}{A counter incremented every two pages} 10572% \changes{v1.5}{2022/08/26}{A counter incremented every two pages}
10509% |pairedpage| is first set as a global counter:--- 10573% |pairedpage| is first set as a global counter:---
10510% \begin{macrocode} 10574% \begin{macrocode}
10511\newcounter{pairedpage} 10575\newcounter{pairedpage}
@@ -10513,19 +10577,19 @@ Sample text with a \textcolor{red}{word} in red.
10513% \end{macrocode} 10577% \end{macrocode}
10514% \end{counter} 10578% \end{counter}
10515% \begin{macro}{\setpairedpagenum} 10579% \begin{macro}{\setpairedpagenum}
10516% \changes{v1.5}{2022/05/15}{sets the same page number on paired 10580% \changes{v1.5}{2022/08/26}{sets the same page number on paired
10517% pages} \cs{setpairedpagenum}\marg{number} is used just ahead of 10581% pages} \cs{setpairedpagenum}\marg{number} is used just ahead of
10518% the alignment environment to set the number of the first left-hand 10582% the alignment environment to set the number of the first left-hand
10519% paired page. 10583% paired page.
10520% \begin{macro}{\setpairedpage} 10584% \begin{macro}{\setpairedpage}
10521% \changes{v1.5}{2022/05/15}{sets the page number of the first paired 10585% \changes{v1.5}{2022/08/26}{sets the page number of the first paired
10522% page} \cs{setpairedpage} is an argument-less command meant to be 10586% page} \cs{setpairedpage} is an argument-less command meant to be
10523% issued in commands used to set headers or footers before 10587% issued in commands used to set headers or footers before
10524% \cs{thepage}. This command has the counter |pairedpage| 10588% \cs{thepage}. This command has the counter |pairedpage|
10525% incremented on right-hand pages only, and sets |page| $\leftarrow$ 10589% incremented on right-hand pages only, and sets |page| $\leftarrow$
10526% |pairedpage| on every page. 10590% |pairedpage| on every page.
10527% \begin{macro}{\resetpagenumber} 10591% \begin{macro}{\resetpagenumber}
10528% \changes{v1.5}{2022/05/15}{resets normal running page numbers} 10592% \changes{v1.5}{2022/08/26}{resets normal running page numbers}
10529% \cs{resetpagenumber} must be used right out of \enquote{mirrored} 10593% \cs{resetpagenumber} must be used right out of \enquote{mirrored}
10530% paired pages alignment environments. This argument-less command 10594% paired pages alignment environments. This argument-less command
10531% corrects any numbering error on the page following the edition 10595% corrects any numbering error on the page following the edition
@@ -10547,7 +10611,7 @@ Sample text with a \textcolor{red}{word} in red.
10547% \end{macro} 10611% \end{macro}
10548% \paragraph{Divisions of the Body} 10612% \paragraph{Divisions of the Body}
10549% \pkg{ekdosis} can convert \cs{book}, \cs{part}, \cs{chapter}, 10613% \pkg{ekdosis} can convert \cs{book}, \cs{part}, \cs{chapter},
10550% \cs{section}, \cs{subsec{\allowbreak}tion} and \cs{subsubsection} 10614% \cs{section}, |\subsec|\allowbreak|tion| and \cs{subsubsection}
10551% into corresponding \texttt{TEI} \enquote*{numbered} 10615% into corresponding \texttt{TEI} \enquote*{numbered}
10552% |<div|\textsubscript{\emph{n}}|>| elements, where $1\leq n\leq 6$. 10616% |<div|\textsubscript{\emph{n}}|>| elements, where $1\leq n\leq 6$.
10553% \begin{macro}{\MkBodyDivs} 10617% \begin{macro}{\MkBodyDivs}
@@ -11306,6 +11370,8 @@ local texpatttotags = {
11306 {a="\\ekdpb%s+%*?{(.-)}", b=""}, 11370 {a="\\ekdpb%s+%*?{(.-)}", b=""},
11307 {a="\\ekdpb%s+%*\\?", b=""}, 11371 {a="\\ekdpb%s+%*\\?", b=""},
11308 {a="\\mbox%s+(%b{})", b="ekd@ob%1ekd@cb"}, 11372 {a="\\mbox%s+(%b{})", b="ekd@ob%1ekd@cb"},
11373 {a="\\App%s+(%b[])(%b{})(%b{})", b="\\app[%1]{%2%3}"},
11374 {a="\\App%s+(%b{})(%b{})", b="\\app{%1%2}"},
11309 {a="\\LR%s+(%b{})", b="ekd@ob%1ekd@cb"}, 11375 {a="\\LR%s+(%b{})", b="ekd@ob%1ekd@cb"},
11310 {a="\\RL%s+(%b{})", b="ekd@ob%1ekd@cb"}, 11376 {a="\\RL%s+(%b{})", b="ekd@ob%1ekd@cb"},
11311 {a="\\%=%=%=%s?", b="—"}, 11377 {a="\\%=%=%=%s?", b="—"},
diff --git a/ekdosis.el b/ekdosis.el
index 50c6364..21d202f 100644
--- a/ekdosis.el
+++ b/ekdosis.el
@@ -257,6 +257,9 @@
257 ("resetvlinenumber" . nil)))) 257 ("resetvlinenumber" . nil))))
258 ;; Folding features: 258 ;; Folding features:
259 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list) 259 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list)
260 '("{1}" ("App"))
261 t)
262 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list)
260 '("{1}" ("app")) 263 '("{1}" ("app"))
261 t) 264 t)
262 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list) 265 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list)
@@ -269,6 +272,9 @@
269 '("[n]" ("note")) 272 '("[n]" ("note"))
270 t) 273 t)
271 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list) 274 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list)
275 '("[n]" ("note*"))
276 t)
277 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list)
272 '("[l]" ("linelabel")) 278 '("[l]" ("linelabel"))
273 t) 279 t)
274 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list) 280 (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list)
@@ -330,6 +336,8 @@
330 0) 336 0)
331 '("ilabel" "indexed label" 337 '("ilabel" "indexed label"
332 0) 338 0)
339 '("App" [ TeX-arg-key-val LaTeX-ekdosis-app-options ]
340 2)
333 '("app" [ TeX-arg-key-val LaTeX-ekdosis-app-options ] 341 '("app" [ TeX-arg-key-val LaTeX-ekdosis-app-options ]
334 t) 342 t)
335 '("lem" [ LaTeX-ekdosis-long-key-val LaTeX-ekdosis-lem-options ] 343 '("lem" [ LaTeX-ekdosis-long-key-val LaTeX-ekdosis-lem-options ]