From 5e8becd7abfd72fd83f940166755d1eed24c58a2 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Fri, 2 Apr 2021 18:40:59 +0200 Subject: use a configuration file if any. added some clarifications and corrections --- Makefile | 2 +- ekdosis.dtx | 79 ++++++++++++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 63 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index eade9cd..4479b82 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ $(NAME).pdf: testsamples $(NAME).dtx @ if [ -f $(NAME).glo ]; then makeindex -q -s gglo.ist -o $(NAME).gls $(NAME).glo; fi @ if [ -f $(NAME).idx ]; then makeindex -q -s gind.ist -o $(NAME).ind $(NAME).idx; fi @ echo "Final runs of $(CMP)..." - @ for run in {1..3}; do $(call do_documentation); done + @ for run in {1..7}; do $(do_documentation); done @ echo "Done" samples: clean sty diff --git a/ekdosis.dtx b/ekdosis.dtx index 6ece3c8..229d7c1 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx @@ -411,7 +411,7 @@ along with this program. If not, see version = {4.00} } \end{filecontents} -\begin{filecontents}[overwrite]{\jobname-cfg.tex} +\begin{filecontents}[overwrite]{\jobname-ekd.cfg} \footnotelayout{m} \EnvtoTEI{ancientgreek}{p}[xml:lang="grc"] \DeclareApparatus{fontium}[ @@ -509,8 +509,8 @@ along with this program. If not, see \DeclareSource{shSewell1725}{S} \DeclareSource{shEwing1771}{E} \DeclareSource{shHudson1856}{Hu\textsuperscript{2}} -\DeclareSource{shWalsh1908}{Wa} \DeclareSource{shButler1899}{But} +\DeclareSource{shWalsh1908}{Wa} \DeclareScholar{shGod}{Godwin}[rawname=Godwin] \DeclareScholar{shStee}{Stee}[rawname=Steevens, note=Notes in Malone] \end{filecontents} @@ -542,7 +542,6 @@ along with this program. If not, see \usepackage{chifoot} \usepackage{arabluatex} \usepackage[parnotes=roman, teiexport=tidy, poetry=verse]{ekdosis} -\input{ekdosis-cfg} \AddxmlBibResource{bibdata.xml} \usepackage{booktabs} \usepackage{xltabular} @@ -781,7 +780,7 @@ along with this program. If not, see % % \fi % -% \CheckSum{2184} +% \CheckSum{2188} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -1118,7 +1117,7 @@ along with this program. If not, see % % \fi % -% \pkg{ekdosis} may be loaded with four optional \enquote*{named +% \pkg{ekdosis} may be loaded with five optional \enquote*{named % arguments} either of which is set using the syntax % \meta{key}$=$\meta{value}. The description of the optional arguments % follows. @@ -1204,6 +1203,18 @@ along with this program. If not, see % % \fi % +% \subsection{Using a Configuration File} +% \label{sec:using-conf-file} +% Complex editions may use a large number of witnesses, sources and +% scholars. It may also be required to define a multiple-layer +% apparatus criticus, several text environments to be aligned and +% quite a number of new commands. \pkg{ekdosis} provides a convenient +% way to avoid overloading the document preamble: all the settings +% related to the critical edition can be gathered in a separate +% configuration file named |\jobname-ekd.cfg|. If such a file can be +% found, its contents is automatically read and used by +% \pkg{ekdosis}. +% % \subsection{Witnesses, Hands, Sources, Scholars \& Shorthands} % \label{sec:declarations} % \paragraph{Terminology} @@ -2586,8 +2597,7 @@ friend % encoding allows not to lose sight of paragraphs that are meant to be % read together, but it is also the only way to align paragraphs in % print, and it is much more suitable to mark up correspondence -% between spans of texts as will be demonstrated below in -% \vref{ref:segmentation}. +% between spans of texts. % % As an illustration, a short extract of Caesar's \emph{Gallic War}, % VI, XIII.1 follows.\footnote{Latin text: \cite{Caesar-BG-v2}; @@ -3057,8 +3067,9 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ % at the bottom of the page. % % \danger Regular footnotes are printed above the block of critical -% notes. Places can be interchanged by just loading the \pkg{fnpos} -% package in the preamble.\footcite{fnpos} +% notes. The respective places of these blocks can be interchanged by +% just loading the \pkg{fnpos} package in the +% preamble.\footcite{fnpos} % % \section{Laying Out the Apparatus Criticus} % \label{sec:apparatus-layout} @@ -3215,6 +3226,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ % \DescribeOption{lang} |lang|$=$\meta{languagename} % \newfeature[v1.2]\phts\label{ref:app-lang-opt} % \hfill\tcboxverb{Default: not set}\\ +% \needspace{3\baselineskip}\noindent % |lang=| is used as described % \vpageref[above]{ref:app-lang} when it is needed to apply in the % apparatus criticus a language different from the one that is @@ -3379,7 +3391,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ % the apparatus criticus this option is related to. As a result, the % page will actually break at the end of the current line. The % particulars of this technique will be discussed below in -% \vref{sec:tricks-of-trade}. +% \vref{sec:oscillating-problem}. % % \section{Inserting Notes in Multiple-Layer Apparatus} % \label{sec:notes-in-multilayer-app} @@ -4155,11 +4167,35 @@ substantiall fewell,} % \fi % % \begin{remarks} -% \item[\textsc{Rem.}] \cs{ekdlettrine} (l.~23) is a specific command -% for the \pkg{lettrine} package does not work in list -% environments. \cs{TeXtoTEIPat} has been used as described below -% \vpageref{ref:textoteipat} to instruct \pkg{ekdosis} to convert this -% command into an acceptable \texttt{TEI} equivalent. +% \item |Gildon1710|, |Gildon1714|, |Sewell1725|, |Ewing1771|, +% |Hudson1856|, |Butler1899| and |Walsh1908| have been declared as +% sources.\footnote{See above \vpageref{ref:declare-source} and +% below \vref{sec:references-cited-works}.} |God| and |Stee|, +% resp.\ Godwin and Steevens, have been decalred as +% scholars.\footnote{See above \vpageref{ref:declare-scholar}.} +% \item \cs{ekdlettrine} (l.~23) is a specific command for the +% \pkg{lettrine} package does not work in list +% environments. \cs{TeXtoTEIPat} has been used as described below +% \vpageref{ref:textoteipat} to instruct \pkg{ekdosis} to convert +% this command into an acceptable \texttt{TEI} equivalent. The +% definition of \cs{ekdlettrine} follows:--- +% \iffalse +%<*example> +% \fi +\begin{minted}[linenos=false]{latex} +% Preamble: +\usepackage{adjustbox} +% This basic command actually requires an adjustment of the vertical +% space at the end of the current line (eg. \\[-1.875ex]) and \vin at +% the beginning of the next line:--- +\NewDocumentCommand{\ekdlettrine}{mm}{% +\adjustbox{valign=t,raise=-0.75ex}{\Huge #1}\textsc{#2}% +} +\TeXtoTEIPat{\ekdlettrine {#1}{#2}}{#1#2} +\end{minted} +% \iffalse +% +% \fi % \end{remarks} % % PDF output:--- @@ -5142,6 +5178,8 @@ subtype="arabtex">'inna 'abI kAna mina % \hologo{LuaLaTeX} to be run three more times to get everything to % the right place with the right numbers. % +% \subsection{The Oscillating Problem} +% \label{sec:oscillating-problem} % In some instances, notably when on a given page entries are very % abundant in number, specifically when the edition text is getting % close to the bottom of the page, \pkg{ekdosis} may oscillate @@ -5195,7 +5233,7 @@ subtype="arabtex">'inna 'abI kAna mina % apparatus criticus may clash again. As said above, a couple of % clashes can be managed with a couple of manually inserted page % breaks. But if there be too many of them, it is a good indication -% that the selected value of |maxentries| is too to high. +% that the selected value of |maxentries| is too high. % % Complex edition texts do have a magic number. An advisable way to % figure it out would be to start from a sample of only a few pages, @@ -8986,7 +9024,14 @@ Sample text with a \textcolor{red}{word} in red. \NewDocumentEnvironment{ekdpar}{}{\par}{\par} % \end{macrocode} % \end{environment} -% +% \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 +% convenient way to gather all the settings related to the critical +% edition in a separate file. +% \begin{macrocode} +\IfFileExists{\jobname-ekd.cfg}{\input{\jobname-ekd.cfg}}{} +% \end{macrocode} % \iffalse % % \fi -- cgit v1.2.3