From 71c18fb4a7af426d22f03429fe8e29cb72b13f45 Mon Sep 17 00:00:00 2001 From: Ashesh Vashi Date: Tue, 16 Jun 2026 15:36:24 +0530 Subject: [PATCH] docs: handle Vietnamese diacritics in LaTeX PDF build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PDF docs build in the Check documentation builds workflow began failing after the 9.16 release notes added "Mai Phạm Hiền" as the reporter for CVE-2026-12049. pdflatex's default utf8 inputenc maps Latin-1 and Latin-Extended-A but rejects the precomposed Vietnamese code points U+1EA1 (a with dot below) and U+1EC1 (e with circumflex and grave) with: ! LaTeX Error: Unicode character ạ (U+1EA1) not set up for use with LaTeX. Declare the two characters in the LaTeX preamble via \DeclareUnicodeCharacter so they typeset correctly: ạ -> \d{a} (a with combining dot below) ề -> \`{\^e} (e with circumflex + grave) Picked this over switching to xelatex because it is a single-file change, keeps the existing pdflatex toolchain, and the CI workflow already has the apt packages it needs (no .github/workflows change). Verified by running make docs-pdf in an ubuntu:22.04 container that mirrors check-doc-builds.yml (same apt packages, locale-gen en_US.UTF-8, sphinx + sphinxcontrib-youtube): 682-page pgadmin4.pdf produced cleanly, zero Unicode-character errors in the log. --- docs/en_US/conf.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/en_US/conf.py b/docs/en_US/conf.py index b52516277..a6bd1eaa4 100644 --- a/docs/en_US/conf.py +++ b/docs/en_US/conf.py @@ -239,6 +239,14 @@ latex_documents = [ # https://groups.google.com/forum/#!topic/sphinx-users/ZlQ95_QikXo latex_elements = { 'fncychap': r'\usepackage[Sonny]{fncychap}', + # pdflatex's default utf8 inputenc covers Latin-1/Latin-Extended-A but + # not the Vietnamese precomposed code points that appear in CVE + # reporter names. Declare the specific characters we use rather than + # switching engines. + 'preamble': r''' +\DeclareUnicodeCharacter{1EA1}{\d{a}} +\DeclareUnicodeCharacter{1EC1}{\`{\^e}} +''', }