Skip to content

Page counter

Giorgio Garofalo edited this page Dec 15, 2025 · 3 revisions

The .currentpage and .totalpages functions display, respectively, the current index (beginning from 1) of the page/slide the function call lies in and the total amount of pages/slides. They don't accept any argument.

They are unsupported in plain documents, where the - placeholder is shown instead.

Note

These functions return visual elements (nodes), not numbers. Hence, it is not allowed to do, for example, .sum {.currentpage} {3}.

Fixed page counter

A page counter can be displayed on each page thanks to page margin content:

.pagemargin {bottomcenter}
  .currentpage / .totalpages

Resetting the page number

The .resetpagenumber {from?}[docs] function allows overwriting the current page number at any point in a paged or slides document.

These changes are reflected in .currentpage and page numbers in the table of contents.

.pagemargin {topcenter}
  .currentpage

# First page

# Second page

.resetpagenumber

# Third page
Page number reset

Getting started [NEW!]

Documentation

CLI tools

Markdown enhancements

Functions

Setting up

Multi-file projects

Layout

Charts & diagrams

Scripting & control flow

Utilities

Slides

I/O

Native content

Value types

Built-in libraries

  • Paper: abstract, definitions, theorems, and more

Extra features

Inside Quarkdown

Clone this wiki locally