From 90adfe55d9d636f85e0cfa7e0f1bd2b045e6ad76 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Tue, 4 Aug 2020 09:27:55 +0200 Subject: better, shorter names for some commands --- ekdosis.dtx | 113 ++++++++++++++++++++++--------------------- samples/Caesar_BG-6-13-1.tex | 6 +-- 2 files changed, 62 insertions(+), 57 deletions(-) diff --git a/ekdosis.dtx b/ekdosis.dtx index a1acf5b..ff37d86 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx @@ -186,7 +186,7 @@ along with this program. If not, see \DeclareWitness{M}{M}{\emph{Marcianus Gr.} 269}[ settlement=Venice, institution=Marciana Library, - msName=\emph{Marcianus Gr.}, + msName=Marcianus Gr., idno=269, origDate=s. X] \DeclareHand{M1}{M}{M\textsuperscript{1}}[Emendatio scribae ipsius] @@ -196,7 +196,7 @@ along with this program. If not, see \DeclareWitness{pjB}{B}{Manuscript B Call No 456} % Caesar's Gallic War: \DeclareWitness{cA}{A}{\emph{Bongarsianus} 81}[ - msName=\emph{Bongarsianus}, + msName=Bongarsianus, settlement=Amsterdam, idno=81, institution=University Library, @@ -963,7 +963,7 @@ along with this program. If not, see \DeclareWitness{M}{M}{\emph{Marcianus Gr.} 269}[ settlement=Venice, institution=Marciana Library, - msName=\emph{Marcianus Gr.}, + msName=Marcianus Gr., idno=269, origDate=s. X] \end{minted} @@ -1562,13 +1562,14 @@ yesterday. % % \fi % -% \DescribeEnv{edition*}\DescribeEnv{translation*} Furthermore, -% so-called \enquote{starred} versions of these environments can be -% used at any point to synchronize texts, that is to print them in -% such a way that the tops of all paragraphs are vertically -% aligned. To that effect, it must be noted that merely applying this -% command on a single environment\---for instance the leftmost -% one\---will have all other associated paragraphs printed aligned. +% \DescribeEnv{edition*}\DescribeEnv{translation*} +% \label{ref:starred-envs} Furthermore, so-called \enquote{starred} +% versions of these environments can be used at any point to +% synchronize texts, that is to print them in such a way that the tops +% of all paragraphs are vertically aligned. To that effect, it must be +% noted that merely applying this command on a single +% environment\---for instance the leftmost one\---will have all other +% associated paragraphs printed aligned. % % \danger While the whole edition text and the whole translation can % be inserted in a single \env{edition}/\env{translation} environment @@ -1628,7 +1629,7 @@ yesterday. % \fi % % \resetlinenumber -% \EkdosisFormatDivision{2}{}{.} +% \FormatDiv{2}{}{.} % \begin{alignment}[flush,lcols=2, % texts=edition[xml:lang="la"]; % translation[xml:lang="en"]] @@ -1723,7 +1724,8 @@ yesterday. % \subsection{Alignment of Several Texts} % \label{sec:multiple-alignment} % As described above \vpageref{ref:alignment-syntax}, the -% \env{alignment} environment may receive an optional argument in which +% \env{alignment} environment may receive an optional argument in +% which % the following \enquote{name$=$value} arguments are accepted:---\\ % \DescribeOption{tcols} % |tcols|$=$\meta{number}\hfill\tcboxverb{Default: 2}\\ @@ -1745,8 +1747,11 @@ yesterday. % Depending on the total number of columns that has been specified % with |tcols| above, |texts| is then used to define the names of the % environments that shall receive edition texts, translations, -% \emph{\&c.} Some very important points need to be emphasized in this -% respect:--- +% \emph{\&c.} Furthermore, as described \vpageref{ref:starred-envs}, +% \pkg{ekdosis} also defines \enquote{starred} versions of these +% environments to be used to synchronize columns so that corresponding +% paragraphs are printed vertically aligned. Some very important +% points need to be emphasized in this respect:--- % \begin{enumerate} % \item Only unaccented letters of the alphabet (whatever the case) % are allowed to compose the names of \LaTeX{} environments. @@ -1862,17 +1867,17 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ % % \fi % -% \DescribeMacro{\SetEkdosisAlignment} -% \cs{SetEkdosisAlignment}\marg{alignment settings}\\ +% \DescribeMacro{\SetAlignment} +% \cs{SetAlignment}\marg{alignment settings}\\ % If the same alignment settings are to be shared by several % \env{alignment} environments, common settings can be collected in -% the argument of \cs{SetEkdosisEnvironment}, like +% the argument of \cs{SetAlignment}, like % so:---\\ % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} -\SetEkdosisAlignment{ +\SetAlignment{ tcols=3, lcols=1, texts=latin[xml:lang="la"]; @@ -1889,7 +1894,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ % % \fi % -% \cs{SetEkdosisAlignment} can be used either in the preamble or at +% \cs{SetAlignment} can be used either in the preamble or at % any point of the document to set or to modify alignment settings. % % \subsubsection{Appending Hooks to Environments} @@ -1900,7 +1905,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ % provided by the \pkg{etoolbox} package\footnote{This package is % loaded by \pkg{ekdosis}.} to further adjust languages, hyphenation % rules, and/or fonts to be applied in each environment. To return to -% the example provided above, once \cs{SetEkdosisAlignment} has been +% the example provided above, once \cs{SetAlignment} has been % used, the languages can be set as follows:--- % % \iffalse @@ -1924,8 +1929,8 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ % the apparatus criticus (e.g. sources, testimonia, variant readings % \emph{\&c.}) % -% \DescribeMacro{\SetEkdosisHooks} -% \cs{SetEkdosisHooks}\marg{csv list of hooks} can be used either in +% \DescribeMacro{\SetHooks} +% \cs{SetHooks}\marg{csv list of hooks} can be used either in % the preamble or at any point of the document. The list of accepted % hooks at the time of writing follows:---\\ % \DescribeOption{appfontsize} |appfontsize|$=$\meta{command} @@ -2043,7 +2048,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ %<*example> % \fi \begin{minted}[linenos=false]{latex} -\SetEkdosisHooks{ +\SetHooks{ refnumstyle=\normalfont } \SetApparatus{ @@ -2081,8 +2086,8 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ % internally. If any additional layer of notes be declared in the % preamble, this |default| layer must be included in the list of % declared layers.\\ -% \DescribeMacro{\EkdosisDefaultApparatus}\label{ref:ekd-default-app} -% \cs{EkdosisDefaultApparatus}\marg{name} can be used at any point of +% \DescribeMacro{\SetDefaultApparatus}\label{ref:ekd-default-app} +% \cs{SetDefaultApparatus}\marg{name} can be used at any point of % the document to change the default name that is used by % \pkg{ekdosis}. % @@ -2145,7 +2150,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ %<*example> % \fi \begin{minted}[linenos=false]{latex} -\SetEkdosisHooks{ +\SetHooks{ refnumstyle=\normalfont } \DeclareApparatus{testium}[ @@ -2170,7 +2175,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ % \textooquote|default|\textcoquote\ layer. As a result, any note % inserted within the argument of \cs{app}|{}| as described % \vpageref{ref:app-cmd} will go into that layer of the apparatus, -% unless \cs{EkdosisDefaultApparatus} has been used to set another +% unless \cs{SetDefaultApparatus} has been used to set another % name for the default layer (see above % \vpageref{ref:ekd-default-app}). % @@ -2205,13 +2210,13 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ % \fi % % If one wishes to refer to |rec1| as the default layer, then -% \cs{EkdosisDefaultApparatus} must be used, like so:--- +% \cs{SetDefaultApparatus} must be used, like so:--- % % \iffalse %<*example> % \fi \begin{minted}[linenos=false]{latex} -\EkdosisDefaultApparatus{rec1} +\SetDefaultApparatus{rec1} \DeclareApparatus{rec1} % new layer set as default \DeclareApparatus{rec2} % additional layer below the default one \end{minted} @@ -3008,9 +3013,9 @@ subtype="arabtex">'inna 'abI kAna mina % contents at the hierarchic level that is specified as value. % % \paragraph{Formatting the Titles} -% \DescribeMacro{\EkdosisFormatDivision} By design, \pkg{ekdosis} does +% \DescribeMacro{\FormatDiv} By design, \pkg{ekdosis} does % not format the titles. Instead, depending on what is needed for the -% edition text, \cs{EkdosisFormatDivision}\marg{n}\marg{code +% edition text, \cs{FormatDiv}\marg{n}\marg{code % before}\marg{code after} is provided to lay out the titles of any % hierarchic depth of division. This command takes three mandatory % arguments as follows: \meta{n}, which is the number referring to the @@ -3023,7 +3028,7 @@ subtype="arabtex">'inna 'abI kAna mina %<*example> % \fi \begin{minted}[linenos=false]{latex} -\EkdosisFormatDivision{1}{\begin{center}\Large}{\end{center}} +\FormatDiv{1}{\begin{center}\Large}{\end{center}} \end{minted} % \iffalse % @@ -3038,9 +3043,9 @@ subtype="arabtex">'inna 'abI kAna mina % \fi \begin{minted}[linenos=false]{latex} % Preamble: -\EkdosisFormatDivision{1}{\begin{center}\Large}{\end{center}} -\EkdosisFormatDivision{2}{\begin{center}\large}{\end{center}} -\EkdosisFormatDivision{3}{\bfseries}{.} +\FormatDiv{1}{\begin{center}\Large}{\end{center}} +\FormatDiv{2}{\begin{center}\large}{\end{center}} +\FormatDiv{3}{\bfseries}{.} % Document: \begin{ekdosis} @@ -3073,9 +3078,9 @@ subtype="arabtex">'inna 'abI kAna mina % \medskip % % \resetlinenumber -% \EkdosisFormatDivision{1}{\begin{center}\Large}{\end{center}} -% \EkdosisFormatDivision{2}{\begin{center}\large}{\end{center}} -% \EkdosisFormatDivision{3}{\bfseries}{.} +% \FormatDiv{1}{\begin{center}\Large}{\end{center}} +% \FormatDiv{2}{\begin{center}\large}{\end{center}} +% \FormatDiv{3}{\bfseries}{.} % \begin{alignment}[flush, % tcols=1, % texts=hippocrates[xml:lang="grc"], @@ -3686,7 +3691,7 @@ subtype="arabtex">'inna 'abI kAna mina % \label{sec:caesar-gw-6-1-13} % \subsection{\texttt{.tex} Source File} % \label{sec:caesar-gw-tex} -% \inputminted[linenos=false]{latex}{samples/Caesar_BG-6-13-1.tex} +% \inputminted[linenos=true]{latex}{samples/Caesar_BG-6-13-1.tex} % \subsection{\texttt{TEI xml} Output} % \label{sec:caesar-gw-tei} % \inputminted[linenos=false]{xml}{samples/Caesar_BG-6-13-1-tei.xml} @@ -3836,7 +3841,7 @@ subtype="arabtex">'inna 'abI kAna mina \luadirect{ekdosis.closestream()} } % \end{macrocode} -% \begin{macro}{\SetEkdosisHooks} \cs{SetEkdosisHooks} is used to set +% \begin{macro}{\SetHooks} \cs{SetHooks} is used to set % hooks meant to be shared by all declared apparatuses, such as the % font size, the format of numerals, \emph{\&c.} This command can be % used in the preamble or at any point of the document. @@ -3849,7 +3854,7 @@ subtype="arabtex">'inna 'abI kAna mina initial refnumstyle = \bfseries, initial postrefnum = ~ } -\NewDocumentCommand{\SetEkdosisHooks}{m}{\ekvset{ekd@hooks}{#1}} +\NewDocumentCommand{\SetHooks}{m}{\ekvset{ekd@hooks}{#1}} % \end{macrocode} % \end{macro} % Build and process the list of witnesses and hands:--- @@ -4438,16 +4443,16 @@ subtype="arabtex">'inna 'abI kAna mina % \begin{macrocode} \renewcommand\linenumberfont{\normalfont\footnotesize} % \end{macrocode} -% \begin{macro}{\EkdosisDefaultApparatus} +% \begin{macro}{\SetDefaultApparatus} % By default, \pkg{ekdosis} defines one layer of critical notes which % is called |default|. This name can be changed at any point of the -% document with \cs{EkdosisDefaultApparatus}\marg{name}. +% document with \cs{SetDefaultApparatus}\marg{name}. % \begin{macrocode} \ekvdefinekeys{appnote}{ store type = \ekdan@type, initial type = default } -\NewDocumentCommand{\EkdosisDefaultApparatus}{m}{% +\NewDocumentCommand{\SetDefaultApparatus}{m}{% \ekvset{appnote}{type=#1}} % \end{macrocode} % \end{macro} @@ -5060,12 +5065,12 @@ subtype="arabtex">'inna 'abI kAna mina default segmentation = auto } % \end{macrocode} -% \begin{macro}{\SetEkdosisAlignment} -% \cs{SetEkdosisAlignment}\marg{settings} can be used either in the +% \begin{macro}{\SetAlignment} +% \cs{SetAlignment}\marg{settings} can be used either in the % preamble or at any point of the document to set or modify the % keys-value settings just defined above. % \begin{macrocode} -\NewDocumentCommand{\SetEkdosisAlignment}{m}{ +\NewDocumentCommand{\SetAlignment}{m}{ \ekvset{ekd@align}{#1} } % \end{macrocode} @@ -5111,10 +5116,10 @@ subtype="arabtex">'inna 'abI kAna mina % right-hand pages. To that effect, it provides by default two new % environments, \env{edition} and \env{translation}, to be used to % typeset both texts. (Either whole texts or texts entered by -% paragraphs alternately.) The optional argument of \env{aligment} -% accepts the exact same key-value options as \cs{SetEkdosisAlignment} +% paragraphs alternately.) The optional argument of \env{alignment} +% accepts the exact same key-value options as \cs{SetAlignment} % described above. One may contrast these options with those accepted -% by \cs{SetEkdosisAlignment} as \enquote{local settings}. +% by \cs{SetAlignment} as \enquote{local settings}. % \begin{macrocode} \NewDocumentEnvironment{alignment}{O{}} {% @@ -5197,14 +5202,14 @@ subtype="arabtex">'inna 'abI kAna mina initial depth = 1 } % \end{macrocode} -% \begin{macro}{\EkdosisFormatDivision} -% \cs{EkdosisFormatDivision}\marg{n}\marg{code before}\marg{code +% \begin{macro}{\FormatDiv} +% \cs{FormatDiv}\marg{n}\marg{code before}\marg{code % after} is used to lay out the heading of the title. It takes three % mandatory arguments: \emph{n}, namely the number referring to the % particular depth of the division, and then some \LaTeX{} formatting % commands to go before and after the heading itself:--- % \begin{macrocode} -\NewDocumentCommand{\EkdosisFormatDivision}{m m m}{ +\NewDocumentCommand{\FormatDiv}{m m m}{ \luadirect{ekdosis.fmtdiv(\luastring{#1}, \luastringN{#2}, \luastringN{#3})} @@ -5212,7 +5217,7 @@ subtype="arabtex">'inna 'abI kAna mina % \end{macrocode} % \end{macro} % \cs{ekd@getfmtdiv} gets the formatting commands that have been -% stored by \cs{EkdosisFormatDivision}. +% stored by \cs{FormatDiv}. % \begin{macrocode} \NewDocumentCommand{\ekd@getfmtdiv}{m m}{% \luadirect{tex.sprint(ekdosis.getfmtdiv(\luastringO{#1}, diff --git a/samples/Caesar_BG-6-13-1.tex b/samples/Caesar_BG-6-13-1.tex index ff793a6..2b1b442 100644 --- a/samples/Caesar_BG-6-13-1.tex +++ b/samples/Caesar_BG-6-13-1.tex @@ -13,9 +13,9 @@ delim=\hskip0.75em, ehook=.] -\EkdosisFormatDivision{2}{}{.} +\FormatDiv{2}{}{.} -\SetEkdosisAlignment{ +\SetAlignment{ tcols=3, lcols=1, texts=latin[xml:lang="la"]; @@ -29,7 +29,7 @@ \AtBeginEnvironment{french}{\sloppy\selectlanguage{french}} \DeclareWitness{A}{A}{\emph{Bongarsianus} 81}[ - msName=\emph{Bongarsianus}, + msName=Bongarsianus, settlement=Amsterdam, idno=81, institution=University Library, -- cgit v1.2.3