emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [new exporter] Captions for tables made by source blocks
@ 2013-03-06  9:55 Vikas Rawal
  2013-03-06 10:05 ` Nicolas Goaziou
  0 siblings, 1 reply; 20+ messages in thread
From: Vikas Rawal @ 2013-03-06  9:55 UTC (permalink / raw)
  To: emacs-orgmode

There has been some change in the behaviour of #+CAPTION in case of
tables made by source blocks. In the old exporter, #+CAPTION just
before #+BEGIN_SRC was sufficient to place the caption before the
table when the file was exported.

The new exporter does not produce captions the same way.

When I looked through the list archives, I found some discussion (
http://list-archives.org/2012/08/20/emacs-orgmode-gnu-org/o-new-exporter-and-latex-attributes/f/2837855005,
and http://www.mail-archive.com/emacs-orgmode@gnu.org/msg57188.html )

It is, however, not clear if the problem was finally resolved and what
is the recommended practice. Could somebody explain?

Vikas

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [new exporter] Captions for tables made by source blocks
  2013-03-06  9:55 [new exporter] Captions for tables made by source blocks Vikas Rawal
@ 2013-03-06 10:05 ` Nicolas Goaziou
  2013-03-06 10:54   ` Vikas Rawal
  0 siblings, 1 reply; 20+ messages in thread
From: Nicolas Goaziou @ 2013-03-06 10:05 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Vikas Rawal <vikaslists@agrarianresearch.org> writes:

> There has been some change in the behaviour of #+CAPTION in case of
> tables made by source blocks. In the old exporter, #+CAPTION just
> before #+BEGIN_SRC was sufficient to place the caption before the
> table when the file was exported.
>
> The new exporter does not produce captions the same way.
>
> When I looked through the list archives, I found some discussion (
> http://list-archives.org/2012/08/20/emacs-orgmode-gnu-org/o-new-exporter-and-latex-attributes/f/2837855005,
> and http://www.mail-archive.com/emacs-orgmode@gnu.org/msg57188.html )
>
> It is, however, not clear if the problem was finally resolved and what
> is the recommended practice. Could somebody explain?

CAPTION keyword above a source block applies to the source block only.
If the source block generates a table, you have to put a CAPTION above
it, as it will not inherit the caption of the source block.

It also implies that you need to name the results. Otherwise, source
block will not recognize its own production, due to the CAPTION keyword
above it.

HTH,


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [new exporter] Captions for tables made by source blocks
  2013-03-06 10:05 ` Nicolas Goaziou
@ 2013-03-06 10:54   ` Vikas Rawal
  2013-03-06 12:28     ` Nicolas Goaziou
  0 siblings, 1 reply; 20+ messages in thread
From: Vikas Rawal @ 2013-03-06 10:54 UTC (permalink / raw)
  To: emacs-orgmode


> CAPTION keyword above a source block applies to the source block only.
> If the source block generates a table, you have to put a CAPTION above
> it, as it will not inherit the caption of the source block.
> 
> It also implies that you need to name the results. Otherwise, source
> block will not recognize its own production, due to the CAPTION keyword
> above it.
> 

Thank you once again Nicolas. 

I understand from this that the variable org-babel-results-keyword has
to be changed to NAME. I did this and it works.

Is there a way that this could be file-specific?

Vikas

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [new exporter] Captions for tables made by source blocks
  2013-03-06 10:54   ` Vikas Rawal
@ 2013-03-06 12:28     ` Nicolas Goaziou
  2013-03-06 23:46       ` Vikas Rawal
  2013-03-07  1:52       ` Mike McLean
  0 siblings, 2 replies; 20+ messages in thread
From: Nicolas Goaziou @ 2013-03-06 12:28 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Eric Schulte

Vikas Rawal <vikaslists@agrarianresearch.org> writes:

