From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id aDi0BWPWEWWycwEAG6o9tA:P1 (envelope-from ) for ; Mon, 25 Sep 2023 20:50:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id aDi0BWPWEWWycwEAG6o9tA (envelope-from ) for ; Mon, 25 Sep 2023 20:50:11 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AE63B6194F for ; Mon, 25 Sep 2023 20:50:10 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=LIJK99Uz; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1695667810; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Pep3sd59Z5cSQLv3Uw0kePdJzPZj54NVcvYbSqfA8hA=; b=ANAFXGp59c231GFj7xr/SM1ThgwWDX09ef1QTweeGGSTugrYW0Y342eLeMMKqS5xaHcoNL vPaz/rxBeUEKUEYBecyS7R1nhEJ1RvxLLczTsmTWgUmsKfci0joM8NY9DZZRfLPcVkzBBb P2FEZRljlD0bZtXBVUo7ruIt1EEQpxFkRxYiLJ4L/OB9G3oyHQnttUMB+IgjMyV8g1/PFB 1pC4CwU+VP2qzf+Kx8Rt2O3h66XBzZZRWIFN/3jt3RZ5b5b2dqSpgMf8ENLIJB7eUolz2X uLWaG1vce82j9ptNj6M8SBgcznHQLh6EJVrmF6PAV0IEMWe2gdIlexNMcNCjPQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1695667810; a=rsa-sha256; cv=none; b=rZ+w0+iuqDEAGpfH2c2y4zjPyXSSeo334y+VdCXoYj9HTkG1WIZrCG8F1EJIgzrbOgkS40 1fxaSTytmV4yYxjl8rwYZvOVS6R5Si14b8dowMIVvYsHEJCCKxk13f7OXUUyC1CDklzmO2 zz8t7+eQjJ21CVZHUHH6RMQmR1KGa1r7HYfEVQUka3DtxXzMWF6BR/+FOlkDEpgFeMVltZ ThY2XTmV/8FoNZE9vY8Vxl+fDCfQsvpPVTOlKN/B1M3oQVwQ5hf4AbsElqQj2kYsMzpI34 Sict4kYl2V3duBjl/nhzwS3FRg5zUmYlHm3WxAzbI3c/lqeKjUR39uNPudDRJg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=LIJK99Uz; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkqe2-0006rz-8N; Mon, 25 Sep 2023 14:49:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qkqe1-0006rr-3z for emacs-orgmode@gnu.org; Mon, 25 Sep 2023 14:49:21 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qkqdy-00037J-I3 for emacs-orgmode@gnu.org; Mon, 25 Sep 2023 14:49:20 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id A6C9B240027 for ; Mon, 25 Sep 2023 20:49:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1695667754; bh=Pep3sd59Z5cSQLv3Uw0kePdJzPZj54NVcvYbSqfA8hA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=LIJK99Uz9zfZm1ypJ3W4i75p8Z4JWKhQvexYM4F89Fl/rBblfatYkAw1j9KVcCFUV dHat61eW+DkmBCAWRuv1zXsxet0foBPJNfU+qjLYgrf4BnRyNavmxJtbyUTTTorwfy PMjMb3LSff2C/vhqhv9oizcsJaLq4/gvJsQSoKSv2UW2HoxwYg0fsSDK2HAxjimAfe uCDzAi0GJaXyjyPeN8Dq7QhYDLxI0S5VA50TldqucbcTx2GoikDhtX/swYbwDes8HW ACSNOgpWZWchsf3MvH1drsA8K4TuNF8wiFJ+661xfzNTxWNfIo90uipez3oUZgGjcB b8oM8G7Q/gf4Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RvX3G139cz6tvk; Mon, 25 Sep 2023 20:49:13 +0200 (CEST) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Max Nikulin Cc: emacs-orgmode@gnu.org Subject: Re: [patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword In-Reply-To: (Max Nikulin's message of "Mon, 25 Sep 2023 20:58:14 +0700") References: <874jjuj8vu.fsf@posteo.net> <87pm2776qq.fsf@posteo.net> Date: Mon, 25 Sep 2023 18:49:11 +0000 Message-ID: <875y3yytp4.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.65; envelope-from=maciaschain@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -8.42 X-Spam-Score: -8.42 X-Migadu-Queue-Id: AE63B6194F X-TUID: xg1gSfwp2tM9 Max Nikulin writes: > On 25/09/2023 01:42, Juan Manuel Mac=C3=ADas wrote: >> According to the pdfx package documentation >> (https://www.ctan.org/pkg/pdfx), p. 6 (at the bottom of the page)/7: >> --- >> Warning: The \jobname.xmpdata file may be included in the main document >> source, within a {filecontents*} environment, provided this comes before >> the \documentclass command, as follows[...] >> --- > > Does it mean that with hyperxmp you can not generate documents > satisfying some requirements and you need namely pdfx? Is there a > reason that .xmpdata files must be generated namely by a LaTeX engine > and writing them by elisp code is unacceptable? In the hyperxmp manual a comparison is made with the pdfx package and other similar packages. Anyway, this topic deviates drastically from the original topic of the thread. There will be users who prefer to use hyperxmp package and users who prefer pdfx. Hyperxmp is probably more recommended, but I don't know either one deeply, so I couldn't say. In any case: I think the central issue is to provide support for inserting arbitrary code before \documentclass. The pdfx example is just one valid example (ideally Org should not put obstacles to the use of any package). As I said, there are more cases. For example, a few packages (I don't remember their names) are recommended to be loaded first using \RequirePackage. And there is also the case of the \PassOptionsToPackage command. A good practice in LaTeX documents is usually to put this command at the very beginning of the document, to avoid messages such as "option class for xx package error". It is placed at the very beginning because there may be classes that already require the package involved in the error. And one more example: a new package for LuaLaTeX was recently uploaded to CTAN, which allows the use of shebangs in LaTeX documents. In short, there are many heterogeneous cases, and it is the very heterogeneity of these cases that leads to a solution similar to LaTeX_header, IMHO. Actually, any code (except \usepackage) would be possible before \cocumentclass. >> For example, the newpax package, to preserve the internal links of a pdf >> included in the document, requires putting commands like >> \DocumentMetadata{ } before documentclass. > > If I understand it correctly, \DocumentMetadata is a switch to enable > "new" LaTeX like it was for \documentclass vs. \documentstyle during > transition to LaTeX2e from LaTeX 2.09. https://tex.stackexchange.com/questions/686898/what-is-documentmetadata-wha= t-key-value-pairs-does-it-take-and-when-should-i-u (As for the transition from LaTeX2e to LaTeX 3, it seems that it is not going to be as defined as the transition we witnessed in the leap from LaTeX 2.09. In reality it seems that there is not going to be such a leap but rather a "coexistence" of both worlds: https://www.latex-project.org/publications/2020-FMi-TUB-tb128mitt-quovadis.= pdf) > If so, Org should have native support of \DocumentMetadata, not > LATEX_PRE_HEADER or something similar. If it were the only case of code before \documentclass, I would agree. But, as I have already said above, the diversity of use cases makes the implementation of /ad hoc/ solutions unviable, in my opinion. -- Juan Manuel Mac=C3=ADas https://juanmanuelmacias.com https://lunotipia.juanmanuelmacias.com https://gnutas.juanmanuelmacias.com