aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2021-06-28 18:43:31 +0200
committerRobert Alessi <alessi@robertalessi.net>2021-06-28 18:43:31 +0200
commitc0ed19154a1435e3a90b79f869d6c5440375f379 (patch)
tree5937c3fb42acbafcae9526e05b0a2c52f601412e
parent4243296d907f6eb790ce259f2da9dbece6d31771 (diff)
downloadekdosis-c0ed19154a1435e3a90b79f869d6c5440375f379.tar.gz
done documenting on headers and footers
-rw-r--r--ekdosis.dtx166
1 files changed, 150 insertions, 16 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx
index 820e9a8..716870c 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -61,7 +61,7 @@ along with this program. If not, see
61%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] 61%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
62%<package>\ProvidesPackage{ekdosis} 62%<package>\ProvidesPackage{ekdosis}
63%<*package> 63%<*package>
64 [2021/06/27 v1.3-dev Typesetting TEI xml-compliant critical editions] 64 [2021/06/28 v1.3-dev Typesetting TEI xml-compliant critical editions]
65%</package> 65%</package>
66%<*driver> 66%<*driver>
67\begin{filecontents}[noheader,overwrite]{bibdata.xml} 67\begin{filecontents}[noheader,overwrite]{bibdata.xml}
@@ -374,6 +374,15 @@ along with this program. If not, see
374 version = {3.47} 374 version = {3.47}
375} 375}
376 376
377@Software{titleps,
378 title = {The Titleps package},
379 titleaddon = {Page style control},
380 author = {Bezos López, Javier},
381 url = {https://ctan.org/pkg/titleps},
382 date = {2019-10-16},
383 version = {2.13}
384}
385
377@Software{verse, 386@Software{verse,
378 title = {The Verse package}, 387 title = {The Verse package},
379 titleaddon = {Aids for typesetting simple verse}, 388 titleaddon = {Aids for typesetting simple verse},
@@ -3603,6 +3612,7 @@ Some \app[type=rec2]{
3603% they are related to. As a result of this rule, all spaces subsequent 3612% they are related to. As a result of this rule, all spaces subsequent
3604% to \cs{note} are ignored. 3613% to \cs{note} are ignored.
3605% 3614%
3615% \needspace{2\baselineskip}
3606% \DescribeMacro{\note} \cs{note}\oarg{options}\marg{text}\\ 3616% \DescribeMacro{\note} \cs{note}\oarg{options}\marg{text}\\
3607% As said above, \cs{note}, when found outside \cs{app}|{}|, is used 3617% As said above, \cs{note}, when found outside \cs{app}|{}|, is used
3608% to insert in additional layers of the apparatus short comments or 3618% to insert in additional layers of the apparatus short comments or
@@ -5139,7 +5149,12 @@ subtype="arabtex">'inna 'abI kAna mina
5139% |toc|$=$\verb+book|part|chapter|section|subsection|subsubsection|paragraph|+\\ 5149% |toc|$=$\verb+book|part|chapter|section|subsection|subsubsection|paragraph|+\\
5140% |subparagraph|\hfill\tcboxverb{Default: not set}\\ 5150% |subparagraph|\hfill\tcboxverb{Default: not set}\\
5141% If |toc| be set, the title of the division goes into the table of 5151% If |toc| be set, the title of the division goes into the table of
5142% contents at the hierarchic level that is specified as value. 5152% contents at the hierarchic level that is specified as value.\\
5153% \DescribeOption{mark} \newfeature[v1.3] |mark|$=$\meta{signpost}
5154% \hfill\tcboxverb{Default: none}\\
5155% |mark| holds the signpost to be emitted as marker for headers and
5156% footers. Its value is recalled by \cs{ekdmark} as described below in
5157% \vref{sec:headers-footers}.
5143% 5158%
5144% \paragraph{Formatting the Titles} 5159% \paragraph{Formatting the Titles}
5145% \DescribeMacro{\FormatDiv} By design, \pkg{ekdosis} does 5160% \DescribeMacro{\FormatDiv} By design, \pkg{ekdosis} does
@@ -5167,10 +5182,11 @@ subtype="arabtex">'inna 'abI kAna mina
5167% here follows how the first three hierarchical levels could be 5182% here follows how the first three hierarchical levels could be
5168% formatted as un-numbered divisions:--- 5183% formatted as un-numbered divisions:---
5169% 5184%
5185% \captof{Divisions of the body text}[\label{lst:ekddiv-ex}]
5170% \iffalse 5186% \iffalse
5171%<*example> 5187%<*example>
5172% \fi 5188% \fi
5173\begin{minted}[linenos=false]{latex} 5189\begin{minted}{latex}
5174% Preamble: 5190% Preamble:
5175\FormatDiv{1}{\begin{center}\Large}{\end{center}} 5191\FormatDiv{1}{\begin{center}\Large}{\end{center}}
5176\FormatDiv{2}{\begin{center}\large}{\end{center}} 5192\FormatDiv{2}{\begin{center}\large}{\end{center}}
@@ -5280,6 +5296,126 @@ subtype="arabtex">'inna 'abI kAna mina
5280%</example> 5296%</example>
5281% \fi 5297% \fi
5282% 5298%
5299% \subsection{Headers and Footers}
5300% \label{sec:headers-footers}
5301% \newfeature[v1.3] \pkg{ekdosis} provides a mechanism of its own for
5302% emitting header and footer marks. The first operation consists in
5303% recording the information to be printed as signpost by means of the
5304% |mark| optional argument of the \cs{ekddiv} command described above
5305% in \vref{sec:ekddiv}.
5306%
5307% \DescribeMacro{\ekdmark} Once this is done, \cs{ekdmark} can be
5308% inserted in commands used to make headers and footers where the mark
5309% is to be printed.
5310%
5311% A common layout is that of headers in which one finds printed in
5312% sequence on even pages the page number, then the author's name, and
5313% on odd pages the title of the edited text, then the current
5314% division, then the page number, like so:---
5315%
5316% \needspace{4\baselineskip}
5317% \begin{xltabular}{1.0\linewidth}{|XcX|}
5318% \multicolumn{3}{l}{Even pages:}\\
5319% \hline
5320% \cs{thepage} & Hippocratis & \\
5321% \hline
5322% \multicolumn{3}{l}{Odd pages:}\\
5323% \hline
5324% & Epidemiarum liber II, \cs{ekdmark} & \hfill\cs{thepage}\\
5325% \hline
5326% \end{xltabular}
5327%
5328% To return to the example provided by \vref{lst:ekddiv-ex}, the mark
5329% of the current division would be inserted in the third-level
5330% \cs{ekddiv} command printed at line~28 like so:---
5331%
5332% \iffalse
5333%<*example>
5334% \fi
5335\begin{minted}[firstnumber=28,linenos]{latex}
5336 \ekddiv{head=1, type=paragraph, depth=3, n=II.1.1, mark={1, 1}}
5337\end{minted}
5338% \iffalse
5339%</example>
5340% \fi
5341%
5342% The following example illustrates how the corresponding headers and
5343% footers could be prepared in a straightforward way with the help of
5344% the \pkg{titleps} package:\footcite{titleps}---
5345%
5346% \iffalse
5347%<*example>
5348% \fi
5349\begin{minted}[linenos=false]{latex}
5350% Preamble:
5351\usepackage{titleps}
5352\newpagestyle{edition}{
5353 \sethead[\thepage][Hippocratis][]
5354 {}{Epidemiarum liber II, \ekdmark}{\thepage}
5355}
5356% Apply the page style:
5357\pagestyle{edition}
5358\end{minted}
5359% \iffalse
5360%</example>
5361% \fi
5362%
5363% \DescribeMacro{\endmark} It must be noted that \cs{ekdmark} is
5364% designed to print the first mark that is emitted on a given page and
5365% ignore the mark corresponding to any portion of text that may be
5366% printed between the top of the page and the point where the first
5367% mark is called. \cs{endmark} is an argument-less command that can be
5368% used just at the end of that portion of text to instruct
5369% \pkg{ekdosis} to print the last-emitted mark of the preceding page
5370% instead of the first-emitted mark of the current page.
5371%
5372% \paragraph{Removing Headers and Footers}
5373% Pages such as title pages must be printed with empty headers and
5374% footers. \pkg{ekdosis} must be given control over every item of
5375% information inserted in these areas beforehand.
5376%
5377% \DescribeMacro{\ekdprintmark}
5378% \cs{ekdprintmark}\marg{selector}\marg{signpost} The signposts
5379% printed in headers and footers must be passed as second argument of
5380% \cs{ekdprintmark} so that \pkg{ekdosis} can remove them on pages
5381% where printing them is not desirable. \meta{selector} refers to
5382% three symbolic letters where the first can be either |H| or
5383% |F|\===for \underLine{h}eader or \underLine{f}ooter\===, the second
5384% |E| or |O|\===for \underLine{o}dd or \underLine{e}ven\===and the
5385% third |L|, |C| or |R|\===for \underLine{l}eft, \underLine{c}enter or
5386% \underLine{r}ight. The example provided above would then read as
5387% follows:---
5388%
5389% \iffalse
5390%<*example>
5391% \fi
5392\begin{minted}[linenos=false]{latex}
5393% Preamble:
5394\usepackage{titleps}
5395\newpagestyle{edition}{
5396 \sethead[\ekdprintmark{HEL}{\thepage}]
5397 [\ekdprintmark{HEC}{Hippocratis}]
5398 []
5399 {}
5400 {\ekdprintmark{HOC}{Epidemiarum liber II, \ekdmark}}
5401 {\ekdprintmark{HOR}{\thepage}}
5402}
5403% Apply the page style:
5404\pagestyle{edition}
5405\end{minted}
5406% \iffalse
5407%</example>
5408% \fi
5409%
5410% \DescribeMacro{\ekdnohfmarks} Once all signposts are marked with
5411% \cs{ekdprintmark}, \cs{ekdnohfmarks} can be used at any point of the
5412% document with the same effect as the \LaTeX\ standard command
5413% \cs{thispagestyle}|{empty}|.
5414%
5415% \DescribeMacro{\ekdresethfmarks} Finally, \cs{ekdresethfmarks} is
5416% provided in rare cases when it is needed to reset headers and
5417% footers to their original, viz.\ printable state.
5418%
5283% \section{The Tricks of the Trade} 5419% \section{The Tricks of the Trade}
5284% \label{sec:tricks-of-trade} 5420% \label{sec:tricks-of-trade}
5285% As the |.tex| source file is compiled, \pkg{ekdosis} has to compute 5421% As the |.tex| source file is compiled, \pkg{ekdosis} has to compute
@@ -6613,8 +6749,6 @@ Sample text with a \textcolor{red}{word} in red.
6613% \item Marginal edition texts: It may happen that the marginalia of 6749% \item Marginal edition texts: It may happen that the marginalia of
6614% manuscripts contain texts worth editing in addition to and along 6750% manuscripts contain texts worth editing in addition to and along
6615% the main text to which they are linked by reference signs. 6751% the main text to which they are linked by reference signs.
6616% \item Headers and footers: \cs{ekddiv} will provide top and bottom
6617% marks to be used in headers and footers.
6618% \end{enumerate} 6752% \end{enumerate}
6619% \item Short-term (months):--- 6753% \item Short-term (months):---
6620% \begin{enumerate} 6754% \begin{enumerate}
@@ -7353,7 +7487,7 @@ Sample text with a \textcolor{red}{word} in red.
7353% \end{macrocode} 7487% \end{macrocode}
7354% \paragraph{Setup} 7488% \paragraph{Setup}
7355% \begin{macro}{\ekdsetup} 7489% \begin{macro}{\ekdsetup}
7356% \changes{v1.3}{2021/06/27}{new command for global options} 7490% \changes{v1.3}{2021/06/28}{new command for global options}
7357% \cs{ekdsetup} is used to specify options that affect the general 7491% \cs{ekdsetup} is used to specify options that affect the general
7358% behavior of \pkg{ekdosis}. It is a preamble-only command. 7492% behavior of \pkg{ekdosis}. It is a preamble-only command.
7359% \begin{macrocode} 7493% \begin{macrocode}
@@ -7584,7 +7718,7 @@ Sample text with a \textcolor{red}{word} in red.
7584% \end{macrocode} 7718% \end{macrocode}
7585% \end{macro} 7719% \end{macro}
7586% \begin{macro}{\teidirect} 7720% \begin{macro}{\teidirect}
7587% \changes{v1.3}{2021/06/27}{direct insertion of elements in the 7721% \changes{v1.3}{2021/06/28}{direct insertion of elements in the
7588% \texttt{TEI xml} file} 7722% \texttt{TEI xml} file}
7589% \cs{teidirect}\oarg{xml attributes}\marg{xml element}\marg{code} 7723% \cs{teidirect}\oarg{xml attributes}\marg{xml element}\marg{code}
7590% does nothing in \LaTeX. Its only use is to insert elements in the 7724% does nothing in \LaTeX. Its only use is to insert elements in the
@@ -7951,7 +8085,7 @@ Sample text with a \textcolor{red}{word} in red.
7951% \end{macrocode} 8085% \end{macrocode}
7952% \end{macro} 8086% \end{macro}
7953% \begin{macro}{\SetApparatusNoteLanguage} 8087% \begin{macro}{\SetApparatusNoteLanguage}
7954% \changes{v1.3}{2021/06/27}{defines an alternate language to be 8088% \changes{v1.3}{2021/06/28}{defines an alternate language to be
7955% applied in note apparatus entries} 8089% applied in note apparatus entries}
7956% \cs{SetApparatusNoteLang}\marg{languagename} can be used when 8090% \cs{SetApparatusNoteLang}\marg{languagename} can be used when
7957% it is needed to apply in entries introduced by the \cs{note} command 8091% it is needed to apply in entries introduced by the \cs{note} command
@@ -9198,11 +9332,11 @@ Sample text with a \textcolor{red}{word} in red.
9198% \end{macrocode} 9332% \end{macrocode}
9199% \end{macro} 9333% \end{macro}
9200% \begin{macro}{\endmark} 9334% \begin{macro}{\endmark}
9201% \changes{v1.3}{2021/06/27}{prints the last-emitted mark of the 9335% \changes{v1.3}{2021/06/28}{prints the last-emitted mark of the
9202% preceding page} 9336% preceding page}
9203% By default, \cs{ekdmark} described below prints the first mark 9337% By default, \cs{ekdmark} described below prints the first mark
9204% that is emitted on a given page and ignores the mark corresponding 9338% that is emitted on a given page and ignores the mark corresponding
9205% to the portion of text that may be printed between the top of the 9339% to any portion of text that may be printed between the top of the
9206% page and the point where the first mark is called. \cs{endmark} is 9340% page and the point where the first mark is called. \cs{endmark} is
9207% an argument-less command that can be used just at the end of that 9341% an argument-less command that can be used just at the end of that
9208% portion of text to instruct \pkg{ekdosis} to print the last-emitted 9342% portion of text to instruct \pkg{ekdosis} to print the last-emitted
@@ -9220,7 +9354,7 @@ Sample text with a \textcolor{red}{word} in red.
9220% \end{macrocode} 9354% \end{macrocode}
9221% \end{macro} 9355% \end{macro}
9222% \begin{macro}{\edkmark} 9356% \begin{macro}{\edkmark}
9223% \changes{v1.3}{2021/06/27}{prints marks in headers or footers} 9357% \changes{v1.3}{2021/06/28}{prints marks in headers or footers}
9224% \cs{ekdmark} is an argument-less command called in commands used to 9358% \cs{ekdmark} is an argument-less command called in commands used to
9225% make headers and footers where the marks stored by means of the 9359% make headers and footers where the marks stored by means of the
9226% |mark| optional argument of \cs{ekddiv} are to be printed. 9360% |mark| optional argument of \cs{ekddiv} are to be printed.
@@ -9231,13 +9365,13 @@ Sample text with a \textcolor{red}{word} in red.
9231% \end{macrocode} 9365% \end{macrocode}
9232% \end{macro} 9366% \end{macro}
9233% \begin{macro}{\ekdprintmark} 9367% \begin{macro}{\ekdprintmark}
9234% \changes{v1.3}{2021/06/27}{prints or removes the marks in headers 9368% \changes{v1.3}{2021/06/28}{prints or removes the marks in headers
9235% and footers} \cs{ekdprintmark}\marg{selector}\marg{signpost} The 9369% and footers} \cs{ekdprintmark}\marg{selector}\marg{signpost} The
9236% signposts printed in headers and footers must be 9370% signposts printed in headers and footers must be
9237% passed as second argument of \cs{ekdprintmark} so that \pkg{ekdosis} 9371% passed as second argument of \cs{ekdprintmark} so that \pkg{ekdosis}
9238% can remove them on pages where printing them is not 9372% can remove them on pages where printing them is not
9239% desirable. \meta{selector} refers to three symbolic letters where 9373% desirable. \meta{selector} refers to three symbolic letters where
9240% the first can be |H| or |F|\===for \underLine{h}eader or 9374% the first can be either |H| or |F|\===for \underLine{h}eader or
9241% \underLine{f}ooter\===, the second |E| or |O|\===for \underLine{o}dd 9375% \underLine{f}ooter\===, the second |E| or |O|\===for \underLine{o}dd
9242% or \underLine{e}ven\===and the third |L|, |C| or |R|\===for 9376% or \underLine{e}ven\===and the third |L|, |C| or |R|\===for
9243% \underLine{l}eft, \underLine{c}enter or \underLine{r}ight:--- 9377% \underLine{l}eft, \underLine{c}enter or \underLine{r}ight:---
@@ -9269,10 +9403,10 @@ Sample text with a \textcolor{red}{word} in red.
9269% \end{macrocode} 9403% \end{macrocode}
9270% \end{macro} 9404% \end{macro}
9271% \begin{macro}{\ekdnofhmarks} 9405% \begin{macro}{\ekdnofhmarks}
9272% \changes{v1.3}{2021/06/27}{removes headers and footers on specific 9406% \changes{v1.3}{2021/06/28}{removes headers and footers on specific
9273% pages} Once the signposts are marked with \cs{ekdprintmark}, 9407% pages} Once the signposts are marked with \cs{ekdprintmark},
9274% \cs{ekdnohfmarks} has the same effect as the \LaTeX\ standard 9408% \cs{ekdnohfmarks} has the same effect as the \LaTeX\ standard
9275% command \cs{thispagestyle}|{empty}|. 9409% command \cs{thispagestyle}|{empty}|.
9276% \begin{macrocode} 9410% \begin{macrocode}
9277\NewDocumentCommand{\ekdnohfmark}{}{% 9411\NewDocumentCommand{\ekdnohfmark}{}{%
9278 \luadirect{ekdosis.nohfmark()}% 9412 \luadirect{ekdosis.nohfmark()}%
@@ -9280,7 +9414,7 @@ Sample text with a \textcolor{red}{word} in red.
9280% \end{macrocode} 9414% \end{macrocode}
9281% \end{macro} 9415% \end{macro}
9282% \begin{macro}{\ekdresethfmarks} 9416% \begin{macro}{\ekdresethfmarks}
9283% \changes{v1.3}{2021/06/27}{marks headers and footers as printable} 9417% \changes{v1.3}{2021/06/28}{marks headers and footers as printable}
9284% \cs{ekdresethfmarks} can be used in rare cases when it is needed to 9418% \cs{ekdresethfmarks} can be used in rare cases when it is needed to
9285% reset headers and footers to their original, viz.\ printable state. 9419% reset headers and footers to their original, viz.\ printable state.
9286% \begin{macrocode} 9420% \begin{macrocode}