mode *last in mkiv
Hm, I have no clue on how enable *last mode in mkiv \starttext \startmode[*last] LAST \stopmode #> context --final test.tex doesn't work -- luigi
Am 19.07.10 13:30, schrieb luigi scarso:
Hm, I have no clue on how enable *last mode in mkiv \starttext \startmode[*last] LAST \stopmode
The '*last' mode is enabled when context needs the maximal number of runs for your document. \definetwopasslist{last} \starttext \gettwopassdata{last} \iftwopassdatafound \savetwopassdata{last}{1}{\number\numexpr\twopassdata+1\relax} \else \savetwopassdata{last}{1}{1} \fi \doifnotmode{*last}{not }the last run \stoptext Wolfgang
On Mon, Jul 19, 2010 at 7:24 PM, Wolfgang Schuster < schuster.wolfgang@googlemail.com> wrote:
Am 19.07.10 13:30, schrieb luigi scarso:
The '*last' mode is enabled when context needs the maximal number of runs
for your document.
\definetwopasslist{last} \starttext \gettwopassdata{last} \iftwopassdatafound \savetwopassdata{last}{1}{\number\numexpr\twopassdata+1\relax} \else \savetwopassdata{last}{1}{1} \fi \doifnotmode{*last}{not }the last run \stoptext
Wolfgang
Hm.
From core-sys.mkiv:
\appendtoks \ifcase\@@svn % % 0 : unknown \or \setsystemmode\v!first % 1 : first run \or % % 2 : successive run \or \setsystemmode\v!first % 3 : first and only run \or \setsystemmode\v!last % 4 : (extra) last run \fi \to \everysetupsystem I suppose that last=4 runs But the max number of runs is 8 , if I've understood mtx-context.lua So \starttext %% %% content here %% \startmode[LAST]\myNullMacro\stopmode% \stoptext #> context mydocument.tex && context --mode=LAST mydocument.tex ensure that the code inside \startmode[LAST]...\stopmode is really seen the "last " pass -- luigi
Am 19.07.10 19:37, schrieb luigi scarso:
#> context mydocument.tex && context --mode=LAST mydocument.tex
ensure that the code inside \startmode[LAST]...\stopmode is really seen the "last " pass
It is seen at the last run but also the first, second ... because you enable just a self defined mode 'LAST'. Wolfgang
On Mon, Jul 19, 2010 at 7:56 PM, Wolfgang Schuster < schuster.wolfgang@googlemail.com> wrote:
Am 19.07.10 19:37, schrieb luigi scarso:
#> context mydocument.tex && context --mode=LAST mydocument.tex
ensure that the code inside \startmode[LAST]...\stopmode is really seen the "last " pass
It is seen at the last run but also the first, second ... because you enable just a self defined mode 'LAST'.
yes but the second "context", ie context --mode=LAST mydocument.tex should change nothing from the first "context", so it's really the last (run only one time) I mean that in #> context mydocument.tex && context mydocument.tex && context mydocument.tex && context mydocument.tex
all but the first run exactly one time, while the first can be 5 runs and so *last is not the last one. (of course one can put nasty things inside \startmode[LAST]...\stopmode etc etc etc) -- luigi
Am 19.07.10 20:26, schrieb luigi scarso:
On Mon, Jul 19, 2010 at 7:56 PM, Wolfgang Schuster
mailto:schuster.wolfgang@googlemail.com> wrote: Am 19.07.10 19:37, schrieb luigi scarso:
#> context mydocument.tex && context --mode=LAST mydocument.tex
ensure that the code inside \startmode[LAST]...\stopmode is really seen the "last " pass
It is seen at the last run but also the first, second ... because you enable just a self defined mode 'LAST'.
yes but the second "context", ie context --mode=LAST mydocument.tex should change nothing from the first "context", so it's really the last (run only one time) I mean that in #> context mydocument.tex && context mydocument.tex && context mydocument.tex && context mydocument.tex
all but the first run exactly one time, while the first can be 5 runs and so *last is not the last one.
(of course one can put nasty things inside \startmode[LAST]...\stopmode etc etc etc)
what is so important that you can include it only in the last run? Wolfgang
On Mon, Jul 19, 2010 at 9:21 PM, Wolfgang Schuster < schuster.wolfgang@googlemail.com> wrote:
what is so important that you can include it only in the last run?
Wolfgang
well, in the end nothing. I mean: nothing that I can't do with an ad-hoc program like MyAnalyzePdfandLog and --batch option, ie #>context --batch mydoc.tex; MyAnalyzePdfandLog mydoc.pdf mydoc.log
-- luigi
Am 19.07.10 22:00, schrieb luigi scarso:
On Mon, Jul 19, 2010 at 9:21 PM, Wolfgang Schuster
mailto:schuster.wolfgang@googlemail.com> wrote: what is so important that you can include it only in the last run?
well, in the end nothing. I mean: nothing that I can't do with an ad-hoc program like MyAnalyzePdfandLog and --batch option, ie #>context --batch mydoc.tex; MyAnalyzePdfandLog mydoc.pdf mydoc.log
why don't you use then a ctx file which process first the document and then MyAnalyze... Wolfgang
On Mon, Jul 19, 2010 at 10:09 PM, Wolfgang Schuster < schuster.wolfgang@googlemail.com> wrote:
why don't you use then a ctx file which process first the document and then MyAnalyze...
yes I know.
The point is: while the *first mode is clear and can be managed inside context, the concept of last run is problematic. If one wants to be sure that "this tex code will be parsed only at the last run" then the tex code must be enclose inside a \startmode[LAST]\stopmode and processed with #>context mydoc.tex && context --mode=LAST mydoc.tex (let's forget of errors for the moment) But if the tex code modify mydoc then the first context mydoc is superfluous. So in the end the tex code must do nothing of relevant, and hence it can be replaced by an external program MyAnalyze which in general must have as input the input source mydoc.tex, the output file mydoc.pdf and the log mydoc.log and processed with #>context --batch mydocument.tex ; MyAnalyze mydoc.tex mydoc.pdf mydoc.log to take care of errors. -- luigi
participants (2)
-
luigi scarso
-
Wolfgang Schuster