diff options
author | Robert Alessi <alessi@robertalessi.net> | 2020-07-27 19:52:09 +0200 |
---|---|---|
committer | Robert Alessi <alessi@robertalessi.net> | 2020-07-27 19:52:09 +0200 |
commit | 80d4307b761b9a1836f5217657283783ca403681 (patch) | |
tree | bcb1752c75ef21c84e789e787c004d4ab81af183 | |
parent | 0f3c0f7d90e67254e6c74b5b750ca80d1b2a3b10 (diff) | |
download | ekdosis-80d4307b761b9a1836f5217657283783ca403681.tar.gz |
new options for pagewise line numbering. done documenting lineation settings
-rw-r--r-- | ekdosis.dtx | 134 |
1 files changed, 131 insertions, 3 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx index 67e402c..dab30cc 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx | |||
@@ -121,6 +121,15 @@ along with this program. If not, see | |||
121 | {https://classicalstudies.org/scs-blog/donald-j-mastronarde/review-guidelines-encoding-critical-editions-library-digital-latin}, | 121 | {https://classicalstudies.org/scs-blog/donald-j-mastronarde/review-guidelines-encoding-critical-editions-library-digital-latin}, |
122 | organization = {Society for Classical Studies} | 122 | organization = {Society for Classical Studies} |
123 | } | 123 | } |
124 | |||
125 | @Software{lineno, | ||
126 | title = {The Lineno package}, | ||
127 | titleaddon = {Line numbers on paragraphs}, | ||
128 | author = {Lück, Uwe and Böttcher, Stephan}, | ||
129 | url = {http://www.ctan.org/pkg/lineno}, | ||
130 | date = {2005-11-02}, | ||
131 | version = {4.41} | ||
132 | } | ||
124 | \end{filecontents} | 133 | \end{filecontents} |
125 | \begin{filecontents}[overwrite]{\jobname-cfg.tex} | 134 | \begin{filecontents}[overwrite]{\jobname-cfg.tex} |
126 | \footnotelayout{m} | 135 | \footnotelayout{m} |
@@ -1102,7 +1111,7 @@ along with this program. If not, see | |||
1102 | % \fi | 1111 | % \fi |
1103 | \begin{minted}[linenos=false]{latex} | 1112 | \begin{minted}[linenos=false]{latex} |
1104 | \begin{xltabular}[c]{0.75\linewidth}{lXl} | 1113 | \begin{xltabular}[c]{0.75\linewidth}{lXl} |
1105 | \caption*{\textbf{Conspectus siglorum}\label{tab:conspectus-siglorum}}\\ | 1114 | \caption*{\textbf{Conspectus siglorum}}\\ |
1106 | \multicolumn{3}{c}{\emph{Familia} \getsiglum{a}}\\ | 1115 | \multicolumn{3}{c}{\emph{Familia} \getsiglum{a}}\\ |
1107 | \SigLine{A}\\ | 1116 | \SigLine{A}\\ |
1108 | & \getsiglum{A1} \emph{Emendationes scribae ipsius} & \\ | 1117 | & \getsiglum{A1} \emph{Emendationes scribae ipsius} & \\ |
@@ -1120,7 +1129,7 @@ along with this program. If not, see | |||
1120 | % \fi | 1129 | % \fi |
1121 | % | 1130 | % |
1122 | % \begin{xltabular}[c]{0.75\linewidth}{lXl} | 1131 | % \begin{xltabular}[c]{0.75\linewidth}{lXl} |
1123 | % \caption*{\textbf{Conspectus siglorum}\label{tab:conspectus-siglorum}}\\ | 1132 | % \caption*{\textbf{Conspectus siglorum}}\\ |
1124 | % \multicolumn{3}{c}{\emph{Familia} \getsiglum{ca}}\\ | 1133 | % \multicolumn{3}{c}{\emph{Familia} \getsiglum{ca}}\\ |
1125 | % \SigLine{cA}\\ | 1134 | % \SigLine{cA}\\ |
1126 | % & \getsiglum{cA1} \emph{Emendationes scribae ipsius} & \\ | 1135 | % & \getsiglum{cA1} \emph{Emendationes scribae ipsius} & \\ |
@@ -2370,6 +2379,84 @@ argument of the | |||
2370 | % element (ll.~5--7). Otherwise, the \texttt{TEI} output would not be | 2379 | % element (ll.~5--7). Otherwise, the \texttt{TEI} output would not be |
2371 | % valid. | 2380 | % valid. |
2372 | % | 2381 | % |
2382 | % \section{Lineation Settings} | ||
2383 | % \label{sec:lineation} | ||
2384 | % \danger \pkg{ekdosis} uses \pkg{lineno} internally for line | ||
2385 | % numbering.\footcite{lineno} But it must be noted that \pkg{ekdosis} | ||
2386 | % strictly prohibits the \enquote{pagewise} mode of operation that is | ||
2387 | % provided by \pkg{lineno}. As a result of this hinderance, all | ||
2388 | % \enquote{margin switching} features of \pkg{lineno} are disabled | ||
2389 | % within the environments that are specific to \pkg{ekdosis}, | ||
2390 | % viz. \env{ekdosis} and \env{alignment}. | ||
2391 | % | ||
2392 | % That said, \pkg{ekdosis} provides equivalents of its own to handle | ||
2393 | % the line numbers the same way as \pkg{lineno}'s \enquote{pagewise} | ||
2394 | % mode of operation does. | ||
2395 | % | ||
2396 | % \DescribeMacro{\SetLineation} \cs{SetLineation}\marg{csv list of | ||
2397 | % options} may be used in the preamble or at any point of the document | ||
2398 | % to set lineation preferences. Its argument processes the |key=value| | ||
2399 | % options that follow:---\\ | ||
2400 | % \DescribeOption{lineation} |lineation|$=$\verb+page|document+ | ||
2401 | % \hfill\tcboxverb{Default: document}\\ | ||
2402 | % |lineation=document| has the lines numbered continuously throughout | ||
2403 | % the document while |lineation=page| instructs \pkg{ekdosis} that the | ||
2404 | % numbering should start afresh at the top of each page.\\ | ||
2405 | % \DescribeOption{modulo} |modulo| \hfill\tcboxverb{Default: not set}\\ | ||
2406 | % |modulo| does not accept any value. When this option is set, every | ||
2407 | % fifth line is numbered.\\ | ||
2408 | % \DescribeOption{modulonum} |modulonum|$=$\emph{n} (where \emph{n} is | ||
2409 | % an integer)\hfill\tcboxverb{Default: not set}\\ | ||
2410 | % |modulonum| allows to modify the interval between the numbers that | ||
2411 | % are printed. |modulo| must be set for this option to have effect. As | ||
2412 | % examples, |modulo, modulonum=3| has every third line numbered and | ||
2413 | % |modulonum=1| disables modulo numbering.\\ | ||
2414 | % \DescribeOption{margin} |margin|$=$\verb+right|left|inner|outer+ | ||
2415 | % \hfill\tcboxverb{Default: left}\\ | ||
2416 | % |margin| sets the margin in which the line numbers are to be | ||
2417 | % printed.\\ | ||
2418 | % \DescribeOption{numbers} |numbers|$=$\verb+elided|full+ | ||
2419 | % \hfill\tcboxverb{Default: elided}\\ | ||
2420 | % This option only has effect on the numbers that are printed in the | ||
2421 | % apparatus criticus. |numbers=elided| applies on spans of numbers and | ||
2422 | % elides the last number of a range to the fewest number of figures | ||
2423 | % possible\---viz. 35--7, 129--31 \emph{\&c.}\---without eliding | ||
2424 | % digits in the group 10 to 19 in each hundred\---viz. 17--19, 115--18 | ||
2425 | % \emph{\&c.} |numbers=full| leaves the numbers untouched. | ||
2426 | % | ||
2427 | % \paragraph{Useful Lineation Commands} | ||
2428 | % As implied above, pretty much all commands that are provided by the | ||
2429 | % \enquote{running} mode of operation of the \pkg{lineno} package will | ||
2430 | % work with \pkg{ekdosis}, notably the following:---\\ | ||
2431 | % \DescribeMacro{\modulolinenumbers} \cs{modulolinenumbers}\oarg{n} | ||
2432 | % can be used to enable modulo line numbering as described above.\\ | ||
2433 | % \DescribeMacro{\resetlinenumber} \cs{resetlinenumber}\oarg{n} resets | ||
2434 | % the line number to one or to \emph{n} if specified.\\ | ||
2435 | % \DescribeMacro{\linelabel} \DescribeMacro{\lineref} | ||
2436 | % \cs{linelabel}\marg{label} sets a line label that can be referred to | ||
2437 | % with \cs{lineref}\marg{label}. | ||
2438 | % | ||
2439 | % The reader is invited to refer to the documentation of the | ||
2440 | % \pkg{lineno} package for more information. | ||
2441 | % | ||
2442 | % As an example, what follows has every fifth line number printed in | ||
2443 | % the inner margins. Additionally, the numbering shall start afresh at | ||
2444 | % the top of each page:--- | ||
2445 | % | ||
2446 | % \iffalse | ||
2447 | %<*example> | ||
2448 | % \fi | ||
2449 | \begin{minted}[linenos=false]{latex} | ||
2450 | \SetLineation{ | ||
2451 | lineation=page, | ||
2452 | modulo, | ||
2453 | margin=inner | ||
2454 | } | ||
2455 | \end{minted} | ||
2456 | % \iffalse | ||
2457 | %</example> | ||
2458 | % \fi | ||
2459 | % | ||
2373 | % \section{To Be Continued...} | 2460 | % \section{To Be Continued...} |
2374 | % v1.0 of \pkg{ekdosis}, which should be available by the end of July | 2461 | % v1.0 of \pkg{ekdosis}, which should be available by the end of July |
2375 | % 2020, will include a full documentation. At the time of writing, the | 2462 | % 2020, will include a full documentation. At the time of writing, the |
@@ -3005,6 +3092,7 @@ argument of the | |||
3005 | \RequirePackage{zref-abspage} | 3092 | \RequirePackage{zref-abspage} |
3006 | \RequirePackage{ltxcmds} | 3093 | \RequirePackage{ltxcmds} |
3007 | \RequirePackage{atbegshi} | 3094 | \RequirePackage{atbegshi} |
3095 | \RequirePackage{ifoddpage} | ||
3008 | \if@pkg@parnotes | 3096 | \if@pkg@parnotes |
3009 | \RequirePackage{parnotes} | 3097 | \RequirePackage{parnotes} |
3010 | \fi | 3098 | \fi |
@@ -3541,6 +3629,39 @@ argument of the | |||
3541 | \luastringO{#1}))}}} | 3629 | \luastringO{#1}))}}} |
3542 | % \end{macrocode} | 3630 | % \end{macrocode} |
3543 | % \paragraph{Lineation settings} | 3631 | % \paragraph{Lineation settings} |
3632 | % \begin{macro}{\outerlinenumbers} | ||
3633 | % \begin{macro}{\innerlinenumbers} | ||
3634 | % \pkg{ekdosis} does not use the \enquote{pagewise} numbering mode | ||
3635 | % that is provided by \pkg{lineno}. Therefore, | ||
3636 | % \cs{outerlinenumbers} and \cs{innerlinenumbers} are defined in | ||
3637 | % addition to \cs{rightlinenum{\allowbreak}bers} and | ||
3638 | % \cs{leftlinenumbers}. | ||
3639 | % \begin{macrocode} | ||
3640 | \def\outerlinenumbers{ | ||
3641 | \def\makeLineNumberRunning{ | ||
3642 | \checkoddpage | ||
3643 | \ifoddpage | ||
3644 | \linenumberfont\hskip\linenumbersep\hskip\textwidth | ||
3645 | \hbox to\linenumberwidth{\hss\LineNumber}\hss | ||
3646 | \else | ||
3647 | \hss\linenumberfont\LineNumber\hskip\linenumbersep | ||
3648 | \fi | ||
3649 | } | ||
3650 | } | ||
3651 | \def\innerlinenumbers{ | ||
3652 | \def\makeLineNumberRunning{ | ||
3653 | \checkoddpage | ||
3654 | \ifoddpage | ||
3655 | \hss\linenumberfont\LineNumber\hskip\linenumbersep | ||
3656 | \else | ||
3657 | \linenumberfont\hskip\linenumbersep\hskip\textwidth | ||
3658 | \hbox to\linenumberwidth{\hss\LineNumber}\hss | ||
3659 | \fi | ||
3660 | } | ||
3661 | } | ||
3662 | % \end{macrocode} | ||
3663 | % \end{macro} | ||
3664 | % \end{macro} | ||
3544 | % The keys to be used for lineation settings follow. A conditional is | 3665 | % The keys to be used for lineation settings follow. A conditional is |
3545 | % defined beforehand so that \pkg{ekdosis} may know whether the | 3666 | % defined beforehand so that \pkg{ekdosis} may know whether the |
3546 | % numbering should start afresh at the top of each page. | 3667 | % numbering should start afresh at the top of each page. |
@@ -3562,7 +3683,14 @@ argument of the | |||
3562 | full = \ekd@elidednumbersfalse}, | 3683 | full = \ekd@elidednumbersfalse}, |
3563 | unknown-choice numbers = \PackageError{ekdosis}{unknown | 3684 | unknown-choice numbers = \PackageError{ekdosis}{unknown |
3564 | numbers=#1}{`numbers' must be either `elided' or `full'.}, | 3685 | numbers=#1}{`numbers' must be either `elided' or `full'.}, |
3565 | initial numbers = elided | 3686 | initial numbers = elided, |
3687 | choice margin = {right = \rightlinenumbers, | ||
3688 | left = \leftlinenumbers, | ||
3689 | inner = \innerlinenumbers, | ||
3690 | outer = \outerlinenumbers}, | ||
3691 | unknown-choice margin = \PackageError{ekdosis}{unknown | ||
3692 | margin=#1}{`margin' must be either `left', `right', \MessageBreak | ||
3693 | `inner' or `outer'} | ||
3566 | } | 3694 | } |
3567 | % \end{macrocode} | 3695 | % \end{macrocode} |
3568 | % \begin{macro}{\SetLineation} | 3696 | % \begin{macro}{\SetLineation} |