From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: interaction between org-latex-custom-lang-environments and name when exporting to latex Date: Tue, 24 Nov 2015 14:14:25 +0100 Message-ID: <87vb8rbkum.fsf@gmx.us> References: <877fld3qcr.fsf@gmx.us> <8737vw1u13.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52872) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1DQY-0004rI-35 for emacs-orgmode@gnu.org; Tue, 24 Nov 2015 08:14:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1DQT-0000ni-0V for emacs-orgmode@gnu.org; Tue, 24 Nov 2015 08:14:34 -0500 Received: from mout.gmx.net ([212.227.17.20]:54886) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1DQS-0000mx-Mh for emacs-orgmode@gnu.org; Tue, 24 Nov 2015 08:14:28 -0500 In-Reply-To: (Alan Schmitt's message of "Tue, 24 Nov 2015 09:07:12 +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: alan.schmitt@polytechnique.org Cc: emacs-orgmode@gnu.org Hi, Alan Schmitt writes: >> Then the cdr of an element in org-latex-custom-lang-environments can be >> something like: >> >> \begin{%e}[label=3D%l, myfunkyoption=3Dval] >> %c >> \end{%e} > > What would "%e" be bound to? Since this is a customization for a given > source block, it should be fixed, so I think we only need "%l" and "%c". You are right on the %e of course. You should check the things we bind in the top let-binding. The useful ones should be accessible. A quick guess (you=E2=80=99ll have to decide): - lang - caption - label - float - perhaps more from attributes? >> The only downside is that you=E2=80=99d have to somehow discriminate bet= ween the >> "old" case where the cdr is a single word denoting an environment. >> Something like this might work: >> >> (string-match-p "\\`\\w+\\'" "hest1") > > This was the main reason why I did not want to go that route. This said, > after understanding this regexp, I see how I can explain how the two > cases are distinguished in the docstring. Perhaps it=E2=80=99s safer to use [[:alnum:]] or even [a-zA-Z0-9]. \w foll= ows the syntax table which might go weird, though I=E2=80=99m not sure how. >> Well, functions would be user written. In general I=E2=80=99d favor inf= o and >> src-block, but I don=E2=80=99t think it=E2=80=99s very user-friendly, as= it requires quite >> some knowledge about how ox works. Also, when using such functions, the >> user would have to write a lot of boilerplate to get e.g . the label. > > Yes. I'll give the template string a try and will report back. Thanks Alan! Rasmus --=20 Warning: Everything saved will be lost