• Skip to main content
  • Skip to footer

eSAIL

Engineering Studio for Advanced Instruction & Learning

  • Home
  • Faculty Services
    • Course Design
    • Canvas Support
    • Digital Accessibility Resources
    • Faculty Learning
    • Helpful Tools
  • Faculty Learning
    • Faculty Learning
    • Online Teaching Tips
    • Digital Accessibility Resources
    • Accessibility Series
    • Tutorials
    • Online Courses
    • Live Workshops
    • Webinars
    • Frequently Asked Questions (FAQ)
  • Contact
    • Contact Us
    • About Our Team
    • eSAIL’s Research Activities
    • Physical Location
    • Subscribe to our Newsletter
    • Website Feedback
Home » Faculty Tutorials » Creating Accessible LaTeX PDFs: PDF/UA-2 Compliance in Overleaf (December 2025)

December 8, 2025 By Christine Roach

Creating Accessible LaTeX PDFs: PDF/UA-2 Compliance in Overleaf (December 2025)

Introduction

There are several methods to create accessible documents from LaTeX. While methods like Mathpix and Pandoc are useful, there are certain scenarios where a LaTeX-generated PDF is necessary or preferable.

While these methods generally do not preserve the characteristic typesetting visual formatting of LaTeX, they are reliable and relatively quick, score well in accessibility checkers, and are well-suited to instructional content.

However, there are certain scenarios where a LaTeX-generated PDF is necessary or preferable. The purpose of this document is to provide LaTeX code necessary to output accessible PDF files directly from Overleaf.

The method described here relies on the ongoing work of the Tagged PDF project. The accessibility functionality of LaTeX is still under development, and there are frequent updates and improvements. Check the LaTeX official website and repository for the latest information.

As of December 4, 2025, the steps listed here are the necessary steps to create a PDF file that is tagged properly and allows math content to be read by a screen reader. Every element listed here is required unless otherwise specified.

This method was tested using Overleaf with Lualatex and Tex Live 2025. It may not work using other compilers, engines or authoring tools. This document is not intended as a comprehensive overview of accessibility considerations. Please refer to WCAG 2.1 and our other tutorials for more information.

If you would like to share information, request corrections or ask questions about the content of this guide, please email us at esail@tamu.edu


Steps to Create an Accessible PDF/UA-2 Document

Step 1: Project Setup and Required Environment

Required Environment

To produce a tagged PDF with accessible math, you must set up your project to use:

  • Engine: LuaLaTeX
  • Version: TeX Live 2025 or newer
  • Packages: `unicode-math` and LuaMML compatible packages (check status).
  • Font: An Opentype font is required; TFM-based fonts are not supported. If you use other fonts, `unicode-math` should be loaded after them.

Step 2: Preamble Requirements: Metadata Declaration

Metadata Declaration

The `\documentmetadata` command is essential to creating an accessible PDF. It must be the very first declaration, before `\documentclass`.

This loads the necessary code and packages. Next, use `\DocumentMetadata` to define required standards and tagging features:

\DocumentMetadata{
  tagging = on,
  lang = en,
  pdfstandard = ua-2,
  pdfstandard = a-4f, % optional archival standard
  tagging-setup = {math/setup={mathml-AF,mathml-SE},
                   extra-modules={verbatim-mo},
                   table/header-rows=1}}

PDF Standards

This method requires the use of PDF standard UA-2 for accessibility. You may also use PDF standard **A-4F** for archival purposes, but this is optional.

Tagging Setup

The `math/setup` portion of `\documentmetadata` enables the creation of MathML as structure elements and associated files, as well as designating the first row of each table as a header row and enabling verbatim. These elements are required.


Step 3: Package Requirements

Required Package

\usepackage{unicode-math}

Recommended Packages

These packages assist with proper structure and tagging of specific elements:

  • `graphicx`: Required if including any images. Allows for alt text to be added within `\includegraphics` (replaces the older `accsup` method).
  • `tabularx` (or `tabular` or `tabular*`): Supported table environments.
  • `float`: Required if using floating elements (tables, graphics). You must use the `[H]` position specifier to ensure correct reading order.
  • `hyperref`: Recommended if there are any internal or external hyperlinks.
  • `enumerate`: Recommended for lists and bullets.

Step 4: Set Accessible Document Properties

Set Document Properties

Set document properties with \hypersetup

\hypersetup{ 

  pdftitle={Accessibility Recommendations for LaTeX Documents}, 

  pdfauthor={eSAIL @ TAMU - Accessibility Team}, 

  pdfsubject={Accessible LaTeX Recommendations (PDF/UA-2)}, 

  pdfkeywords={LaTeX, accessibility, PDF/UA-2, NVDA, MathML}, 

  pdfdisplaydoctitle=true 

}

Step 5: Set Document Elements

You must manually ensure the following elements are properly formatted if present in your document.

Headers

Ensure your document is organized into headers and subheaders using \section{} (this will be read as Header 1) and \subsection{} (read as Header 2). Each section should have a corresponding title defined and should not be left blank.

Floating Elements

Floating elements such as images and tables create problems with the reading order of the PDF, because the element may “float” to the bottom of the tag tree, or get mixed in with other content. To remedy this:

  1. Load the float package and use `[H]` to ensure the element is read in the correct order in the document. This may interfere with the visual formatting, but it is essential to ensure the content is presented to assistive technology users in logical order.
  2. Manually wrap a tag container around the floating element
    1. Place `\tagstructbegin{tag=Part}` immediately before your floating element. Ensure there is a blank line immediately prior to this command to avoid tagpdf structure errors. Place `\tagstructend` immediately following the floating element to close the section.
    2. Only the element and its caption should be inside this structure. See graphics and table examples below for examples.

