I'm creating a pdf with the scribble/acmart
language. How can I add page numbers to my document?
The solution Ben gave is one way. But you can actually do this without modifying your texstyle.tex
file.
If you add the following lines to your document, the appropriate topmatter will be added to your pdf file:
@para[#:style 'pretitle]{
@elem[#:style "settopmatter"]{
printfolios=true}}
You can see it doing this by running:
> scribble --latex myfile.scrbl
If you do this, you will notice the following line in your pdf file:
\settopmatter{printfolios=true}\titleAndVersionAndAuthors{Hello}{6.9.0.4}{\SNumberOfAuthors{1}\SAuthor{World}}
(Where Hello
and World
is the name and author of your paper, and the \title...
macro runs \maketitle
.)
This works because the 'pretitle
style (when given to a paragraph), pulls its entire body above the title.
And whenever a string is given as the style for an element, it maps to the a latex command.
That is, this scribble code:
@elem[#:style "mycommand"]{Thebody}
Maps to:
\mycommand{Thebody}
The result of composing these two forms together is to drag this to the top of the file.
And because you've done this in scribble rather than latex, you can use Racket's semantics to add page numbers. For example, if you use your own #lang
, you can now have the language decide whether or not you want pages.