From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vikas Rawal Subject: label and ref in latex export Date: Thu, 11 Oct 2012 10:21:32 +0900 Message-ID: <20121011012131.GA20544@panahar> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34480) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TM7T3-00066g-AM for emacs-orgmode@gnu.org; Wed, 10 Oct 2012 21:21:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TM7T2-0000aA-9l for emacs-orgmode@gnu.org; Wed, 10 Oct 2012 21:21:41 -0400 Received: from mail-pb0-f41.google.com ([209.85.160.41]:43504) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TM7T2-0000a3-3X for emacs-orgmode@gnu.org; Wed, 10 Oct 2012 21:21:40 -0400 Received: by mail-pb0-f41.google.com with SMTP id rq2so1426050pbb.0 for ; Wed, 10 Oct 2012 18:21:38 -0700 (PDT) Content-Disposition: inline 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode The following has been taken from my org file. ------------- #+CAPTION: Average output, cost and net income per acre, by area, (2005-06 prices) #+LABEL: tab:avprofit #+ATTR_LATEX: table * tabulary width=\textwidth align=l|RRRR #+BEGIN_SRC R :results value raw :colnames yes :hline yes subset(a,Crop_group=="Paddy")->a a[,c(8:10)]*a[,6]/a[,7]->a[,c(8:10)] vtab1(a,8,10,1,wtd.mean)->a1 round(as.numeric(as.character(a1[,2])))->a1[,2] round(as.numeric(as.character(a1[,3])))->a1[,3] round(as.numeric(as.character(a1[,4])))->a1[,4] names(a1)<-c("Area","output","Cost","Net income") #+END_SRC \ref{tab:avprofit} shows that the average levels of are highest in Area 7. ------------------ When I export it to latex/pdf, \ref{tab:avprofit} is just shown as ??. What am I not doing correctly? Also, is it okay if the text where the table is referenced comes before the table (and therefore its label) itself? Vikas