From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thomas S. Dye" Subject: Re: a better way with babel Date: Mon, 21 Jun 2010 06:12:38 -1000 Message-ID: References: <201006211803.25616.robut@iinet.net.au> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=39305 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OQjrl-0006OJ-BB for Emacs-orgmode@gnu.org; Mon, 21 Jun 2010 12:28:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OQjc4-0006Q5-MM for Emacs-orgmode@gnu.org; Mon, 21 Jun 2010 12:12:46 -0400 Received: from oproxy3-pub.bluehost.com ([69.89.21.8]:39177) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OQjc4-0006Pf-Fc for Emacs-orgmode@gnu.org; Mon, 21 Jun 2010 12:12:44 -0400 In-Reply-To: <201006211803.25616.robut@iinet.net.au> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Robert Cunningham Cc: Emacs-orgmode@gnu.org Aloha Robert, One solution might be to tangle the LaTeX code blocks instead of exporting the buffer to LaTeX. I like this approach--the org-mode buffer can be full of meta-data (and messy) but I retain fine control over the LaTeX output. > #+begin_src latex :noweb yes :tangle yes > \begin{figure}[htb!] > \centering > \includegraphics[width=0.98\textwidth]{<>} > \caption[Nice data]{Nice data (filled points indicate less nice > data)} > \label{fig:nicedata} > \end{figure} > #+end_src All the best, Tom On Jun 21, 2010, at 12:03 AM, Robert Cunningham wrote: > 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]{<>} > \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 > > > > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode