How do you hint to a screen reader it should skip certain text?

Hello, I’d like to be able to tell a screen reader to skip certain text such as page headers and page numbers. I’m not currently compiling against the UA-1 standard (I need to add some alt text), but is there anything I can do to hint to a screen-reader that it shouldn’t read something out?

For context, here’s the page setup I’m currently using:

  #set page(
    paper: "a4",
    header: context {
      set align(center)
      block(
        width: header-footer-width,
        {
          if calc.odd(here().page()) {
            align(right, emph(hydra(1)))
          } else {
            align(left, emph(hydra(2)))
          }
          line(length: 100%)
        },
      )
    },
    footer: context {
      set align(center)
      set block(width: header-footer-width)
      align(center)[#counter(page).display()]
    },
  )

Hi, you can use pdf.artifact to tell screen readers something should be skipped. Accessibility – Typst Documentation has additional information. Some elements like headers, footers, backgrounds, and foregrounds are marked by default.

I’m not entirely sure if it works with non-UA-1 PDFs, but I would assume it does, as Typst adds PDF tags by default. Maybe someone else knows for sure?

1 Like

Must’ve skipped over that bit in the accessibility docs, oops. Looks like what I need, thank you!