From 9ad3d75b3ccad6ce150ac7eed6eb3ec973651a02 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Sun, 15 May 2022 11:36:36 +0200 Subject: removed the need of {} or \ after \ekdpb*. improved the \ekddot trick. removed the braces around the contents of \ekd@note added a second call texpatttotei() to process any remnant patterns --- ekdosis.dtx | 150 +++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 87 insertions(+), 63 deletions(-) diff --git a/ekdosis.dtx b/ekdosis.dtx index da016a7..7a16446 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/09 v1.5-dev Typesetting TEI xml-compliant critical editions] + [2022/05/15 v1.5-dev Typesetting TEI xml-compliant critical editions] % %<*driver> \begin{filecontents}[noheader,overwrite]{bibdata.xml} @@ -6156,7 +6156,7 @@ subtype="arabtex">'inna 'abI kAna mina % \paragraph{Conditional page breaks} % \phts\label{ref:ekdpb} \DescribeMacro{\ekdpb}\DescribeMacro{\ekdpb*} % \cs{ekdpb}\oarg{page no}\marg{line no} -% \cs{ekdpb*}|{}| \cs{ekdpb*}|\| +% \cs{ekdpb*}|{}| \cs{ekdpb*} % \newfeature[v1.2]\\ % One way to avoid this inconvenience is to use \cs{ekdpb} instead of % the standard \cs{pagebreak} command provided by \LaTeX\ to insert @@ -6269,7 +6269,7 @@ subtype="arabtex">'inna 'abI kAna mina \makeatletter \newcommand{\ekddot}{% - \ltx@ifnextchar{.}{\xspace}{.\xspace}} + \ltx@ifnextchar@nospace{.}{\xspace}{.\xspace}} \makeatother \DeclareApparatus{default}[ehook=.] @@ -6282,9 +6282,9 @@ subtype="arabtex">'inna 'abI kAna mina % \begin{remarks} % \item Line~2: The \pkg{xspace} package is needed for \cs{xspace} is % used by the \cs{ekddot} command that is defined at l.~6. -% \item Line~7: \cs{ltx@ifnextchar} is part of the \pkg{ltxcmds} -% package which is loaded by \pkg{ekdosis}. As this command uses a -% private control sequence, it must be found within +% \item Line~7: \cs{ltx@ifnextchar@nospace} is part of the +% \pkg{ltxcmds} package which is loaded by \pkg{ekdosis}. As this +% 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} @@ -8167,6 +8167,7 @@ Sample text with a \textcolor{red}{word} in red. \newif\if@pkg@footins \newif\if@pkg@keyfloat \newif\if@pkg@fitapp +\newif\if@pkg@breakable \newif\if@pkg@ekddivs \newif\if@parnotesroman \newif\if@pkg@parnotes @@ -8176,10 +8177,12 @@ Sample text with a \textcolor{red}{word} in red. choice layout = {float = {\@pkg@floattrue}, footins = {\@pkg@floatfalse\@pkg@footinstrue}, keyfloat = {\@pkg@floatfalse\@pkg@keyfloattrue}, - fitapp = {\@pkg@floatfalse\@pkg@fitapptrue}}, + fitapp = {\@pkg@floatfalse\@pkg@fitapptrue}, + breakable = {\@pkg@floatfalse\@pkg@fitapptrue\@pkg@breakabletrue}}, initial layout = float, unknown-choice layout = \PackageError{ekdosis}{unknown - layout=#1}{`layout' must be either `float' or `footins'.}, + layout=#1}{`layout' must be either `float', `footins', `keyfloat', + `fitapp' or `breakable'.}, choice divs = {ekdosis = {\@pkg@ekddivstrue}, latex = {\@pkg@ekddivsfalse \AtBeginDocument{\luadirect{ekdosis.setekddivsfalse()}}}}, @@ -8237,7 +8240,11 @@ Sample text with a \textcolor{red}{word} in red. \fi \if@pkg@fitapp \RequirePackage{tcolorbox} - \tcbuselibrary{fitting,skins} %,breakable} + \tcbuselibrary{fitting,skins} +\fi +\if@pkg@breakable + \RequirePackage{tcolorbox} + \tcbuselibrary{fitting,skins,breakable} \fi \RequirePackage{refcount} \RequirePackage{zref-user} @@ -8263,7 +8270,7 @@ Sample text with a \textcolor{red}{word} in red. % \end{macrocode} % \paragraph{\textsf{ekdosis} Symbol} % \begin{macro}{\eKd} -% \changes{v1.5}{2022/05/09}{Prints \textsf{ekdosis} indentifying +% \changes{v1.5}{2022/05/15}{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. @@ -8526,7 +8533,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/09}{direct insertion of empty elements in the +% \changes{v1.5}{2022/05/15}{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 @@ -8541,7 +8548,7 @@ Sample text with a \textcolor{red}{word} in red. % \end{macro} % \end{macro} % \begin{macro}{\getTEIxmlid} -% \changes{v1.5}{2022/05/09}{returns \texttt{TEI xml:ids} from a +% \changes{v1.5}{2022/05/15}{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 @@ -8723,7 +8730,9 @@ Sample text with a \textcolor{red}{word} in red. \NewDocumentCommand{\ekdpb}{s o m}{% \IfBooleanTF{#1} {\ifekd@showpb\marginpar{\ekd@hpbmk}\fi - \pagebreak} + \pagebreak + \@ifnextchar\bgroup{}{#3}% + } {% \def\@tmpoarg{#2}% \def\@tmpmarg{#3}% @@ -9014,7 +9023,7 @@ Sample text with a \textcolor{red}{word} in red. \if@pkg@fitapp \newtcboxfit{\ekd@fitapp}{% blankest, - % breakable, + \if@pkg@breakable breakable\fi, fit basedim = \f@size pt, fit fontsize macros, fit height from=0pt to \ekd@app@height, @@ -9022,6 +9031,15 @@ Sample text with a \textcolor{red}{word} in red. float=!b} \fi % \end{macrocode} +% Then \cs{ekd@breakable} for |layout=breakable|:--- +% \begin{macrocode} + % \if@pkg@breakable + % \newtcboxfit{\ekd@breakable}{% + % blankest, + % breakable, + % float=!b} + % \fi +% \end{macrocode} % Finally two commands are used to actually insert the apparatus % depending on the value set in the |layout| global option. % \begin{macrocode} @@ -9082,6 +9100,9 @@ Sample text with a \textcolor{red}{word} in red. \if@pkg@fitapp \ekd@fitapp{\ekd@insert@apparatus}% \fi + % \if@pkg@breakable + % \ekd@breakable{\ekd@insert@apparatus}% + % \fi } % \end{macrocode} % Before inserting any new entry, \cs{add@apparatus} calls @@ -9937,12 +9958,12 @@ Sample text with a \textcolor{red}{word} in red. % defined above. % \begin{macrocode} \NewDocumentCommand{\ekd@note}{O{} m}{% - \bgroup% + \bgroup \ekvset{ekd@note}{#1}% \edef\note@contents{% \ekvifdefinedNoVal{ekd@note}{pre}{}{% \unexpanded\expandafter{\pre@value}}% - {\unexpanded{#2}}% + \unexpanded{#2}% \ekvifdefinedNoVal{ekd@note}{post}{}{% \unexpanded\expandafter{\post@value}}% }% @@ -9951,7 +9972,7 @@ Sample text with a \textcolor{red}{word} in red. \else% \append@app{\note@contents}% \fi% - \egroup% + \egroup } \NewDocumentCommand{\ekd@note@star}{O{} m}{% \bgroup @@ -10118,7 +10139,7 @@ Sample text with a \textcolor{red}{word} in red. % \end{macro} % \paragraph{Lacunae} % \begin{macro}{\ilabel} -% \changes{v1.5}{2022/05/09}{recalls and sets the ending label of +% \changes{v1.5}{2022/05/15}{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=