diff options
Diffstat (limited to 'ekdosis.dtx')
-rw-r--r-- | ekdosis.dtx | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx index d867f27..a1bbe10 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx | |||
@@ -8200,6 +8200,21 @@ Sample text with a \textcolor{red}{word} in red. | |||
8200 | {\getrefnumber{\luadirect{tex.sprint(ekdosis.getprevlnlab())}-b}} | 8200 | {\getrefnumber{\luadirect{tex.sprint(ekdosis.getprevlnlab())}-b}} |
8201 | = | 8201 | = |
8202 | 0 | 8202 | 0 |
8203 | %%%begin | ||
8204 | \ifnum% | ||
8205 | \pdf@strcmp{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}% | ||
8206 | {\getrefnumber{\luadirect{tex.sprint(ekdosis.getprevlnlab())}-e}} | ||
8207 | = | ||
8208 | 0 | ||
8209 | \ifekd@isinlem | ||
8210 | \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% | ||
8211 | \unexpanded\expandafter{\ekd@postrefnum}% issue the no | ||
8212 | \fi | ||
8213 | \else | ||
8214 | \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% | ||
8215 | \unexpanded\expandafter{\ekd@postrefnum}% issue the no | ||
8216 | \fi | ||
8217 | %%%end | ||
8203 | \else | 8218 | \else |
8204 | \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% | 8219 | \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% |
8205 | \unexpanded\expandafter{\ekd@postrefnum}% issue the no | 8220 | \unexpanded\expandafter{\ekd@postrefnum}% issue the no |
@@ -8214,6 +8229,21 @@ Sample text with a \textcolor{red}{word} in red. | |||
8214 | {\getrefnumber{\luadirect{tex.sprint(ekdosis.getprevlnlab())}-b}} | 8229 | {\getrefnumber{\luadirect{tex.sprint(ekdosis.getprevlnlab())}-b}} |
8215 | = | 8230 | = |
8216 | 0 | 8231 | 0 |
8232 | %%%begin | ||
8233 | \ifnum% | ||
8234 | \pdf@strcmp{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}% | ||
8235 | {\getrefnumber{\luadirect{tex.sprint(ekdosis.getprevlnlab())}-e}} | ||
8236 | = | ||
8237 | 0 | ||
8238 | \ifekd@isinlem | ||
8239 | \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% | ||
8240 | \unexpanded\expandafter{\ekd@postrefnum}% issue the no | ||
8241 | \fi | ||
8242 | \else | ||
8243 | \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% | ||
8244 | \unexpanded\expandafter{\ekd@postrefnum}% issue the no | ||
8245 | \fi | ||
8246 | %%%end | ||
8217 | \else | 8247 | \else |
8218 | \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% | 8248 | \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% |
8219 | \unexpanded\expandafter{\ekd@postrefnum}% issue the no | 8249 | \unexpanded\expandafter{\ekd@postrefnum}% issue the no |
@@ -8972,6 +9002,19 @@ Sample text with a \textcolor{red}{word} in red. | |||
8972 | } | 9002 | } |
8973 | % \end{macrocode} | 9003 | % \end{macrocode} |
8974 | % \end{environment} | 9004 | % \end{environment} |
9005 | % \paragraph{Headers and Footers} | ||
9006 | % \begin{macrocode} | ||
9007 | \NewDocumentCommand{\ekd@storemark}{m}{% | ||
9008 | \stepcounter{ekd@lab}% | ||
9009 | \zlabel{ekd:\theekd@lab}% | ||
9010 | \luadirect{ekdosis.storehfmark( | ||
9011 | \luastring{\zref@extract{ekd:\theekd@lab}{abspage}}, | ||
9012 | \luastringN{#1})}% | ||
9013 | } | ||
9014 | \NewDocumentCommand{\ekdmark}{}{% | ||
9015 | \luadirect{tex.sprint(ekdosis.gethfmark(\luastring{\thepage}))}% | ||
9016 | } | ||
9017 | % \end{macrocode} | ||
8975 | % \paragraph{Divisions of the Body} | 9018 | % \paragraph{Divisions of the Body} |
8976 | % \pkg{ekdosis} can convert \cs{book}, \cs{part}, \cs{chapter}, | 9019 | % \pkg{ekdosis} can convert \cs{book}, \cs{part}, \cs{chapter}, |
8977 | % \cs{section}, \cs{subsec{\allowbreak}tion} and \cs{subsubsection} | 9020 | % \cs{section}, \cs{subsec{\allowbreak}tion} and \cs{subsubsection} |
@@ -9008,6 +9051,7 @@ Sample text with a \textcolor{red}{word} in red. | |||
9008 | code head = \def\head@value{#1}, | 9051 | code head = \def\head@value{#1}, |
9009 | code barehead = \def\barehead@value{#1}, | 9052 | code barehead = \def\barehead@value{#1}, |
9010 | store depth = \depth@value, | 9053 | store depth = \depth@value, |
9054 | code mark = \ekd@storemark{#1}, | ||
9011 | choice toc = {book = \def\toc@value{book}, | 9055 | choice toc = {book = \def\toc@value{book}, |
9012 | part = \def\toc@value{part}, | 9056 | part = \def\toc@value{part}, |
9013 | chapter = \def\toc@value{chapter}, | 9057 | chapter = \def\toc@value{chapter}, |
@@ -10220,6 +10264,24 @@ local function self_close_tags(str) | |||
10220 | return str | 10264 | return str |
10221 | end | 10265 | end |
10222 | 10266 | ||
10267 | --headers and footers | ||
10268 | local hfmarks = {} | ||
10269 | |||
10270 | function ekdosis.storehfmark(page, mk) | ||
10271 | table.insert(hfmarks, {a = page, mark = mk}) | ||
10272 | return true | ||
10273 | end | ||
10274 | |||
10275 | function ekdosis.gethfmark(page) | ||
10276 | local indexpage = get_a_index(page, hfmarks) | ||
10277 | if hfmarks[indexpage] ~= nil | ||
10278 | then | ||
10279 | return hfmarks[indexpage].mark | ||
10280 | else | ||
10281 | return "nil" | ||
10282 | end | ||
10283 | end | ||
10284 | |||
10223 | local divdepth = { | 10285 | local divdepth = { |
10224 | book = 1, | 10286 | book = 1, |
10225 | part = 2, | 10287 | part = 2, |