ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] how access to \namedstructurevariable [next / previous]
@ 2023-04-29 16:07 Garulfo via ntg-context
  2023-04-29 21:23 ` Garulfo via ntg-context
  0 siblings, 1 reply; 2+ messages in thread
From: Garulfo via ntg-context @ 2023-04-29 16:07 UTC (permalink / raw)
  To: Aditya Mahajan via ntg-context; +Cc: Garulfo

Hi all,

I would like to use the title and the number of a section twice :
- first with a specific layout (with makeup)
- second, as usual, as part of the page flow.

like in : http://www.pragma-ade.nl/general/manuals/cont-enp.pdf#page=23

looking at the source code 
(http://context.aanhet.net/svn/manuals/context/layo-00.tex), I 
understood that it was achieved with :

\setuphead
   [\v!chapter]
   [\c!command=\PlaatsHoofdstuk,
    \c!page=\v!yes,
    \c!before=,
    \c!inbetween=\PlaatsHoofdstukIndex,
   %\c!incrementnumber=cont-\currentlanguage,
    \c!header=\v!nomarking,
    \c!textstyle=\bfd,
    \c!numberstyle=\bfe]

and

\def\PlaatsHoofdstukIndex % todo: lucida
  {%\startnotmode[*\v!frontpart]
     \page[\v!right]
     \setupbackgrounds[\v!paper][\c!background=\v!color]
     \startmakeup[\v!standard]
       \raggedleft
       \doifsomething{\currentheadnumber}
          {\hfill\expanded{\processMPheadnumber{\currentheadnumber}}}
       \vfill
       \hfill\expanded{\processMPheadtext{\currentheadtext}}
     \stopmakeup
     \setupbackgrounds[\v!paper][\c!background=]
   }%\stopnotmode}



But currently, I can not reproduce it :
- \currentheadtex return empty
- \namedstructurevariable{section}{title} only report the update title
   once the title is actually typesetted

Is there a way to access \namedstructurevariable with [next] or 
[previous] like options ?


Here is a test trying to reproduce cont-enp.pdf example
===================================================

\def\CheckA{{\mono\currentheadtext}}
\def\CheckB{{\mono\namedstructurevariable{section}{title}}\page}

\setuphead
   [section]
   [before={before : \CheckA - \CheckB},
   inbetween={inbetween: \CheckA - \CheckB},
   after={after: \CheckA - \CheckB},
   beforesection={beforesection: \CheckA - \CheckB},
   insidesection={insidesection: \CheckA - \CheckB},
   aftersection={aftersection: \CheckA - \CheckB},
   color=darkred,
   style=\tfc,
   ]

\starttext

\startsection[title=Section A]
Text of section A.
\stopsection

\startsection[title=Section B]
Text of section B.
\stopsection

\stoptext

===================================================

Thanks for your help
Garulfo
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-29 21:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-29 16:07 [NTG-context] how access to \namedstructurevariable [next / previous] Garulfo via ntg-context
2023-04-29 21:23 ` Garulfo via ntg-context

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).