universal-accessCreating accessible PDFs in LaTeX

This page describes LaTeX accessibility in Overleaf and relevant considerations.

Over time, updates to standards and authoring tools have made it possible to produce accessible PDFs. Recent strides, including essential contributions from the LaTeX Tagging Projectarrow-up-right, now allow LaTeX-based PDFs to be accessible as well, and improvements continue to occur.

circle-check
swapSelecting a TeX Live version and LaTeX compilerchevron-right

The approach described in this documentation is largely informed by the LaTeX Project's accessible PDF instructionsarrow-up-right, which you can refer to for more details on the following topics.

circle-exclamation

tag Tagging and \DocumentMetaData

In essence, PDF tagging is a process that automatically creates a "structure" that is easily identified by screen readers, and is more searchable both now and in the future. It leverages the existing structure defined by your LaTeX code so the screen reader can differentiate between elements like headers, body text, figures, and equations.

TeX Live 2025 fully supports automated PDF tags with the \DocumentMetaData declaration. Add this declaration before \documentclass. There are several important keys to this declaration that affect tagging capabilities: tagging , tagging-setup , pdfstandard , and lang.

tagging

Ensure that tagging is enabled by setting the tagging key to on.

The setting tagging=on should be the standard setting on your document. It instructs LaTeX to produce a tagged PDF. Using the setting tagging=draft is appropriate for speeding up the compile on large projects before you produce the final PDF, as it performs the tagging logic but does not write the tags to the compiled PDF.

tagging-setup

Configure how your document is tagged by changing the value of the tagging-setup key.

circle-info

In this example, we used math/setup=mathml-SE for MathML Structure Element tagging, but it can be set to any value that \tagpdfsetuparrow-up-right supports.

MathML Structure Element tagging requires LuaLaTeX. If you are not using LuaLaTeX (or if the automatically generated MathML needs to be altered), you can use the Associated File method using the key-value pair tagging-setup={math/setup=mathml-AF} , and provide the file containing the MathML. In Overleaf, if you enable the mathml-AF option, the generated MathML files will be available in the Other logs and files of your project. Please see the LaTeX tagging project documentationarrow-up-right for more information on using the Associated File method.

pdfstandard

Tell the compiler which PDF standard you are targeting using the pdfstandard key. The recommended value here is pdfstandard=ua-2 (the PDF/UA-2 or ISO 14289-2 standard).

There are several different PDF standards, but UA-2 (Universal Accessibility) directly supports MathML. Generating a valid PDF/UA-2 document is the provides the key technical contitions to meet the PDF-specific criteria of WCAG.

Some older PDF readers may not support PDF 2.0, and the UA-1 version that is supported by PDF 1.7 may be required.

lang

Tell screen readers how to pronounce the text in your document using the lang key. The default value is en-US , and if not set, your document may not be accessible to screen reader users. Note that this setting only affects PDF metadata and does not influence the language used in your document for generated text or hyphenation.

The valid settings for lang are standard BCP 47 language tagsarrow-up-right: either codes like en (English), de (German), or fr (French), or the regional variations such as en-GB (British English), or de-DE (German as used in Germany).

text-size Descriptions

In addition to automatic tagging, you may also need to also add descriptions of the content of the elements, particularly if your document contains images and/or tables.

image Images

It's simple to add vital descriptions for images in Overleaf, which can also help with understanding the context of certain images when referencing the LaTeX code. All you have to do is add the associated image description option in each instance of \includegraphics. There are three main types of images to distinguish for accessibility: images that require alternative (alt) text, artifacts, and images that translate to actual text.

Alt text

Adding alternative text to images ensures that the photo has a description that can be used as a text-based substitute to the visual. Use the alt key and input a text value.

Artifacts

If an image doesn't need to be picked up by a screen reader (i.e., if it's purely decoration), mark the image as an artifact. Use the artifact option without assigning a value.

Actual text

If an image is a solely a picture of a Unicode character, then include the text-based character. Use the actualtext key and assign it a single character value (without brackets).

table Tables

While tables usually have text associated with them, it's still important that the text is associated with the correct aspects of the table. Add \tagpdfsetup to describe the table structure before your tabular. If your tables have common tagging requirements, this can placed in the preamble of your document. There are two main types of tables to distinguish for accessibility: data tables and presentation tables.

Data tables

If a table has at least one header row, then designate which rows are the header rows. Use the table/header-rows key and provide for the value a series of numbers that correspond with the locations of the header rows.

Presentation tables

If a table is not meant to be interpreted as a table by a screen reader, then mark it as a presentation table. Set the table/tagging key to presentation.

square-check Best practices

