From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Variable table length Date: Mon, 03 Jun 2013 15:15:14 -0400 Message-ID: <87k3mbqa4d.fsf@pierrot.dokosmarshall.org> References: <20130603145428.6180b013@aga-netbook> <20130603200701.36812e5a@aga-netbook> 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]:46907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjaOi-0002iD-Nc for emacs-orgmode@gnu.org; Mon, 03 Jun 2013 15:26:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UjaOh-0002sl-PA for emacs-orgmode@gnu.org; Mon, 03 Jun 2013 15:26:28 -0400 Received: from plane.gmane.org ([80.91.229.3]:55698) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjaE9-0006MC-Bi for emacs-orgmode@gnu.org; Mon, 03 Jun 2013 15:15:33 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UjaE7-0005C4-7u for emacs-orgmode@gnu.org; Mon, 03 Jun 2013 21:15:31 +0200 Received: from pool-108-7-96-134.bstnma.fios.verizon.net ([108.7.96.134]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 03 Jun 2013 21:15:31 +0200 Received: from ndokos by pool-108-7-96-134.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 03 Jun 2013 21:15:31 +0200 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 Marcin Borkowski writes: > Dnia 2013-06-03, o godz. 16:32:20 > Michael Brand napisaƂ(a): > >> Hi Marcin >> >> On Mon, Jun 3, 2013 at 3:38 PM, Michael Brand >> wrote: >> > I would use one row per payback and manually add/remove rows until >> > the last row is the only one with a different sign for the floating >> > loan. >> >> Forgot to mention that if you don't need all the intermediate steps >> per payback rate then you can of course simply use the annuity >> functions from Emacs Calc: >> (info "(calc) Related Financial Functions") >> or >> http://www.gnu.org/software/emacs/manual/html_node/calc/Related-Financial-Functions.html > > Thanks, I am aware of that - but what I want is actually a table (I'm > teaching an introductory course in financial mathematics). > Use babel perhaps? Not sure what your inputs are and what your table should look like but you could use something like this to produce a skeleton table of the right length and a set of column formulas (nb: fake ones used below), then C-C C-c on the #+tblfm: line to calculate the rest of the table: --8<---------------cut here---------------start------------->8--- #+begin_src sh :results raw :var n=20 echo "#+name: amorttable" echo "|month | interest | principal | balance |" for i in $(seq 1 $n) do echo "| $i ||||" done echo '#+tblfm: $2 = 2 * $1 :: $3 = 3 * $1 :: $4 = 4 * $1' #+end_src --8<---------------cut here---------------end--------------->8--- -- Nick