>> CAPTION keyword above a source block applies to the source block only.
>> If the source block generates a table, you have to put a CAPTION above
>> it, as it will not inherit the caption of the source block.
>> 
>> It also implies that you need to name the results. Otherwise, source
>> block will not recognize its own production, due to the CAPTION keyword
>> above it.
>> 
>
> Thank you once again Nicolas. 
>
> I understand from this that the variable org-babel-results-keyword has
> to be changed to NAME. I did this and it works.
>
> Is there a way that this could be file-specific?

I wasn't clear. By "naming the results", I mean that you must provide
your source block a "#+NAME: something" attribute, so the generated
table gets a "#+RESULTS: something" attribute.

BTW, you mustn't change `org-babel-results-keyword'. I don't even know
why this is a defcustom and why it is allowed to turn it into "NAME".
RESULTS refers to the name of the src-block which produced the current
element, whereas NAME refers to the name of the current element. Their
purpose is completely different.

Cc'ing Eric Schulte about it.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [new exporter] Captions for tables made by source blocks
  2013-03-06 12:28     ` Nicolas Goaziou
@ 2013-03-06 23:46       ` Vikas Rawal
  2013-03-07  0:03         ` Andreas Leha
  2013-03-07  1:52       ` Mike McLean
  1 sibling, 1 reply; 20+ messages in thread
From: Vikas Rawal @ 2013-03-06 23:46 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode, Eric Schulte

> 
> I wasn't clear. By "naming the results", I mean that you must provide
> your source block a "#+NAME: something" attribute, so the generated
> table gets a "#+RESULTS: something" attribute.

Got it. Thanks.
 
> BTW, you mustn't change `org-babel-results-keyword'. I don't even know
> why this is a defcustom and why it is allowed to turn it into "NAME".
> RESULTS refers to the name of the src-block which produced the current
> element, whereas NAME refers to the name of the current element. Their
> purpose is completely different.

Have changed `org-babel-results-keyword' back to RESULTS. The captions
are working fine. Thank you.
 
> Cc'ing Eric Schulte about it.

Let us hear from Eric what is the purpose of this variable, and if it
has some use.

Best,

Vikas
 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [new exporter] Captions for tables made by source blocks
  2013-03-06 23:46       ` Vikas Rawal
@ 2013-03-07  0:03         ` Andreas Leha
  0 siblings, 0 replies; 20+ messages in thread
From: Andreas Leha @ 2013-03-07  0:03 UTC (permalink / raw)
  To: emacs-orgmode

Vikas Rawal <vikaslists@agrarianresearch.org> writes:

>> 
>> I wasn't clear. By "naming the results", I mean that you must provide
>> your source block a "#+NAME: something" attribute, so the generated
>> table gets a "#+RESULTS: something" attribute.
>
> Got it. Thanks.
>  
>> BTW, you mustn't change `org-babel-results-keyword'. I don't even know
>> why this is a defcustom and why it is allowed to turn it into "NAME".
>> RESULTS refers to the name of the src-block which produced the current
>> element, whereas NAME refers to the name of the current element. Their
>> purpose is completely different.
>
> Have changed `org-babel-results-keyword' back to RESULTS. The captions
> are working fine. Thank you.
>  
>> Cc'ing Eric Schulte about it.
>
> Let us hear from Eric what is the purpose of this variable, and if it
> has some use.

IIRC, that was introduced to allow users to choose #+results or
#+Results.

Regards,
Andreas

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [new exporter] Captions for tables made by source blocks
  2013-03-06 12:28     ` Nicolas Goaziou
  2013-03-06 23:46       ` Vikas Rawal
@ 2013-03-07  1:52       ` Mike McLean
  2013-03-07  8:20         ` Nicolas Goaziou
  1 sibling, 1 reply; 20+ messages in thread
From: Mike McLean @ 2013-03-07  1:52 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode, Eric Schulte

[-- Attachment #1: Type: text/plain, Size: 1417 bytes --]

On Wed, Mar 6, 2013 at 7:28 AM, Nicolas Goaziou <n.goaziou@gmail.com> wrote:

> Vikas Rawal <vikaslists@agrarianresearch.org> writes:
>
> >> CAPTION keyword above a source block applies to the source block only.
> >> If the source block generates a table, you have to put a CAPTION above
> >> it, as it will not inherit the caption of the source block.
> >>
> >> It also implies that you need to name the results. Otherwise, source
> >> block will not recognize its own production, due to the CAPTION keyword
> >> above it.
> >>
> >
> > Thank you once again Nicolas.
> >
> > I understand from this that the variable org-babel-results-keyword has
> > to be changed to NAME. I did this and it works.
> >
> > Is there a way that this could be file-specific?
>
> I wasn't clear. By "naming the results", I mean that you must provide
> your source block a "#+NAME: something" attribute, so the generated
> table gets a "#+RESULTS: something" attribute.
>

Interesting that this topic comes up today just as I noticed it. I'm still
unclear about how to put the CAPTION keyword in when using a dynamic block
via org-collector.el.

I have the lines below and I do not get a table caption like I used to in
the old exporter.

#+NAME: tbl-coi
#+CAPTION: COI Table
#+BEGIN: propview :colnames ( "Area" "Shorthand" "COI" ) :cols ( AREA
CATEGORY ITEM ) :match "+COI+LEVEL=2-ARCHIVE" :noquote t :scope agenda
:inherit (AREA)

Mike

[-- Attachment #2: Type: text/html, Size: 2109 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [new exporter] Captions for tables made by source blocks
  2013-03-07  1:52       ` Mike McLean
