ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Example for switching page numbering from roman to numeric in PDF outline
@ 2024-09-24 12:05 Shiv Shankar Dayal
  2024-09-24 14:02 ` [NTG-context] " Henning Hraban Ramm
  0 siblings, 1 reply; 10+ messages in thread
From: Shiv Shankar Dayal @ 2024-09-24 12:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi all,

I want to switch page numbering from roman(which is
typical in frontmatter) to roman. I also want these to
appear in PDF outline.

Can someone provide an MWE?

-- 
Respect,
Shiv Shankar Dayal
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Example for switching page numbering from roman to numeric in PDF outline
  2024-09-24 12:05 [NTG-context] Example for switching page numbering from roman to numeric in PDF outline Shiv Shankar Dayal
@ 2024-09-24 14:02 ` Henning Hraban Ramm
  2024-09-24 14:14   ` Shiv Shankar Dayal
  0 siblings, 1 reply; 10+ messages in thread
From: Henning Hraban Ramm @ 2024-09-24 14:02 UTC (permalink / raw)
  To: ntg-context

Am 24.09.24 um 14:05 schrieb Shiv Shankar Dayal:
> Hi all,
> 
> I want to switch page numbering from roman(which is
> typical in frontmatter) to roman. I also want these to
> appear in PDF outline.
> 
> Can someone provide an MWE?

It’s a bit unclear what your problem is.

Try
\setupuserpagenumber[numberconversion=romannumerals]

Instead of “romannumerals” you can also use r, R, or, or RK.

If you meant “Arabic” numerals, try n, N, o, or zero.

Hraban
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Example for switching page numbering from roman to numeric in PDF outline
  2024-09-24 14:02 ` [NTG-context] " Henning Hraban Ramm
@ 2024-09-24 14:14   ` Shiv Shankar Dayal
  2024-09-24 14:24     ` Henning Hraban Ramm
  0 siblings, 1 reply; 10+ messages in thread
From: Shiv Shankar Dayal @ 2024-09-24 14:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> Try
> \setupuserpagenumber[numberconversion=romannumerals]
>
> Instead of “romannumerals” you can also use r, R, or, or RK.
>
> If you meant “Arabic” numerals, try n, N, o, or zero.

The problem is that PDF Outline does not show roman numerals.
It shows page numbers in arabic numerals.

-- 
Respect,
Shiv Shankar Dayal
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Example for switching page numbering from roman to numeric in PDF outline
  2024-09-24 14:14   ` Shiv Shankar Dayal
@ 2024-09-24 14:24     ` Henning Hraban Ramm
  2024-09-24 16:19       ` Shiv Shankar Dayal
  0 siblings, 1 reply; 10+ messages in thread
From: Henning Hraban Ramm @ 2024-09-24 14:24 UTC (permalink / raw)
  To: ntg-context

Am 24.09.24 um 16:14 schrieb Shiv Shankar Dayal:
> The problem is that PDF Outline does not show roman numerals.
> It shows page numbers in arabic numerals.

Sorry, I misunderstood.

I don’t know and can’t find any documentation on that.

Did you try a different PDF viewer? The display of the PDF outline 
probably depends on the viewer.

Maybe try
\enabledirectives[references.bookmarks.preroll]
or
\setupheads[expansion=yes]

I’m not sure if the numbering of bookmarks is related to expansion of 
their text.


Hraban
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Example for switching page numbering from roman to numeric in PDF outline
  2024-09-24 14:24     ` Henning Hraban Ramm
@ 2024-09-24 16:19       ` Shiv Shankar Dayal
  2024-09-24 18:50         ` Florent Michel
  0 siblings, 1 reply; 10+ messages in thread
From: Shiv Shankar Dayal @ 2024-09-24 16:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> Did you try a different PDF viewer? The display of the PDF outline
> probably depends on the viewer.

I used Evince and Okular(I am on Linux) and both work for LaTeX
generated pdfs.

> Maybe try
> \enabledirectives[references.bookmarks.preroll]
> or
> \setupheads[expansion=yes]

Tried both but they do not work.

