Hi, Alan Schmitt <alan.schm...@polytechnique.org> writes:
>> 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} > > 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’ll have to decide): - lang - caption - label - float - perhaps more from attributes? >> 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") > > 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’s safer to use [[:alnum:]] or even [a-zA-Z0-9]. \w follows the syntax table which might go weird, though I’m not sure how. >> 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. > > Yes. I'll give the template string a try and will report back. Thanks Alan! Rasmus -- Warning: Everything saved will be lost