Hi Ihor

answers inline

On 13/10/26 20:18, Ihor Radchenko wrote:
"Pedro A. Aranda" <[email protected]> writes:

this is a bigger patch that adds more user control to the PDF Metadata
infrastructure, based on experience of switching back and forth betwee
MacTex2025 and 2026.

I feel it needs some checking from your side...
...
+  When the document metadata include the shorthand ~DOC_LANGS~, it
+  will be replaced by the main language declared with the ~LANGUAGE~
+  and ~OTHER_LANGUAGES~ keywords, formatted by
+  ~org-latex-build-doclangs-function~.  This custom variable points
+  to either of the functions ~org-latex-doclang-full~ or
+  ~org-latex-doclang-short~, or a user-defined function:
...
+  language=en, other-languages={es, fr}}
...
+\DocumentMetadata{tagging=on, lang=en}

I feel that this is going in a wrong direction.

ACK, although not agreeing with it from my limited experience since starting with ltx-talk.

I currently have three systems, each with a different texlive and its capabilities, to test the range from "the latest and best" to "what we currently have".

The whole point of export backend is automating LaTeX export, so that
users do not need to customize every possible detail, conditioned on
exact details of the latex version used or the compiler.

If I have learnt something in this process, it is that different systems need different settings, just an example: it is not the same to use MacTeX 2025 and MacTeX 2026 in my mac (the same system) because they provide different versions for most packages.
What you propose can be achieved much simpler - by supplying
#+LATEX_DOC_METADATA: tagging=on, lang=en
directly.

But then, you are repeating the language which you might be setting with #+LANGUAGE, which is redundant. Or you might oversee that you have one setting in LANGUAGE and a different setting in DOC_METADATA, which might be weird (or wrong).

The indirection with
#+LATEX_DOC_METADATA: tagging=on, DOC_LANGS + yet another extra
customization feels like over-engineering.

If you have a new system, the default setting is OK, so you don't need to touch anything. For older systems, you may need to set it to generate the old lang=xxx in your init.el

If you want to support different latex versions, we should automatically
detect it and use the appropriate format.

How? By running ~<latex_compiler> -version~ parsing that and then setting the variable I propose (or something of the sorts) to produce the correct output? And what do we do when the interaction between babel and DocumentMetadata is refined once again?

The idea is that (a snippet like)

#+LANGUAGE: ${1:main}
#+OTHER_LANGUAGE: ${2: secondary}
#+LATEX_DOC_METADATA: tagging=on, DOC_LANGS

produces a consistent definition regardless of the version of the LaTeX distribution and, in some cases, yes, you need to adjust your system, hopefully once in init.el, to get optimum results.

Best, /PA

PS: I'm also thinking about the FIXME regarding the conversion from Org language to BCP language codes and where to place it. This gives us a limited and well-identifiable set of functions to implement it.
--
Pedro A. Aranda
ox-latex & ox-beamer maintainer

Sagen's Paradeiser! (ORF: Als Radiohören gefährlich war) => write BE!
IA: onomatopeya del rebuzno
2nd year of the New Koprocracy


Reply via email to