-- 
Respect,
Shiv Shankar Dayal
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Example for switching page numbering from roman to numeric in PDF outline
  2024-09-24 16:19       ` Shiv Shankar Dayal
@ 2024-09-24 18:50         ` Florent Michel
  2024-09-24 22:17           ` Florent Michel
  0 siblings, 1 reply; 10+ messages in thread
From: Florent Michel @ 2024-09-24 18:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi,

I do not know how to do that properly (if someone has a solution, I'd also
be interested), but here is something which seems to give a partial
solution:

```
\usemodule[ipsum]

\starttext

\placecontent

\section{Section 1}

\dorecurse {6} \ipsum

\pagebreak

\section{Section 2}

\def\romanpage{\convertnumber{romannumerals}{\userpage}}
\setupuserpagenumber[
    numberconversion=romannumerals,
    viewerprefix=\romanpage -,
]

\dorecurse {6} \ipsum

\stoptext
```

In section 2, pages are shown with roman numerals in the document and as
(roman numerals)-(arabic numerals) in the outline with Okular and Evince. I
don't know how to get only the first part, though.

Best regards,
Florent

Le mar. 24 sept. 2024 à 17:20, Shiv Shankar Dayal <
shivshankar.dayal@gmail.com> a écrit :

> > Did you try a different PDF viewer? The display of the PDF outline
> > probably depends on the viewer.
>
> I used Evince and Okular(I am on Linux) and both work for LaTeX
> generated pdfs.
>
> > Maybe try
> > \enabledirectives[references.bookmarks.preroll]
> > or
> > \setupheads[expansion=yes]
>
> Tried both but they do not work.
>
> --
> Respect,
> Shiv Shankar Dayal
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki     : https://wiki.contextgarden.net
>
> ___________________________________________________________________________________
>

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

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Example for switching page numbering from roman to numeric in PDF outline
  2024-09-24 18:50         ` Florent Michel
@ 2024-09-24 22:17           ` Florent Michel
  2024-09-25 11:58             ` Shiv Shankar Dayal
  2024-09-25 18:11             ` Wolfgang Schuster
  0 siblings, 2 replies; 10+ messages in thread
From: Florent Michel @ 2024-09-24 22:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi,

After looking at it a bit more, one solution can be found in the accepted
answer to this question:
https://tex.stackexchange.com/questions/108676/page-numbers-roman-number-and-arabic-numerals-in-context

The following example is slightly adapted from Marco's answer:

```
\usemodule[ipsum]

\definesectionblock[roman][romanpages]
\definestructureconversionset [roman:pagenumber] [] [romannumerals]

\startsectionblockenvironment [bodypart]
  \setcounter [userpage] [1]
\stopsectionblockenvironment

\starttext
  \startstandardmakeup
    \placecontent
  \stopstandardmakeup
  \startromanpages
    \section{Roman numeral pages}
    \dorecurse{6}{\ipsum\par}
  \stopromanpages
  \startbodymatter
    \section{Arabic numeral pages}
    \dorecurse{6}{\ipsum\par}
  \stopbodymatter
\stoptext
```

The page numbers look correct in Okular.

Best regards,
Florent

Le mar. 24 sept. 2024 à 19:50, Florent Michel <florent.m42@gmail.com> a
écrit :

> Hi,
>
> I do not know how to do that properly (if someone has a solution, I'd also
> be interested), but here is something which seems to give a partial
> solution:
>
> ```
> \usemodule[ipsum]
>
> \starttext
>
> \placecontent
>
> \section{Section 1}
>
> \dorecurse {6} \ipsum
>
> \pagebreak
>
> \section{Section 2}
>
> \def\romanpage{\convertnumber{romannumerals}{\userpage}}
> \setupuserpagenumber[
>     numberconversion=romannumerals,
>     viewerprefix=\romanpage -,
> ]
>
> \dorecurse {6} \ipsum
>
> \stoptext
> ```
>
> In section 2, pages are shown with roman numerals in the document and as
> (roman numerals)-(arabic numerals) in the outline with Okular and Evince. I
> don't know how to get only the first part, though.
>
> Best regards,
> Florent
>
> Le mar. 24 sept. 2024 à 17:20, Shiv Shankar Dayal <
> shivshankar.dayal@gmail.com> a écrit :
>
>> > Did you try a different PDF viewer? The display of the PDF outline
>> > probably depends on the viewer.
>>
>> I used Evince and Okular(I am on Linux) and both work for LaTeX
>> generated pdfs.
>>
>> > Maybe try
>> > \enabledirectives[references.bookmarks.preroll]
>> > or
>> > \setupheads[expansion=yes]
>>
>> Tried both but they do not work.
>>
>> --
>> Respect,
>> Shiv Shankar Dayal
>>
>> ___________________________________________________________________________________
>> If your question is of interest to others as well, please add an entry to
>> the Wiki!
>>
>> maillist : ntg-context@ntg.nl /
>> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
>> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net
>> (mirror)
>> archive  : https://github.com/contextgarden/context
>> wiki     : https://wiki.contextgarden.net
>>
>> ___________________________________________________________________________________
>>
>

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

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Example for switching page numbering from roman to numeric in PDF outline
  2024-09-24 22:17           ` Florent Michel
