From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sMAWN7zTrmACDQAAgWs5BA (envelope-from ) for ; Thu, 27 May 2021 01:03:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id CBXnMrzTrmB6egAAB5/wlQ (envelope-from ) for ; Wed, 26 May 2021 23:03:24 +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 0F4121668A for ; Thu, 27 May 2021 01:03:24 +0200 (CEST) Received: from localhost ([::1]:59884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lm2Yc-0002Qf-Hf for larch@yhetil.org; Wed, 26 May 2021 19:03:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lm2Xi-0002QS-Uw for emacs-orgmode@gnu.org; Wed, 26 May 2021 19:02:26 -0400 Received: from mout02.posteo.de ([185.67.36.66]:56593) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lm2Xf-0002ph-PD for emacs-orgmode@gnu.org; Wed, 26 May 2021 19:02:26 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 2B6B52400FC for ; Thu, 27 May 2021 01:02:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1622070140; bh=5y0dyKPdPMeBj3sJaWvOLcjVUdC9sLrTbbyA7H89gh4=; h=From:To:Cc:Subject:Date:From; b=gLObKPR/NcmJCw0hD/8z4OOEVjpNRUCsS4Hifj0yM1PnhIGt7Y10bHTxzRADHo6my MsEGyBjUd8EiagMgcHnxFM15CfCm0tUPY5FyMq1OwWAgrN4vATPOVSr+9iqtzKuF8M I5HTWiqz5feH1mUDJ4lpA5ByIqzYm3xhNFBn/1iO4l/Plq1Kw/Lmhfw2LQLKmUsoLb qqw28sIfrPmRDB5cbeWop5/xoMGM+NTT4hJVVs8NSMsiwnRktL1N0MHXnY3+LA/b3S 2N9Y6exZl8sz+aqhiq5kkeVzv/KR0dhZW1X1ifiqpaDJh7JQz1g4rmUVRRvPaPxOX4 71S+ERkgTDiFQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Fr60W2pzTz6tm5; Thu, 27 May 2021 01:02:19 +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> <874kerf0hu.fsf@posteo.net> <87y2c2ajzw.fsf@nicolasgoaziou.fr> <87v976ler8.fsf@posteo.net> <87r1htdx3x.fsf@nicolasgoaziou.fr> Date: Wed, 26 May 2021 23:02:17 +0000 In-Reply-To: <87r1htdx3x.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Wed, 26 May 2021 23:05:38 +0200") Message-ID: <87wnrlumiu.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=maciaschain@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_H4=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=1622070204; 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=KNvpf/MsJ7zDK+o2YGEhLUD/h/y12+IHf0I3JPLxKLk=; b=Co917y+nfvsdLT1bpxtyrcltrkFxs+vCssxuGsTdnIuutqFG8PUTWfjTfKfxyTkvdL8+F8 CqO7+vHyJbRYdHPgWs8XQ6vyIbUPCq1WNMwutuDPZlp4L7t6iWyNtmsnhxXJbWnU2fMyIj nQJxb3kqibaFUBz5PuiFEkKfFhByb7KSJ0HlPGi3OkaeI4u8wcTpO8n9nAvCqJJ8m07o4P tKprU0gK8av0lNc+8Ipd9eWqI65gUjNKbrAHZ642NysUnEj39S3bT9VRGqEogU2OLU2GME JHvXlL961rntJDmeaS1qDP4RfCdNfr7l6sdbqijpXZo16SihnGncuPtl3Bf2XA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622070204; a=rsa-sha256; cv=none; b=LGzNv1HEU6Q957LXTwrAQBVhXSS5FFYfwCEwEi3gi4rF4l6AZPFI1W48IydIZM+nN0Ixv1 wcGkVJ9wf33SLCGa588Zyq7GFcRxdvXGnk5Wrdw0p8VTsacNiaKOVnM/tuMqjQUIwUU1+6 v84uVqQU0xu/V6aApOd/8SPIRnVlSxqTsVxOZUgRsrujgw6lbnAmBLgkk5DTaABNTA7tsW vHJD2Kr8cUExUZ0KTWvl8n5mNqe8mwvQKOdQEjcCB+Q0bOzg8prNxBIBuxVVcysRz6vH+a MKlitt5FFtNUSoDblXXQcTVrnfp3KfQb3v//fkl3lxiHNdGdytLfcsnKDcTZOw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="gLObKPR/"; 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: -1.63 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="gLObKPR/"; 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: 0F4121668A X-Spam-Score: -1.63 X-Migadu-Scanner: scn0.migadu.com X-TUID: Ypa+/CVY4XR5 --=-=-= Content-Type: text/plain Nicolas Goaziou writes: > I cannot apply it on top of master however. On what commit did you base > it? I'm sorry, it's my fault. It's already fixed. I think the patch attached here should apply well... > [...] > I don't know if this example is a good illustration because you can > currently achieve the same with: > > #+attr_latex: :options {german} > > #+begin_foreigndisplayquote > some text in German... > #+end_foreigndisplayquote > > Are there use cases that would be better than using special blocks as in > the example above? I think I have not explained well about the rationale for this patch, sorry. The advantage (IMHO) of being able to choose between several LaTeX environments to the export of the quote blocks has more to do with the consistency between various output formats (and a single origin). Of course, quotation, quoting, foreigndisplayquote and a few more can be obtained using special blocks. But for LaTeX they are just different styles and ways to create a quote environment. At the end of the day they are all 'quote'. It's ok that Org has only one single quote block that is exported indistinctly to LaTeX, html, odt, etc. (Org tends to be format agnostic and focuses more on the logical structure of the text). But in the case of LaTeX it would be nice if the user could choose between several ways or formats to do quotes (in LaTeX), without resorting to special blocks. On the other hand, the standard LaTeX `quote' environment is already far exceeded by other more powerful options, like the csquotes package. Best regards, Juan Manuel --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-ox-latex.el-add-LaTeX-attributes-to-quote-block.patch Content-Transfer-Encoding: quoted-printable >From c2e39f5f3046d7a8e90878351b35c89656dacdfc Mon Sep 17 00:00:00 2001 From: Juan Manuel Macias Date: Wed, 26 May 2021 23:58:05 +0200 Subject: [PATCH] ox-latex.el: add LaTeX attributes to quote block * doc/org-manual.org (Quote blocks in LaTeX export): manual updated * etc/ORG-NEWS (Support quote blocks in LaTeX export): news updated * 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' --- doc/org-manual.org | 42 ++++++++++++++++++++++++++++++++++++++++++ etc/ORG-NEWS | 7 +++++++ lisp/ox-latex.el | 22 ++++++++++++++++++++-- 3 files changed, 69 insertions(+), 2 deletions(-) diff --git a/doc/org-manual.org b/doc/org-manual.org index 118d97e0e..dd51df27e 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -13919,6 +13919,48 @@ To eat the world=E2=80=99s due, by the grave and t= hee. ,#+END_VERSE #+end_src =20 +*** Quote blocks in LaTeX export +:PROPERTIES: +:DESCRIPTION: Attributes specific to quote blocks. +:END: + +#+cindex: quote blocks, in @LaTeX{} export +#+cindex: @samp{ATTR_LATEX}, keyword +#+cindex: org-latex-default-quote-environment + +The LaTeX export back-end accepts two attributes for quote blocks: +=3D:environment=3D, for an arbitrary quoting environment (the default +value is that of =3Dorg-latex-default-quote-environment=3D: =3D"quote"=3D)= and +=3D:options=3D. For example, to choose the environment =3Dquotation=3D, +included as an alternative to =3Dquote=3D in standard LaTeX classes: + +#+begin_example +,#+ATTR_LATEX: :environment quotation +,#+BEGIN_QUOTE +some text... +,#+END_QUOTE +#+end_example + +To choose the =3Dforeigndisplayquote=3D environment, included in the LaTeX +package =3Dcsquotes=3D, with the =3Dgerman=3D option, use this syntax: + +#+begin_example +,#+LATEX_HEADER:\usepackage[autostyle=3Dtrue]{csquotes} +,#+ATTR_LATEX: :environment foreigndisplayquote :options {german} +,#+BEGIN_QUOTE +some text in German... +,#+END_QUOTE +#+end_example + +#+texinfo: @noindent +which is exported to LaTeX as + +#+begin_example +\begin{foreigndisplayquote}{german} +some text in German... +\end{foreigndisplayquote} +#+end_example + ** Markdown Export :PROPERTIES: :DESCRIPTION: Exporting to Markdown. diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 8707222e0..c8a93c933 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -244,6 +244,13 @@ require the external LaTeX package =3Dverse.sty=3D, wi= ch is an extension of the standard LaTeX environment. The purpose of these attributes is explained below. =20 +*** Support quote blocks in LaTeX export + +The LaTeX export back-end accepts two attributes for quote blocks: +=3D:environment=3D, for an arbitrary quoting environment (the default +value is that of =3Dorg-latex-default-quote-environment=3D: =3D"quote"=3D)= and +=3D:options=3D. + *** =3Dorg-set-tags-command=3D selects tags from ~org-global-tags-completi= on-table~ =20 Let ~org-set-tags-command~ TAB fast tag completion interface complete diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index b9ecf070a..9e2e7be47 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-posit= ion) (:latex-default-table-environment nil nil org-latex-default-table-envi= ronment) + (:latex-default-quote-environment nil nil org-latex-default-quote-envi= ronment) (:latex-default-table-mode nil nil org-latex-default-table-mode) (:latex-diary-timestamp-format nil nil org-latex-diary-timestamp-forma= t) (:latex-footnote-defined-format nil nil org-latex-footnote-defined-for= mat) @@ -772,6 +773,13 @@ default we use here encompasses both." :package-version '(Org . "8.0") :type 'string) =20 +(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. =20 @@ -2895,9 +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))) =20 ;;;; Radio Target =20 --=20 2.31.1 --=-=-=--