aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2020-10-12 12:34:36 +0200
committerRobert Alessi <alessi@robertalessi.net>2020-10-12 12:34:36 +0200
commit28beeb84d780edd5fe55b49eeeb14a502f0721e1 (patch)
tree5280c3f5cc797311bb3160128d54dfca87d55616
parent53f5512bf166b856f1cafeec9384999bb7958c5e (diff)
downloadekdosis-28beeb84d780edd5fe55b49eeeb14a502f0721e1.tar.gz
new global option 'verse'
-rw-r--r--ekdosis.dtx81
1 files changed, 61 insertions, 20 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx
index d3e2bd5..811b4f2 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -360,7 +360,7 @@ along with this program. If not, see
360\def\sg#1{\textancientgreek{#1}} 360\def\sg#1{\textancientgreek{#1}}
361\usepackage[Old Standard]{mathfont} 361\usepackage[Old Standard]{mathfont}
362\usepackage{arabluatex} 362\usepackage{arabluatex}
363\usepackage[parnotes=roman,teiexport=tidy]{ekdosis} 363\usepackage[parnotes=roman,teiexport=tidy,verse]{ekdosis}
364\input{ekdosis-cfg} 364\input{ekdosis-cfg}
365\AddxmlBibResource{bibdata.xml} 365\AddxmlBibResource{bibdata.xml}
366\usepackage{booktabs} 366\usepackage{booktabs}
@@ -5022,7 +5022,7 @@ Sample text with a \textcolor{red}{word} in red.
5022 \lem[source=Drak, type=emendation]{ne morem} 5022 \lem[source=Drak, type=emendation]{ne morem}
5023 \rdg[wit={L, F}]{me morem} 5023 \rdg[wit={L, F}]{me morem}
5024 \rdg[wit={O, V}]{memorem} 5024 \rdg[wit={O, V}]{memorem}
5025 } et pugnae signum exspectate petendae: 5025 } et pugnae signum exspectate petendae:\\
5026 \end{ekdverse} 5026 \end{ekdverse}
5027\end{ekdosis} 5027\end{ekdosis}
5028\end{minted} 5028\end{minted}
@@ -5035,8 +5035,8 @@ Sample text with a \textcolor{red}{word} in red.
5035% 5035%
5036% \needspace{7\baselineskip} 5036% \needspace{7\baselineskip}
5037% \begin{alignment}[flush,tcols=1,texts=specimen,apparatus=specimen] 5037% \begin{alignment}[flush,tcols=1,texts=specimen,apparatus=specimen]
5038% \resetlinenumber[30]\rightlinenumbers 5038% \setverselinenums{30}{0}
5039% \setlength{\linenumbersep}{-1.5in} 5039% \setlength{\vrightskip}{-1.5in}
5040% \begin{specimen} 5040% \begin{specimen}
5041% \begin{ekdverse} 5041% \begin{ekdverse}
5042% Sed uos, quorum oculos atque ora humentia uidi,\\ 5042% Sed uos, quorum oculos atque ora humentia uidi,\\
@@ -5045,7 +5045,7 @@ Sample text with a \textcolor{red}{word} in red.
5045% \lem[source=sDrak, type=emendation]{ne morem} 5045% \lem[source=sDrak, type=emendation]{ne morem}
5046% \rdg[wit={sL, sF}]{me morem} 5046% \rdg[wit={sL, sF}]{me morem}
5047% \rdg[wit={sO, sV}]{memorem} 5047% \rdg[wit={sO, sV}]{memorem}
5048% } et pugnae signum exspectate petendae: 5048% } et pugnae signum exspectate petendae:\\
5049% \end{ekdverse} 5049% \end{ekdverse}
5050% \end{specimen} 5050% \end{specimen}
5051% \end{alignment} 5051% \end{alignment}
@@ -5956,7 +5956,8 @@ Sample text with a \textcolor{red}{word} in red.
5956 \AtBeginDocument{\luadirect{ekdosis.setekddivsfalse()}}}}, 5956 \AtBeginDocument{\luadirect{ekdosis.setekddivsfalse()}}}},
5957 initial divs = ekdosis, 5957 initial divs = ekdosis,
5958 unknown-choice divs = \PackageError{ekdosis}{unknown divs=#1}{`divs' 5958 unknown-choice divs = \PackageError{ekdosis}{unknown divs=#1}{`divs'
5959 must be either `ekdosis' or `latex'.}, 5959 must be either `ekdosis' or `latex'.},
5960 bool verse = \if@pkg@verse,
5960 choice parnotes = {false = {}, 5961 choice parnotes = {false = {},
5961 true = {\@pkg@parnotestrue}, 5962 true = {\@pkg@parnotestrue},
5962 roman = {\@pkg@parnotestrue\@parnotesromantrue}}, 5963 roman = {\@pkg@parnotestrue\@parnotesromantrue}},
@@ -5996,6 +5997,9 @@ Sample text with a \textcolor{red}{word} in red.
5996\RequirePackage{ltxcmds} 5997\RequirePackage{ltxcmds}
5997\RequirePackage{pdftexcmds} 5998\RequirePackage{pdftexcmds}
5998\RequirePackage{ifoddpage} 5999\RequirePackage{ifoddpage}
6000\if@pkg@verse
6001 \RequirePackage{verse}
6002\fi
5999\if@pkg@parnotes 6003\if@pkg@parnotes
6000 \RequirePackage{parnotes} 6004 \RequirePackage{parnotes}
6001\fi 6005\fi
@@ -6669,6 +6673,9 @@ Sample text with a \textcolor{red}{word} in red.
6669 lineation=#1}{`lineation' must be either `page' or `document'.}, 6673 lineation=#1}{`lineation' must be either `page' or `document'.},
6670 code modulonum = \chardef\c@linenumbermodulo#1\relax, 6674 code modulonum = \chardef\c@linenumbermodulo#1\relax,
6671 noval modulo = \modulolinenumbers, 6675 noval modulo = \modulolinenumbers,
6676 code vmodulonum = \if@pkg@verse\poemlines{#1}\fi,
6677 initial vmodulonum = 1,
6678 noval vmodulo = \if@pkg@verse\poemlines{5}\fi,
6672 choice numbers = {elided = \ekd@elidednumberstrue, 6679 choice numbers = {elided = \ekd@elidednumberstrue,
6673 full = \ekd@elidednumbersfalse}, 6680 full = \ekd@elidednumbersfalse},
6674 unknown-choice numbers = \PackageError{ekdosis}{unknown 6681 unknown-choice numbers = \PackageError{ekdosis}{unknown
@@ -7636,21 +7643,51 @@ Sample text with a \textcolor{red}{word} in red.
7636} 7643}
7637% \end{macrocode} 7644% \end{macrocode}
7638% \end{macro} 7645% \end{macro}
7639% A very basic and provisional implementation of poetry lines 7646% If \pkg{ekdosis} be loaded with the |verse| global option, the
7640% follows:--- 7647% \env{verse} environment needs to be redefined so that lines of
7648% poetry are numbered continuously. Additionally,
7649% \cs{verselinenumfont} is initially set to
7650% \cs{normalfont}\cs{footnotesize}.
7641% \begin{macrocode} 7651% \begin{macrocode}
7642\newlength{\ekdverseindentlength} 7652\if@pkg@verse
7643\setlength{\ekdverseindentlength}{\parindent} 7653\verselinenumfont{\normalfont\footnotesize}
7644\newenvironment*{ekdverse}[1][\ekdverseindentlength]{ 7654\setcounter{poemline}{1}
7645 \begin{list}{}{% 7655\renewenvironment{verse}[1][\linewidth]{%
7646 \setlength{\leftmargin}{#1} 7656 \stepcounter{verse@envctr}%
7647 \setlength{\itemsep}{0pt} 7657 \setcounter{vslineno}{1}%
7648 \setlength{\topsep}{0pt} 7658 \let\\=\@vscentercr
7649 \setlength{\partopsep}{0pt} 7659 \list{}{\itemsep \z@
7650 } 7660 \itemindent -\vindent%
7651 \item[] 7661 \listparindent\itemindent
7652 }{\end{list}} 7662 \parsep \stanzaskip
7663 \ifdim #1 < \linewidth
7664 \rightmargin \z@
7665 \setlength{\leftmargin}{\linewidth}%
7666 \addtolength{\leftmargin}{-#1}%
7667 \addtolength{\leftmargin}{-0.5\leftmargin}%
7668 \else
7669 \rightmargin \leftmargin
7670 \fi
7671 \addtolength{\leftmargin}{\vindent}}%
7672\item[]%
7673}{\endlist}
7674\fi
7653% \end{macrocode} 7675% \end{macrocode}
7676% \begin{environment}{ekdverse}
7677% \env{ekdverse} provides an implementation of poetry lines. It is
7678% set to use either the \pkg{lineno} or the \pkg{verse} package
7679% depending on the value that is passed to the global option
7680% |verse|:---
7681% \begin{macrocode}
7682\NewDocumentEnvironment{ekdverse}{}{%
7683 \if@pkg@verse
7684 \nolinenumbers
7685 \let\linelabel\label
7686 \fi
7687 \begin{verse}}
7688 {\end{verse}}
7689% \end{macrocode}
7690% \end{environment}
7654% \begin{environment}{ekdpar} 7691% \begin{environment}{ekdpar}
7655% When |autopar| is set to |false| by means of \cs{SetTEIxmlExport}, 7692% When |autopar| is set to |false| by means of \cs{SetTEIxmlExport},
7656% \env{ekdpar}\---or any other environment set to be inserted within 7693% \env{ekdpar}\---or any other environment set to be inserted within
@@ -8049,6 +8086,10 @@ local cmdtotags = {
8049local texpatttotags = { 8086local texpatttotags = {
8050 {a="\\addentries%s+%[(.-)%]{(.-)}", b=""}, 8087 {a="\\addentries%s+%[(.-)%]{(.-)}", b=""},
8051 {a="\\addentries%s+{(.-)}", b=""}, 8088 {a="\\addentries%s+{(.-)}", b=""},
8089 {a="\\setverselinenums%s+{(.-)}{(.-)}", b=""},
8090 {a="\\resetlinenumber%s+%[(.-)%]", b=""},
8091 {a="\\resetlinenumber%s+", b=""},
8092 {a="\\poemlines%s+{(.-)}", b=""},
8052 {a="\\pagebreak%s+%[[1-4]%]", b=""}, 8093 {a="\\pagebreak%s+%[[1-4]%]", b=""},
8053 {a="\\pagebreak%s+", b=""}, 8094 {a="\\pagebreak%s+", b=""},
8054 {a="\\altrfont%s+", b=""}, 8095 {a="\\altrfont%s+", b=""},
@@ -8278,7 +8319,7 @@ end
8278 8319
8279local function linestotei(str) 8320local function linestotei(str)
8280-- str = "\n<l>"..str 8321-- str = "\n<l>"..str
8281 str = string.gsub(str, "^%s?(.-)%s?$", "\n<l>%1</l>\n") 8322 str = string.gsub(str, "^%s?(.-)\\\\%!?%s?$", "\n<l>%1</l>\n")
8282-- str = gsub(str, endpoem, "</l>\n") 8323-- str = gsub(str, endpoem, "</l>\n")
8283 str = gsub(str, poemline * spcenc^-1 * lpeg.P("&gt;"), "\n<lb/>") 8324 str = gsub(str, poemline * spcenc^-1 * lpeg.P("&gt;"), "\n<lb/>")
8284 str = gsub(str, poemline * spcenc^-1, "</l>\n<l>") 8325 str = gsub(str, poemline * spcenc^-1, "</l>\n<l>")