@ 2024-09-25 11:58             ` Shiv Shankar Dayal
  2024-09-25 18:04               ` Florent Michel
  2024-09-25 18:11             ` Wolfgang Schuster
  1 sibling, 1 reply; 10+ messages in thread
From: Shiv Shankar Dayal @ 2024-09-25 11:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Much thanks Florent. It works really well, perhaps you should add it to wiki.

On Wed, Sep 25, 2024 at 3:52 AM Florent Michel <florent.m42@gmail.com> wrote:
>
> Hi,
>
> After looking at it a bit more, one solution can be found in the accepted answer to this question: https://tex.stackexchange.com/questions/108676/page-numbers-roman-number-and-arabic-numerals-in-context
>
> The following example is slightly adapted from Marco's answer:
>
> ```
> \usemodule[ipsum]
>
> \definesectionblock[roman][romanpages]
> \definestructureconversionset [roman:pagenumber] [] [romannumerals]
>
> \startsectionblockenvironment [bodypart]
>   \setcounter [userpage] [1]
> \stopsectionblockenvironment
>
> \starttext
>   \startstandardmakeup
>     \placecontent
>   \stopstandardmakeup
>   \startromanpages
>     \section{Roman numeral pages}
>     \dorecurse{6}{\ipsum\par}
>   \stopromanpages
>   \startbodymatter
>     \section{Arabic numeral pages}
>     \dorecurse{6}{\ipsum\par}
>   \stopbodymatter
> \stoptext
> ```
>
> The page numbers look correct in Okular.
>
> Best regards,
> Florent
>
> Le mar. 24 sept. 2024 à 19:50, Florent Michel <florent.m42@gmail.com> a écrit :
>>
>> Hi,
>>
>> I do not know how to do that properly (if someone has a solution, I'd also be interested), but here is something which seems to give a partial solution:
>>
>> ```
>> \usemodule[ipsum]
>>
>> \starttext
>>
>> \placecontent
>>
>> \section{Section 1}
>>
>> \dorecurse {6} \ipsum
>>
>> \pagebreak
>>
>> \section{Section 2}
>>
>> \def\romanpage{\convertnumber{romannumerals}{\userpage}}
>> \setupuserpagenumber[
>>     numberconversion=romannumerals,
>>     viewerprefix=\romanpage -,
>> ]
>>
>> \dorecurse {6} \ipsum
>>
>> \stoptext
>> ```
>>
>> In section 2, pages are shown with roman numerals in the document and as (roman numerals)-(arabic numerals) in the outline with Okular and Evince. I don't know how to get only the first part, though.
>>
>> Best regards,
>> Florent
>>
>> Le mar. 24 sept. 2024 à 17:20, Shiv Shankar Dayal <shivshankar.dayal@gmail.com> a écrit :
>>>
>>> > Did you try a different PDF viewer? The display of the PDF outline
>>> > probably depends on the viewer.
>>>
>>> I used Evince and Okular(I am on Linux) and both work for LaTeX
>>> generated pdfs.
>>>
>>> > Maybe try
>>> > \enabledirectives[references.bookmarks.preroll]
>>> > or
>>> > \setupheads[expansion=yes]
>>>
>>> Tried both but they do not work.
>>>
>>> --
>>> Respect,
>>> Shiv Shankar Dayal
>>> ___________________________________________________________________________________
>>> If your question is of interest to others as well, please add an entry to the Wiki!
>>>
>>> maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
>>> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
>>> archive  : https://github.com/contextgarden/context
>>> wiki     : https://wiki.contextgarden.net
>>> ___________________________________________________________________________________
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki     : https://wiki.contextgarden.net
> ___________________________________________________________________________________



-- 
Respect,
Shiv Shankar Dayal
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Example for switching page numbering from roman to numeric in PDF outline
  2024-09-25 11:58             ` Shiv Shankar Dayal
