14

Can you specify the natural language of a PDF compiled with pdflatex? This Tingtun Accessibility checker doesn't like my PDFs because this isn't set. This page calls it the " /Lang entry in the document catalog of a PDF" and describes how to change it in Adobe Acrobat. But it would be nice to set this automatically at compile time. I would imagine that there is a setting to pass to hyperref to set the natural language, but I haven't found it yet.

  • Interesting link! Thanks a lot. I tested my actual document and it had two errors. The natural language you mentioned and---surprise---inconsistent headers and footers. I used KOMA-Script scrbook and its default headers. I couldn't find any mistake. Quite stunning! – Jan Dec 4 '19 at 8:08
17

The following document passes the test that you linked. It should be obvious from the example how to set the language.

\documentclass{article}

\usepackage{hyperref}
\hypersetup{
  pdftitle={Test},
  pdflang={en-US}, % PDF language identifier (RFC 3066)
}

\begin{document}

\section{foobar}

\end{document}

If for some reason you cannot use hyperref, you can also modify the PDF catalog by hand using

\pdfcatalog{/Lang (en-US)}
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.