From 7f6d19adb83a2e81312a69208876c360f1848d7d Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Fri, 26 Aug 2022 15:44:26 +0200 Subject: new alternate command \App to allow for better code folding with ekdosis.el --- Makefile | 1 + ekdosis.dtx | 108 ++++++++++++++++++++++++++++++++++++++++++++++++------------ ekdosis.el | 8 +++++ 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 @ echo "Cleaning $(NAME) directory" rm -f $(NAME).bib $(PWD)/TMP/*.bib rm -rf .backup + rm -rf auto find -iname "*~" -or -iname "*.pdf" -or -iname "*_out*.tex" | xargs rm -rf find ./* -type f -iname "Makefile" $(findopts) $(findfiles) > ls-R 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 %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{ekdosis} %<*package> - [2022/05/15 v1.5-dev Typesetting TEI xml-compliant critical editions] + [2022/08/26 v1.5-dev Typesetting TEI xml-compliant critical editions] % %<*driver> \begin{filecontents}[noheader,overwrite]{bibdata.xml} @@ -685,9 +685,11 @@ along with this program. If not, see \newbool{nocolordoc} \definecolor{ekdcolor}{RGB}{243,241,235} \definecolor{cinnamon}{rgb}{0.82, 0.41, 0.12} +\definecolor{lavender}{RGB}{152,115,172} \ifbool{nocolordoc}{ \colorlet{ekdcolor}{white} - \colorlet{cinnamon}{black}}{} + \colorlet{cinnamon}{black} + \colorlet{lavender}{gray}}{} \definecolor{gainsboro}{RGB}{222,222,222} \PassOptionsToPackage{bookmarks=true}{hyperref} \usepackage[numbered]{hypdoc} @@ -1927,11 +1929,53 @@ yesterday. % option}. For more information about inserting notes in % multiple-layer apparatus, see \vref{sec:notes-in-multilayer-app}. % -% \paragraph{Base text and variants} As can be seen in the example -% above, there are two kinds of individual readings: the \emph{lemma}, -% which contains the base text accepted by the editor, and the -% \emph{reading}, which contains deviant readings rejected by the -% editor. +% \paragraph{Alternate Command} +% \DescribeMacro{\App} +% \newfeature[v1.5]\cs{App}|[type=|\meta{type}|]|\marg{lemma +% text}\marg{readings and notes}\phts\label{ref:App-cmd}\\ +% \cs{App} is strictly equivalent to \cs{app}, except that the +% apparatus entries are meant to be distributed in two different +% arguments, like so:--- +% +% \iffalse +%<*example> +% \fi +\begin{minted}[linenos=false]{latex} +I saw my friend \App{\lem{Peter}}{\rdg{John}} yesterday. +or: +I saw my friend \App{\lem{Peter}}{ + \rdg{John} + } yesterday. +\end{minted} +% \iffalse +% +% \fi +% +% Used in the \textsf{emacs} editor conjointly with the AUC\TeX\ style +% file that is provided by \pkg{ekdosis}, this command allows for much +% more flexible code folding where notes and variants are hidden to +% let only the base text appear on the screen. Code folding, once +% applied, results in a clean source text with no clutter as +% follows:--- +% +% \iffalse +%<*example> +% \fi +\begin{minted}[escapeinside=++]{latex} +I saw my friend +\textcolor{lavender}{Peter}+ yesterday. +\end{minted} +% \iffalse +% +% \fi +% +% \danger There is no point in using this command for anything other +% than this specific purpose. +% +% \paragraph{Base text and variants} As can be seen in \vref{lst:pj1} +% and the examples provided above, there are two kinds of individual +% readings: the \emph{lemma}, which contains the base text accepted by +% the editor, and the \emph{reading}, which contains deviant readings +% rejected by the editor. % % \danger What follows refers to the notions of \enquote{witness}, % \enquote{source} and \enquote{scholar} as defined above @@ -6287,7 +6331,7 @@ subtype="arabtex">'inna 'abI kAna mina % command uses a private control sequence, it must be found within % \cs{makeatletter} \dots\ \cs{makeatother}. % \item Line~10: \cs{ekddot} will only work with multiple-layer -% apparatus criticus. Therefore, \cs{DeclareAppa{\allowbreak}ratus} +% apparatus criticus. Therefore, |\DeclareAppa|\allowbreak|ratus| % must be used even if only one layer of critical notes be needed. % \end{remarks} % @@ -8270,7 +8314,7 @@ Sample text with a \textcolor{red}{word} in red. % \end{macrocode} % \paragraph{\textsf{ekdosis} Symbol} % \begin{macro}{\eKd} -% \changes{v1.5}{2022/05/15}{Prints \textsf{ekdosis} indentifying +% \changes{v1.5}{2022/08/26}{Prints \textsf{ekdosis} indentifying % symbol} As of v1.5, \pkg{ekdosis} has its own identifying % symbol. It is produced by \cs{eKd} and best printed with the Old % Standard Greek font. @@ -8533,7 +8577,7 @@ Sample text with a \textcolor{red}{word} in red. % \begin{macro}{\teidirectE} % \changes{v1.3}{2021/08/18}{direct insertion of elements in the % \texttt{TEI xml} file} -% \changes{v1.5}{2022/05/15}{direct insertion of empty elements in the +% \changes{v1.5}{2022/08/26}{direct insertion of empty elements in the % \texttt{TEI xml} file} % \cs{teidirect}\oarg{xml attributes}\marg{xml element}\marg{code} % 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. % \end{macro} % \end{macro} % \begin{macro}{\getTEIxmlid} -% \changes{v1.5}{2022/05/15}{returns \texttt{TEI xml:ids} from a +% \changes{v1.5}{2022/08/26}{returns \texttt{TEI xml:ids} from a % csv-list of ids} This command returns from a csv-list of unique % identifiers declared in commands such as \cs{DeclareWitness} and the % 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. % \pkg{ekdosis} does not use the \enquote{pagewise} numbering mode % that is provided by \pkg{lineno}. Therefore, % \cs{outerlinenumbers} and \cs{innerlinenumbers} are defined in -% addition to \cs{rightlinenum{\allowbreak}bers} and +% addition to |\rightlinenum|\allowbreak|bers| and % \cs{leftlinenumbers}. % \begin{macrocode} \def\outerlinenumbers{% @@ -9275,8 +9319,8 @@ Sample text with a \textcolor{red}{word} in red. % \cs{app}|[type=|\meta{type}|]|\marg{apparatus entries} takes one % mandatory argument and accepts one optional argument. |type=| refers % to the layer the note must go into and \meta{apparatus entries} -% contains command used to insert the entries, either \cs{lem}, -% \cs{rdg} or \cs{note}\meta{*}:--- +% contains commands used to insert the entries, either \cs{lem}, +% \cs{rdg} or \cs{note}:--- % \begin{macrocode} \NewDocumentCommand{\app}{O{} > { \TrimSpaces } +m}{% \leavevmode @@ -9295,6 +9339,26 @@ Sample text with a \textcolor{red}{word} in red. \endgroup} % \end{macrocode} % \end{macro} +% \begin{macro}{\App} +% \changes{v1.5}{2022/08/26}{To be used conjointly with +% \texttt{ekdosis.el}} +% In contrast to \cs{app}, \cs{App} takes two mandatory arguments and +% accepts one optional argument like so: +% \cs{App}|[type=|\meta{type}|]|\marg{lemma text}\marg{variants and +% notes}. As just described above, |type=| refers to the layer the +% note must go into. \cs{App} is strictly equivalent to \cs{app}, +% except that lemmas, variants and notes are split into two different +% arguments, which allows for more flexible code folding. \meta{lemma +% text} is meant to receive \cs{lem}, while \cs{rdg} and \cs{note} go +% into \meta{variants and notes}. +% \begin{macrocode} +\NewDocumentCommand{\App}{omm}{% + \IfNoValueTF{#1} + {\app{#2#3}} + {\app[#1]{#2#3}}% +} +% \end{macrocode} +% \end{macro} % \begin{macro}{\ekdpage} % \changes{v1.4}{2021/11/21}{prints page marks used internally by % \textsf{ekdosis} to generate the apparatus blocks on pages} @@ -10149,7 +10213,7 @@ Sample text with a \textcolor{red}{word} in red. % \end{macro} % \paragraph{Lacunae} % \begin{macro}{\ilabel} -% \changes{v1.5}{2022/05/15}{recalls and sets the ending label of +% \changes{v1.5}{2022/08/26}{recalls and sets the ending label of % lemmas used to mark lacunae in witnesses} When \cs{lem} has been % used with the optional argument |ilabel=