@ 2024-09-25 18:04               ` Florent Michel
  0 siblings, 0 replies; 10+ messages in thread
From: Florent Michel @ 2024-09-25 18:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

You are most welcome!

> It works really well, perhaps you should add it to wiki.

Good idea! I have added it here:
https://wiki.contextgarden.net/Command/definesectionblock
I have also tentatively added an alternate version which weems to work too
as a second example for the \setupuserpagenumber command (
https://wiki.contextgarden.net/Command/setupuserpagenumber ).

Best regards,
Florent



Le mer. 25 sept. 2024 à 13:06, Shiv Shankar Dayal <
shivshankar.dayal@gmail.com> a écrit :

> Much thanks Florent. It works really well, perhaps you should add it to
> wiki.
>
> On Wed, Sep 25, 2024 at 3:52 AM Florent Michel <florent.m42@gmail.com>
> wrote:
> >
> > Hi,
> >
> > After looking at it a bit more, one solution can be found in the
> accepted answer to this question:
> https://tex.stackexchange.com/questions/108676/page-numbers-roman-number-and-arabic-numerals-in-context
> >
> > The following example is slightly adapted from Marco's answer:
> >
> > ```
> > \usemodule[ipsum]
> >
> > \definesectionblock[roman][romanpages]
> > \definestructureconversionset [roman:pagenumber] [] [romannumerals]
> >
> > \startsectionblockenvironment [bodypart]
> >   \setcounter [userpage] [1]
> > \stopsectionblockenvironment
> >
> > \starttext
> >   \startstandardmakeup
> >     \placecontent
> >   \stopstandardmakeup
> >   \startromanpages
> >     \section{Roman numeral pages}
> >     \dorecurse{6}{\ipsum\par}
> >   \stopromanpages
> >   \startbodymatter
> >     \section{Arabic numeral pages}
> >     \dorecurse{6}{\ipsum\par}
> >   \stopbodymatter
> > \stoptext
> > ```
> >
> > The page numbers look correct in Okular.
> >
> > Best regards,
> > Florent
> >
> > Le mar. 24 sept. 2024 à 19:50, Florent Michel <florent.m42@gmail.com> a
> écrit :
> >>
> >> Hi,
> >>
> >> I do not know how to do that properly (if someone has a solution, I'd
> also be interested), but here is something which seems to give a partial
> solution:
> >>
> >> ```
> >> \usemodule[ipsum]
> >>
> >> \starttext
> >>
> >> \placecontent
> >>
> >> \section{Section 1}
> >>
> >> \dorecurse {6} \ipsum
> >>
> >> \pagebreak
> >>
> >> \section{Section 2}
> >>
> >> \def\romanpage{\convertnumber{romannumerals}{\userpage}}
> >> \setupuserpagenumber[
> >>     numberconversion=romannumerals,
> >>     viewerprefix=\romanpage -,
> >> ]
> >>
> >> \dorecurse {6} \ipsum
> >>
> >> \stoptext
> >> ```
> >>
> >> In section 2, pages are shown with roman numerals in the document and
> as (roman numerals)-(arabic numerals) in the outline with Okular and
> Evince. I don't know how to get only the first part, though.
> >>
> >> Best regards,
> >> Florent
> >>
> >> Le mar. 24 sept. 2024 à 17:20, Shiv Shankar Dayal <
> shivshankar.dayal@gmail.com> a écrit :
> >>>
> >>> > Did you try a different PDF viewer? The display of the PDF outline
> >>> > probably depends on the viewer.
> >>>
> >>> I used Evince and Okular(I am on Linux) and both work for LaTeX
> >>> generated pdfs.
> >>>
> >>> > Maybe try
> >>> > \enabledirectives[references.bookmarks.preroll]
> >>> > or
> >>> > \setupheads[expansion=yes]
> >>>
> >>> Tried both but they do not work.
> >>>
> >>> --
> >>> Respect,
> >>> Shiv Shankar Dayal
> >>>
> ___________________________________________________________________________________
> >>> If your question is of interest to others as well, please add an entry
> to the Wiki!
> >>>
> >>> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> >>> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net
> (mirror)
> >>> archive  : https://github.com/contextgarden/context
> >>> wiki     : https://wiki.contextgarden.net
> >>>
> ___________________________________________________________________________________
> >
> >
> ___________________________________________________________________________________
> > If your question is of interest to others as well, please add an entry
> to the Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> > webpage  : https://www.pragma-ade.nl / https://context.aanhet.net
> (mirror)
> > archive  : https://github.com/contextgarden/context
> > wiki     : https://wiki.contextgarden.net
> >
> ___________________________________________________________________________________
>
>
>
> --
> Respect,
> Shiv Shankar Dayal
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki     : https://wiki.contextgarden.net
>
> ___________________________________________________________________________________
>

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

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Example for switching page numbering from roman to numeric in PDF outline
  2024-09-24 22:17           ` Florent Michel
  2024-09-25 11:58             ` Shiv Shankar Dayal
@ 2024-09-25 18:11             ` Wolfgang Schuster
  1 sibling, 0 replies; 10+ messages in thread
