From db95b2cda2d37112c89a4e41d0e2d2e65fa34807 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Tue, 4 Jan 2022 13:16:28 +0100 Subject: new option 'nodelim' for \lem and \note. remove unwanted spaces around empty lemmas --- README.md | 4 +-- ekdosis.dtx | 101 +++++++++++++++++++++++++++++++++++++++++++++--------------- ekdosis.el | 2 +- ekdosis.ins | 2 +- 4 files changed, 80 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index ae7e851..9787430 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ License and Disclamer ===================== ekdosis – Typesetting TEI xml-Compliant Critical Editions -Copyright ⓒ 2020--2021 Robert Alessi +Copyright ⓒ 2020--2022 Robert Alessi Please send error reports and suggestions for improvements to Robert Alessi: @@ -62,7 +62,7 @@ This release of ekdosis consists of the following source files: License Applicable to the Documentation --------------------------------------- -Copyright ⓒ 2020--2021 Robert Alessi +Copyright ⓒ 2020--2022 Robert Alessi The documentation file `ekdosis.pdf` that is generated from the `ekdosis.dtx` source file is licensed under the GNU Free Documentation diff --git a/ekdosis.dtx b/ekdosis.dtx index 6c56066..68d968e 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment % % ekdosis -- Typesetting TEI xml-compliant critical editions -% Copyright (C) 2020--2021 Robert Alessi +% Copyright (C) 2020--2022 Robert Alessi % % Please send error reports and suggestions for improvements to Robert % Alessi @@ -28,7 +28,7 @@ This file is part of the `ekdosis' package ekdosis -- Typesetting TEI xml-compliant critical editions -Copyright (C) 2020--2021 Robert Alessi +Copyright (C) 2020--2022 Robert Alessi Please send error reports and suggestions for improvements to Robert Alessi @@ -61,7 +61,7 @@ along with this program. If not, see %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{ekdosis} %<*package> - [2021/12/14 v1.5-dev Typesetting TEI xml-compliant critical editions] + [2022/01/04 v1.5-dev Typesetting TEI xml-compliant critical editions] % %<*driver> \begin{filecontents}[noheader,overwrite]{bibdata.xml} @@ -647,6 +647,7 @@ along with this program. If not, see \bibinput{ekdosis} \newcommand\vnref[1]{\vref{#1}, \enquote{\nameref{#1}}} \usepackage[style=oxnotes-inote,dashed]{biblatex} +\usepackage{xurl} \DefineBibliographyStrings{english}{ seenote={cf\adddotspace n\adddotspace}} \DeclareSourcemap{ @@ -749,7 +750,7 @@ along with this program. If not, see Para ver una copia de esta licencia, siga el vínculo: \metapick[#1]{licenseurl}.} \metaset{copyrightowner}{\metapick[#1]{author}} -\metaset{copyrightdate}{2020--2021} +\metaset{copyrightdate}{2020--2022} \metaset{licensemessage}{Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by @@ -1923,6 +1924,14 @@ yesterday. % introduce an alternate way of writing entries with Latin technical % terms in the apparatus criticus as will be demonstrated below in the % example provided by \vref{lst:pj2}.\\ +% \DescribeOption{nodelim} |nodelim|$=$\verb+true|false+\\ +% \newfeature[v1.5] This named argument does not need a value as it +% defaults to |true| if used. |nodelim| removes the delimiter that is +% printed just before the entry in the apparatus criticus. This option +% is typically used in rare occasions in combination with |nolem| and +% |nonum| for entries that carry information not to be printed in the +% apparatus but nevertheless to be retained in the \texttt{TEI xml} +% output file.\\ % \DescribeOption{sep} |sep|$=$\meta{separator}\\ % |sep| allows to change the symbol used to separate the lemma text % from deviant readings, which is by default the closing square @@ -3868,6 +3877,10 @@ Some \app[type=rec2]{ % |type| is used to specify the name of the layer where the note is to % be printed.\footnote{See \vref{sec:declaring-layers} to learn how to % declare and lay out new layers of notes.}\\ +% \DescribeOption{nodelim} |nodelim|$=$\verb+true|false+\\ +% \newfeature[v1.5] This named argument does not need a value as it +% defaults to |true| if used. This option removes the delimiter that +% is printed just before the note in the apparatus criticus.\\ % \DescribeOption{sep} |sep|$=$\meta{command \textbar\ chars}\\ % The separator between the lemma text and the contents of the note.\\ % \DescribeOption{nosep} |nosep|$=$\verb+true|false+\\ @@ -7776,7 +7789,7 @@ Sample text with a \textcolor{red}{word} in red. % \end{macrocode} % \paragraph{\textsf{ekdosis} Symbol} % \begin{macro}{\eKd} -% \changes{v1.5}{2021/12/14}{Prints \textsf{ekdosis} indentifying +% \changes{v1.5}{2022/01/04}{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. @@ -8978,6 +8991,7 @@ Sample text with a \textcolor{red}{word} in red. store sep = \ekdl@sep, noval nonum = \ekdl@nonumtrue, noval num = \ekdl@forcenumtrue, + bool nodelim = \ifekdl@nodelim, bool nolem = \ifekdl@nolem, bool nosep = \ifekdl@nosep, initial sep = \ekdsep @@ -9042,7 +9056,7 @@ Sample text with a \textcolor{red}{word} in red. % the optional key-value arguments just defined above. % \begin{macrocode} \NewDocumentCommand{\lem}{O{} m}{% - \ekd@isinlemtrue% + \ekd@isinlemtrue \luadirect{ekdosis.dolnlab(\luastringN{#2})}% \null \bgroup% @@ -9064,10 +9078,14 @@ Sample text with a \textcolor{red}{word} in red. \ifekdl@nolem\edef\lem@app{% % \hskip .75em \ifekd@mapps - \ifbool{subsq@unit@\ekdan@type}% - {\ekd@munit@delim}{}% - \else% - \ifsubsq@unit\unexpanded\expandafter{\ekd@unit@delim}\fi% + \unless\ifekdl@nodelim + \ifbool{subsq@unit@\ekdan@type}% + {\ekd@munit@delim}{}% + \fi + \else + \unless\ifekdl@nodelim + \ifsubsq@unit\unexpanded\expandafter{\ekd@unit@delim}\fi + \fi \fi% \unless\ifekdl@nonum\current@ref\fi}%\hskip .25em}% \else% @@ -9075,10 +9093,14 @@ Sample text with a \textcolor{red}{word} in red. \edef\lem@app{% % \hskip .75em \ifekd@mapps - \ifbool{subsq@unit@\ekdan@type}% - {\ekd@munit@delim}{}% - \else% - \ifsubsq@unit\unexpanded\expandafter{\ekd@unit@delim}\fi% + \unless\ifekdl@nodelim + \ifbool{subsq@unit@\ekdan@type}% + {\ekd@munit@delim}{}% + \fi + \else + \unless\ifekdl@nodelim + \ifsubsq@unit\unexpanded\expandafter{\ekd@unit@delim}\fi + \fi \fi% \unless\ifekdl@nonum\current@ref\fi%\hskip .25em \ifdefined\ekdlr@alt% @@ -9110,10 +9132,14 @@ Sample text with a \textcolor{red}{word} in red. \edef\lem@app{% % \hskip .75em \ifekd@mapps - \ifbool{subsq@unit@\ekdan@type}% - {\ekd@munit@delim}{}% - \else% - \ifsubsq@unit\unexpanded\expandafter{\ekd@unit@delim}\fi% + \unless\ifekdl@nodelim + \ifbool{subsq@unit@\ekdan@type}% + {\ekd@munit@delim}{}% + \fi + \else + \unless\ifekdl@nodelim + \ifsubsq@unit\unexpanded\expandafter{\ekd@unit@delim}\fi + \fi \fi% \unless\ifekdl@nonum\current@ref\fi%\hskip .25em \ifdefined\ekdlr@alt% @@ -9267,6 +9293,7 @@ Sample text with a \textcolor{red}{word} in red. store lem = \ekdn@lem, code labelb = \def\ekdn@labelb{#1}, code labele = \def\ekdn@labele{#1}, + bool nodelim = \ifekdn@nodelim, store sep = \ekdn@sep, bool nosep = \ifekdn@nosep, initial type = default, @@ -9313,10 +9340,14 @@ Sample text with a \textcolor{red}{word} in red. {\edef\note@contents{% % \hskip .75em \ifekd@mapps + \unless\ifekdn@nodelim \ifbool{subsq@unit@\ekdan@type}% - {\ekd@munit@delim}{}% - \else% - \ifsubsq@unit\unexpanded\expandafter{\ekd@unit@delim}\fi% + {\ekd@munit@delim}{}% + \fi + \else + \unless\ifekdn@nodelim + \ifsubsq@unit\unexpanded\expandafter{\ekd@unit@delim}\fi + \fi \fi% \unless\ifekdn@nonum\current@ref@arg{\ekdn@labelb}{\ekdn@labele}\fi%\hskip .25em \ifdefined\ekdn@lem% @@ -9329,10 +9360,14 @@ Sample text with a \textcolor{red}{word} in red. {\edef\note@contents{% % \hskip .75em \ifekd@mapps - \ifbool{subsq@unit@\ekdan@type}% - {\ekd@munit@delim}{}% - \else% - \ifsubsq@unit\unexpanded\expandafter{\ekd@unit@delim}\fi% + \unless\ifekdn@nodelim + \ifbool{subsq@unit@\ekdan@type}% + {\ekd@munit@delim}{}% + \fi + \else + \unless\ifekdn@nodelim + \ifsubsq@unit\unexpanded\expandafter{\ekd@unit@delim}\fi + \fi \fi% \unless\ifekdn@nonum\current@ref@arg{\ekdn@labelb}{\ekdn@labele}\fi%\hskip .25em \ifdefined\ekdn@lem @@ -10109,6 +10144,17 @@ Sample text with a \textcolor{red}{word} in red. \NewDocumentEnvironment{ekdpar}{}{\par}{\par} % \end{macrocode} % \end{environment} +% \begin{macro}{\ekdunspace} +% Provisionally, this very simple command is used by \pkg{ekdosis} to +% remove undesirable spaces, notably around empty lemmas in the +% apparatus. As it is used internally, \cs{ekdunspace} is not +% documented. +% \begin{macrocode} +\newlength{\ekdspace} +\settowidth{\ekdspace}{ } +\def\ekdunspace{\hskip-\ekdspace} +% \end{macrocode} +% \end{macro} % \paragraph{Configuration File} Finally, if a configuration file % named |\jobname-ekd.cfg| can be found, this file is read and its % contents loaded into the document preamble. This provides a @@ -10559,6 +10605,7 @@ local texpatttotags = { {a="\\teidirect%s+{(.-)}(%b{})", b="<%1>ekd@ob%2ekd@cb"}, {a="\\altrfont%s+", b=""}, {a="\\endmark%s+", b=""}, + {a="\\unskip%s+", b=""}, {a="\\ekdpb%s+%*?%[(.-)%]{(.-)}", b=""}, {a="\\ekdpb%s+%*?{(.-)}", b=""}, {a="\\ekdpb%s+%*\\?", b=""}, @@ -12495,6 +12542,10 @@ local function remove_from_app(str) end function ekdosis.mdvappend(str, teitype) + if current_lemma == "" + then + current_lemma = "\\ekdunspace" + end if teitype == nil then return "\\linelabel{" .. current_lnlab .. "-b}\\wordboundary{}" diff --git a/ekdosis.el b/ekdosis.el index d128b7a..8f6d8ab 100644 --- a/ekdosis.el +++ b/ekdosis.el @@ -2,7 +2,7 @@ ;; This file is part of the `ekdosis' package ;; ekdosis -- TEI xml compliant critical editions -;; Copyright (C) 2020--2021 Robert Alessi +;; Copyright (C) 2020--2022 Robert Alessi ;; Please send error reports and suggestions for improvements to Robert ;; Alessi diff --git a/ekdosis.ins b/ekdosis.ins index e0c3c84..de08215 100644 --- a/ekdosis.ins +++ b/ekdosis.ins @@ -12,7 +12,7 @@ License:| Released under the GNU General Public License v3 or later This file is part of the `ekdosis' package ekdosis -- Typesetting TEI xml compliant critical editions -Copyright (C) 2020--2021 Robert Alessi +Copyright (C) 2020--2022 Robert Alessi Please send error reports and suggestions for improvements to Robert Alessi -- cgit v1.2.3