@ 2013-03-07  8:20         ` Nicolas Goaziou
  2013-03-07 12:27           ` Vikas Rawal
  2013-03-07 16:44           ` Achim Gratz
  0 siblings, 2 replies; 20+ messages in thread
From: Nicolas Goaziou @ 2013-03-07  8:20 UTC (permalink / raw)
  To: Mike McLean; +Cc: emacs-orgmode, Eric Schulte

Hello,

Mike McLean <mike.mclean@pobox.com> writes:

> On Wed, Mar 6, 2013 at 7:28 AM, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
>
>> Vikas Rawal <vikaslists@agrarianresearch.org> writes:
>>
>> >> CAPTION keyword above a source block applies to the source block only.
>> >> If the source block generates a table, you have to put a CAPTION above
>> >> it, as it will not inherit the caption of the source block.
>> >>
>> >> It also implies that you need to name the results. Otherwise, source
>> >> block will not recognize its own production, due to the CAPTION keyword
>> >> above it.
>> >>
>> >
>> > Thank you once again Nicolas.
>> >
>> > I understand from this that the variable org-babel-results-keyword has
>> > to be changed to NAME. I did this and it works.
>> >
>> > Is there a way that this could be file-specific?
>>
>> I wasn't clear. By "naming the results", I mean that you must provide
>> your source block a "#+NAME: something" attribute, so the generated
>> table gets a "#+RESULTS: something" attribute.
>>
>
> Interesting that this topic comes up today just as I noticed it. I'm still
> unclear about how to put the CAPTION keyword in when using a dynamic block
> via org-collector.el.
>
> I have the lines below and I do not get a table caption like I used to in
> the old exporter.
>
> #+NAME: tbl-coi
> #+CAPTION: COI Table
> #+BEGIN: propview :colnames ( "Area" "Shorthand" "COI" ) :cols ( AREA
> CATEGORY ITEM ) :match "+COI+LEVEL=2-ARCHIVE" :noquote t :scope agenda
> :inherit (AREA)

For the same reason, caption here applies to the dynamic block, not to
its contents.

The usual way to handle it is to provide a :caption argument in the
header, which will in turn create a "#+CAPTION" keyword above the table
upon updating.

However, I don't think that org-collector handles it. You may want to
patch it (you can look at `org-clocktable-write-default' for an
example).


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [new exporter] Captions for tables made by source blocks
  2013-03-07  8:20         ` Nicolas Goaziou
@ 2013-03-07 12:27           ` Vikas Rawal
  2013-03-07 12:42             ` Nicolas Goaziou
  2013-03-07 16:44           ` Achim Gratz
  1 sibling, 1 reply; 20+ messages in thread
