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: Mon, 23 Nov 2015 18:54:00 +0100 Message-ID: <8737vw1u13.fsf@gmx.us> References: <877fld3qcr.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0vJh-0000je-Bq for emacs-orgmode@gnu.org; Mon, 23 Nov 2015 12:54:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0vJe-0004H6-Ju for emacs-orgmode@gnu.org; Mon, 23 Nov 2015 12:54:17 -0500 Received: from plane.gmane.org ([80.91.229.3]:58457) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0vJe-0004Ge-Cd for emacs-orgmode@gnu.org; Mon, 23 Nov 2015 12:54:14 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1a0vJZ-0003dh-6S for emacs-orgmode@gnu.org; Mon, 23 Nov 2015 18:54:09 +0100 Received: from 62.80.108.13 ([62.80.108.13]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 23 Nov 2015 18:54:09 +0100 Received: from rasmus by 62.80.108.13 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 23 Nov 2015 18:54:09 +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@gnu.org Hi Alan, Alan Schmitt writes: > What I propose is to have either a string or a function in > `org-latex-custom-lang-environments'. A string would be used as it is > currently, whereas a function would be applied. Here is what it could > look like: I think a format-string is fine, though I don’t oppose allowing a function as well. I don’t foresee a great necessity of the latter, though. I'd use format-spec. E.g. here’s how hyperref is filled (let ((template (plist-get info :latex-hyperref-template))) (and (stringp template) (format-spec template (org-latex--format-spec info)))) Then the cdr of an element in org-latex-custom-lang-environments can be something like: \begin{%e}[label=%l, myfunkyoption=val] %c \end{%e} The only downside is that you’d have to somehow discriminate between the "old" case where the cdr is a single word denoting an environment. Something like this might work: (string-match-p "\\`\\w+\\'" "hest1") > My main design question is what the arguments to the function should be. > I thought the formatted source code and label would work, but I'm > wondering if it may be better to simply give the `src-block' and `info' > arguments directly. Well, functions would be user written. In general I’d favor info and src-block, but I don’t think it’s 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. Rasmus -- Not everything that goes around comes back around, you know