summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/strc-lnt.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/strc-lnt.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/strc-lnt.mkiv73
1 files changed, 37 insertions, 36 deletions
diff --git a/Master/texmf-dist/tex/context/base/strc-lnt.mkiv b/Master/texmf-dist/tex/context/base/strc-lnt.mkiv
index 0df44294bdd..442a9378fb6 100644
--- a/Master/texmf-dist/tex/context/base/strc-lnt.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-lnt.mkiv
@@ -17,13 +17,13 @@
\unprotect
-\newcounter\linenotecounter \newif\iftracelinenotes % will be tracker
+\newcount\noflinenotes \newif\iftracelinenotes % will be tracker
\def\dohandlelinenote#1#2#3%
{\bgroup
\def\linenotelinenumber##1{\inlinerange[#2]}% ##1 == order
- \setupnote[ln:#1][\c!numbercommand=\linenotelinenumber,\c!textcommand=\gobbleoneargument]% todo: deep hook
- \setnote[ln:#1]{#3}%
+ \setupnote[#1][\c!numbercommand=\linenotelinenumber,\c!textcommand=\gobbleoneargument]% todo: deep hook
+ \getvalue{\??vn:ln:#1}{#3}%
\egroup}
\def\dotracedlinenote#1%
@@ -32,7 +32,7 @@
{\forgetall
\hsize\zeropoint
\hss
- \vbox to \strutheight{\llap{\red\infofont\setstrut\linenotecounter}\vss}%
+ \vbox to \strutheight{\llap{\red\infofont\setstrut\the\noflinenotes}\vss}%
{\color[blue]{\vl}}%
\vbox to \strutheight{\rlap{\red\infofont\setstrut#1}\vss}%
\hss}%
@@ -40,13 +40,13 @@
\fi}
\def\dolinenote#1#2%
- {\doglobal\increment\linenotecounter
- \dohandlelinenote{#1}{\linenotecounter}{#2}%
+ {\global\advance\noflinenotes\plusone
+ \dohandlelinenote{#1}{\the\noflinenotes}{#2}%
\dotracedlinenote\empty
- \expanded{\someline[\linenotecounter]}}
+ \normalexpanded{\someline[\the\noflinenotes]}}
\def\dostartlinenote#1[#2]#3%
- {\doglobal\increment\linenotecounter
+ {\global\advance\noflinenotes\plusone
\dohandlelinenote{#1}{#2}{#3}%
\dotracedlinenote{#2}%
\startline[#2]}
@@ -55,68 +55,69 @@
{\stopline[#2]}
\unexpanded\def\definelinenote
- {\dodoubleempty\dodefinelinenote}
+ {\dotripleempty\dodefinelinenote}
-\def\dodefinelinenote[#1][#2]%
- {\definenote[ln:#1][#2]%
+\def\dodefinelinenote[#1][#2][#3]%
+ {\dodefinenote[#1][#2][#3]% do as we need to test for arguments
+ \expandafter\let\csname\??vn:ln:#1\expandafter\endcsname\csname#1\endcsname % use copy command
\setuvalue {#1}{\dolinenote {#1}}%
\setuvalue{\e!start#1}{\dostartlinenote{#1}}%
\setuvalue{\e!stop #1}{\dostoplinenote {#1}}}
-\unexpanded\def\setuplinenote[#1]% convenient
- {\setupnote[ln:#1]}
+\let\setuplinenote\setupnote
% We predefine one, namely \type {\linenote} cum suis.
\definelinenote[\v!linenote]
+% beware: line numbers are added later on so grouping setups is a bad idea
+%
% \startbuffer[test]
% \startlinenumbering[100]
-% test \linenote {oeps} test test test test test test
-% test \startlinenote [well] {oeps} test test test test test test
-% test \linenote {oeps} test test test test test test
-% test \linenote {oeps} test test test test test test
-% test \linenote {oeps} test test test test test test
-% test \linenote {oeps} test test test test test test
+% test \linenote {oeps 1} test test test test test test
+% test \startlinenote [well] {oeps X} test test test test test test
+% test \linenote {oeps 2} test test test test test test
+% test \linenote {oeps 3} test test test test test test
+% test \linenote {oeps 4} test test test test test test
+% test \linenote {oeps 5} test test test test test test
% test \stoplinenote [well] test test test test test test
% \stoplinenumbering
% \stopbuffer
%
-% \setupnotedefinition[linenote] [location=serried,distance=.5em]
-%
-% {\typebuffer[test] \getbuffer[test]} \page
+% \typebuffer[test] \getbuffer[test] \page
%
% \startbuffer[setup]
% \setuplinenumbering
-% [align=left]
+% [align=flushleft]
% \stopbuffer
%
-% {\typebuffer[setup] \getbuffer[setup,test]} \page
+% \typebuffer[setup] \getbuffer[setup,test] \page
%
% \startbuffer[setup]
% \setuplinenumbering
-% [width=1em,
-% align=left]
+% [width=4em,
+% distance=1em,
+% align=flushright]
% \stopbuffer
%
-% {\typebuffer[setup] \getbuffer[setup,test]} \page
+% \typebuffer[setup] \getbuffer[setup,test] \page
%
% \startbuffer[setup]
% \setuplinenumbering
-% [width=2em,
-% distance=.5em,
-% align=left]
+% [width=4em,
+% align=flushleft]
% \stopbuffer
%
-% {\typebuffer[setup] \getbuffer[setup,test]} \page
+% \typebuffer[setup] \getbuffer[setup,test] \page
%
% \startbuffer[setup]
% \setuplinenumbering
% [width=2em,
+% distance=.5em,
% align=middle]
% \stopbuffer
%
-% {\typebuffer[setup] \getbuffer[setup,test]} \page
+% \typebuffer[setup] \getbuffer[setup,test] \page
%
% \startbuffer[setup]
% \setuplinenumbering
@@ -129,7 +130,7 @@
% width=1.5em]
% \stopbuffer
%
-% {\typebuffer[setup] \startnarrower\getbuffer[setup,test]\stopnarrower} \page
+% \typebuffer[setup] \getbuffer[setup] \startnarrower\getbuffer[test]\stopnarrower \page
%
% \startbuffer[setup]
% \setuplinenumbering
@@ -139,7 +140,7 @@
% align=middle]
% \stopbuffer
%
-% {\typebuffer[setup] \getbuffer[setup,test]} \page
+% \typebuffer[setup] \getbuffer[setup,test] \page
%
% \startbuffer[setup-1]
% \setuplinenumbering
@@ -159,7 +160,7 @@
% {#1}}
% \stopbuffer
%
-% {\typebuffer[setup-1,setup-2] \getbuffer[setup-1,setup-2,test]} \page
+% \typebuffer[setup-1,setup-2] \getbuffer[setup-1,setup-2,test] \page
%
% \startbuffer[setup-1]
% \setuplinenumbering
@@ -168,6 +169,6 @@
% command=\WatchThis]
% \stopbuffer
%
-% {\typebuffer[setup-1] \getbuffer[setup-1,setup-2,test]} \page
+% \typebuffer[setup-1] \getbuffer[setup-1,setup-2,test] \page
\protect \endinput