From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id EJlFGwGZq2BqPgEAgWs5BA (envelope-from ) for ; Mon, 24 May 2021 14:16:01 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id iDwBFwGZq2BmQgAA1q6Kng (envelope-from ) for ; Mon, 24 May 2021 12:16:01 +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 BD6601BB84 for ; Mon, 24 May 2021 14:16:00 +0200 (CEST) Received: from localhost ([::1]:41484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ll9V1-0001y1-0Z for larch@yhetil.org; Mon, 24 May 2021 08:15:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ll9Tn-0001uy-87 for emacs-orgmode@gnu.org; Mon, 24 May 2021 08:14:43 -0400 Received: from mout01.posteo.de ([185.67.36.65]:50107) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ll9Tj-0003EZ-JI for emacs-orgmode@gnu.org; Mon, 24 May 2021 08:14:43 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 3C03A240028 for ; Mon, 24 May 2021 14:14:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1621858475; bh=y6tBRye9lzWx+KDZweI/WsnshfcYNRlXw9ZZKlTo/1E=; h=From:To:Subject:Date:From; b=iNivlCXLJc38ymSxqHzT2r3/dA4NhRdBOrLJjdy4Ik/h/40lLfvOoAIgBjvZRZVSV vXHsmumMtBr4aznadTDMRf8lGfXPcSYvdH0+gpyqEy0YEP/BGOChKxL8OFAGvq43O6 J7XtIWbFPo7vGpSuou6SyIzhsYOKYWFoyaWbBckumA4MEH/XP7ts08Bi6ZZe9C41L6 H1/kmejm5aV7CNFgonfRZoORyekhHlBAHXZIdxKaPrZLaLgY9W69VzvWMr3copldZ/ 4dMYWN1n6bRZ4XWBix2e7Wzwr1sKMbN0z4WjzZIzjyzC/fna0kiIjExjCC5rMz6K8r Ves7+1xDKF9Cw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Fpbk25Ls9z6tmB for ; Mon, 24 May 2021 14:14:34 +0200 (CEST) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: orgmode Subject: [PATCH] ox-latex.el: add LaTeX attributes to quote block Date: Mon, 24 May 2021 12:14:33 +0000 Message-ID: <87h7is49cm.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: , 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=1621858560; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=s73CYea6qb6tKpS0cVfkduFJxJDxSMttvDis/T4t5Ss=; b=VVlIONl3g8H4TgGEibeQ0wJXGldy7bYvtm8vNz7I/NlabokAorpuMmV/nTYE+n9K5t0gT8 iUYz+Q6kyXQSBy/sjOeDN0HBwYZqFtLzGRcr6yFbPtOGy9taCm300zvIDDaxye25BZjmHH oAF4apJdK3nQf/7N/6WDxF9W02Qd8TDfnHZuz6550rwtqF4rF2ugTtaKxG9er12aPVvep8 uC6pfQws38+jtEVgNxLrkG3fXuBC4Hm710vYzRpDNQRM7QSZDOK0durCRXUIh8dFNIuQAm aO5uyp3isEqFoHzBlM+RI+4VpPUHhn1PE2ffyMrEaJZCY7uc2u25JSSybRHl8g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621858560; a=rsa-sha256; cv=none; b=mKWvop/TiZL9QrNyqy5cphXpZ4zLUj0O4gFx2phRLbd1mcNaPOBkHob3cBQH+pK2iQsg5I DNgsFOKwXvnqGhnssW5l1oN8swFZQyDy61u7u4PNgpgr8wk6c9qdnA6OK5cVY5icQhrCYy PxLfcwrjlYjVK7Xz9EKkgYxhdzOtrVEPn7qF14ZclsF14XwvW2+CHbBaqO7Ttrm8r8ywCB Fw7tKCfXhUWEcVfu9R3fPwJJtNpZyg7TNwyxgq2gB8SIhjli4OoUek8ekOFg0UknOLH32g ye1dh3zi1uF18FCI+5wfOI94I1M7mwRVpa3iHzVI33K78Xf+l3sJWStddX/LEQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=iNivlCXL; 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-Spam-Score: -1.13 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=iNivlCXL; 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: BD6601BB84 X-Spam-Score: -1.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: MxzHJJQTrwkl --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi all, The `quote' block is exported to LaTeX as a `quote' environment. However, standard LaTeX classes have two environments for quotes: `quote' and `quotation', with certain format differences: it is often said that `quotation' is intended for longer quotes with several paragraphs and applies a first line indent to each paragraph. In addition there are several very popular packages that offer more environments and features for quoting, for example `quoting' or `csquotes', which includes a set of quote environments and very powerful options. Even some languages as Spanish option for Babel have their own quoting environment. Given all this variety, I think it would be nice to offer the user at least a couple of LaTeX attributes to choose: `:environment' (by default the environment would remain `quote') and `:options'. I attach a possible patch for it (if the patch sounds good, I can add the documentation for the new features). An example with a quote in German: #+LaTeX_Header:\usepackage[german,english]{babel} #+LaTeX_Header:\usepackage{quoting} #+LaTeX_Header:\usepackage[babel=3Dtrue,autostyle=3Dtrue,german=3Dquotes]{c= squotes} #+LaTeX_Header:\SetBlockEnvironment{quoting} #+ATTR_LaTeX: :environment foreigndisplayquote :options {german} #+begin_quote Eine Erkl=C3=A4rung, wie sie einer Schrift in einer Vorrede nach der Gewohnheit vorausgeschickt wird ---=C3=BCber den Zweck, den der Verfasser sich in ihr vorgesetzt, sowie =C3=BCber die Veranlassungen und das Verh=C3=A4ltnis, worin er sie zu andern fr=C3=BChern oder gleichzeitigen Behandlungen desselben Gegenstandes zu stehen glaubt--- scheint bei einer philosophischen Schrift nicht nur =C3=BCberfl=C3=BCssig, sondern um d= er Natur der Sache willen sogar unpassend und zweckwidrig zu sein (Hegel). #+end_quote Best regards, Juan Manuel --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-ox-latex.el-add-LaTeX-attributes-to-quote-block.patch >From 1164c3066f0ea7e639382b01c5da2d7b5b46efb8 Mon Sep 17 00:00:00 2001 From: Juan Manuel Macias Date: Mon, 24 May 2021 13:19:01 +0200 Subject: [PATCH] ox-latex.el: add LaTeX attributes to quote block * lisp/ox-latex.el: 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 | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index b9ecf070a..3704267c9 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' environment." + :group 'org-export-latex + :version "24.4" + :package-version '(Org . "8.0") + :type 'string) + (defcustom org-latex-default-table-mode 'table "Default mode for tables. @@ -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 :environment)) + (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 ""))) (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}" + current-env + current-opt + contents + current-env) + info))) ;;;; Radio Target -- 2.26.0 --=-=-=--