Hi Fabrice, 2013ko maiatzak 7an, Fabrice Popineau-ek idatzi zuen: > > Currently we need to write this : > > #+ATTR_LATEX: :options [title of definition] > #+begin_definition > This is a definition. > #+end_definition > > to get this with the LaTeX exporter : > > \begin{definition}[title of definition] > This is a definition. > \end{definition} > > I was wondering if something like this is possible : > > #+begin_definition :options [title of definition] > This is a definition. > #+end_definition > > Generally speaking, the rest of the line with #+begin_... could be > considered as an implicit #+ATTR_HTML for this environment.
I don’t think you want to do that – each backend (latex, html, etc.) could have its own incompatible keywords. In this case, :options for latex and :options for html (and ascii, etc.) will have different syntax. (html, ascii, etc. export don’t handle :options at the moment, but you can imagine how they might want to do so, which would certainly not share latex’s syntax.) The present #+attr_X convention keeps these separate. (I’ve got a solution to this that I’ve been using for the past several weeks, but it involves several interlocking pieces and is too messy to be shared still. In brief, it comprises extending the parser to handle :keywords on a #+begin_foo line, and extending the exporter backends to allow different types of block (definition, quote, etc.) to be formatted using that information. I’m busy with exams at the moment, but in a week or so I hope to have some free time to work on it, among other org-related projects.) -- Aaron Ecay