From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: Passing an image reference to source code block Date: Tue, 27 Dec 2016 16:05:54 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c07577c8f42530544a6070a Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLuGS-00041S-2N for emacs-orgmode@gnu.org; Tue, 27 Dec 2016 11:06:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cLuGO-0000pr-T5 for emacs-orgmode@gnu.org; Tue, 27 Dec 2016 11:06:12 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:36990) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cLuGO-0000pI-M6 for emacs-orgmode@gnu.org; Tue, 27 Dec 2016 11:06:08 -0500 Received: by mail-wm0-f50.google.com with SMTP id t79so288383209wmt.0 for ; Tue, 27 Dec 2016 08:06:06 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Orgmode Mailing List , shripad sinari --94eb2c07577c8f42530544a6070a Content-Type: text/plain; charset=UTF-8 Can you pass \ref{fig:image} in? I think that is what you would do in Latex. On Mon, Dec 26, 2016 at 7:00 PM shripad sinari wrote: > Hello all, > I would like to know if there is a way to pass a reference for a figure to > a source block as in the following example: > > ----x-----------x--- > > * Section name > > some text > #+CAPTION: Fig Caption > #+NAME: fig:image > [[file:img.jpg]] > some reference to figure [[fig:image]] > > * other section > reference to Section [[Section name]] > > #+BEGIN_SRC R :session *sample* default :exports results :results output > latex :tangle yes :var plot=[[fig:image]] > library(xtable) > print(xtable(BOD > , caption = paste("Link the image", plot,"to this table"))) > #+END_SRC > > > ----x-----------x--- > > I would like the caption of the table to point to the image, at the point > where the word "plot" is located, in LaTeX export of the org file. > > Any help or other workarounds are appreciated. I am using org version > 9.0.3 in GNU Emacs 24.5.1. > > Thanks for your help and regards, > > Shripad > Tucson, AZ > > > > > --94eb2c07577c8f42530544a6070a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Can you pass \ref{fig:image} in? I think that is what you would do in = Latex.=C2=A0


O= n Mon, Dec 26, 2016 at 7:00 PM shripad sinari <shripad.sinari@gmail.com> wrote:
<= div class=3D"gmail_msg">
Hello all,
I would like to know if there is a way to pass a reference fo= r a figure to a source block as in the following example:

----x-----------x---

* Section name

some text
#+CAPTION: Fig Caption
#+NAME: fig:image
[[file:img.jpg= ]]
some reference to figure [[fig:image]]

* other section
reference to Section [[Section name]]

#+BEGIN_SRC R :session *sample* default :exports results :re= sults output latex :tangle yes :var plot=3D[[fig:image]]
=C2=A0 library(xtable)
=C2=A0 print(xtable(BOD<= br class=3D"gmail_msg">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 , caption =3D paste("Link the image", plot,= "to this table")))
#+END_SRC


----x------= -----x---

I would like= the caption of the table to point to the image, at the point where the wor= d "plot" is located, in LaTeX export of the org file.

Any help= or other workarounds are appreciated. I am using org version 9.0.3 in GNU = Emacs 24.5.1.

Thanks for your help and regards,
<= /div>

<= div class=3D"gmail_msg">
<= div class=3D"gmail_msg">
<= div class=3D"m_-1217058085573589173gmail_signature gmail_msg">
Shripad
Tucson,= AZ




--94eb2c07577c8f42530544a6070a--