aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2021-03-12 18:53:17 +0100
committerRobert Alessi <alessi@robertalessi.net>2021-03-12 18:53:17 +0100
commit01b4f2311a844a702ca390deb66ee1100e64aed9 (patch)
tree8cdc165e5eb8b9d9ec172fbe9fc4907fc1c83864
parent98651e3d1f13dc0cc7880b7fc5dab01e2bc55e50 (diff)
downloadekdosis-01b4f2311a844a702ca390deb66ee1100e64aed9.tar.gz
'verse option' -> 'poetry=verse'. new hook 'initialrule'. latex-dev needed subtle insertions of \leavevmode. improved ekdosis.appout()
-rw-r--r--ekdosis.dtx165
1 files changed, 114 insertions, 51 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx
index 3e8181a..9e1ead5 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -962,8 +962,8 @@ along with this program. If not, see
962% \section{The Basics of \pkg{ekdosis}} 962% \section{The Basics of \pkg{ekdosis}}
963% \label{sec:ekdosis-basics} 963% \label{sec:ekdosis-basics}
964% 964%
965%\subsection{Loading the Package\---General Options} 965% \subsection{Loading the Package\---General Options}
966%\label{sec:load-general-options} 966% \label{sec:load-general-options}
967% 967%
968% \pkg{ekdosis} is loaded in the preamble like so:--- 968% \pkg{ekdosis} is loaded in the preamble like so:---
969% \iffalse 969% \iffalse
@@ -1010,14 +1010,13 @@ along with this program. If not, see
1010% \danger It must be noted that the two styles are mutually exclusive. 1010% \danger It must be noted that the two styles are mutually exclusive.
1011% \vskip\baselineskip 1011% \vskip\baselineskip
1012% 1012%
1013% \DescribeOption{verse}\label{ref:verse-opt} 1013% \DescribeOption{poetry}\label{ref:poetry-opt}
1014% |verse|$=$\verb+true|false+ 1014% |poetry|$=$\verb+verse+
1015% \hfill\tcboxverb{Default: false}\\ 1015% \hfill\tcboxverb{Default: not set}\\
1016% This named argument does not need a value as it defaults to |true| 1016% |poetry=verse| instructs \pkg{ekdosis} to load and use the facilites
1017% if it is used. |verse| instructs \pkg{ekdosis} to load and use the 1017% supplied by the \pkg{verse} package for typesetting lines of
1018% facilites supplied by the \pkg{verse} package for typesetting lines 1018% poetry. The \env{ekdverse} environment must then be used instead of
1019% of poetry. The \env{ekdverse} environment must then be used instead 1019% the \env{verse} environment that is provided by the \pkg{verse}
1020% of the \env{verse} environment that is provided by the \pkg{verse}
1021% package as described below in \vref{sec:poetry}. 1020% package as described below in \vref{sec:poetry}.
1022% 1021%
1023% \DescribeOption{parnotes}\label{ref:parnotes-opt} 1022% \DescribeOption{parnotes}\label{ref:parnotes-opt}
@@ -2948,7 +2947,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
2948% reference to line numbers. By default, it is |~|, namely an 2947% reference to line numbers. By default, it is |~|, namely an
2949% unbreakable space. As an example, |postrefnum=\hskip 0.5em| will 2948% unbreakable space. As an example, |postrefnum=\hskip 0.5em| will
2950% insert a \unit[0.5]{em} space between the numerals and the beginning 2949% insert a \unit[0.5]{em} space between the numerals and the beginning
2951% of all subsequent notes. 2950% of all subsequent notes.\\
2952% \DescribeOption{lemmastyle} |lemmastyle|$=$\meta{command} 2951% \DescribeOption{lemmastyle} |lemmastyle|$=$\meta{command}
2953% \hfill\tcboxverb{Default: not set}\\ 2952% \hfill\tcboxverb{Default: not set}\\
2954% \newfeature[v1.2] |lemmastyle| can be used to set the family, series 2953% \newfeature[v1.2] |lemmastyle| can be used to set the family, series
@@ -2956,7 +2955,19 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
2956% criticus. For example, |lemmastyle=|\cs{bfseries} will print all 2955% criticus. For example, |lemmastyle=|\cs{bfseries} will print all
2957% instances of lemma text in bold while 2956% instances of lemma text in bold while
2958% |lemmastyle=|\cs{color}|{blue}| will print them in blue. 2957% |lemmastyle=|\cs{color}|{blue}| will print them in blue.
2959% 2958% \DescribeOption{initialrule} |initialrule|$=$\meta{command}
2959% \label{ref:initialrule}\hfill\bgroup\footnotesize
2960% \tcboxverb{Default: \rule{0.4\columnwidth}{0.4pt} (initially not set)}%
2961% \egroup
2962% \newfeature[v1.2] |initialrule| draws a separating rule between the
2963% edition text and all subsequent layers of critical notes. Of course,
2964% this option only makes sense when multiple-layer apparatus criticus
2965% are set. Therefore, it has no effect on single-layer apparatus
2966% criticus.\\
2967% \DescribeOption{noinitialrule}\hfill\tcboxverb{Default: not set}\\
2968% This is a no-value option. It removes any previously set
2969% |initialrule|.
2970%
2960% \subsection{Single-Layer Apparatus Criticus} 2971% \subsection{Single-Layer Apparatus Criticus}
2961% \label{sec:single-layer-app} 2972% \label{sec:single-layer-app}
2962% \paragraph{Specific Commands} 2973% \paragraph{Specific Commands}
@@ -3170,25 +3181,37 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
3170% \iffalse 3181% \iffalse
3171%<*example> 3182%<*example>
3172% \fi 3183% \fi
3173\begin{minted}[linenos=false]{latex} 3184\begin{minted}{latex}
3174\SetHooks{ 3185\SetHooks{
3175 refnumstyle=\normalfont 3186 refnumstyle=\normalfont,
3187 initialrule=\rule{0.7in}{0.4pt}
3176} 3188}
3177\DeclareApparatus{testium}[ 3189\DeclareApparatus{testium}[
3178 sep={] }, 3190 sep={] },
3179 delim=\hskip 1em, 3191 delim=\hskip 1em,
3180 rule=\rule{0.7in}{0.4pt} 3192 norule
3181] 3193]
3182\DeclareApparatus{default}[ 3194\DeclareApparatus{default}[
3183 sep={: }, 3195 sep={: },
3184 delim=\hskip 1em, 3196 delim=\hskip 1em,
3185 norule 3197 rule=\relax
3186] 3198]
3187\end{minted} 3199\end{minted}
3188% \iffalse 3200% \iffalse
3189%</example> 3201%</example>
3190% \fi 3202% \fi
3191% 3203%
3204% \begin{remarks}
3205% \item The general hook \texttt{initialrule} used here (l.~3) is
3206% described above \vpageref{ref:initialrule}.
3207% \item \cs{relax} (l.~13) is a \TeX\ primitive that instructs to do
3208% nothing. Therefore, |rule=\relax| is not strictly equivalent to
3209% |norule|: with the former, \cs{relax} removes the rule but leaves
3210% untouched the subsequent carriage return: as a result, the layers
3211% are visually separated from one another by a blank line. With the
3212% latter everything is removed, carriage return included.
3213% \end{remarks}
3214%
3192% \paragraph{Limiting the Number of Entries per Page} 3215% \paragraph{Limiting the Number of Entries per Page}
3193% \label{ref:maxentries} 3216% \label{ref:maxentries}
3194% In some instances, it can be useful to set a limit to the number of 3217% In some instances, it can be useful to set a limit to the number of
@@ -3442,7 +3465,7 @@ the American Continent</emph>, II.61--2.</note></p>
3442\begin{minted}[linenos=false]{latex} 3465\begin{minted}[linenos=false]{latex}
3443This is some \app{ 3466This is some \app{
3444 \lem[alt=dummy]{\note[type=fontium, labelb=bnote, labele=enote, 3467 \lem[alt=dummy]{\note[type=fontium, labelb=bnote, labele=enote,
3445 lem=dummy... command]{Text of the note} 3468 lem=dummy... command]{Text of the note.}
3446 dummy} 3469 dummy}
3447 \rdg{pseudo}} 3470 \rdg{pseudo}}
3448text to demonstrate how to insert a note in the argument of the 3471text to demonstrate how to insert a note in the argument of the
@@ -3461,7 +3484,7 @@ text to demonstrate how to insert a note in the argument of the
3461% \begin{specimen} 3484% \begin{specimen}
3462% This is some \app{ 3485% This is some \app{
3463% \lem[alt=dummy]{\note[type=fontium, labelb=bnote, labele=enote, 3486% \lem[alt=dummy]{\note[type=fontium, labelb=bnote, labele=enote,
3464% lem=dummy... command]{Text of the note} 3487% lem=dummy... command]{Text of the note.}
3465% dummy} 3488% dummy}
3466% \rdg{pseudo}} 3489% \rdg{pseudo}}
3467% text to demonstrate how to insert a note in the argument of the 3490% text to demonstrate how to insert a note in the argument of the
@@ -3481,7 +3504,7 @@ text to demonstrate how to insert a note in the argument of the
3481 <anchor xml:id="bnote" />dummy</lem> 3504 <anchor xml:id="bnote" />dummy</lem>
3482 <note type="fontium" 3505 <note type="fontium"
3483 target="#range(right(bnote),left(enote))">Text of the 3506 target="#range(right(bnote),left(enote))">Text of the
3484 note</note> 3507 note.</note>
3485 <rdg>pseudo</rdg> 3508 <rdg>pseudo</rdg>
3486</app>text to demonstrate how to insert a note in the 3509</app>text to demonstrate how to insert a note in the
3487argument of the 3510argument of the
@@ -6233,6 +6256,9 @@ Sample text with a \textcolor{red}{word} in red.
6233 store refnumstyle = \ekd@refnumstyle, 6256 store refnumstyle = \ekd@refnumstyle,
6234 store postrefnum = \ekd@postrefnum, 6257 store postrefnum = \ekd@postrefnum,
6235 store lemmastyle = \ekd@lemmastyle, 6258 store lemmastyle = \ekd@lemmastyle,
6259 code initialrule = \def\ekd@initial@rule{#1\NLS},
6260 default initialrule = \rule{0.4\columnwidth}{0.4pt},
6261 noval noinitialrule = \undef\ekd@initial@rule,
6236 initial appfontsize = \footnotesize, 6262 initial appfontsize = \footnotesize,
6237 initial refnumstyle = \bfseries, 6263 initial refnumstyle = \bfseries,
6238 initial postrefnum = ~, 6264 initial postrefnum = ~,
@@ -6802,11 +6828,14 @@ Sample text with a \textcolor{red}{word} in red.
6802% documented. 6828% documented.
6803% \begin{macrocode} 6829% \begin{macrocode}
6804\newcommand*{\NLS}{% 6830\newcommand*{\NLS}{%
6805 \par% 6831 \nobreak\@normalcr\relax
6806 \nobreak% 6832 % \par
6807 \vspace{-\parskip}% 6833 % \nobreak
6808 \noindent% 6834 % \vspace{-\parskip}%
6809 \ignorespaces} 6835 % \leavevmode
6836 % \noindent
6837 % \ignorespaces
6838}
6810% \end{macrocode} 6839% \end{macrocode}
6811% \end{macro} 6840% \end{macro}
6812% This boolean is used to test if a given entry is to be preceded by a 6841% This boolean is used to test if a given entry is to be preceded by a
@@ -6823,34 +6852,53 @@ Sample text with a \textcolor{red}{word} in red.
6823% \begin{macrocode} 6852% \begin{macrocode}
6824\newif\ifekd@inside@app 6853\newif\ifekd@inside@app
6825\def\add@@apparatus{% 6854\def\add@@apparatus{%
6826 \if@pkg@parnotes\parnotes\else\fi% 6855 \if@pkg@parnotes\parnotes\else\fi
6827 \if@pkg@footins% 6856 \if@pkg@footins
6828 \bgroup% 6857 \bgroup
6829 \ifrtl@app\setRL\else\setLR\fi% 6858 \unless\ifekd@mapps
6859 \ifrtl@app\pardir TRT\leavevmode\textdir TRT\else
6860 \pardir TLT\leavevmode\textdir TLT\fi
6861 \fi
6830 \blfootnote{% 6862 \blfootnote{%
6831 \if@pkg@parnotes% 6863 \if@pkg@parnotes
6832 \if@parnotesroman% 6864 \if@parnotesroman
6833 \renewcommand*{\theparnotemark}{\roman{parnotemark}}\else\fi% 6865 \renewcommand*{\theparnotemark}{\roman{parnotemark}}\else\fi
6834 \parnoteclear\else\fi% 6866 \parnoteclear\else\fi
6835 \ekd@inside@apptrue 6867 \ekd@inside@apptrue
6836 \footnotesize\apparatus\unless\ifekd@mapps\ekd@end@apparatus\fi% 6868 \ekd@appfontsize
6869 \ifekd@mapps
6870 \ifdefined\ekd@initial@rule
6871 \ekd@initial@rule
6872 \fi
6873 \fi
6874 \apparatus\unless\ifekd@mapps\ekd@end@apparatus\fi
6837 \ekd@inside@appfalse 6875 \ekd@inside@appfalse
6838 \if@pkg@parnotes\parnotes\parnotereset\else\fi 6876 \if@pkg@parnotes\parnotes\parnotereset\else\fi
6839 }% 6877 }%
6840 \egroup% 6878 \egroup
6841 \fi% 6879 \fi
6842 \if@pkg@float% 6880 \if@pkg@float
6843 \keyparbox[!b]{}{\ifrtl@app\setRL\else\setLR\fi% 6881 \keyparbox[!b]{}{%
6844 \if@pkg@parnotes% 6882 \unless\ifekd@mapps
6845 \if@parnotesroman% 6883 \ifrtl@app\pardir TRT\leavevmode\textdir TRT\else
6846 \renewcommand*{\theparnotemark}{\roman{parnotemark}}\else\fi% 6884 \pardir TLT\leavevmode\textdir TLT\fi
6847 \parnoteclear\else\fi% 6885 \fi
6886 \if@pkg@parnotes
6887 \if@parnotesroman
6888 \renewcommand*{\theparnotemark}{\roman{parnotemark}}\else\fi
6889 \parnoteclear\else\fi
6848 \ekd@inside@apptrue 6890 \ekd@inside@apptrue
6849 \ekd@appfontsize\apparatus\unless\ifekd@mapps\ekd@end@apparatus\fi% 6891 \ekd@appfontsize
6892 \ifekd@mapps
6893 \ifdefined\ekd@initial@rule
6894 \ekd@initial@rule
6895 \fi
6896 \fi
6897 \apparatus\unless\ifekd@mapps\ekd@end@apparatus\fi
6850 \ekd@inside@appfalse 6898 \ekd@inside@appfalse
6851 \if@pkg@parnotes\parnotes\parnotereset\else\fi% 6899 \if@pkg@parnotes\parnotes\parnotereset\else\fi
6852 }% 6900 }%
6853 \fi% 6901 \fi
6854} 6902}
6855% \end{macrocode} 6903% \end{macrocode}
6856% Before inserting any new entry, \cs{add@apparatus} calls 6904% Before inserting any new entry, \cs{add@apparatus} calls
@@ -9924,7 +9972,7 @@ function ekdosis.appout()
9924 local output = {} 9972 local output = {}
9925 if next(apparatuses) == nil then 9973 if next(apparatuses) == nil then
9926 -- table.insert(output, "BEGIN") 9974 -- table.insert(output, "BEGIN")
9927 table.insert(output, "\\noindent\\csname ekd@default@rule\\endcsname\\NLS") 9975 table.insert(output, "\\csname ekd@default@rule\\endcsname\\NLS")
9928 table.insert(output, "\\csname ekd@begin@apparatus\\endcsname\\ignorespaces") 9976 table.insert(output, "\\csname ekd@begin@apparatus\\endcsname\\ignorespaces")
9929-- table.insert(output, "\\noindent ") 9977-- table.insert(output, "\\noindent ")
9930 for i in string.gmatch(t, 9978 for i in string.gmatch(t,
@@ -9939,6 +9987,7 @@ function ekdosis.appout()
9939 end 9987 end
9940 -- table.insert(output, "END") 9988 -- table.insert(output, "END")
9941 else 9989 else
9990 local appinserted = false
9942 local n = 1 9991 local n = 1
9943 while apparatuses[n] 9992 while apparatuses[n]
9944 do 9993 do
@@ -9953,16 +10002,19 @@ function ekdosis.appout()
9953 table.insert(output, "\\bgroup{}") 10002 table.insert(output, "\\bgroup{}")
9954 if apparatuses[n].direction == "LR" 10003 if apparatuses[n].direction == "LR"
9955 then 10004 then
9956 table.insert(output, "\\pardir TLT\\textdir TLT{}") 10005 table.insert(output, "\\pardir TLT\\leavevmode\\textdir TLT{}")
9957 elseif apparatuses[n].direction == "RL" 10006 elseif apparatuses[n].direction == "RL"
9958 then 10007 then
9959 table.insert(output, "\\pardir TRT\\textdir TRT{}") 10008 table.insert(output, "\\pardir TRT\\leavevmode\\textdir TRT{}")
9960 end 10009 end
9961 if apparatuses[n].rule == "none" 10010 if apparatuses[n].rule == "none"
9962 then 10011 then
9963 if n > 1 10012 if n > 1
9964 then 10013 then
9965 table.insert(output, "\\NLS{}") 10014 if appinserted
10015 then
10016 table.insert(output, "\\NLS{}")
10017 end
9966 else 10018 else
9967 table.insert(output, "\\noindent ") 10019 table.insert(output, "\\noindent ")
9968 end 10020 end
@@ -9970,7 +10022,12 @@ function ekdosis.appout()
9970 then 10022 then
9971 if n > 1 10023 if n > 1
9972 then 10024 then
9973 table.insert(output, "\\NLS{}" .. apparatuses[n].rule .. "\\NLS{}") 10025 if appinserted
10026 then
10027 table.insert(output, "\\NLS{}" .. apparatuses[n].rule .. "\\NLS{}")
10028 else
10029 table.insert(output, apparatuses[n].rule .. "\\NLS{}")
10030 end
9974 else 10031 else
9975-- table.insert(output, "\\noindent ") 10032-- table.insert(output, "\\noindent ")
9976 table.insert(output, apparatuses[n].rule .. "\\NLS{}") 10033 table.insert(output, apparatuses[n].rule .. "\\NLS{}")
@@ -9978,7 +10035,12 @@ function ekdosis.appout()
9978 else 10035 else
9979 if n > 1 10036 if n > 1
9980 then 10037 then
9981 table.insert(output, "\\NLS\\csname ekd@default@rule\\endcsname\\NLS{}") 10038 if appinserted
10039 then
10040 table.insert(output, "\\NLS\\csname ekd@default@rule\\endcsname\\NLS{}")
10041 else
10042 table.insert(output, "\\csname ekd@default@rule\\endcsname\\NLS{}")
10043 end
9982 else 10044 else
9983-- table.insert(output, "\\noindent ") 10045-- table.insert(output, "\\noindent ")
9984 table.insert(output, "\\csname ekd@default@rule\\endcsname\\NLS{}") 10046 table.insert(output, "\\csname ekd@default@rule\\endcsname\\NLS{}")
@@ -10004,6 +10066,7 @@ function ekdosis.appout()
10004 ..curcol.."%-"..n..">") 10066 ..curcol.."%-"..n..">")
10005 do 10067 do
10006 table.insert(output, i) 10068 table.insert(output, i)
10069 appinserted = true
10007 end 10070 end
10008 if apparatuses[n].ehook ~= "" 10071 if apparatuses[n].ehook ~= ""
10009 then 10072 then