问题
I'd like to build a column that begins with a constant, say, 1, and whose succeeding rows are double the preceding row (or some variable coefficient I set in the formula):
| 1 |
| 2 |
| 4 |
| 8 |
| 16 |
Is there a way to quickly set this up in Emacs? I see that there are row formulas, column formulas, and rectangular region formulas, but I don't see any recursion or quick formula replication in the manual.
回答1:
#+TBLFM: @1$1=1::@<<..>$1=@-1 * 2
will produce that table recursively. Put the cursor on the last row and hit C-u C-u C-c * @<<..>
is a range from second to the last row.
#+TBLFM: @1$1=0::@2$1=1::@<<<..>$1=@-1 + @-2
will produce the Fibonacci Sequence
来源:https://stackoverflow.com/questions/20063690/is-it-possible-to-use-recursive-cell-formulas-in-org-mode-tables