Hello ConTeXist, Just a minute ago I upgraded my standalone version ConTeXt (minimals) to last version. It stopped writing to the table of contents with \writebetweenlist (implemented using a macro \rtitle). In my latest version of ConTeXt minimals, everything worked OK. Ii there any problem with expansion ?? What could it be? Thanx Jaroslav Hajtmar Here is my "problematic" macro and error report: When I delete the rows with "\writebetweenlist" then everything is OK. \def\rtitle[#1][#2] #3\par{\reference[#2]{#3}% \writebetweenlist[#1kap]{\blank}% \writebetweenlist[#1kap]{\hskip2em {\bf \ref[t][#2]} \hfill \at[#2]}% \writebetweenlist[#1kap]{\blank[small]}% \xtitle[#1] #3\par% } mtx-context | run 1: luatex --fmt="C:/context/tex/texmf-cache/luatex-cache/c ontext/2448223e6631addb83df348d74153606/formats/cont-en" --lua="C:/context/tex/t exmf-cache/luatex-cache/context/2448223e6631addb83df348d74153606/formats/cont-en .lui" --backend="pdf" "./dphk" \stoptext This is LuaTeX, Version beta-0.70.1-2012021116 (rev 4277) \write18 enabled. ConTeXt ver: 2012.02.21 14:02 MKIV fmt: 2012.2.24 int: english/english \strc_lists_inject_yes ...tnumber )}\fi \endgroup <argument> ...t_yes [IIkap][,\c!type =\s!command ] [\s!command ={\hskip 2em {... \firstofoneargument #1->#1 \rnadpis ...em {\bf \ref [t][#2]} \hfill \at [#2]} \writebetweenlist [#1kap]{... l.60 ?
On 24-2-2012 12:34, Jaroslav Hajtmar wrote:
Hello ConTeXist, Just a minute ago I upgraded my standalone version ConTeXt (minimals) to last version. It stopped writing to the table of contents with \writebetweenlist (implemented using a macro \rtitle). In my latest version of ConTeXt minimals, everything worked OK. Ii there any problem with expansion ?? What could it be?
\rnadpis ...em {\bf \ref [t][#2]} \hfill \at [#2]} \writebetweenlist [#1kap]{... l.60
You can try adding a \begingroup in: \def\strc_lists_write_between[#tag][#settings]#command% {\begingroup ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Thanks Hans for the reply. Can you please advise where to stop this group? That is where to put \endgroup? I can not find this place... Thanks Jaroslav Hajtmar Dne 24.2.2012 22:58, Hans Hagen napsal(a):
On 24-2-2012 12:34, Jaroslav Hajtmar wrote:
Hello ConTeXist, Just a minute ago I upgraded my standalone version ConTeXt (minimals) to last version. It stopped writing to the table of contents with \writebetweenlist (implemented using a macro \rtitle). In my latest version of ConTeXt minimals, everything worked OK. Ii there any problem with expansion ?? What could it be?
\rnadpis ...em {\bf \ref [t][#2]} \hfill \at [#2]} \writebetweenlist [#1kap]{... l.60
You can try adding a \begingroup in:
\def\strc_lists_write_between[#tag][#settings]#command% {\begingroup
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Am 24.02.2012 um 23:19 schrieb Jaroslav Hajtmar:
Thanks Hans for the reply. Can you please advise where to stop this group? That is where to put \endgroup? I can not find this place…
You don’t \endgroup because it’s are lady in \strc_lists_inject_yes but the \begingroup has to be at at another place (see below): \def\strc_lists_write_between[#tag][#settings]#command% we can overload location {\doif{\namedlistparameter{#tag}\c!state}\v!start %{\strc_lists_inject_yes[#tag][#settings,\c!type=\s!command][\s!command={#command}]}} {\begingroup\strc_lists_inject_yes[#tag][#settings,\c!type=\s!command][\s!command={#command}]}} Wolfgang
Thanx Wolfgang for reply, but it does not work still. I am sending example whitch works in ConTeXt MKIV in TeXlive 2011, but does not work in standalone MKIV (minimals). Command \writebetweenlist probably works differently than the previous version. Here is minimal example: \setupinteraction[state=start] \definehead[Ikap][section] \definehead[IIkap][subsection] \definecombinedlist[dpcontent][Ikap, IIkap][criterium=all] \def\SECTION[#1] #2\par{{\csname#1kap\endcsname{#2}}\par} \def\RSECTION[#1][#2] #3\par{\reference[#2]{#3}% \writebetweenlist[Ikap][location=here]{\blank}% \writebetweenlist[#1kap][location=here]{\hskip2em {\bf \ref[t][#2]} \hfill \at[#2]}% \writebetweenlist[#1kap][location=here]{\blank[small]}% \title{#3}\par% } \starttext \placedpcontent[alternative=b] \RSECTION[I][refsextionXXX] Section XXX \SECTION[I] Section One \SECTION[II] Subsection \SECTION[II] Subsection \SECTION[I] Section One \SECTION[II] Subsection \SECTION[II] Subsection \RSECTION[II][refsextionYYY] Section YYY \SECTION[I] Subsection \SECTION[II] Subsection \SECTION[I] Section Two \SECTION[II] Subsection \SECTION[II] Subsection \SECTION[I] Section Three \stoptext Dne 25.2.2012 8:24, Wolfgang Schuster napsal(a):
Am 24.02.2012 um 23:19 schrieb Jaroslav Hajtmar:
Thanks Hans for the reply. Can you please advise where to stop this group? That is where to put \endgroup? I can not find this place…
You don’t \endgroup because it’s are lady in \strc_lists_inject_yes but the \begingroup has to be at at another place (see below):
\def\strc_lists_write_between[#tag][#settings]#command% we can overload location {\doif{\namedlistparameter{#tag}\c!state}\v!start %{\strc_lists_inject_yes[#tag][#settings,\c!type=\s!command][\s!command={#command}]}} {\begingroup\strc_lists_inject_yes[#tag][#settings,\c!type=\s!command][\s!command={#command}]}}
Wolfgang
Just one a notice. Using the standalone version can not be resolved even Hans's example in wikipedia at http://wiki.contextgarden.net/Reference/en/writebetweenlist Jaroslav Hajtmar Dne 25.2.2012 12:02, Jaroslav Hajtmar napsal(a):
Thanx Wolfgang for reply, but it does not work still. I am sending example whitch works in ConTeXt MKIV in TeXlive 2011, but does not work in standalone MKIV (minimals). Command \writebetweenlist probably works differently than the previous version.
Here is minimal example:
\setupinteraction[state=start]
\definehead[Ikap][section] \definehead[IIkap][subsection]
\definecombinedlist[dpcontent][Ikap, IIkap][criterium=all]
\def\SECTION[#1] #2\par{{\csname#1kap\endcsname{#2}}\par}
\def\RSECTION[#1][#2] #3\par{\reference[#2]{#3}% \writebetweenlist[Ikap][location=here]{\blank}% \writebetweenlist[#1kap][location=here]{\hskip2em {\bf \ref[t][#2]} \hfill \at[#2]}% \writebetweenlist[#1kap][location=here]{\blank[small]}% \title{#3}\par% }
\starttext
\placedpcontent[alternative=b]
\RSECTION[I][refsextionXXX] Section XXX
\SECTION[I] Section One
\SECTION[II] Subsection
\SECTION[II] Subsection
\SECTION[I] Section One
\SECTION[II] Subsection
\SECTION[II] Subsection
\RSECTION[II][refsextionYYY] Section YYY
\SECTION[I] Subsection
\SECTION[II] Subsection
\SECTION[I] Section Two
\SECTION[II] Subsection
\SECTION[II] Subsection
\SECTION[I] Section Three
\stoptext
Dne 25.2.2012 8:24, Wolfgang Schuster napsal(a):
Am 24.02.2012 um 23:19 schrieb Jaroslav Hajtmar:
Thanks Hans for the reply. Can you please advise where to stop this group? That is where to put \endgroup? I can not find this place… You don’t \endgroup because it’s are lady in \strc_lists_inject_yes but the \begingroup has to be at at another place (see below):
\def\strc_lists_write_between[#tag][#settings]#command% we can overload location {\doif{\namedlistparameter{#tag}\c!state}\v!start
%{\strc_lists_inject_yes[#tag][#settings,\c!type=\s!command][\s!command={#command}]}}
{\begingroup\strc_lists_inject_yes[#tag][#settings,\c!type=\s!command][\s!command={#command}]}}
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
Am 25.02.2012 um 12:02 schrieb Jaroslav Hajtmar:
Thanx Wolfgang for reply, but it does not work still.
I was in a hurry and had no time to test it but the following is tested and works. \def\strc_lists_write_between[#tag][#settings]#command% we can overload location {\begingroup \edef\currentlist{#tag}% \doifelse{\namedlistparameter{#tag}\c!state}\v!start {\strc_lists_inject_yes[#settings,\c!type=\s!command][command={#command}]} {\endgroup}} \def\strc_lists_write_to_yes[#settings]#first#second% {\strc_lists_inject_yes[\c!location=\v!here,#settings,\c!type=\s!simple][first={#first},second={#second}]} @Hans The “\s!” prefix for first, second and command can’t be used because otherwise the keys end up as “\\s!first ” in Lua table index. Wolfgang
Thanx Wolfgang for your help. I made changes according to your instructions, but it does not work still. I can not even translate the example of what I sent last time to the mailing list. It is needed in addition to changes in the shove-lst.mkvi do something (eg any context database files refresh, etc. .. what I know)? Or what I doing wrong? Thanx Jaroslav Hajtmar Dne 25.2.2012 17:52, Wolfgang Schuster napsal(a):
Am 25.02.2012 um 12:02 schrieb Jaroslav Hajtmar:
Thanx Wolfgang for reply, but it does not work still.
I was in a hurry and had no time to test it but the following is tested and works.
\def\strc_lists_write_between[#tag][#settings]#command% we can overload location {\begingroup \edef\currentlist{#tag}% \doifelse{\namedlistparameter{#tag}\c!state}\v!start {\strc_lists_inject_yes[#settings,\c!type=\s!command][command={#command}]} {\endgroup}}
\def\strc_lists_write_to_yes[#settings]#first#second% {\strc_lists_inject_yes[\c!location=\v!here,#settings,\c!type=\s!simple][first={#first},second={#second}]}
@Hans The “\s!” prefix for first, second and command can’t be used because otherwise the keys end up as “\\s!first ” in Lua table index.
Wolfgang
Am 25.02.2012 um 18:55 schrieb Jaroslav Hajtmar:
Thanx Wolfgang for your help. I made changes according to your instructions, but it does not work still. I can not even translate the example of what I sent last time to the mailing list. It is needed in addition to changes in the shove-lst.mkvi do something (eg any context database files refresh, etc. .. what I know)?
When you type “context --expert --touch” context will regenerate the format file when you process your document. Wolfgang
Thanks Wolfgang
for the willingness! I'm sorry, but after re-generation format context
always has an error (see below). I guess I'll wait for the subsequent
official correction. Fortunately in TeX Live version of MKIV works as it
should.
Thanks again.
Jaroslav Hajtmar
I do not know if will help this extract:
C:\$~1da\ConTeXt\Diplomova_prace-Hanca>ctx dphk
C:\$~1da\ConTeXt\Diplomova_prace-Hanca>context --autopdf dphk
mtx-context | run 1: luatex --fmt="C:/context/tex/texmf-cache/luatex-cache/c
ontext/2448223e6631addb83df348d74153606/formats/cont-en"
--lua="C:/context/tex/t
exmf-cache/luatex-cache/context/2448223e6631addb83df348d74153606/formats/cont-en
.lui" --backend="pdf" "./dphk" \stoptext
This is LuaTeX, Version beta-0.70.1-2012021116 (rev 4277)
\write18 enabled.
(dphk.tex
jobcontrol > version mismatch with jobfile: 1.14 <> 1.18
ConTeXt ver: 2012.02.21 14:02 MKIV fmt: 2012.2.24 int: english/english
system > cont-new.mkiv loaded
(C:/context/tex/texmf-context/tex/context/base/cont-new.mkiv
system > beware: some patches loaded from cont-new.mkiv
)
system > dphk.top loaded
(dphk.top)
fonts > latin modern fonts are not preloaded
languages > language en is active
{C:/context/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}
fonts > preloading latin modern fonts (second stage)
fonts > typescripts > unknown: library 'loc'
{C:/context/tex/texmf/fonts/map/dvips/lm/lm-math.map}{C:/context/tex/texmf/fonts
/map/dvips/lm/lm-rm.map}
fonts > virtual math > unable to resolve name mapsfromchar
fonts > fallback modern rm 12pt is loaded
(dp_env.tex
colors > rgb color space is not supported
colors > cmyk color space is not supported
resolvers > modules > not found: 't-bib'
resolvers > modules > not found: 't-bibltx'
resolvers > modules > loaded: 'chemic'
(C:/context/tex/texmf-context/tex/context/base/m-chemic.mkiv
ppchtex > not loaded as support for chemistry in now built in
)
resolvers > modules > loaded: 'units'
(C:/context/tex/texmf-context/tex/context/base/m-units.mkiv<+
C:/context/tex/tex
mf-context/tex/context/base/x-mathml.lua>) (_dpobrazky.tex
publications > loading database from dphk.bbl
(dphk.bbl)) (_dptabulky.tex) (_dpprilohy.tex)
(C:/context/tex/texmf-context/tex/
context/base/type-imp-texgyre.mkiv){C:/context/tex/texmf-context/fonts/map/pdfte
x/context/mkiv-tx.map}
fonts > virtual math > the mapping is incomplete for 'txmath' at 7pt
)
publications > wrote a new auxiliary file \jobname.aux
This is BibTeX, Version 0.99d (Web2C 2011)
The top-level auxiliary file: dphk.aux
The style file: cont-no.bst
Database file #1: dphk.bib
publications > loading formatting style from bibl-ams
(C:/context/tex/texmf-context/tex/context/bib/bibl-ams.tex)
structures > begin of sectionblock frontpart
(_dptitulnistrana.tex
backend > xmp > using file 'C:/context/tex/texmf-context/tex/context/bas
e/lpdf-pdx.xml'
pages > flushing realpage 1, userpage 1, subpage 1
) (_dpprohlaseni.tex
structure > sectioning > Ikapn @ level 2 : 0.0 ->
)
pages > flushing realpage 2, userpage 1
(_dpzadani.tex
Am 25.02.2012 um 18:55 schrieb Jaroslav Hajtmar:
Thanx Wolfgang for your help. I made changes according to your instructions, but it does not work still. I can not even translate the example of what I sent last time to the mailing list. It is needed in addition to changes in the shove-lst.mkvi do something (eg any context database files refresh, etc. .. what I know)?
When you type “context --expert --touch” context will regenerate the format file when you process your document.
Wolfgang
On 25-2-2012 17:52, Wolfgang Schuster wrote:
Am 25.02.2012 um 12:02 schrieb Jaroslav Hajtmar:
Thanx Wolfgang for reply, but it does not work still.
I was in a hurry and had no time to test it but the following is tested and works.
\def\strc_lists_write_between[#tag][#settings]#command% we can overload location {\begingroup \edef\currentlist{#tag}% \doifelse{\namedlistparameter{#tag}\c!state}\v!start {\strc_lists_inject_yes[#settings,\c!type=\s!command][command={#command}]} {\endgroup}}
\def\strc_lists_write_to_yes[#settings]#first#second% {\strc_lists_inject_yes[\c!location=\v!here,#settings,\c!type=\s!simple][first={#first},second={#second}]}
@Hans The “\s!” prefix for first, second and command can’t be used because otherwise the keys end up as “\\s!first ” in Lua table index.
ok, but another one needed fixing as well, so now we have \unexpanded\def\writebetweenlist{\dodoubleempty \strc_lists_write_between} \unexpanded\def\writedatatolist {\dotripleargument\strc_lists_write_data_to} \unexpanded\def\writetolist {\dodoubleempty \strc_lists_write_to} \def\strc_lists_write_between[#tag]% {\begingroup \edef\currentlist{#tag}% \doifelse{\namedlistparameter{#tag}\c!state}\v!start \strc_lists_write_between_yes \strc_lists_write_between_nop} \def\strc_lists_write_between_yes[#settings]#command% {\strc_lists_inject_yes[#settings,\c!type=\s!command][command={#command}]} \def\strc_lists_write_between_nop[#settings]#command% {\endgroup} \def\strc_lists_write_data_to[#tag]% {\begingroup \edef\currentlist{#tag}% \doifelse{\namedlistparameter{#tag}\c!state}\v!start \strc_lists_write_data_to_yes \strc_lists_write_data_to_nop} \def\strc_lists_write_data_to_yes[#settings][#userdata]% {\ifthirdargument % no need to have an extra step ... used seldom \strc_lists_inject_yes[#settings,\c!type=\s!userdata][#userdata]% \else \strc_lists_inject_yes[\c!type=\s!userdata][#settings]% \fi} \def\strc_lists_write_data_to_nop[#settings][#userdata]% {\endgroup} \def\strc_lists_write_to[#tag]% {\begingroup \edef\currentlist{#tag}% \doifelse{\namedlistparameter{#tag}\c!state}\v!start \strc_lists_write_to_yes \strc_lists_write_to_nop} \def\strc_lists_write_to_yes[#settings]#first#second% no \s!first because we don't expand user settings {\strc_lists_inject_yes[\c!location=\v!here,#settings,\c!type=\s!simple][first={#first},second={#second}]} \def\strc_lists_write_to_nop[#settings]#first#second% {\endgroup} ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (3)
-
Hans Hagen
-
Jaroslav Hajtmar
-
Wolfgang Schuster