Following the instructions for producing tagged PDFs are an essential part of creating an accessible PDFs but are not on their own sufficient.

As described above, proper document metadata must be provided using the \DocumentMetaData command. All meaningful images must include a text description, any decorative images should be marked as artifacts. Data table structure should be as simple as possible, and have headers indicated, and any structural tables should be identified.

In addition, observing the following guidelines can help ensure that your LaTeX document is accessible.

Create structure using standard commands

A document can't be accessible if visual formatting is used to imply structure.

  • Inaccessible: \textbf{\Large 1. Introduction} (Just big bold text with no semantics).

  • Accessible: \section{Introduction} (This creates a navigation point and a heading tag).

Screen readers use the "Heading Tree" to navigate. If you don't create actual headings, the user can't jump to sections.

Fix all LaTeX errors

By default, the Overleaf compiler runs in non-stop mode, in which the compiler will attempt to continue working to produce a PDF even if errors are encountered. To produce proper PDF output, all LaTeX errors must be addressed. Please see: Fixing LaTeX errors.

Enable MathML for mathematics

Setting the math/setup key to the value mathml-SE in the \DocumentMetaData block described above instructs LaTeX to use MathML to tag mathematics in the document. It is essential to use this method, rather than other alternatives which also might seem reasonable.

In order to pass an accessibility checker, authors may be tempted to tag an equation as a figure, and add a textual description. The alt-text that some PDF tools or outdated LaTeX packages can allow you to add to mathematics will not convey mathematical structure or meaning, however.

Enabling MathML provides a structured representation of the mathematics in your document and is an essential part of making any document that contains mathematics accessible.

Load the unicode-math package

The package unicode-matharrow-up-right maps LaTeX commands for mathematical characters to the Unicode Mathematical Alphanumeric Symbols blockarrow-up-right. This helps ensure that the the intended meaning of mathematical symbols are conveyed, rather than just their appearance.

Avoid forced vertical whitespace

Attempts to alter the layout of text and especially mathematics can cause problems. Refrain from adding blank lines or \par commands in math expressions, and refrain from adding redundant line ends (\\). When a document is tagged, paragraphs is considered a cohesive and logical container of text. If you force a line break \\ to change the appearance of the text (e.g., to make a line look shorter), you are inserting a visual instruction will affect the logical structure that the tags are attempting to describe. This may impact the reading flow and order provided by assistive technology that is relying on the tagging information.

If blank lines are left inside an equation, LaTeX will often throw a compilation error. In some cases, this may still produce a seemingly correct PDF if the compilation is running in non-stop mode. As mentioned above, PDFs produced with errors will not have an intact tagging structure; all errors must be resolved in order to produce an accessible PDF.

Follow up-to-date instructions

There are some packages, such as the accessibilityarrow-up-right package that are still distributed in TeX Live and referenced in some online instructions that are no longer valid or maintained. When in doubt, please check the LaTeX Tagged PDF Project instructionsarrow-up-right.

Be aware that not all packages support tagging

To help ensure that your document is well tagged, compare the list of packages that you import in your document preamble and the LaTeX Tagging Project's list of compatible packagesarrow-up-right. In general, packages that alter document structure, create complex layouts, or draw text are possible sources of incompatibilities and should be checked for tagging support.

building-columns Regulations and standards

Regulations

Many LaTeX users, especially in education and government, are explicitly required to make the documents they produce for teaching and publication accessible.

  • In the United States: The Department of Justice (DOJ) recently updated ADA Title II (April 2024), mandating that state and local governments (including public universities and schools) ensure their digital content meets WCAG 2.1 Level AA standards by April 2026 (or 2027 for smaller entities). Additionally, Section 504 applies similar requirements to any institution receiving federal funding.

  • In Europe: The European Accessibility Act (EAA) and standard EN 301 549 require digital products and services to be accessible, effective June 2025.

Standards

While there are many PDF standards, PDF/UA (Universal Accessibility) is the standard for producing documents compatible with assistive technology. This is distinct from PDF/A (Archiving), which focuses on long-term archiving and does not strictly require accessibility features.

For accessibility compliance, two versions of the PDF/UA standard are relevant:

  • PDF/UA-1: An early accessibility standard (ISO 14289-1) for PDFs. PDF/UA-1 addresses accessibility for older PDF versions (PDF 1.7) and remains relevant because some legacy software tools and validators may only support this version.

  • PDF/UA-2: The current accessibility standard (ISO 14289-2) for PDFs. It supports modern PDF features (PDF 2.0), offering significantly better capabilities for complex content, such as mathematics.

circle-check

code HTML output options

For some institutions and users, HTML is the preferred format for accessibility because it naturally responds to various sizes of screens and integrates well with web-based assistive technologies. There are a number of options for obtaining an HTML output from a LaTeX source.