From: Vikas Rawal @ 2013-03-07 12:27 UTC (permalink / raw)
  To: emacs-orgmode


> >> I wasn't clear. By "naming the results", I mean that you must provide
> >> your source block a "#+NAME: something" attribute, so the generated
> >> table gets a "#+RESULTS: something" attribute.

There is something strange happening. Cross-references to captions of
tables that are produced thus get exported to latex as
\texttt{something} rather than as \ref{something}.

Am not able to figure out what have I missed up. It was working fine
yesterday but then [perhaps] I did something.

Vikas

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [new exporter] Captions for tables made by source blocks
  2013-03-07 12:27           ` Vikas Rawal
@ 2013-03-07 12:42             ` Nicolas Goaziou
  2013-03-07 13:41               ` Vikas Rawal
  2013-03-07 14:43               ` Vikas Rawal
  0 siblings, 2 replies; 20+ messages in thread
From: Nicolas Goaziou @ 2013-03-07 12:42 UTC (permalink / raw)
  To: emacs-orgmode

Vikas Rawal <vikaslists@agrarianresearch.org> writes:

>> >> I wasn't clear. By "naming the results", I mean that you must provide
>> >> your source block a "#+NAME: something" attribute, so the generated
>> >> table gets a "#+RESULTS: something" attribute.
>
> There is something strange happening. Cross-references to captions of
> tables that are produced thus get exported to latex as
> \texttt{something} rather than as \ref{something}.
>
> Am not able to figure out what have I missed up. It was working fine
> yesterday but then [perhaps] I did something.

Could you provide an ECM?


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [new exporter] Captions for tables made by source blocks
  2013-03-07 12:42             ` Nicolas Goaziou
@ 2013-03-07 13:41               ` Vikas Rawal
  2013-03-07 15:02                 ` Eric S Fraga
  2013-03-07 14:43               ` Vikas Rawal
  1 sibling, 1 reply; 20+ messages in thread
From: Vikas Rawal @ 2013-03-07 13:41 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 72 bytes --]

> 
> Could you provide an ECM?
> 


See the attached dummy file.

Vikas

[-- Attachment #2: japan-temp.org --]
[-- Type: text/plain, Size: 2043 bytes --]

#+STARTUP: hidestars
#+TITLE: Title of the paper
#+DATE: 
#+AUTHOR: name of author
#+COLUMNS: %25ITEM %TAGS %PRIORITY %T
#+property: exports results
#+property: session fbi
#+OPTIONS: H:2 toc:nil num:1
#+LaTeX_CLASS: article
* Introduction

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.


* Levels and variation in farm business incomes
** Annual income from crop production

+ For a large majority of cultivating households in all the villages,
  crop production provided only meagre incomes. Table [[crop-median]] shows median
  incomes from crop production in each village. The Table shows that
  the median annual income was only Rs. 1290 per household in
  Mahatwar, a village where agriculture was primarily rainfed. Even in
  Ananthavaram, where Xx of the gross cropped area was irrigated,
  annual income was only Rs. 2654 per household. In Warwat Khanderao,
  a cotton-growing village in Vidarbha region, median income from crop
  production was only Rs. 14755 per household. In Nimshirgaon, where
  sugarcane was the most important crop, the median income from crop
  production was only Rs. 9991 per household.

#+CAPTION:  Median and ninth decile annual income from crop production, by village (2005-06 prices)
#+NAME: crop-median
#+BEGIN_SRC R :results value :colnames yes :hline yes
  c(1:5)->a
  data.frame(name=paste("a",a),id=a,id2=a^2)->b
  b
  #+END_SRC


#+CAPTION: Median and ninth decile annual income from crop production, by village (2005-06 prices)
#+RESULTS: crop-median
| name | id | id2 |
|------+----+-----|
| a 1  |  1 |   1 |
| a 2  |  2 |   4 |
| a 3  |  3 |   9 |
| a 4  |  4 |  16 |
| a 5  |  5 |  25 |






^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [new exporter] Captions for tables made by source blocks
  2013-03-07 12:42             ` Nicolas Goaziou
  2013-03-07 13:41               ` Vikas Rawal
@ 2013-03-07 14:43               ` Vikas Rawal
  2013-03-07 17:33                 ` Nicolas Goaziou
  1 sibling, 1 reply; 20+ messages in thread
From: Vikas Rawal @ 2013-03-07 14:43 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 73 bytes --]


