![](https://secure.gravatar.com/avatar/c454c7402b3c58eaddc7622147742a81.jpg?s=120&d=mm&r=g)
I use \definestructureconversionset [frontpart:pagenumber][][romannumerals] to make sure the numbering of my pages in frontmatter use Roman numerals. Not only are the pages numbered with Roman numerals, but the PDF index links and PDF page numbers use this as well. I would like to do something similar for the backmatter, but I would like both the page numbers and the PDF index links and PDF page numbers look like A1, A2, ... (for appendix). How can this be done? Thanks, Troy Henderson
![](https://secure.gravatar.com/avatar/c454c7402b3c58eaddc7622147742a81.jpg?s=120&d=mm&r=g)
To give an idea of what I am wanting, the attached screenshot is from Evince for a particular PDF that was created with some other program other than ConTeXt. Notice the custom page number names such as "Statement", "P-1", "P-5", ..., "P-25", "APP-1", "APP-3", ... How can I get this with ConTeXt? Troy
![](https://secure.gravatar.com/avatar/b79687264c3e06cba13b54d05b12a9f5.jpg?s=120&d=mm&r=g)
Am 06.02.2014 um 04:17 schrieb Troy Henderson
To give an idea of what I am wanting, the attached screenshot is from Evince for a particular PDF that was created with some other program other than ConTeXt. Notice the custom page number names such as "Statement", "P-1", "P-5", ..., "P-25", "APP-1", "APP-3", ...
How can I get this with ConTeXt?
\defineconversionset[frontpart:pagenumber][][romannumerals] \definesectionblock[project][projectmatter] \startsectionblockenvironment[project] \setcounter[userpage][1] \setuppagenumber[numberstarter=P-] \stopsectionblockenvironment \startsectionblockenvironment[bodypart] \setcounter[userpage][1] \stopsectionblockenvironment \startsectionblockenvironment[appendix] \setcounter[userpage][1] \setuppagenumber[numberstarter=APP-] \stopsectionblockenvironment \starttext \startfrontmatter \dorecurse{10}{\dontleavehmode\page} \stopfrontmatter \startprojectmatter \dorecurse{10}{\dontleavehmode\page} \stopprojectmatter \startbodymatter \dorecurse{10}{\dontleavehmode\page} \stopbodymatter \startappendices \dorecurse{10}{\dontleavehmode\page} \stopappendices \stoptext Wolfgang
![](https://secure.gravatar.com/avatar/c454c7402b3c58eaddc7622147742a81.jpg?s=120&d=mm&r=g)
Wolfgang, Thank you for your response. Unfortunately, this does not quite work. The page numbers are correct, but they're not showing up like the previous screenshot in Evince's index. I've attached my ConTeXt source as well as the output PDF and a screenshot of Evince's Index view. Troy
![](https://secure.gravatar.com/avatar/c454c7402b3c58eaddc7622147742a81.jpg?s=120&d=mm&r=g)
Any thoughts on getting these "custom PDF bookmark/index" entries? Thanks in advance, Troy
![](https://secure.gravatar.com/avatar/c454c7402b3c58eaddc7622147742a81.jpg?s=120&d=mm&r=g)
Andreas, Thank you for the reply. I'm afraid that I don't know how to manually manipulate the PDF Catalog. I was able to successfully build the code on this page http://www.ntg.nl/pipermail/ntg-context/2008/036947.html but I had to add \placebookmarks[chapter,section][chapter][force=yes] and although I have Evince's "Index" visible, all of the PageLabels are "1" and when I click on the entry it doesn't change to the correct page. I do get an error from Evince that says "failed to look up aut:3" or another number. I'm not sure what my options are. Troy
![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
On 2/13/2014 1:39 PM, Troy Henderson wrote:
Andreas,
Thank you for the reply. I'm afraid that I don't know how to manually manipulate the PDF Catalog. I was able to successfully build the code on this page
http://www.ntg.nl/pipermail/ntg-context/2008/036947.html
but I had to add
\placebookmarks[chapter,section][chapter][force=yes]
and although I have Evince's "Index" visible, all of the PageLabels are "1" and when I click on the entry it doesn't change to the correct page. I do get an error from Evince that says "failed to look up aut:3" or another number.
I'm not sure what my options are.
mkiv: \nopdfcompression \setupinteraction [state=start] \defineconversionset[frontpart:pagenumber][][romannumerals] \defineconversionset[bodypart:pagenumber] [][numbers] \defineconversionset[appendix:pagenumber] [][Characters] \setupuserpagenumber[numberconverionset=pagenumber,way=byblock] \setupheadertexts[Page \userpagenumber\ of \lastuserpagenumber] \starttext \startfrontmatter \startchapter[title=Fontpart] \dorecurse{20}{\input knuth \footnote{test}\par} \stopchapter \stopfrontmatter \startbodymatter \startchapter[title=Bodypart] \dorecurse{20}{\input tufte\par} \stopchapter \stopbodymatter \startappendices \startchapter[title=Appendix] \dorecurse{20}{\input zapf\par} \stopchapter \stopappendices \stoptext gigves in the pdf: /PageLabels << /Nums [ 0 << /S /r >> 6 << /S /D >> 11 << /S /A >> ] >> ----------------------------------------------------------------- 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 -----------------------------------------------------------------
![](https://secure.gravatar.com/avatar/c454c7402b3c58eaddc7622147742a81.jpg?s=120&d=mm&r=g)
Hans, Attached is a screenshot of what your output looks like in Evince. I am trying to get the "Page Number" listed as "A" for the Appendix. Troy
![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
On 2/13/2014 4:28 PM, Troy Henderson wrote:
Hans,
Attached is a screenshot of what your output looks like in Evince. I am trying to get the "Page Number" listed as "A" for the Appendix.
It shows ok in Okular and Sumatrapdf (both on windows) so it's probably a bug in Evince then. Hans ----------------------------------------------------------------- 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 -----------------------------------------------------------------
![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
On Thu, 13 Feb 2014, Troy Henderson wrote:
Hans,
Attached is a screenshot of what your output looks like in Evince. I am trying to get the "Page Number" listed as "A" for the Appendix.
If I add \placebookmarks[chapter,section][chapter][force=yes] to Hans's example and compile it (using the old ConTeXt ver 2013.12.24), I see the bookmarks in Evince (ver 3.10.3 on Linux). See the attached figure. Aditya
![](https://secure.gravatar.com/avatar/c454c7402b3c58eaddc7622147742a81.jpg?s=120&d=mm&r=g)
I do have an older version of Evince on this machine (v. 2.32.0). I have a new version installed on another machine. I will check it there. Thank you very much. My only question now would be how to remove the "1" and "A" PRECEDING the chapter names (as indicated in the attached editing of Aditya's screenshot). Troy
![](https://secure.gravatar.com/avatar/c454c7402b3c58eaddc7622147742a81.jpg?s=120&d=mm&r=g)
My desired PDF PageLabels are in the attached PNG. I have also attached a ConTeXt source file that attempts attempts this, but clearly I am missing a bit. I would appreciate any help in accomplishing this effect. Troy
![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
On 2/13/2014 11:16 PM, Troy Henderson wrote:
My desired PDF PageLabels are in the attached PNG. I have also attached a ConTeXt source file that attempts attempts this, but clearly I am missing a bit. I would appreciate any help in accomplishing this effect.
it's not that trivial to come up with an interface for that which also can be wikified and remembered well anyhow, i'll add this: \setupuserpagenumber[viewerprefix=titlepage] \startstandardmakeup The first page \stopstandardmakeup \setupuserpagenumber[viewerprefix=p ] so it's a semi-manual job Hans ----------------------------------------------------------------- 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 -----------------------------------------------------------------
![](https://secure.gravatar.com/avatar/c454c7402b3c58eaddc7622147742a81.jpg?s=120&d=mm&r=g)
\setupuserpagenumber[viewerprefix=titlepage] \startstandardmakeup The first page \stopstandardmakeup \setupuserpagenumber[viewerprefix=p ]
I'm clearly missing something. Troy \setupinteraction[state=start] \defineconversionset[frontpart:pagenumber][][romannumerals] \defineconversionset[bodypart:pagenumber][][numbers] \defineconversionset[appendix:pagenumber][][Characters] \setupuserpagenumber[numberconverionset=pagenumber,way=byblock] \placebookmarks[chapter,section][chapter][force=yes] \starttext \startfrontmatter \startchapter[title={Cover}]\stopchapter \dorecurse{2}{\mbox{}\page} \setupuserpagenumber[viewerprefix=titlepage] \startstandardmakeup \startchapter[title={Title Page}] \stopchapter \stopstandardmakeup \setupuserpagenumber[viewerprefix=p ] \stopfrontmatter \startbodymatter \stopbodymatter \stoptext http://www.ntg.nl/mailman/listinfo/ntg-context
![](https://secure.gravatar.com/avatar/b79687264c3e06cba13b54d05b12a9f5.jpg?s=120&d=mm&r=g)
Am 15.02.2014 um 02:30 schrieb Troy Henderson
\setupuserpagenumber[viewerprefix=titlepage] \startstandardmakeup The first page \stopstandardmakeup \setupuserpagenumber[viewerprefix=p ]
I'm clearly missing something.
Have you updated you installation because the viewerprefix key was added yesterday.
\dorecurse{2}{\mbox{}\page}
\dorecurse{2}{\dontleavehmode\page} Wolfgang
![](https://secure.gravatar.com/avatar/c454c7402b3c58eaddc7622147742a81.jpg?s=120&d=mm&r=g)
anyhow, i'll add this:
\setupuserpagenumber[viewerprefix=titlepage] \startstandardmakeup The first page \stopstandardmakeup \setupuserpagenumber[viewerprefix=p ]
Thanks Hans. That works great. Is it possible to have ONLY the prefix (not followed by the corresponding page number) with this implementation? If not, is that a feature that can also be added? Troy
![](https://secure.gravatar.com/avatar/c454c7402b3c58eaddc7622147742a81.jpg?s=120&d=mm&r=g)
Is it possible to have ONLY the prefix (not followed by the corresponding page number) with this implementation? If not, is that a feature that can also be added?
I tried to create a custom label called "viewercustom" (which operates like "viewerprefix" but omits the userpage counter value), but I have been unsuccessful . I modified the following four files (which were the only files that I could find containing "viewerprefix") ./tex/texmf-context/tex/context/base/strc-pag.mkiv ./tex/texmf-context/tex/context/base/strc-pag.lua ./tex/texmf-context/tex/context/base/mult-def.mkiv ./tex/texmf-context/tex/context/base/lpdf-mis.lua Is there something else that needs to be modified that I am missing? Troy
![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
On Tue, 25 Feb 2014, Troy Henderson wrote:
Is it possible to have ONLY the prefix (not followed by the corresponding page number) with this implementation? If not, is that a feature that can also be added?
I tried to create a custom label called "viewercustom" (which operates like "viewerprefix" but omits the userpage counter value), but I have been unsuccessful . I modified the following four files (which were the only files that I could find containing "viewerprefix")
./tex/texmf-context/tex/context/base/strc-pag.mkiv ./tex/texmf-context/tex/context/base/strc-pag.lua ./tex/texmf-context/tex/context/base/mult-def.mkiv ./tex/texmf-context/tex/context/base/lpdf-mis.lua
Is there something else that needs to be modified that I am missing?
Did you regenerate the format? context --make. Aditya
![](https://secure.gravatar.com/avatar/c454c7402b3c58eaddc7622147742a81.jpg?s=120&d=mm&r=g)
I have now :-) which now reflects may changes, but now I have to figure out why my changes aren't working as expected. :-/
After trying for quite some time, I believe it's safe to say that someone with more knowledge of Lua and the internals of ConTeXt may have to look into this as I may be underqualified. Troy
participants (5)
-
Aditya Mahajan
-
Andreas Schneider
-
Hans Hagen
-
Troy Henderson
-
Wolfgang Schuster