ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Manipulating the pagenumber in the TOC
@ 2019-04-21 17:28 Willi Egger
  2019-04-21 17:59 ` Wolfgang Schuster
  0 siblings, 1 reply; 2+ messages in thread
From: Willi Egger @ 2019-04-21 17:28 UTC (permalink / raw)
  To: NTG-Context ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 478 bytes --]

Hi all,

"when manipulating in one area you will have to manipulate also in other aeras” I must confess.

I asked some time ago about manipulating the pagenumber. Wolfgang provide me the following approach:


\cldcontext{“\letterpercent.0f”,(\pagenumber+1)/2}

This works indeed fine. However now I am confronted with the fact, that in the TOC the manipulated pagenumbers should be taken into account. 

Wolfgang’s approach does not help and ends in an error:

[-- Attachment #2: TOC-pagenumber-test.tex --]
[-- Type: application/octet-stream, Size: 662 bytes --]


\setupbodyfont[pagella,rm,10pt]

\setuppagenumbering[location=none,alternative=doublesided]


\startsetups Pagenumber
\doifoddpageelse
  {\cldcontext{"\letterpercent.0f",(\pagenumber+1)/2}}
	{}
\stopsetups

\setupfootertexts[\directsetup{Pagenumber}]
	
\setuppapersize[A6][A6]

\define[1]\SectionTOCPagenumber{%#1}
	\cldcontext{"\letterpercent.0f",(#1 +1)/2}}

\setuplist
	[section]
	[pagecommand=\SectionTOCPagenumber]
\stopmode
	
\starttext

\startsubject[title=Contents]
\placelist[section][criterium=all]
\stopsubject

\page

	\dorecurse{4}{
		\startsection[title=Ward-\recurselevel\hfill\pagenumber]
			\input ward\blank
		\stopsection
		\page}
\stoptext


[-- Attachment #3: Type: text/plain, Size: 315 bytes --]



\define[1]\SectionTOCPagenumber{
	\cldcontext{“\letterpercent.0f”,(\pagenumber+1)/2}}

\setuplist
	[section]
	[pagecommand=\SectionTOCPagenumber]

My question is: is there a way to manipulate the pagenumber in the TOC such, that it reflects the pagenumbers in the document?


Kind regards

Willi

[-- Attachment #4: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Manipulating the pagenumber in the TOC
  2019-04-21 17:28 Manipulating the pagenumber in the TOC Willi Egger
@ 2019-04-21 17:59 ` Wolfgang Schuster
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Schuster @ 2019-04-21 17:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Willi Egger

Willi Egger schrieb am 21.04.2019 um 19:28:
> Hi all,
>
> "when manipulating in one area you will have to manipulate also in other aeras” I must confess.
>
> I asked some time ago about manipulating the pagenumber. Wolfgang provide me the following approach:
>
>
> \cldcontext{“\letterpercent.0f”,(\pagenumber+1)/2}
>
> This works indeed fine. However now I am confronted with the fact, that in the TOC the manipulated pagenumbers should be taken into account.

\def\dwarsliggernumber#1%
   {\number\numexpr(#1+1)/2\relax}

\defineconversion [dwarsligger] [\dwarsliggernumber]

\setuppapersize[A5,landscape]

\setupuserpagenumber[numberconversion=dwarsligger]

\setuppagenumbering[location=none]

\setupheadertexts [\doifoddpageelse{}{\prefixedpagenumber}]
\setupfootertexts [\doifoddpageelse{\prefixedpagenumber}{}]

\usemodule [visual]

\starttext

\completecontent

\dorecurse{10}
   {\chapter{\fakewords{5}{10}}
    \fakelines{50}{100}}

\stoptext

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2019-04-21 17:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-21 17:28 Manipulating the pagenumber in the TOC Willi Egger
2019-04-21 17:59 ` Wolfgang Schuster

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).