> 
> Could you provide an ECM?
> 

Please see the attached file.

Vikas

[-- Attachment #2: japan-temp.org --]
[-- Type: text/plain, Size: 2043 bytes --]

#+STARTUP: hidestars
#+TITLE: Title of the paper
#+DATE: 
#+AUTHOR: name of author
#+COLUMNS: %25ITEM %TAGS %PRIORITY %T
#+property: exports results
#+property: session fbi
#+OPTIONS: H:2 toc:nil num:1
#+LaTeX_CLASS: article
* Introduction

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.


* Levels and variation in farm business incomes
** Annual income from crop production

+ For a large majority of cultivating households in all the villages,
  crop production provided only meagre incomes. Table [[crop-median]] shows median
  incomes from crop production in each village. The Table shows that
  the median annual income was only Rs. 1290 per household in
  Mahatwar, a village where agriculture was primarily rainfed. Even in
  Ananthavaram, where Xx of the gross cropped area was irrigated,
  annual income was only Rs. 2654 per household. In Warwat Khanderao,
  a cotton-growing village in Vidarbha region, median income from crop
  production was only Rs. 14755 per household. In Nimshirgaon, where
  sugarcane was the most important crop, the median income from crop
  production was only Rs. 9991 per household.

#+CAPTION:  Median and ninth decile annual income from crop production, by village (2005-06 prices)
#+NAME: crop-median
#+BEGIN_SRC R :results value :colnames yes :hline yes
  c(1:5)->a
  data.frame(name=paste("a",a),id=a,id2=a^2)->b
  b
  #+END_SRC


#+CAPTION: Median and ninth decile annual income from crop production, by village (2005-06 prices)
#+RESULTS: crop-median
| name | id | id2 |
|------+----+-----|
| a 1  |  1 |   1 |
| a 2  |  2 |   4 |
| a 3  |  3 |   9 |
| a 4  |  4 |  16 |
| a 5  |  5 |  25 |






^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [new exporter] Captions for tables made by source blocks
  2013-03-07 13:41               ` Vikas Rawal
@ 2013-03-07 15:02                 ` Eric S Fraga
  0 siblings, 0 replies; 20+ messages in thread
From: Eric S Fraga @ 2013-03-07 15:02 UTC (permalink / raw)
  To: emacs-orgmode

Vikas Rawal <vikaslists@agrarianresearch.org> writes:

>> 
>> Could you provide an ECM?

I have always used something along these lines

#+label: crop-median

just before the table to define the target.  This works for your ECM.
-- 
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.3.50.1 and Org release_7.9.3f-1199-g3a0e55

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [new exporter] Captions for tables made by source blocks
  2013-03-07  8:20         ` Nicolas Goaziou
  2013-03-07 12:27           ` Vikas Rawal
@ 2013-03-07 16:44           ` Achim Gratz
  2013-03-07 20:48             ` Nicolas Goaziou
  1 sibling, 1 reply; 20+ messages in thread
From: Achim Gratz @ 2013-03-07 16:44 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou writes:
> For the same reason, caption here applies to the dynamic block, not to
> its contents.

This seems to be a common enough mistake and it is currently impossible
to put captions and other arguments on results blocks save with yet
another source block that produces the correct org code (well you can
put the headers there after the result has been generated, but then you
have to delete all that stuff before generating a new result).

Would it be possible to either change the insertion of the results so
that the user has a chance to put any options before the place where it
should go or (I'm not fond of that idea, but I'll put it out there
anyway) have yet more option arguments (along the lines of
#+RESULTS_HEADER…) that will be transferred to the results block along
with the actual result?


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

DIY Stuff:
http://Synth.Stromeko.net/DIY.html

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [new exporter] Captions for tables made by source blocks
  2013-03-07 14:43               ` Vikas Rawal
@ 2013-03-07 17:33                 ` Nicolas Goaziou
  2013-03-07 23:38                   ` Vikas Rawal
  2013-03-08  0:00                   ` Vikas Rawal
  0 siblings, 2 replies; 20+ messages in thread
From: Nicolas Goaziou @ 2013-03-07 17:33 UTC (permalink / raw)
  To: emacs-orgmode

Vikas Rawal <vikaslists@agrarianresearch.org> writes:

>> 
>> Could you provide an ECM?
>> 
>
> Please see the attached file.

I cannot reproduce it, i.e. I get "\ref{crop-median}" in the output.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [new exporter] Captions for tables made by source blocks
  2013-03-07 16:44           ` Achim Gratz
@ 2013-03-07 20:48             ` Nicolas Goaziou
  2013-03-07 21:41               ` Achim Gratz
  0 siblings, 1 reply; 20+ messages in thread
From: Nicolas Goaziou @ 2013-03-07 20:48 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode

Hello,

Achim Gratz <Stromeko@nexgo.de> writes:

> Nicolas Goaziou writes:
>> For the same reason, caption here applies to the dynamic block, not to
>> its contents.
>
> This seems to be a common enough mistake and it is currently impossible
> to put captions and other arguments on results blocks save with yet
> another source block that produces the correct org code (well you can
> put the headers there after the result has been generated, but then you
> have to delete all that stuff before generating a new result).

It's very easy to have a caption on the generated output: name the code.
Hence, the following code block:

  #+NAME: calculation
  #+BEGIN_SRC emacs-lisp
  (+ 1 1)
  #+END_SRC

will produce:

  #+RESULTS: calculation
  2

If you add a caption to the results, like:

  #+CAPTION: Basic arithmetic
  #+RESULTS: calculation
  2

you can update the source block without ever needing to remove the
caption.

At some point, it would be nice if Babel could find captioned anonymous
results (so you wouldn't even have to name the block). I'll have a look
at it. But meanwhile, this solution is sufficient.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [new exporter] Captions for tables made by source blocks
  2013-03-07 20:48             ` Nicolas Goaziou
@ 2013-03-07 21:41               ` Achim Gratz
  2013-03-08  8:21                 ` Sebastien Vauban
  0 siblings, 1 reply; 20+ messages in thread
From: Achim Gratz @ 2013-03-07 21:41 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou writes:
> It's very easy to have a caption on the generated output: name the code.
> Hence, the following code block:
>
>   #+NAME: calculation
>   #+BEGIN_SRC emacs-lisp
>   (+ 1 1)
>   #+END_SRC
>
> will produce:
>
>   #+RESULTS: calculation
>   2
>
> If you add a caption to the results, like:
>
>   #+CAPTION: Basic arithmetic
>   #+RESULTS: calculation
>   2
>
> you can update the source block without ever needing to remove the
> caption.

Great.  I could swear the last time I was trying this it would add a new
result block on top of the old one, but I may have changed the name
inbetween.  It would still be nice (I think) if an unnamed source block would
simply replace the next unnamed result block if there is one.

> At some point, it would be nice if Babel could find captioned anonymous
> results (so you wouldn't even have to name the block). I'll have a look
> at it. But meanwhile, this solution is sufficient.

Oh absolutely.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [new exporter] Captions for tables made by source blocks
  2013-03-07 17:33                 ` Nicolas Goaziou
@ 2013-03-07 23:38                   ` Vikas Rawal
  2013-03-08  0:00                   ` Vikas Rawal
  1 sibling, 0 replies; 20+ messages in thread
From: Vikas Rawal @ 2013-03-07 23:38 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode


> >> Could you provide an ECM?
> >> 
> >
> > Please see the attached file.
> 
> I cannot reproduce it, i.e. I get "\ref{crop-median}" in the output.
> 

This is odd!! Please see the .tex file attached with this mail. This
is what I get. Any idea, how do I debug this?

Vikas

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [new exporter] Captions for tables made by source blocks
  2013-03-07 17:33                 ` Nicolas Goaziou
  2013-03-07 23:38                   ` Vikas Rawal
@ 2013-03-08  0:00                   ` Vikas Rawal
  1 sibling, 0 replies; 20+ messages in thread
From: Vikas Rawal @ 2013-03-08  0:00 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode


> >> 
> >> Could you provide an ECM?
> >> 
> >
> > Please see the attached file.
> 
> I cannot reproduce it, i.e. I get "\ref{crop-median}" in the output.
> 
> 
> Regards,

For me, it works if I change the value of org-babel-results-keyword
to NAME. Then the results block is produced with  #+NAME: crop-median

The cross-reference picks this up fine. 

But when org-babel-results-keyword is set to RESULTS, the results
block is produced with #+RESULTS: crop-median

The cross-reference does not pick it up correctly. The latex backend
does not export it with a \ref but with a \texttt. The odt backend
also produces "crop-median" in cross-reference rather than the table
number.

Vikas

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [new exporter] Captions for tables made by source blocks
  2013-03-07 21:41               ` Achim Gratz
@ 2013-03-08  8:21                 ` Sebastien Vauban
  0 siblings, 0 replies; 20+ messages in thread
From: Sebastien Vauban @ 2013-03-08  8:21 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello Achim,

Achim Gratz wrote:
> Nicolas Goaziou writes:
>> It's very easy to have a caption on the generated output: name the code.
>> Hence, the following code block:
>>
>>   #+NAME: calculation
>>   #+BEGIN_SRC emacs-lisp
>>   (+ 1 1)
>>   #+END_SRC
>>
>> will produce:
>>
>>   #+RESULTS: calculation
>>   2
>>
>> If you add a caption to the results, like:
>>
>>   #+CAPTION: Basic arithmetic
>>   #+RESULTS: calculation
>>   2
>>
>> you can update the source block without ever needing to remove the
>> caption.
>
> Great.  I could swear the last time I was trying this it would add a new
> result block on top of the old one, but I may have changed the name
> inbetween.

The thing is:

- you try with an unnamed block
- you get an unnamed result block inserted
- you name the block
- you get a named result block inserted
- you have to manually remove the unnamed result block

> It would still be nice (I think) if an unnamed source block would
> simply replace the next unnamed result block if there is one.

I think this is a great proposition, which would make a lot of sense.

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2013-03-08  8:21 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-06  9:55 [new exporter] Captions for tables made by source blocks Vikas Rawal
2013-03-06 10:05 ` Nicolas Goaziou
2013-03-06 10:54   ` Vikas Rawal
2013-03-06 12:28     ` Nicolas Goaziou
2013-03-06 23:46       ` Vikas Rawal
2013-03-07  0:03         ` Andreas Leha
2013-03-07  1:52       ` Mike McLean
2013-03-07  8:20         ` Nicolas Goaziou
2013-03-07 12:27           ` Vikas Rawal
2013-03-07 12:42             ` Nicolas Goaziou
2013-03-07 13:41               ` Vikas Rawal
2013-03-07 15:02                 ` Eric S Fraga
2013-03-07 14:43               ` Vikas Rawal
2013-03-07 17:33                 ` Nicolas Goaziou
2013-03-07 23:38                   ` Vikas Rawal
2013-03-08  0:00                   ` Vikas Rawal
2013-03-07 16:44           ` Achim Gratz
2013-03-07 20:48             ` Nicolas Goaziou
2013-03-07 21:41               ` Achim Gratz
2013-03-08  8:21                 ` Sebastien Vauban

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).