From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>
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 UHXnL2iYGWXsdgAAG6o9tA:P1
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Sun, 01 Oct 2023 18:03:52 +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 UHXnL2iYGWXsdgAAG6o9tA
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Sun, 01 Oct 2023 18:03:52 +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 6E10F59F39
	for <larch@yhetil.org>; Sun,  1 Oct 2023 18:03:52 +0200 (CEST)
Authentication-Results: aspmx1.migadu.com;
	dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b="P1LU/0Zy";
	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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none)
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1696176232;
	h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to: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=596sPmUBgnwyMnXVgITEeJoy204JfoFWQoZ1vzccJxk=;
	b=GeulvxbnU00jEEHiXWHwtCl+t4atedoln4VJUny0TM4k+tl3pEQD2R7RvpFVytDpWlsnAX
	RYrJMi9IWbQFV1rkG98jAbLZQQfBasBwd//RK6kE1/2RQxcalUvD/YTReB3ZvjgbvJwOJ/
	k7l4JeFJBU54vFd20lTwMsT9+PIFBWKRIlb9fGZdeNQsLHqw4tgbFI6ovKy6WzXMDQOkyj
	WIzExIm19REpFno52C1ZQDDAQv7FeLXikJWEAlx7mMfC+NRpTY9f8UiXqer6expvKT/gf3
	qpMtRmex3438rc/VKuz8Zubboa9j+JSK5e1gyVY/MmgsodQs9Ch37QUqZxdEmA==
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1696176232; a=rsa-sha256; cv=none;
	b=EibdAjKui86SA73wDCW9283fxVM59ZuMCK3CuOUDIZdt6f5AhDt9Lsr8EStocAe68bujqo
	QRMGpvlAk9AklJF2atONiFcW8rwPzNjjfca+r0nZ0WaX6SwvNAKB4ZTw/oyfUx8qLK+XZ7
	9yWRNwn4fKQg+XdY0QKDVN2tD3/ITXNkwfJUETUx9FvNJRleIUgo77hvEE8/hyiUXXaLZu
	OXocUFVbjUqBtSeBWsRuIfFAp2Nak82Eg6Xua/FHs0LwSfWvMZO4W+TWLpXoj+h48igsrJ
	iOLIJtIJk1+I6cWU0kirCrVQOUHItA8kSN4ZMBwbeZ1UwBQ1Bw+BQvS1JJoqPQ==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b="P1LU/0Zy";
	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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-orgmode-bounces@gnu.org>)
	id 1qmyuN-0006Zv-E4; Sun, 01 Oct 2023 12:03:03 -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 <manikulin@gmail.com>)
 id 1qmyuA-0006HT-90
 for emacs-orgmode@gnu.org; Sun, 01 Oct 2023 12:02:55 -0400
Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <manikulin@gmail.com>)
 id 1qmyu6-0001S9-0M
 for emacs-orgmode@gnu.org; Sun, 01 Oct 2023 12:02:48 -0400
Received: by mail-lf1-x12a.google.com with SMTP id
 2adb3069b0e04-50437c618b4so21840369e87.2
 for <emacs-orgmode@gnu.org>; Sun, 01 Oct 2023 09:02:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1696176161; x=1696780961; darn=gnu.org;
 h=content-transfer-encoding:in-reply-to:mail-followup-to:from
 :references:to:content-language:subject:user-agent:mime-version:date
 :message-id:sender:from:to:cc:subject:date:message-id:reply-to;
 bh=596sPmUBgnwyMnXVgITEeJoy204JfoFWQoZ1vzccJxk=;
 b=P1LU/0ZyBWG5ZQEcXSzAo1RsdMK+qRIaE57ttJUwjGP1BmN1lVgyZ//ViojcvdNIU3
 m3EHTr73LQdpH3dUnE1TnSq9A1uEMfzo24gYP5M0ECox0Ju4D873aAlEQuho/Riu76/T
 H9QJ0wAy/tEScoJDEbDWEEtacAWoGpd171j/HMsQPVxb55bEE7OrjcoCt/llaMBwD4vx
 sOB4SzXgli4M2NcILrM2UY+y19E6fAvY/SQijMCEZNfzetOy1VxW2IT+zwSC7lH5CwDV
 PyiUvluDNUKuli7vY7FYaGt+lPZIwNwvb2Fj1WRmfeE1jc2rEn8+G9ASOR2cxNx0OfWg
 BI4g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1696176161; x=1696780961;
 h=content-transfer-encoding:in-reply-to:mail-followup-to:from
 :references:to:content-language:subject:user-agent:mime-version:date
 :message-id:sender:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=596sPmUBgnwyMnXVgITEeJoy204JfoFWQoZ1vzccJxk=;
 b=sQX4uOqQkze/IaJLo70yjoGIN03sN33c8h/PZpu/d7x1crJKI6cCXUrk3jS5L43bZQ
 I8D06UaVSHp41Cbx7lizvG8RQAbTSVpcrM3psfvjT9nnOlQgLYLVl2burgjj5iHqRoJF
 J9eHnzfJ4ZHlrX3PXnLEVzE7/wQEhBEicIXmwLRVHo+5Nf1rQYxy0bf1Qs+aIsKZzRBS
 XNj4xVlUwrpZa7dCH4A7ow71vDS5Xy6QBmaTh7GfBmU+hikF5W0rHqz8Lt3UDXRiphXL
 sUe3G0TPtIxSw7TBDDFis5rCAj5CqC3Z+ByzF1dmWuId4+jaQ+AE/wNwqsVt8gKHg7k0
 tqxw==