Math

  • Inline Math: For inline math (equations shown within a sentence) it is recommended to use the standard $ $ delimiters to define a math expression.Example: Define the loop gain $L(s)=G(s) G_{c}(s)$.
  • Display Math: For an equation in displayed math mode (equations on their own line), you should use `\[ \]`.Example: \[T(s)=\frac{Y(s)}{R(s)} \]
  • Align and cases environments can also be used.

 

Tables

  • Table headers. Currently table headers are defined by `table/header-rows=1` in the `\documentmetadata` command.
  • To ensure your table and caption read in the correct order, you should use `[H]` and wrap the element with a manual tag structure See floating elements, above, for full information.
%leave an empty line before \tagstructbegin

\tagstructbegin{tag=Part}%required to ensure correct reading order of contents if the table has any caption
\begin{table}[H]
\caption{Sample Table}%caption must be first or last element of environment
\centering
\begin{tabularx}{\linewidth}{|X|X|}
\hline
\textbf{Category 1} & \textbf{Category 2} \\ \hline
First block of information & Second block of information \\ \hline
More information & Other information \\ \hline
\end{tabularx}
\end{table}
\tagstructend

Graphics and Alt Text

  1. Images must include alt text (alternative text describing the content of the image) to ensure accessibility for screen readers. The `graphicx` package allows you to easily add alt text using the `\includegraphics` command. Within the `\includegraphics` command, specify your main parameters and then insert a comma and add: `alt={your descriptive text here}`.

Here is an example of alt text use:

\includegraphics[width=.75\textwidth,alt={SVM classifier showing the maximum margin hyperplane and support
vectors separating two classes}]{Images/img1.png}

If your image is decorative and you wish to exclude it from tags, you can use the word `artifact` within the include graphics commands.

Here is an example:

\includegraphics[width=.75\textwidth,artifact]{Images/img1.png}

If your graphic has a caption, you must add a manual section break around the graphic to ensure the correct reading order. See floating elements, above, for full information.

The full graphics command with alt text should now look like the following:

%leave an empty line before \tagstructbegin

\tagstructbegin{tag=Sect}%required to ensure correct reading order of contents if the table has any caption
\begin{figure}[H]
\centering
\includegraphics[width=.75\textwidth,alt={Unity Feedback Configuration for Error Signal Analysis}]{Images/img1.png}
\caption{Unity Feedback Configuration for Error Signal Analysis}
\end{figure}
\tagstructend

Step 6: Validation and Accessibility Scoring

PDF Validation

Most PDF checkers (Adobe Acrobat, PAC, Canvas Ally) do not yet fully recognize MathML content tags and may flag them as errors.

  • VeraPDF is the currently recommended tool to check your document for proper tag structure.
  • Recommendation: We recommend listening to the math content with a screen reader to ensure it is being read correctly.

PDF Limitations and Requirements

This method was tested using Foxit PDF reader and Adobe Acrobat. Other PDF readers may not be able to interface with math content and/or screen readers to output accessible content.

Screen Reader Limitations and Requirements

This method was tested with NVDA screen reader with the Mathcat addon which allows the screen reader to announce MathML content within a PDF document. While Jaws can read math in HTML format and Word documents, it cannot yet read MathML content in PDF files.

Critical Warning: Avoid Adobe Autotagging. Adobe Acrobat’s autotagging feature is incompatible with this PDF/UA-2 method and will replace the correct tags with inaccessible versions. Do not use Adobe’s autotagging feature.

Miscellaneous Notes and Future Status

  • The **`\documentmetadata`** instructions are updated frequently; expect this to change again in the future.
  • Be sure to check the package compatibility list on the Tagged PDF project website.
  • Pdf standards are not mutually exclusive. You must use `ua-2` for accessibility reasons, but you may also use `a-4` for archival purposes.
  • An Opentype font is required; TFM-based fonts are not supported. Unicode-math automatically uses latin modern math for math, and you can change this using `\setmathfont{}`. If you use other fonts in your document, unicode-math should be loaded after other fonts.
  • Avoid using Adobe Acrobat’s autotagging feature as it is not compatible with the PDF/ua-2 method and will replace tags with inaccessible versions.
  • Screen reader heuristics ignore/do not announce punctuation in plain text. If punctuations such as slashes, parentheses, brackets, etc, need to be spoken, they need to be marked as verbatim or math.
  • While adding `\tagpdfsetup{math/alt/use}` will satisfy Ally, it usually results in the screen reader no longer being able to see the MathML content, so it is not recommended.

Filed Under: Faculty Tutorials

Previous Post: « Generating and Applying Long Descriptions of Complex Images

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Texas A&M University Engineering

Footer

About Our Team

Our team is comprised of individuals with development, video producing, accessibility, writing, and learning/teaching expertise – all ready to partner with faculty...
Meet eSAIL Team Members!

Contact

Online Course & Mediasite Support
eSAIL@tamu.edu
We'd love to hear from you!
Contact Us

Quick Links

  • Site Map
  • Website Feedback
  • Submit Website Issue
  • State Links & Policies

Site Search & Subscribe

Get tips each quarter to make each semester more successful than the last!
Subscribe to our Newsletter

© 2026 · Texas A&M University · All Rights Reserved · Log in