Vikas Rawal <vikasli...@agrarianresearch.org> writes: >> > cross-reference will pick that up correctly. >> > >> > If #+RESULT is not to work, it is better to change >> > org-babel-results-keyword to NAME, and then what you are suggesting >> > happens automatically. But in the earlier thread on the topic, Nicolas >> > said that was not the right way. >> >> We are misunderstanding each other. >> >> #+results are never used for cross-references. This is a Babel internal >> keyword used to refer to the source that generated this element. >> >> Cross-references only react to #+name keyword. >> > > > Sorry, this is confusing. Is it then the case that we are naming the > source block to ensure that captions stick to the corresponding > results block?
Source block captions apply to the source block, not to the results. You have to define a separate caption for the results. Source block name will be used both as a label for cross referencing and as a Babel internal code for results correspondence. > And then, we need to separately name the results block, and use > a different name for it, so that the cross-references pick it up > correctly? Yes, the name given to the results block doesn't depend on the results keyword. You can give it any name, as long as it is unique. Here is an example: #+caption: Src block caption #+name: my-src #+begin_src emacs-lisp (+ 1 2) #+end_src #+name: anything #+caption: Element caption #+results: my-src : 3 As far as affiliated keywords go, the only one you needn't provide is "#+results:". HTH, Regards, -- Nicolas Goaziou