On Wednesday 25 November 2009 11:12:40 werner wrote:
> Hi Roberto,
>
> Roberto Alsina wrote:
> > On Wednesday 25 November 2009 10:11:36 werner wrote:
> >> That would be great.
> >>
> >> Any chance that you could also allow for page numbers (e.g. Page 'n' or
> >> Page 'n' of 'tn' or similar), either in the header or footer of each
> >> page - or is there some support for this already and I have not seen
> >> it? This would be especially useful for users who print out the PDF.
> >
> > Indeed this is already implemented in part :-)
> >
> > On headers and footers you can use these:
> >
> > ###Page###
> > Replaced by the current page number.
> > ###Title###
> > Replaced by the document title
> > ###Section###
> > Replaced by the currect section title
> > ###SectNum###
> > Replaced by the currect section number.
> >
> > No support for a total number of pages yet.
>
> Thanks for the quick response.
>
> Sorry but I need a bit more help on how to do this.
>
> Searched in rst2pdf and found that "###Page###" is used in the
> styles.json file, so I guess that adding this style to my list of
> pdf_stylesheets would do the trick. But no luck, I currently have
> "pdf_stylesheets = ['sphinx', 'styles', ]".
>
> Is this where I should set it, or am I missing the point?
You could create your custom stylesheet with something like this:
{
"pageTemplates" : {
"cutePage": {
"frames": [
["0%", "0%", "100%", "100%"]
],
"showHeader" : false,
"showFooter" : true,
"defaultFooter" : "###Page###"
}
}
}
cutePage is the page template used by sphinx+pdfbuilder, so anything you
redefine there is used in the document (not in the cover page, that one is the
coverPage template).
You can set whatever you want your header and footer to be in defaultFooter
and defaultHeader, and you choose which are visble with showHeader and
showFooter.
The example above shows no header, and the page number in the footer.
Hope that helps!
--
("\''/").__..-''"`-. . Roberto Alsina
`9_ 9 ) `-. ( ).`-._.`) KDE Developer (MFCH)
(_Y_.)' ._ ) `._`. " -.-' http://lateral.netmanagers.com.ar
_..`-'_..-_/ /-'_.' The 6,855th most popular site of Slovenia
(l)-'' ((i).' ((!.' according to alexa.com (27/5/2007)
--
You received this message because you are subscribed to the Google Groups
"sphinx-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sphinx-dev?hl=en.