Re: [O] Collapse LaTeX source before start of main document?

2012-09-27 Thread Renier Marchand
Matt Lundin mdl at imapmail.org writes:

 
 Chris Malone chris.m.malone at gmail.com writes:
 
  I added your suggestion to my .emacs but upon export it removed the
  entire block, which is odd based on the source code for the
  function...
 
 Hmm... That's not my experience.
 
 When I export the following file...
 
 --8---cut here---start-8---
 * Preliminary material 
:prelim:
 
 Some preliminary material
 
 * Point one
 
 Text in point one
 
 * Point two:prelim:
 
 Text in point two.
 
 * Point three
 
 Text in point three.
 --8---cut here---end---8---
 
 The resulting html looks like this (rendered in w3m)...
 
 --8---cut here---start-8---
 Some preliminary material
 
 Table of Contents
 
   * 1 Point one
   * 2 Point three
 
 1 Point one
 
 Text in point one
 
 Text in point two.
 
 2 Point three
 
 Text in point three.
 
 Date: 2011-05-04 18:22:09 EDT
 
 Author: Matt Lundin
 
 Org version 7.5 with Emacs version 24
 
 Validate XHTML 1.0
 --8---cut here---end---8---
 
 Best,
 Matt
 
 

It seems that the reason this does not work for Chris Malone is that if the 
heading tagged with :prelim: is preceded with a heading tagged with :noexport: 
then the content of the prelim section is in effect not exported. 

For this example

--8---cut here---start-8---
* My setup :noexport:
  Some org-mode setup commands that should not be exported
* Preliminary material   :prelim:

Some preliminary material

* Point one

Text in point one

* Point two  :prelim:

Text in point two.

* Point three

Text in point three.
--8---cut here---end---8---

The following is exported

--8---cut here---start-8---
Table of Contents

1 Point one
2 Point three
1 Point one

Text in point one

Text in point two.

2 Point three

Text in point three.

Date: 2012-09-27 11:04:36 SAST

Author: Renier Marchand

Org version 7.6 with Emacs version 23

Validate XHTML 1.0
--8---cut here---end---8---

Note the absence of the text before the table of contents.

Hope this clears it up
Renier




Re: [O] Complex numbers

2011-04-15 Thread Renier Marchand
It is a cool idea yes, but I quickly learned that it also have its
problems, i.e. you cant really create nice column formulas because the
reference is not aware of the current row etc.

The biggest problem as I see it is that emacs-lisp does not support
the complex data type as lisp (natively) do. I am going to look into a
way of representing it.. maybe a two element lisp list (re im). I am
not really versed in lisp so it is a bit of a problem to modify code,
but I am looking into it.

One problem that I have encountered is that when a two element list is
referenced in the following scenario

| (1 2) | #ERROR |
#+TBLFM: $2='(sbe myfunc (data $1))

an error is caused because lisp is trying to execute this list
appearing struct, but when I do

| (1 2) |
| (2 3) |
| resul |
#+TBLFM: $1@3='(sbe myfunc (data @1$1..@2$1))

no error is reported because it is assumed to be a list of data for my
python code. i.e. it is sent as [[1,2],[2,3]] which is what I want. Is
there a way to get more consistent behavior?

Thank you.
Renier

