emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Robert Cunningham <robut@iinet.net.au>
To: Emacs-orgmode@gnu.org
Subject: a better way with babel
Date: Mon, 21 Jun 2010 18:03:22 +0800	[thread overview]
Message-ID: <201006211803.25616.robut@iinet.net.au> (raw)

G'day All,

I wonder if I've missed something and there is a better way.

Essentially I'm trying to use org babel with R and LaTeX to create figures 
with both long and short captions (for contents)

I'd started with:

#+CAPTION: Nice data (filled points indicate less nice data)
#+LABEL:   fig:nicedata
#+ATTR_LaTeX: width=0.98\textwidth
#+begin_src R :file ndata.pdf :width 1000 :height 617 :exports results
  dotchart(data$ndata)
#+end_src

which pointed to the need for long/short captions...

feeling hopeful I tried:

#+CAPTION: Nice data [Nice data (filled points indicate less nice data)]
#+LABEL:   fig:nicedata
#+ATTR_LaTeX: width=0.98\textwidth
#+begin_src R :file ndata.pdf :width 1000 :height 617 :exports results
  dotchart(data$ndata)
#+end_src


but no luck there.

Next effort was to try to use R and LaTex more directly with noweb. I tried 
this:



#+srcname: r-nicedata
#+begin_src R :session :file ndata.pdf :results output :exports results
  dotchart(data$ndata)	
#+end_src


#+begin_src latex :noweb yes
  \begin{figure}[htb!]
    \centering
    \includegraphics[width=0.98\textwidth]{<<r-nicedata()>>}
    \caption[Nice data]{Nice data (filled points indicate less nice data)}
    \label{fig:nicedata}
  \end{figure}
#+end_src



This does produce the figure and long/short contents BUT ALSO produces this:

#+results: r-nicedata
[[file:ndata.pdf]]

which upon export results in a link and consequently the plot appearing both 
in the figure and elsewhere. This second plot is unwelcome.

I've tried assorted :results and :output options but have not found how to 
suppress the #+results: but still obtain the figure. I've always used 
the :session option. 

I've also tried twigging an org-export option to suppress pdf export but the 
link is still exported so that is not a solution.

The current "working" solution is to use the noweb approach and then use sed 
to clean out the links to the second image-ugly to say the least!



All this with org version 6.36c


What have I missed? What is the best way to do this? 


Cheers,

Robert Cunningham

             reply	other threads:[~2010-06-21 10:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-21 10:03 Robert Cunningham [this message]
2010-06-21 16:00 ` a better way with babel Erik Iverson
2010-06-21 16:12 ` Thomas S. Dye
2010-06-21 16:37 ` Eric Schulte
2010-07-01 13:39   ` Carsten Dominik
2010-07-01 15:19     ` Eric Schulte

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=201006211803.25616.robut@iinet.net.au \
    --to=robut@iinet.net.au \
    --cc=Emacs-orgmode@gnu.org \
    /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).