From: Wolfgang Schuster @ 2024-09-25 18:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Florent Michel

Florent Michel schrieb am 25.09.2024 um 00:17:
> Hi,
> 
> After looking at it a bit more, one solution can be found in the 
> accepted answer to this question: 
> https://tex.stackexchange.com/questions/108676/page-numbers-roman-number-and-arabic-numerals-in-context
> 
> The following example is slightly adapted from Marco's answer:
> 
> ```
> \usemodule[ipsum]
> 
> \definesectionblock[roman][romanpages]
> \definestructureconversionset [roman:pagenumber] [] [romannumerals]
> 
> \startsectionblockenvironment [bodypart]
>    \setcounter [userpage] [1]
> \stopsectionblockenvironment
> 
> \starttext
>    \startstandardmakeup
>      \placecontent
>    \stopstandardmakeup
>    \startromanpages
>      \section{Roman numeral pages}
>      \dorecurse{6}{\ipsum\par}
>    \stopromanpages
>    \startbodymatter
>      \section{Arabic numeral pages}
>      \dorecurse{6}{\ipsum\par}
>    \stopbodymatter
> \stoptext
> ```
> 
> The page numbers look correct in Okular.

Is there a reason why you create a new sectionblock?

BTW: You can also reset userpagenumber instead of setting it back to 1 
by hand.

%%%% begin example
\defineconversionset [frontpart:pagenumber] [] [romannumerals]

\startsectionblockenvironment [bodypart]
   \resetuserpagenumber
\stopsectionblockenvironment

\starttext

\startfrontmatter

\completecontent

\dorecurse{4}
   {\chapter{Chapter #1}
    \dorecurse{\numexpr#1*2\relax}{\samplefile{lorem}}}

\stopfrontmatter

\startbodymatter

\dorecurse{4}
   {\chapter{Chapter #1}
    \dorecurse{\numexpr#1*2\relax}{\samplefile{lorem}}}

\stopbodymatter

\stoptext
%%%% end example

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2024-09-25 18:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-24 12:05 [NTG-context] Example for switching page numbering from roman to numeric in PDF outline Shiv Shankar Dayal
2024-09-24 14:02 ` [NTG-context] " Henning Hraban Ramm
2024-09-24 14:14   ` Shiv Shankar Dayal
2024-09-24 14:24     ` Henning Hraban Ramm
2024-09-24 16:19       ` Shiv Shankar Dayal
2024-09-24 18:50         ` Florent Michel
2024-09-24 22:17           ` Florent Michel
2024-09-25 11:58             ` Shiv Shankar Dayal
2024-09-25 18:04               ` Florent Michel
2024-09-25 18:11             ` 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).