From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id sPCxB5DOBmU5IwAA9RJhRA:P1 (envelope-from ) for ; Sun, 17 Sep 2023 12:01:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id sPCxB5DOBmU5IwAA9RJhRA (envelope-from ) for ; Sun, 17 Sep 2023 12:01: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 D299666A24 for ; Sun, 17 Sep 2023 12:01:51 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=hewO9g37; 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=1694944912; 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=qAIaQ3gZ13yyS7Xg1iu5oYe6/53x1DgZxhzT7rnRZBw=; b=eL5lgV3ngfCt9sZDG0q2IUDosWXMXLDyh9viTTCFHTDtREqn7lDR3VsBmDUU96i4yrhcIN LoC/sJjQVbuDtJv7PsaGtOSezyyW+bVYp3tJTkE8vdQBsg3tYIs51eH8X9z9mm7TYd4Lx1 H/ZIwyr4XN6TodGfMX13M/VdI8MwVC6UlIhuPUDWf+kIaQdxMcoPhq+EzeAZAcmaLpJpkS mB9A3zI3ftugo4wXa3PA+fBl+gXV2Bgn86AxA4BFrXVsVZqULVTQIR+2fHOpsdPlAl0K10 HvZ5g6m5f0NQzvJIXvCoVlAcj0vZT32u4iMBzYnUQ0lyk9p/HSAgkFIghaILSw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=hewO9g37; 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-Seal: i=1; s=key1; d=yhetil.org; t=1694944912; a=rsa-sha256; cv=none; b=WyK4R6QktKjcfpTTiG+BE1pwUMGK1tnp/aQVeq9kzrPlyrjUEajyxNHa4btQy3GjwSbTH4 iAAv6KHwv/txPVLytSY123Pbh5J2SB4J2cQpm/EtvCLvkCig0tkJ3x3vX+OkIgsDxbI1Vo 1t9mdlGAm41jk1RY5DOV469H6XpHhm8rLtM0VB1qrNE7hqWTgM07JGW2q+cDf44r8pPvMj TeCMrDpnlSh1cRsiJM/stOwyaASMmzhtYRQIGStve3V5jgJjkdmErVDRIlqMSswee6t+Rf 9HEo5VEaZwsrO4oUv8MZhzaLBdLDAfyIkX6T+4AFdisb/yPjCNxJYyxsPfsLPQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qhoaK-0006AW-H9; Sun, 17 Sep 2023 06:01:00 -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 1qhoaH-00064q-T0 for emacs-orgmode@gnu.org; Sun, 17 Sep 2023 06:00:58 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qhoaE-0002uO-SM for emacs-orgmode@gnu.org; Sun, 17 Sep 2023 06:00:57 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 9C6D8240101 for ; Sun, 17 Sep 2023 12:00:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1694944852; bh=vS402iMsGCmZsg9WRoWrB2D+mrjc1cXGcVRyvOIOM5o=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=hewO9g37XO9pX8xnA2rqAXw8uA9koqLL8Rk/3ZJeciXQ3lCwowoyacqEQDmBAcvEd TypHS19TXegqNf/LHKl/t83lyk1LjcrIZ7P0F0D4RAQ0H7dZ8f+Gsz19kk/CeCu1LX qkmcJTXQmNqNv90x1NMjQJPjEotNR6DBJ8GwQ5a5TQFfjNoEy7dQdS1VG4VOhULoxs S7OfBOgsntz05wQFfqzXTsRZL//wMkf7pxNThbRuJUhd3ZFrz8ZgGlGhidxtpEXANa typYMMcI21YhW2Z60qeCIY8c6bhPLG2QU3NBQq/WY0T+Cdc/nv7xvaI3BCDeB667XI I1YUIfowVcMrg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RpNjJ1dgJz9rxL; Sun, 17 Sep 2023 12:00:52 +0200 (CEST) From: Ihor Radchenko To: Juan Manuel =?utf-8?Q?Mac=C3=ADas?= Cc: orgmode Subject: Re: [patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword In-Reply-To: <874jjuj8vu.fsf@posteo.net> References: <874jjuj8vu.fsf@posteo.net> Date: Sun, 17 Sep 2023 10:02:09 +0000 Message-ID: <874jjtqfry.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.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: mx1.migadu.com X-Migadu-Spam-Score: -2.31 X-Spam-Score: -2.31 X-Migadu-Queue-Id: D299666A24 X-TUID: m/RopJR0o8zY Juan Manuel Mac=C3=ADas writes: > Rationale for this patch: in certain cases, in a LaTeX document, it is > necessary to add code before the class declaration (\documentclass...). > For example, commands like \PassOptionsToPackage, \DocumentMetadata{ }, > etc.; or certain packages that should be loaded first using > \RequirePackage{}; and other miscellaneous cases[1]. I think that by > defining a new keyword `latex_pre_header', which behaves the same as > latex_header but concatenated before the class, these situations can be > resolved from Org. Thanks for the patch! It looks reasonable. > https://gnutas.juanmanuelmacias.com > From ac6b743a4489f7bc8ab1cdae7ffd3b36e5f3c1d2 Mon Sep 17 00:00:00 2001 > From: Juan Manuel Macias > Date: Sat, 16 Sep 2023 19:22:39 +0200 > Subject: [PATCH] lisp/ox-latex.el (latex): Add `LATEX_PRE_HEADER' keyword > > * (org-latex-make-preamble): In some cases it is necessary to add code > before the `\documentclass' line. `LATEX_PRE_HEADER' behaves the same as > `LATEX_HEADER', except that it is concatenated before the class. I think that you do not need to `quote' LATEX_PRE_HEADER - it is not a lisp symbol. Also, the new keyword should be documented in the manual. > - (user-error "Unknown LaTeX class `%s'" class)))) > + (user-error "Unknown LaTeX class `%s'" class))) > + (pre-header (mapconcat > + #'org-element-normalize-string > + (list (plist-get info :latex-pre-header) "")))) mapconcat is redundant here. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at