Page numbers in scribble/acmart

876 Views Asked by At

I'm creating a pdf with the scribble/acmart language. How can I add page numbers to my document?

2

There are 2 best solutions below

0
On BEST ANSWER

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.

0
On
  1. Make a LaTeX file with the line \settopmatter{printfolios=true}
  2. If the file is named texstyle.tex, invoke Scribble with the command:

    scribble ++style texstyle.tex --pdf FILE.scrbl

The rendered FILE.pdf should have line numbers.

(If you already had a ++style file, just add the \settopmatter line to that.)