Re: [O] feature request: exporting TBLFM line, formatted or not
On Tuesday, 12 Apr 2016 at 20:15, Nicolas Goaziou wrote: > You can write a custom back-end. All the TBLFM information is stored in > the table element. Thanks for the suggestion. I will explore this option. -- : Eric S Fraga (0xFFFCF67D), Emacs 25.0.92.1, Org release_8.3.4-705-g716e33
Re: [O] feature request: exporting TBLFM line, formatted or not
Hello, Eric S Fragawrites: > For pedagogical reasons, it would be nice to be able, in some case, to > export a table (to LaTeX typically) with annotations (i.e. column and > row labels) and, more importantly, the equations used to populate the > table. Is this possible somehow? > > Obviously, for the row/column labelling, I could simply add an extra > column and row with those labels... > > For the TBLFM aspect, thinking aloud but with no real knowledge, would > it be possible to create a filter, say, that maybe copies and transforms > a TBLFM line before being thrown away by the export engine? You can write a custom back-end. All the TBLFM information is stored in the table element. Regards, -- Nicolas Goaziou
Re: [O] feature request: exporting TBLFM line, formatted or not
Okay, a start on this using hooks: #+begin_src emacs-lisp (defun esf/process-table-tblfm (backend) "Process the TBLFM line to make it available for export as a verbatim block" (while (re-search-forward "^ *#\\+TBLFM:" (point-max) t) (replace-match ":") (let ((start (point)) (end (progn (forward-line) (point (goto-char start) (while (re-search-forward "::" end t) (replace-match "\n: "))) ) ) (add-hook 'org-export-before-parsing-hook 'esf/process-table-tblfm) #+end_src I'm sure there's a much easier way to do this but, for now, this does what I need. thanks, eric -- : Eric S Fraga (0xFFFCF67D), Emacs 25.0.92.1, Org release_8.3.4-705-g716e33
Re: [O] feature request: exporting TBLFM line, formatted or not
On Monday, 11 Apr 2016 at 13:22, Nick Dokos wrote: > Bastien's table formulas tutorial does it this way: > > * Column formulas and field formulas > > Ok, so now we have this table: > > : | Student | Maths | Physics | Mean | > : |--+---+-+--| > : | Bertrand |13 | 09 | 11 | > : | Henri|15 | 14 | | > : | Arnold |17 | 13 | | > : #+TBLFM: @2$4=vmean($2..$3) > > Will that work for you? It would but what I would really like is to have an option I can turn on to enable me to process the TBLFM line for output but have the table appear as normal. I don't want to have the table in verbatim. What I was thinking of is to have essentially a caption below the table that presents the equations used. -- : Eric S Fraga (0xFFFCF67D), Emacs 25.0.92.1, Org release_8.3.4-705-g716e33
Re: [O] feature request: exporting TBLFM line, formatted or not
Eric S Fragawrites: > Hello, > > For pedagogical reasons, it would be nice to be able, in some case, to > export a table (to LaTeX typically) with annotations (i.e. column and > row labels) and, more importantly, the equations used to populate the > table. Is this possible somehow? > > Obviously, for the row/column labelling, I could simply add an extra > column and row with those labels... > > For the TBLFM aspect, thinking aloud but with no real knowledge, would > it be possible to create a filter, say, that maybe copies and transforms > a TBLFM line before being thrown away by the export engine? > > Any suggestions welcome. > Bastien's table formulas tutorial does it this way: --8<---cut here---start->8--- * Column formulas and field formulas Ok, so now we have this table: : | Student | Maths | Physics | Mean | : |--+---+-+--| : | Bertrand |13 | 09 | 11 | : | Henri|15 | 14 | | : | Arnold |17 | 13 | | : #+TBLFM: @2$4=vmean($2..$3) --8<---cut here---end--->8--- Will that work for you? -- Nick