From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: [PATCH] make options available for custom source environment in ox-latex Date: Thu, 14 Jan 2016 14:40:46 +0100 Message-ID: References: <87h9igphe9.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33998) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJi8w-00083x-AY for emacs-orgmode@gnu.org; Thu, 14 Jan 2016 08:40:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJi8t-0001a6-2G for emacs-orgmode@gnu.org; Thu, 14 Jan 2016 08:40:50 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:44293) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJi8s-0001Zn-RD for emacs-orgmode@gnu.org; Thu, 14 Jan 2016 08:40:46 -0500 In-Reply-To: <87h9igphe9.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Thu, 14 Jan 2016 11:47:10 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain On 2016-01-14 11:47, Nicolas Goaziou writes: >> Here is a small addition to the custom source environments for >> ox-latex. > > Thank you. Some comments follow. > >> + (?o . >> + ,(let ((local-options (plist-get attributes :options))) >> + (if local-options local-options "")))))))) > > Shorter: > > (?o . ,(or (plist-get attributes :options) "")) > > I think this should also be documented in > `org-latex-custom-lang-environments' docstring. > > Could you send an updated patch? Thanks a lot for these comments. Here is an updated patch. Best, Alan --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-ox-latex-Add-option-support-to-custom-environment.patch Content-Transfer-Encoding: quoted-printable From=20749ea7dc9e8d6d85c2d05a16e881b948d8c74ee9 Mon Sep 17 00:00:00 2001 From: Alan Schmitt Date: Wed, 13 Jan 2016 16:03:40 +0100 Subject: [PATCH] ox-latex: Add option support to custom environment * lisp/ox-latex.el (org-latex-src-block): make the options from attr_latex available to the custom environment using %o. =2D-- lisp/ox-latex.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index a57677b..7f889d7 100644 =2D-- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -1034,13 +1034,14 @@ exported. This format string may contain these ele= ments: %c for the caption %f for the float attribute %l for an appropriate label=20 + %o for the LaTeX attributes =20 For example, =20 (setq org-latex-custom-lang-environments '((python \"pythoncode\") (ocaml \"\\\\begin{listing} =2D\\\\begin{minted}{ocaml} +\\\\begin{minted}[%o]{ocaml} %s\\\\end{minted} \\\\caption{%c} \\\\label{%l}\"))) @@ -1056,7 +1057,7 @@ and if Org encounters an Ocaml source block during La= TeX export it will produce =20 \\begin{listing} =2D \\begin{minted}{ocaml} + \\begin{minted}[]{ocaml} \\end{minted} \\caption{} @@ -2802,7 +2803,8 @@ contextual information." `((?s . ,formatted-src) (?c . ,caption) (?f . ,float) =2D (?l . ,(org-latex--label src-block info))))))) + (?l . ,(org-latex--label src-block info)) + (?o . ,(or (plist-get attributes :options) ""))))))) ;; Case 3. Use minted package. ((eq listings 'minted) (let* ((caption-str (org-latex--caption/label-string src-block info)) =2D-=20 2.7.0 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =2D-=20 OpenPGP Key ID : 040D0A3B4ED2E5C7 Athmospheric CO=E2=82=82 (Updated January 13, 2016, Mauna Loa Obs.): 401.97= ppm --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBCgAGBQJWl6VeAAoJEAQNCjtO0uXHCQwH/0ccExuqHdxYtlIiL4JUD5cD o+XqZOi0HSioueVcG8Vg57NqmAcrYKUPmtMCZvaMUF5PFI/nlUC5iwcMMCR/PSoq OgmT18rysQQFVR1G/z+f+scVjqqsuzUqFLMPqpr4AhXgI1bj1CIpMRSv9LnBBUVe 2LUniVib8wtXcSzsT74TeXnDThZjPTdvEremIajE6WdgFo1L06uOfqZhFy3pjHHf ar8tbNHTw3J0dzeoYRXLr6ctl2CqpX9sdAEYKJ3f+YmIGTmNmb2t4hK/Teoj0exy uq8+7w5qiJ0zXj+Te2B16ar6uqsZGcroyBqDM8gOxjFCFrZ2cUi8278ZWx00bo0= =ReBv -----END PGP SIGNATURE----- --==-=-=--