ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* "page i/n" in footer
@ 2020-11-08  1:58 Sylvain Hubert
  2020-11-08  9:19 ` Wolfgang Schuster
  2020-11-08  9:30 ` Pablo Rodriguez
  0 siblings, 2 replies; 10+ messages in thread
From: Sylvain Hubert @ 2020-11-08  1:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 319 bytes --]

Dear List,

Does anyone know how to set the footer to be "page i/n" where i=current
page number, n=total number of page? I've tried

    \setuppagenumbering[location=footer, command=\groupedcommand{page
}{/\lastcounter[userpage]}]

but \lastcounter[userpage] results in empty string.

Thanks in advance.

Best,
Sylvain

[-- Attachment #1.2: Type: text/html, Size: 503 bytes --]

[-- Attachment #2: 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] 10+ messages in thread

* Re: "page i/n" in footer
  2020-11-08  1:58 "page i/n" in footer Sylvain Hubert
@ 2020-11-08  9:19 ` Wolfgang Schuster
  2020-11-08 10:42   ` Sylvain Hubert
  2020-11-08  9:30 ` Pablo Rodriguez
  1 sibling, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2020-11-08  9:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Sylvain Hubert schrieb am 08.11.2020 um 02:58:
> Dear List,
> 
> Does anyone know how to set the footer to be "page i/n" where i=current 
> page number, n=total number of page? I've tried
> 
>      \setuppagenumbering[location=footer, command=\groupedcommand{page 
> }{/\lastcounter[userpage]}]
> 
> but \lastcounter[userpage] results in empty string.


\setuppagenumbering
   [ left={Page },
    right={/\lastuserpagenumber}]

\starttext
\unknown
\stoptext

or


\setuppagenumbering
   [location=]

\setupfootertexts
   [Page \userpagenumber/\lastuserpagenumber]

\starttext
\unknown
\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] 10+ messages in thread

* Re: "page i/n" in footer
  2020-11-08  1:58 "page i/n" in footer Sylvain Hubert
  2020-11-08  9:19 ` Wolfgang Schuster
@ 2020-11-08  9:30 ` Pablo Rodriguez
  2020-11-08 10:48   ` Sylvain Hubert
  1 sibling, 1 reply; 10+ messages in thread
From: Pablo Rodriguez @ 2020-11-08  9:30 UTC (permalink / raw)
  To: ntg-context

On 11/8/20 2:58 AM, Sylvain Hubert wrote:
> Dear List,
>
> Does anyone know how to set the footer to be "page i/n" where i=current
> page number, n=total number of page? I've tried
>
>     \setuppagenumbering[location=footer, command=\groupedcommand{page
> }{/\lastcounter[userpage]}]
>
> but \lastcounter[userpage] results in empty string.

Hi Sylvain,

  \setupfootertexts[\pagenumber/\lastpagenumber]
  \starttext
  \dorecurse{25}{\null\page}
  \stoptext

I never used you approach with \setuppagenubering (all being said).

This might help,

Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
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] 10+ messages in thread

* Re: "page i/n" in footer
  2020-11-08  9:19 ` Wolfgang Schuster
@ 2020-11-08 10:42   ` Sylvain Hubert
  0 siblings, 0 replies; 10+ messages in thread
From: Sylvain Hubert @ 2020-11-08 10:42 UTC (permalink / raw)
  To: Wolfgang Schuster, mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 782 bytes --]

Many thanks for the help!

On Sun, 8 Nov 2020 at 10:20, Wolfgang Schuster <
wolfgang.schuster.lists@gmail.com> wrote:

> Sylvain Hubert schrieb am 08.11.2020 um 02:58:
> > Dear List,
> >
> > Does anyone know how to set the footer to be "page i/n" where i=current
> > page number, n=total number of page? I've tried
> >
> >      \setuppagenumbering[location=footer, command=\groupedcommand{page
> > }{/\lastcounter[userpage]}]
> >
> > but \lastcounter[userpage] results in empty string.
>
>
> \setuppagenumbering
>    [ left={Page },
>     right={/\lastuserpagenumber}]
>
> \starttext
> \unknown
> \stoptext
>
> or
>
>
> \setuppagenumbering
>    [location=]
>
> \setupfootertexts
>    [Page \userpagenumber/\lastuserpagenumber]
>
> \starttext
> \unknown
> \stoptext
>
>
> Wolfgang
>