On Wed, Apr 13, 2011 at 6:35 PM, Eric Schulte schulte.e...@gmail.com wrote:
 Renier Marchand reni...@gmail.com writes:

 I have found the following way to reference my data correctly without
 having to quote it or have data rewritten.

 I do:

       #+tblname: my-data
       | hmin |
       |--|
       |      |
       | 0.05 |
       |  0.2 |
       |  0.2 |
       #+TBLFM: @5$1='(sbe myfunc (data my-data[3:4,0]))

 This also works for complex data as you suggested.


 Very cool, I would never have thought to use a reference within a table
 formula.


 But is there a way to refer in the formula to the current table
 instead of a specific table? Because this would obviously not work for
 multiple tables with the same name. (i.e. copy and paste for another
 dataset)


 No, there is no support for that sort of usage, and adding such a
 position dependent reference would be a fairly large change from the
 existing reference resolution mechanisms.

 Best -- Eric


 Regards,

 Renier

 On Wed, Apr 13, 2011 at 5:52 AM, Eric Schulte schulte.e...@gmail.com wrote:
 Hi Renier,

 The Org-mode table machinery is interpreting the values of your table
 cells as emacs lisp (given that the table formula is an elisp, rather
 than a calc formula).  Due to the , the result is a weird nested list
 which confuses your python code block.  Some options here include...

 1. wrapping these cells in quotes so that they are passed to the python
   block as strings...

   #+source: parameter-variation(data=0)
   #+begin_src python :result values
     return 'text'
   #+end_src

   |---|
   | (0.0331901438056,0.000535222885197) |
   | (0.0333434157791,0.000537930174356) |
   | (0.0345727512157,0.000559346040457) |
   | (0.0353146483908,0.000571501584524) |
   | (0.0355522909393,0.000574387067408) |
   | (0.0356575682336,0.000574851263615) |
   | (0.0357806926897,0.000575051685084) |
   |---|
   | text                                  |
   #+TBLFM: @8$1='(sbe parameter-variation (nums @1$1..@7$1))

 2. referencing the table from an external code block, rather than inside
   of a table formula.  This is probably the easier solution, but it
   doesn't insert the result into your table, unless you do something
   tricky like give the code block and the table the same name so that
   the results of the code block replace the table...

   #+results: complex-data
   |-|
   | (0.0331901438056,0.000535222885197) |
   | (0.0333434157791,0.000537930174356) |
   | (0.0345727512157,0.000559346040457) |
   | (0.0353146483908,0.000571501584524) |
   | (0.0355522909393,0.000574387067408) |
   | (0.0356575682336,0.000574851263615) |
   | (0.0357806926897,0.000575051685084) |
   #+TBLFM: @8$1='(sbe parameter-variation (nums @1$1..@7$1))

   #+begin_src python :var data=complex-data
     return data
   #+end_src

 Hope this helps -- Eric

 Renier Marchand reni...@gmail.com writes:

 Hi.

 I have been playing around with complex data that has been returned
 from Python. This is obviously not in calc.el format but if I change
 them to the correct format I can manipulate them using calc.

 but

 When I want to pass the complex numbers (python format) to python I
 get an error. If I pass real number everything works as expected

 For example:

       #+source: parameter-variation(data=0)
       #+begin_src python :result values
         return 'text'
       #+end_src


   |   |  hmin |                         |
   |---+---+-|
   |   |   |     |
   |   |  0.05 | (0.0331901438056,0.000535222885197) |
   |   |   0.1 | (0.0333434157791,0.000537930174356) |
   |   |   0.3 | (0.0345727512157,0.000559346040457) |
   |   |   0.6 | (0.0353146483908,0.000571501584524) |
   |   |   0.9 | (0.0355522909393,0.000574387067408

Re: [O] Complex numbers

2011-04-13 Thread Renier Marchand
Hi Eric

Thank you, that clarifies it quite a bit. Forgot about the lispyness
of the numbers in brackets.

Renier

On Wed, Apr 13, 2011 at 5:52 AM, Eric Schulte schulte.e...@gmail.com wrote:
 Hi Renier,

 The Org-mode table machinery is interpreting the values of your table
 cells as emacs lisp (given that the table formula is an elisp, rather
 than a calc formula).  Due to the , the result is a weird nested list
 which confuses your python code block.  Some options here include...

 1. wrapping these cells in quotes so that they are passed to the python
   block as strings...

   #+source: parameter-variation(data=0)
   #+begin_src python :result values
     return 'text'
   #+end_src

   |---|
   | (0.0331901438056,0.000535222885197) |
   | (0.0333434157791,0.000537930174356) |
   | (0.0345727512157,0.000559346040457) |
   | (0.0353146483908,0.000571501584524) |
   | (0.0355522909393,0.000574387067408) |
   | (0.0356575682336,0.000574851263615) |
   | (0.0357806926897,0.000575051685084) |
   |---|
   | text                                  |
   #+TBLFM: @8$1='(sbe parameter-variation (nums @1$1..@7$1))

 2. referencing the table from an external code block, rather than inside
   of a table formula.  This is probably the easier solution, but it
   doesn't insert the result into your table, unless you do something
   tricky like give the code block and the table the same name so that
   the results of the code block replace the table...

   #+results: complex-data
   |-|
   | (0.0331901438056,0.000535222885197) |
   | (0.0333434157791,0.000537930174356) |
   | (0.0345727512157,0.000559346040457) |
   | (0.0353146483908,0.000571501584524) |
   | (0.0355522909393,0.000574387067408) |
   | (0.0356575682336,0.000574851263615) |
   | (0.0357806926897,0.000575051685084) |
   #+TBLFM: @8$1='(sbe parameter-variation (nums @1$1..@7$1))

   #+begin_src python :var data=complex-data
     return data
   #+end_src

 Hope this helps -- Eric

 Renier Marchand reni...@gmail.com writes:

 Hi.

 I have been playing around with complex data that has been returned
 from Python. This is obviously not in calc.el format but if I change
 them to the correct format I can manipulate them using calc.

 but

 When I want to pass the complex numbers (python format) to python I
 get an error. If I pass real number everything works as expected

 For example:

       #+source: parameter-variation(data=0)
       #+begin_src python :result values
         return 'text'
       #+end_src


   |   |  hmin |                         |
   |---+---+-|
   |   |   |     |
   |   |  0.05 | (0.0331901438056,0.000535222885197) |
   |   |   0.1 | (0.0333434157791,0.000537930174356) |
   |   |   0.3 | (0.0345727512157,0.000559346040457) |
   |   |   0.6 | (0.0353146483908,0.000571501584524) |
   |   |   0.9 | (0.0355522909393,0.000574387067408) |
   |   |   1.2 | (0.0356575682336,0.000574851263615) |
   |   |  10.0 | (0.0357806926897,0.000575051685084) |
   | $ | x=0.1 | y=0.1   |
   |   |  text |         |
   #+TBLFM: @11$2='(sbe parameter-variation (data
 @3$2..@9$2))::@11$3='(sbe parameter-variation (data @3$3..@9$3))

 i.e. I get the word 'text' returned for column 2 where there are real
 numbers but I don't get anything returned where there are complex
 numbers. As you can see, there are no actual calculation performed on
 the data I am just returning 'text' so I am expecting it to work in
 both instances.

 The debug sessions show the following for the real column:

 Substitution history of formula
 Orig:   '(sbe parameter-variation (data @3$2..@9$2))
 $xyz-  '(sbe parameter-variation (data @3$2..@9$2))
 @r$c-  '(sbe parameter-variation (data #(0.05 0 4 (fontified t
 face org-table)) #(0.1 0 3 (fontified t face org-table)) #(0.3 0 3
 (fontified t face org-table)) #(0.6 0 3 (fontified t face
 org-table)) #(0.9 0 3 (fontified t face org-table)) #(1.2 0 3
 (fontified t face org-table)) #(10.0 0 4 (fontified t face
 org-table
 $1-    '(sbe parameter-variation (data #(0.05 0 4 (fontified t
 face org-table)) #(0.1 0 3 (fontified t face org-table)) #(0.3 0 3
 (fontified t face org-table)) #(0.6 0 3 (fontified t face
 org-table)) #(0.9 0 3 (fontified t face org-table)) #(1.2 0 3
 (fontified t face org-table)) #(10.0 0 4 (fontified t face
 org-table
 Result: text
 Format: NONE
 Final:  text

 and for the complex column:

 Substitution history of formula
 Orig:   '(sbe parameter-variation (data @3$3..@9$3))
 $xyz-  '(sbe parameter-variation (data @3$3..@9$3))
 @r$c-  '(sbe parameter-variation (data
 #((0.0331901438056,0.000535222885197) 0 35 (fontified t face
 org-table)) #((0.0333434157791,0.000537930174356) 0 35 (fontified t
 face org-table