Tagging can still be helpful

Even if your ultimate goal is to produce HTML, we recommend following the LaTeX tagging instructions outlined in this guide. The steps followed to produce a valid tagged PDF, such as using semantic structure, adding alternative text to images, and utilizing proper table headers, produces higher quality and more accessible LaTeX source.

Conversion workflows

While Overleaf focuses on PDF generation, the platform supports workflows for users who need to generate HTML.

PDF to HTML

By using the LaTeX tagging features to produce a high-quality, well-structured PDF, you can often use third-party tools to successfully convert that PDF into accessible HTML.

There is an ISO standardarrow-up-right for converting PDF to HTML that many tools implement. A recommended tool for PDF to HTML is ngPDFarrow-up-right.

LaTeX to HTML

Users can utilize external tools (such as LaTeXMLarrow-up-right or BookMLarrow-up-right) to generate HTML directly from LaTeX source code.

While these HTML conversion tools are not currently built into the Overleaf compiler, you can connect your project to GitHub using Overleaf’s GitHub Synchronization feature to set up automated external workflows that handle this conversion.

comments-question FAQs

chevron-rightAre there any tools that can help verify that my document is accessible?hashtag

Yes, there are several external tools, including veraPDFarrow-up-right, that can validate PDF/A parts and conformance levels. Ensure that the tool you use understands tagged PDFs.

Additionally, there are other external tools for more targeted accessibility checks. For example, WebAIMarrow-up-right calculates the contrast ratio between two colors, which can be helpful for infographics.

circle-exclamation
circle-info

In addition to using third-party tools, consider the content of items such as alt text or headings, which can't always be verified as sufficient by an accessibility checker.

chevron-rightAre the packages in my Overleaf project compatible with these features?hashtag

It is a best practice to check the packages used in your project with those that have been tested against the LaTeX tagging features. You can refer to the LaTeX Tagging Project's packages status listarrow-up-right for an assessement of the status of most common packages.

chevron-rightCan I still use beamer? Are there other packages available for presentations?hashtag

Unfortunately, the beamer class is not compatible with PDF tagging. The experimental ltx-talk classarrow-up-right is intended to be a replacement for beamer that is built with tagging support as a core requirement. The ltx-talk class requires a more recent version of TeX Live 2025 than is provided by default by Overleaf, so to use this package you would need to use the "rolling TeX Live" image provided through Overleaf Labsarrow-up-right.

chevron-rightIs the Overleaf editor accessible?hashtag

As a web application, Overleaf leverages the accessibility features and functionality of modern web browsers which are regularly assessed by accessibility experts. Our latest completed Voluntary Product Accessibility Template (VPAT)arrow-up-right shows conformance with Web Content Accessibility Guidelines (WCAG) 2.2 Level AA.

chevron-rightCan PDFs produced by Overleaf satisfy the requirements of Title II of the Americans with Disability Act (ADA) and the harmonized European Standard for accessibility (EN 301 549)?hashtag

Yes. Legislation in the United States and Europe requires that PDFs meet WCAG 2.1 AA. To meet WCAG 2.1 AA, a PDF must be a tagged PDF. Making use of the support for PDF tagging that is provided in TeX Live 2025 is an important step towards producing accessible documents that are compliant with these regulations. However, as mentioned above, it is not sufficient to simply compile with TeX Live 2025 and enable the LaTeX tagging support to produce either compliant or truly accessible documents. We recommend following the instructions and best practices outlined here, as well as making accessibility a primary consideration throughout your writing process. Please note also that local and institutional accessibility guidelines and recommendations should be considered, and that testing and validation results may vary depending on the tools used.

chevron-rightHow do I switch my compiler to LuaLaTeX?hashtag

It's easy to switch to using LuaLaTeX, the LaTeX compilation engine that is recommended by the LaTeX tagging project team. While the default compiler in Overleaf is PDFLaTeX, you can switch to LuaLaTeX in your project settings.

chevron-rightWhere can I select the most recent version of TeX Live?hashtag

Most PDF tagging features are available in the standard TeX Live 2025arrow-up-right image. You can get the latest in Overleaf Labsarrow-up-right, which provides access to the "rolling TeX Live" image in Overleaf, including the latest in PDF tagging support. This experimental TeX Live version is primarily for testing changes to TeX Live, packages, and previewing new accessibility features before they’re compiled into our annual TeX Live release. To get the latest fixes provided by the LaTeX team with respect to automatic MathML tagging, you should include a custom latexmkrc file with a $lualatex = 'lualatex-dev'; rule. See The latexmkrc file.

Last updated

Was this helpful?