From e1351175a5b28e9422106abcd216047a6d5e05d8 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Mon, 30 Aug 2021 17:54:07 +0200
Subject: new option 'keepinapp' for \SetCritSymbols

---
 ekdosis.dtx | 46 ++++++++++++++++++++++++++++++++++++----------
 1 file changed, 36 insertions(+), 10 deletions(-)

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index ca73f75..7ff76a2 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -2558,6 +2558,14 @@ friend
 % \DescribeOption{gapmark}|gapmark|$=$\meta{symbols}
 % \hfill\tcboxverb{Default: ***}\\
 % The symbols used to mark lacunae.\\
+% \DescribeOption{keepinapp} |keepinapp|$=$\verb+true|false+
+% \hfill\tcboxverb{Default: false}\\
+% \newfeature[v1.4] This named argument does not need a value as it
+% defaults to |true| if used. By default, the critical symbols used by
+% \cs{supplied}, \cs{surplus} and \cs{sic} described below
+% \vpagerefrange{ref:corr-cmds-b}{ref:corr-cmds-e} are printed in the
+% edition text but removed from the apparatus. |keepinapp| instructs
+% \pkg{ekdosis} to print these symbols in both places.
 %
 % As an example, what follows sets |[]| for deletions and |...| for
 % lacunae:---
@@ -2585,6 +2593,7 @@ friend
 % used to perform the test.
 %
 % \paragraph{Editorial Addition}
+% \phts\label{ref:corr-cmds-b}
 % \DescribeMacro{\supplied}\newfeature[v1.1]\cs{supplied}\marg{text}
 % is used to mark \meta{text} that is by definition missing from the
 % tradition as supplied by the editor or some other scholar. This
@@ -2602,6 +2611,7 @@ friend
 % mandatory argument the text deemed by the editor to be readable but
 % not understandable. \cs{sic} inserts \meta{text} between cruces
 % while \cs{sic*} prints only one crux before \meta{text}.
+% \phts\label{ref:corr-cmds-e}
 %
 % \paragraph{Lacuna}
 % \DescribeMacro{\gap}\newfeature[v1.1] \cs{gap}\marg{csv list of
@@ -8422,9 +8432,10 @@ Sample text with a \textcolor{red}{word} in red.
 % either in the footnote floating block or in a float of its own,
 % depending on the value set in the |layout| global option. As some
 % commands need to know whether they are called from inside the
-% apparatus criticus, a conditional is first defined.
+% apparatus criticus, two conditionals are first defined.
 %    \begin{macrocode}
 \newif\ifekd@inside@app
+\newif\ifekd@keepinapp
 %    \end{macrocode}
 % Then \cs{ekd@fitapp} is defined for |layout=fitapp|:---
 %    \begin{macrocode}
@@ -9361,7 +9372,8 @@ Sample text with a \textcolor{red}{word} in red.
   initial delend = \ifbool{al@rlmode}{\{}{\}},
   initial sicbegin = \dag,
   initial sicend = \dag,
-  initial gapmark = ***
+  initial gapmark = ***,
+  bool keepinapp = \ifekd@keepinapp
 }
 %    \end{macrocode}
 % \begin{macro}{\supplied}
@@ -9371,9 +9383,13 @@ Sample text with a \textcolor{red}{word} in red.
 %    \begin{macrocode}
 \NewDocumentCommand{\supplied}{m}{%
   \ifekd@inside@app
-  #1%
+    \ifekd@keepinapp
+      \suppb@value #1\suppe@value
+    \else
+      #1%
+    \fi
   \else
-  \suppb@value #1\suppe@value
+    \suppb@value #1\suppe@value
   \fi
 }
 %    \end{macrocode}
@@ -9387,9 +9403,13 @@ Sample text with a \textcolor{red}{word} in red.
 %    \begin{macrocode}
 \NewDocumentCommand{\surplus}{m}{%
   \ifekd@inside@app
-  #1%
+    \ifekd@keepinapp
+      \delb@value #1\dele@value
+    \else
+      #1%
+    \fi
   \else
-  \delb@value #1\dele@value
+    \delb@value #1\dele@value
   \fi
 }
 %    \end{macrocode}
@@ -9404,11 +9424,17 @@ Sample text with a \textcolor{red}{word} in red.
 %    \begin{macrocode}
 \NewDocumentCommand{\sic}{s m}{%
   \ifekd@inside@app
-  #2%
+    \ifekd@keepinapp
+      \IfBooleanTF{#1}
+        {\sicb@value #2}
+        {\sicb@value #2\sice@value}%
+    \else
+      #2%
+    \fi
   \else
-  \IfBooleanTF{#1}
-    {\sicb@value #2}
-    {\sicb@value #2\sice@value}%
+    \IfBooleanTF{#1}
+      {\sicb@value #2}
+      {\sicb@value #2\sice@value}%
   \fi
 }
 %    \end{macrocode}
-- 
cgit v1.2.3

