From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id SO7QB/TwrGDFxwAAgWs5BA (envelope-from ) for ; Tue, 25 May 2021 14:43:32 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id YMByA/TwrGDVFwAAbx9fmQ (envelope-from ) for ; Tue, 25 May 2021 12:43:32 +0000 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 7A84B1237F for ; Tue, 25 May 2021 14:43:31 +0200 (CEST) Received: from localhost ([::1]:36716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llWPA-00071k-Pr for larch@yhetil.org; Tue, 25 May 2021 08:43:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48528) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llWOU-00071Y-Ms for emacs-orgmode@gnu.org; Tue, 25 May 2021 08:42:47 -0400 Received: from mout01.posteo.de ([185.67.36.65]:34689) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llWOS-0000ZC-7t for emacs-orgmode@gnu.org; Tue, 25 May 2021 08:42:46 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 3ADF6240028 for ; Tue, 25 May 2021 14:42:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1621946560; bh=yh6xgAiQ2AuWziBuP9jj3pgeV5p99hllDTAc6xO94Mg=; h=From:To:Cc:Subject:Date:From; b=We/cqMNUuO+B9TSvCtHjW9NqcrMkNhO9MIzdiwFWTeTjoD8qmQJJ9Qd5OQ6VzVL93 ENJ8ND+4/9d32JcMEWq/A5TTVQbtiK4Fj/mm7zGWAUX4lz+61/gZWo7bde8gH8m29w 2cYs47exA1aDj9zDlrJP+97m/kFRVGPv4Nqip914+YBSELL2w5SPkXs1SHB+vyI4jf 8sOKaDA5uuH+XBSnxSGKm0jmYE2ncIFrGREpTVpApH0w5SARhSX8qPqYMBRvsW8xM3 ZIJPiKepWPBSvD1MCsumHU9TRMIR9t1Udy7Y5no7zw4lY8F6SavXGAF9aNbhlBjYs7 auSDo5sjEevxA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FqDHz17vLz6tmG; Tue, 25 May 2021 14:42:38 +0200 (CEST) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Nicolas Goaziou Subject: Re: [PATCH] ox-latex.el: add LaTeX attributes to quote block References: <87h7is49cm.fsf@posteo.net> <875yz76uem.fsf@nicolasgoaziou.fr> Date: Tue, 25 May 2021 12:42:37 +0000 In-Reply-To: <875yz76uem.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Tue, 25 May 2021 11:21:21 +0200") Message-ID: <874kerf0hu.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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_H3=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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1621946611; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=50NTn5C49dV8JoJXVsQerkbyFNrdbTp9//YZO0PP4GA=; b=Msv+oA1qjwZdrwdh9/W+e2Hp0dDgIaXYrEjL4fjuhczJVozOxeKNCF/A6XeNX8DJlUV9Xj Qt92cKprGC0bloWhyv/31DBJIa5G1FocZPaR2pND4qv0wq+2Iwn1QflpjWNHjqFyxTGCyx kXNvWA4cF0KejdwVqM/v96rpb7cRQW04HW0HrkTB7RFY9CFwShXHUKpgEs2wU3cI0f7kjJ fAX7doKJNV5CqyaWtRcH51DSSzbPl6FAvA68i872FyXmnhtIyy8Bn3iEp8HMx7eSYKuDJX aDw97sto4+4CGl+F6xSV7/hwLzd3l+gKZCf40OQ90ku0dgHMcYckb8MQagvA4A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621946611; a=rsa-sha256; cv=none; b=Om1AdSa44Izdx6aUag0hSqyAC13h+VlLHirBnvlPb73mF0ge3TXWti3XEQBKeC0pBBCRv4 T5efSGFYM70uDc8cya7DtU1rrbZOW9JCvXAtfSjSZ1lXm3V2D/jXPKTdmfofEDHzDGKTBc fPqj/aFq9ZXQk+ZPqd/5fUjWOy5dKQAMyjxY2uvLbcc7sCZp8jPgGTBrvG6upNZKcO4x99 DrhZedUMJMdbH0ceqFuUDBxhGub0mbdKpV/GRl4URqEtuRFeAbTfGdy9NB+JTdMZaPAKZt 1d0d0Jey/FLoBvroP1X+JbnBQXKiONlnxftGmFgyKgwD16qZKGca5xo02nyNLA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="We/cqMNU"; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.13 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="We/cqMNU"; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 7A84B1237F X-Spam-Score: -3.13 X-Migadu-Scanner: scn1.migadu.com X-TUID: I0lT2RJjiygi --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Nicolas, Thank you for your indications. Attached the updated patch. Do you need me to prepare another patch to document the modifications and add them to org-NEWS? Best regards, Juan Manuel=20 Nicolas Goaziou writes: > Hello, > > Juan Manuel Mac=C3=ADas writes: > >> Subject: [PATCH] ox-latex.el: add LaTeX attributes to quote block > > Thank you. Some comments follow. > >> +(defcustom org-latex-default-quote-environment "quote" >> + "Default environment used to `quote' environment." > > --> Default environment used for "quote" blocks. > >> + :group 'org-export-latex >> + :version "24.4" >> + :package-version '(Org . "8.0") > > You can remove the :version keyword. And :package-version is wrong. > >> + :type 'string) > > You also need to add :safe t > >> (defcustom org-latex-default-table-mode 'table >> "Default mode for tables. >>=20=20 >> @@ -2895,9 +2903,17 @@ channel." >> "Transcode a QUOTE-BLOCK element from Org to LaTeX. >> CONTENTS holds the contents of the block. INFO is a plist >> holding contextual information." >> + (let* ((env (org-export-read-attribute :attr_latex quote-block :envir= onment)) >> + (opt (org-export-read-attribute :attr_latex quote-block :options)) >> + (current-env (if env env org-latex-default-quote-environment)) >> + (current-opt (if opt opt ""))) > > We don't use global variables directly as above, but use > > (plist-get info :latex-default-quote-environment) > > instead. This could be written as > > > (let ((environment > (or (org-export-read-attribute :attr_latex quote-block :environ= ment) > (plist-get info :latex-default-quote-environment))) > (options > (or (org-export-read-attribute :attr_latex quote-block :options) > ""))) > ...) > > Could you send an updated patch? > > Regards, --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-ox-latex.el-add-LaTeX-attributes-to-quote-block_updated.patch >From eea6956e1baa07c9a9753ed71be48a1e962442a9 Mon Sep 17 00:00:00 2001 From: Juan Manuel Macias Date: Tue, 25 May 2021 14:02:06 +0200 Subject: [PATCH] ox-latex.el: add LaTeX attributes to quote block * lisp/ox-latex.el (latex): add `org-latex-default-quote-environment' to `:options-alist' (org-latex-default-quote-environment): the default quote environment is `quote' (org-latex-quote-block): add two attributes: `environment' and `options' --- lisp/ox-latex.el | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index b9ecf070a..c4f2c6f53 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -121,6 +121,7 @@ (:latex-classes nil nil org-latex-classes) (:latex-default-figure-position nil nil org-latex-default-figure-position) (:latex-default-table-environment nil nil org-latex-default-table-environment) + (:latex-default-quote-environment nil nil org-latex-default-quote-environment) (:latex-default-table-mode nil nil org-latex-default-table-mode) (:latex-diary-timestamp-format nil nil org-latex-diary-timestamp-format) (:latex-footnote-defined-format nil nil org-latex-footnote-defined-format) @@ -772,6 +773,13 @@ default we use here encompasses both." :package-version '(Org . "8.0") :type 'string) +(defcustom org-latex-default-quote-environment "quote" + "Default environment used to `quote' blocks." + :group 'org-export-latex + :package-version '(Org . "9.5") + :type 'string + :safe t) + (defcustom org-latex-default-table-mode 'table "Default mode for tables. @@ -2895,10 +2903,19 @@ channel." "Transcode a QUOTE-BLOCK element from Org to LaTeX. CONTENTS holds the contents of the block. INFO is a plist holding contextual information." + (let ((environment + (or (org-export-read-attribute :attr_latex quote-block :environment) + (plist-get info :latex-default-quote-environment))) + (options + (or (org-export-read-attribute :attr_latex quote-block :options) + ""))) (org-latex--wrap-label - quote-block (format "\\begin{quote}\n%s\\end{quote}" contents) info)) - + quote-block (format "\\begin{%s}%s\n%s\\end{%s}" + environment + options + contents + environment) + info))) ;;;; Radio Target -- 2.31.1 --=-=-=--