X-Gm-Message-State: AOJu0YxOFaW180fP5q1/C8BEdLKTXu/0TfYR3N+3RdncRwuC3LB41vbc
 OO7w78au0z3waWhiORbe6FIP6lS125w=
X-Google-Smtp-Source: AGHT+IE7/re3iPqEnA+hsl1h5uGiOzvQOH68QqqhzB959NnoYc3Dc4C7L5ORfXNW8+LVWCSWmdFcTw==
X-Received: by 2002:a05:6512:20d2:b0:503:60e:91f5 with SMTP id
 u18-20020a05651220d200b00503060e91f5mr6990362lfr.36.1696176160982; 
 Sun, 01 Oct 2023 09:02:40 -0700 (PDT)
Received: from [192.168.0.101] (nat-0-0.nsk.sibset.net. [5.44.169.188])
 by smtp.googlemail.com with ESMTPSA id
 v29-20020a056512049d00b00502af40d9efsm4336285lfq.261.2023.10.01.09.02.40
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 01 Oct 2023 09:02:40 -0700 (PDT)
Message-ID: <a113634f-60e1-a4ae-fd20-c4e254095dae@gmail.com>
Date: Sun, 1 Oct 2023 23:02:38 +0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.15.1
Subject: Re: [patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword
Content-Language: en-US, ru-RU
To: AW <alexander.willand@t-online.de>, emacs-orgmode@gnu.org
References: <874jjuj8vu.fsf@posteo.net> <87lecsvjdd.fsf@posteo.net>
 <uf3j9f$62n$1@ciao.gmane.io> <2240064.iZASKD2KPV@linux.fritz.box>
From: Max Nikulin <manikulin@gmail.com>
Mail-Followup-To: AW <alexander.willand@t-online.de>, emacs-orgmode@gnu.org
In-Reply-To: <2240064.iZASKD2KPV@linux.fritz.box>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=2a00:1450:4864:20::12a;
 envelope-from=manikulin@gmail.com; helo=mail-lf1-x12a.google.com
X-Spam_score_int: -51
X-Spam_score: -5.2
X-Spam_bar: -----
X-Spam_report: (-5.2 / 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, FREEMAIL_FROM=0.001,
 NICE_REPLY_A=-3.058, RCVD_IN_DNSWL_NONE=-0.0001, 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." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-orgmode>
List-Post: <mailto:emacs-orgmode@gnu.org>
List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=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: -2.52
X-Spam-Score: -2.52
X-Migadu-Queue-Id: 6E10F59F39
X-TUID: WFkvBscx1Puu

On 28/09/2023 22:36, AW wrote:
> 
> The idea to have a LATEX_PRE_HEADER to insert `\DocumentMetadata{}` is exactly
> what you need right now, if you export from orgmode to current LaTeX. With
> `\DocumentMetadata{}` you can add most of the necessary xmp data -- and I
> write most, because I'm using it on a daily basis, but haven't checked if
> really everything is included yet.

The question is if Juan Manuel can use \DocumentMetadata instead of the 
pdfx package in his workflow.

However there is a common part of \DocumentMetadata and .xmpdata usage. 
Currently Org mode allows to specify a very limited subset of metadata 
through keywords

#+language: en
#+author: Me
#+title: Statement

The advantage is that the same data are used by all export backends: 
LaTeX, HTML, etc. Specifying \DocumentMetadata literally without 
substitutions from Org keywords may cause diverged values. That is why I 
proposed to consider some kind of templates.

Another issue is extended metadata. I would consider an approach similar 
to header arguments for source code blocks:

#+property: header-args :eval never-export
for all languages
#+property: header-args:elisp :exports both :eval yes
overrides for emacs-lisp

Perhaps it is not reasonable to require to specify all metadata through 
Org keywords and it may be more convenient to combine raw LaTeX code and 
fragments generated by Org

#+name: preamble
#+begin_src latex :exports none :noweb yes
\DocumentMetadata{
   pdfstandard = a-2b
   <<ox-latex-template-document-metadata-entries>>
}
<<ox-latex-template-documentclass>>
<<ox-latex-template-usepackage>>
#+end_src

Access to keywords values during evaluation of source code blocks have 
to be implemented however.