emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Berry, Charles" <ccberry@ucsd.edu>
To: Ken Mankoff <mankoff@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: where to place caption so babel results include caption?
Date: Wed, 6 Nov 2019 16:05:39 +0000	[thread overview]
Message-ID: <5A52F11B-774A-46A3-B507-70883FB181A8@ucsd.edu> (raw)
In-Reply-To: <871ruls518.fsf@gmail.com>



> On Nov 6, 2019, at 1:55 AM, Ken Mankoff <mankoff@gmail.com> wrote:
> 
> Hello,
> 
> If I have a babel block that generates a table and I'd like latex attributes associated with that table, it seems to work well if I do this:
> 
> #+NAME: foo
> #+BEGIN_SRC bash :results table
> echo "${RANDOM}|${RANDOM}|"
> echo "${RANDOM}|${RANDOM}|"
> #+END_SRC
> 
> #+caption: foo
> #+latex_attr: :placement [!h]
> #+RESULTS: foo
> | 17326 | 29919 |
> | 30565 |  9548 |
> 
> 
> And I can re-run the babel block and CAPTION and ATTR_LATEX remain.
> 
> But if I want to clean with =[C-u] C-c C-v k= or (org-babel-remove-result-one-or-many) and regenerate =C-c C-v C-b= or (org-babel-execute-buffer), then this happens:
> 
> 
> #+RESULTS: foo
> | 17225 | 29253 |
> | 18433 | 27388 |
> 
> #+caption: foo
> #+latex_attr: :placement [!h]
> 
> If I place CAPTION and LATEX_ATTR above the babel block it isn't exported correctly. Is there some way to have this work?
> 


Maybe use something like

M-: (org-babel-map-src-blocks nil (org-babel-insert-result "" '("replace"))) RET

to scrub the existing result values without removing the '#+RESULTS' line.

??

HTH,

Chuck

  reply	other threads:[~2019-11-06 16:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-06  9:55 where to place caption so babel results include caption? Ken Mankoff
2019-11-06 16:05 ` Berry, Charles [this message]
2019-11-06 16:53   ` Ken Mankoff
2019-11-09 22:28     ` Ken Mankoff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5A52F11B-774A-46A3-B507-70883FB181A8@ucsd.edu \
    --to=ccberry@ucsd.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=mankoff@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).