[-- Attachment #1.2: Type: text/html, Size: 1249 bytes --]

[-- Attachment #2: 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] 10+ messages in thread

* Re: "page i/n" in footer
  2020-11-08  9:30 ` Pablo Rodriguez
@ 2020-11-08 10:48   ` Sylvain Hubert
  2020-11-08 11:07     ` Wolfgang Schuster
  2020-11-08 12:43     ` Pablo Rodriguez
  0 siblings, 2 replies; 10+ messages in thread
From: Sylvain Hubert @ 2020-11-08 10:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 587 bytes --]

On Sun, 8 Nov 2020 at 10:31, Pablo Rodriguez <oinos@gmx.es> wrote:

> Hi Sylvain,
>
>   \setupfootertexts[\pagenumber/\lastpagenumber]
>   \starttext
>   \dorecurse{25}{\null\page}
>   \stoptext
>

Indeed, \setupfooterexts is much clearer for page numbering. Thanks for the
help!.

Btw, do you know whether there is any difference between \lastpagenumber
and \lastuserpagenumber mentioned both by Wolfgang and by the excursion book
<http://www.pragma-ade.com/general/manuals/ma-cb-en.pdf>?


>
> I never used you approach with \setuppagenubering (all being said).
>
> This might help,
>

[-- Attachment #1.2: Type: text/html, Size: 1125 bytes --]

[-- Attachment #2: 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] 10+ messages in thread

* Re: "page i/n" in footer
  2020-11-08 10:48   ` Sylvain Hubert
@ 2020-11-08 11:07     ` Wolfgang Schuster
  2020-11-08 11:19       ` Sylvain Hubert
  2020-11-08 12:43     ` Pablo Rodriguez
  1 sibling, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2020-11-08 11:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Sylvain Hubert schrieb am 08.11.2020 um 11:48:
> On Sun, 8 Nov 2020 at 10:31, Pablo Rodriguez <oinos@gmx.es 
> <mailto:oinos@gmx.es>> wrote:
> 
>     Hi Sylvain,
> 
>        \setupfootertexts[\pagenumber/\lastpagenumber]
>        \starttext
>        \dorecurse{25}{\null\page}
>        \stoptext
> 
> 
> Indeed, \setupfooterexts is much clearer for page numbering. Thanks for 
> the help!.
> 
> Btw, do you know whether there is any difference between \lastpagenumber 
> and \lastuserpagenumber mentioned both by Wolfgang and by the excursion 
> book <http://www.pragma-ade.com/general/manuals/ma-cb-en.pdf>?

\defineconversionset [bodypart:pagenumber] [] [Romannumerals]

\startsetups [footer]
     \starttabulate[|l|c|c|]
     \NC \bf Command          \NC \bf Current page \NC \bf Last page 
   \NC\NR
     \NC \tex{pagenumber}     \NC \pagenumber      \NC \lastpagenumber 
   \NC\NR
     \NC \tex{userpagenumber} \NC \userpagenumber  \NC 
\lastuserpagenumber \NC\NR
     \stoptabulate
\stopsetups

\setupfootertexts[\directsetup{footer}]

\starttext
\dorecurse{10}{\dontleavehmode\page}
\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] 10+ messages in thread

* Re: "page i/n" in footer
  2020-11-08 11:07     ` Wolfgang Schuster
@ 2020-11-08 11:19       ` Sylvain Hubert
  2020-11-08 11:32         ` Wolfgang Schuster
  0 siblings, 1 reply; 10+ messages in thread
From: Sylvain Hubert @ 2020-11-08 11:19 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1405 bytes --]

On Sun, 8 Nov 2020 at 12:07, Wolfgang Schuster <
wolfgang.schuster.lists@gmail.com> wrote:

> Sylvain Hubert schrieb am 08.11.2020 um 11:48:
> > On Sun, 8 Nov 2020 at 10:31, Pablo Rodriguez <oinos@gmx.es
> > <mailto:oinos@gmx.es>> wrote:
> >
> >     Hi Sylvain,
> >
> >        \setupfootertexts[\pagenumber/\lastpagenumber]
> >        \starttext
> >        \dorecurse{25}{\null\page}
> >        \stoptext
> >
> >
> > Indeed, \setupfooterexts is much clearer for page numbering. Thanks for
> > the help!.
> >
> > Btw, do you know whether there is any difference between \lastpagenumber
> > and \lastuserpagenumber mentioned both by Wolfgang and by the excursion
> > book <http://www.pragma-ade.com/general/manuals/ma-cb-en.pdf>?
>
> \defineconversionset [bodypart:pagenumber] [] [Romannumerals]
>
> \startsetups [footer]
>      \starttabulate[|l|c|c|]
>      \NC \bf Command          \NC \bf Current page \NC \bf Last page
>    \NC\NR
>      \NC \tex{pagenumber}     \NC \pagenumber      \NC \lastpagenumber
>    \NC\NR
>      \NC \tex{userpagenumber} \NC \userpagenumber  \NC
> \lastuserpagenumber \NC\NR
>      \stoptabulate
> \stopsetups
>
> \setupfootertexts[\directsetup{footer}]
>
> \starttext

\dorecurse{10}{\dontleavehmode\page}
> \stoptext
>

Thanks, so basically \(last-)userpagenumber is a configurable descendent
of \(last-)pagenumber if I've got the right message from this example?

Sylvain

[-- Attachment #1.2: Type: text/html, Size: 2337 bytes --]

[-- Attachment #2: 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] 10+ messages in thread

* Re: "page i/n" in footer
  2020-11-08 11:19       ` Sylvain Hubert
@ 2020-11-08 11:32         ` Wolfgang Schuster
  0 siblings, 0 replies; 10+ messages in thread
From: Wolfgang Schuster @ 2020-11-08 11:32 UTC (permalink / raw)
  To: Sylvain Hubert; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2094 bytes --]

Sylvain Hubert schrieb am 08.11.2020 um 12:19:
> On Sun, 8 Nov 2020 at 12:07, Wolfgang Schuster 
> <wolfgang.schuster.lists@gmail.com 
> <mailto:wolfgang.schuster.lists@gmail.com>> wrote:
>
>     Sylvain Hubert schrieb am 08.11.2020 um 11:48:
>     > On Sun, 8 Nov 2020 at 10:31, Pablo Rodriguez <oinos@gmx.es
>     <mailto:oinos@gmx.es>
>     > <mailto:oinos@gmx.es <mailto:oinos@gmx.es>>> wrote:
>     >
>     >     Hi Sylvain,
>     >
>     >        \setupfootertexts[\pagenumber/\lastpagenumber]
>     >        \starttext
>     >        \dorecurse{25}{\null\page}
>     >        \stoptext
>     >
>     >
>     > Indeed, \setupfooterexts is much clearer for page numbering.
>     Thanks for
>     > the help!.
>     >
>     > Btw, do you know whether there is any difference between
>     \lastpagenumber
>     > and \lastuserpagenumber mentioned both by Wolfgang and by the
>     excursion
>     > book <http://www.pragma-ade.com/general/manuals/ma-cb-en.pdf>?
>
>     \defineconversionset [bodypart:pagenumber] [] [Romannumerals]
>
>     \startsetups [footer]
>          \starttabulate[|l|c|c|]
>          \NC \bf Command          \NC \bf Current page \NC \bf Last page
>        \NC\NR
>          \NC \tex{pagenumber}     \NC \pagenumber      \NC
>     \lastpagenumber
>        \NC\NR
>          \NC \tex{userpagenumber} \NC \userpagenumber  \NC
>     \lastuserpagenumber \NC\NR
>          \stoptabulate
>     \stopsetups
>
>     \setupfootertexts[\directsetup{footer}]
>
>     \starttext
>
>     \dorecurse{10}{\dontleavehmode\page}
>     \stoptext
>
>
> Thanks, so basically \(last-)userpagenumber is a configurable 
> descendent  of \(last-)pagenumber if I've got the right message from 
> this example?

\pagenumber and \lastpagenumber are the raw values which can be used to 
calculate
the difference between both etc. while \userpagenumber and 
\lastuserpagenumber
are the formatted result of these values. The latter are needed when you 
apply
a conversion to the page number (e.g. roman numberals in the frontmatter).

Wolfgang


[-- Attachment #1.2: Type: text/html, Size: 3133 bytes --]

[-- Attachment #2: 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] 10+ messages in thread

* Re: "page i/n" in footer
  2020-11-08 10:48   ` Sylvain Hubert
  2020-11-08 11:07     ` Wolfgang Schuster
@ 2020-11-08 12:43     ` Pablo Rodriguez
  2020-11-08 13:51       ` Sylvain Hubert
  1 sibling, 1 reply; 10+ messages in thread
From: Pablo Rodriguez @ 2020-11-08 12:43 UTC (permalink / raw)
  To: ntg-context

On 11/8/20 11:48 AM, Sylvain Hubert wrote:
> Indeed, \setupfooterexts is much clearer for page numbering. Thanks for
> the help!.
>
> Btw, do you know whether there is any difference between \lastpagenumber
> and \lastuserpagenumber mentioned both by Wolfgang and by the excursion
> book <http://www.pragma-ade.com/general/manuals/ma-cb-en.pdf>?

Besides Wolfgang’s reply (way far more authoritative than mine), my
approach is basic.

grep the and read the source:

  $ grep -irl lastpagenumber ~/lmtx
    ~/lmtx/mlib-int.lua
    ~/lmtx/mlib-int.lmt
    ~/lmtx/meta-pag.mkiv
    ~/lmtx/mult-def.lua
    ~/lmtx/strc-pag.mkxl
    ~/lmtx/strc-pag.mkiv

~/lmtx is only a symlink for
~/context/tex/texmf-context/tex/context/base/mkiv/.

I created that symlink, because grepping for commands or options is a
way to learn by reading the code.

Not that I understand the whole, but I see which options are available
and I can check some samples included.

strc-pag.mkxl is your friend here. There are three page series. You
could even create more page series (not normally needed).

Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
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] 10+ messages in thread

* Re: "page i/n" in footer
  2020-11-08 12:43     ` Pablo Rodriguez
@ 2020-11-08 13:51       ` Sylvain Hubert
  0 siblings, 0 replies; 10+ messages in thread
From: Sylvain Hubert @ 2020-11-08 13:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1377 bytes --]

On Sun, 8 Nov 2020 at 13:44, Pablo Rodriguez <oinos@gmx.es> wrote:

> On 11/8/20 11:48 AM, Sylvain Hubert wrote:
> > Indeed, \setupfooterexts is much clearer for page numbering. Thanks for
> > the help!.
> >
> > Btw, do you know whether there is any difference between \lastpagenumber
> > and \lastuserpagenumber mentioned both by Wolfgang and by the excursion
> > book <http://www.pragma-ade.com/general/manuals/ma-cb-en.pdf>?
>
> Besides Wolfgang’s reply (way far more authoritative than mine), my
> approach is basic.
>
> grep the and read the source:
>
>   $ grep -irl lastpagenumber ~/lmtx
>     ~/lmtx/mlib-int.lua
>     ~/lmtx/mlib-int.lmt
>     ~/lmtx/meta-pag.mkiv
>     ~/lmtx/mult-def.lua
>     ~/lmtx/strc-pag.mkxl
>     ~/lmtx/strc-pag.mkiv
>
> ~/lmtx is only a symlink for
> ~/context/tex/texmf-context/tex/context/base/mkiv/.
>
> I created that symlink, because grepping for commands or options is a
> way to learn by reading the code.
>
> Not that I understand the whole, but I see which options are available
> and I can check some samples included.
>
> strc-pag.mkxl is your friend here. There are three page series. You
> could even create more page series (not normally needed).
>

Thank you very much for the pointers. It does save me from drowning in the
code base as I have been for multiple occasions.

Sylvain

[-- Attachment #1.2: Type: text/html, Size: 1897 bytes --]

[-- Attachment #2: 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] 10+ messages in thread

end of thread, other threads:[~2020-11-08 13:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-08  1:58 "page i/n" in footer Sylvain Hubert
2020-11-08  9:19 ` Wolfgang Schuster
2020-11-08 10:42   ` Sylvain Hubert
2020-11-08  9:30 ` Pablo Rodriguez
2020-11-08 10:48   ` Sylvain Hubert
2020-11-08 11:07     ` Wolfgang Schuster
2020-11-08 11:19       ` Sylvain Hubert
2020-11-08 11:32         ` Wolfgang Schuster
2020-11-08 12:43     ` Pablo Rodriguez
2020-11-08 13:51       ` Sylvain Hubert

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