Re: [O] Complex numbers

2011-04-13 Thread Renier Marchand
I have found the following way to reference my data correctly without
having to quote it or have data rewritten.

I do:

  #+tblname: my-data
  | hmin |
  |--|
  |  |
  | 0.05 |
  |  0.2 |
  |  0.2 |
  #+TBLFM: @5$1='(sbe myfunc (data my-data[3:4,0]))

This also works for complex data as you suggested.

But is there a way to refer in the formula to the current table
instead of a specific table? Because this would obviously not work for
multiple tables with the same name. (i.e. copy and paste for another
dataset)

Regards,

Renier

On Wed, Apr 13, 2011 at 5:52 AM, Eric Schulte schulte.e...@gmail.com wrote:
 Hi Renier,

 The Org-mode table machinery is interpreting the values of your table
 cells as emacs lisp (given that the table formula is an elisp, rather
 than a calc formula).  Due to the , the result is a weird nested list
 which confuses your python code block.  Some options here include...

 1. wrapping these cells in quotes so that they are passed to the python
   block as strings...

   #+source: parameter-variation(data=0)
   #+begin_src python :result values
     return 'text'
   #+end_src

   |---|
   | (0.0331901438056,0.000535222885197) |
   | (0.0333434157791,0.000537930174356) |
   | (0.0345727512157,0.000559346040457) |
   | (0.0353146483908,0.000571501584524) |
   | (0.0355522909393,0.000574387067408) |
   | (0.0356575682336,0.000574851263615) |
   | (0.0357806926897,0.000575051685084) |
   |---|
   | text                                  |
   #+TBLFM: @8$1='(sbe parameter-variation (nums @1$1..@7$1))

 2. referencing the table from an external code block, rather than inside
   of a table formula.  This is probably the easier solution, but it
   doesn't insert the result into your table, unless you do something
   tricky like give the code block and the table the same name so that
   the results of the code block replace the table...

   #+results: complex-data
   |-|
   | (0.0331901438056,0.000535222885197) |
   | (0.0333434157791,0.000537930174356) |
   | (0.0345727512157,0.000559346040457) |
   | (0.0353146483908,0.000571501584524) |
   | (0.0355522909393,0.000574387067408) |
   | (0.0356575682336,0.000574851263615) |
   | (0.0357806926897,0.000575051685084) |
   #+TBLFM: @8$1='(sbe parameter-variation (nums @1$1..@7$1))

   #+begin_src python :var data=complex-data
     return data
   #+end_src

 Hope this helps -- Eric

 Renier Marchand reni...@gmail.com writes:

 Hi.

 I have been playing around with complex data that has been returned
 from Python. This is obviously not in calc.el format but if I change
 them to the correct format I can manipulate them using calc.

 but

 When I want to pass the complex numbers (python format) to python I
 get an error. If I pass real number everything works as expected

 For example:

       #+source: parameter-variation(data=0)
       #+begin_src python :result values
         return 'text'
       #+end_src


   |   |  hmin |                         |
   |---+---+-|
   |   |   |     |
   |   |  0.05 | (0.0331901438056,0.000535222885197) |
   |   |   0.1 | (0.0333434157791,0.000537930174356) |
   |   |   0.3 | (0.0345727512157,0.000559346040457) |
   |   |   0.6 | (0.0353146483908,0.000571501584524) |
   |   |   0.9 | (0.0355522909393,0.000574387067408) |
   |   |   1.2 | (0.0356575682336,0.000574851263615) |
   |   |  10.0 | (0.0357806926897,0.000575051685084) |
   | $ | x=0.1 | y=0.1   |
   |   |  text |         |
   #+TBLFM: @11$2='(sbe parameter-variation (data
 @3$2..@9$2))::@11$3='(sbe parameter-variation (data @3$3..@9$3))

 i.e. I get the word 'text' returned for column 2 where there are real
 numbers but I don't get anything returned where there are complex
 numbers. As you can see, there are no actual calculation performed on
 the data I am just returning 'text' so I am expecting it to work in
 both instances.

 The debug sessions show the following for the real column:

 Substitution history of formula
 Orig:   '(sbe parameter-variation (data @3$2..@9$2))
 $xyz-  '(sbe parameter-variation (data @3$2..@9$2))
 @r$c-  '(sbe parameter-variation (data #(0.05 0 4 (fontified t
 face org-table)) #(0.1 0 3 (fontified t face org-table)) #(0.3 0 3
 (fontified t face org-table)) #(0.6 0 3 (fontified t face
 org-table)) #(0.9 0 3 (fontified t face org-table)) #(1.2 0 3
 (fontified t face org-table)) #(10.0 0 4 (fontified t face
 org-table
 $1-    '(sbe parameter-variation (data #(0.05 0 4 (fontified t
 face org-table)) #(0.1 0 3 (fontified t face org-table)) #(0.3 0 3
 (fontified t face org-table)) #(0.6 0 3 (fontified t face
 org-table)) #(0.9 0 3 (fontified t face org-table)) #(1.2 0 3
 (fontified t face