From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Re: LaTeX export figure width, when figure comes from python? Date: Fri, 29 Mar 2013 15:53:53 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:36734) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULgJB-0007u8-2N for emacs-orgmode@gnu.org; Fri, 29 Mar 2013 16:53:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULgJ8-0005o3-Fk for emacs-orgmode@gnu.org; Fri, 29 Mar 2013 16:53:57 -0400 Received: from mail-ob0-x233.google.com ([2607:f8b0:4003:c01::233]:59488) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULgJ8-0005nl-BC for emacs-orgmode@gnu.org; Fri, 29 Mar 2013 16:53:54 -0400 Received: by mail-ob0-f179.google.com with SMTP id un3so621874obb.38 for ; Fri, 29 Mar 2013 13:53:53 -0700 (PDT) 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Gary Oberbrunner Cc: Orgmode Mailing List On Fri, Mar 29, 2013 at 3:16 PM, Gary Oberbrunner wrote: > Now that python mode is working nicely, I'm generating lots of graphics. > > #+BEGIN_SRC python :session MYpython :exports results :results file > #... bunch of matplotlib stuff that produces /tmp/myfig.pdf > '/tmp/myfig.pdf' > #+END_SRC > > This works, and the LaTeX exporter includes /tmp/mfig.pdf: > > \includegraphics[width=.9\linewidth]{c:/tmp/myfig.pdf} > > My question is, is there any way to remove the width specifier? If the > figure were coming straight from org-mode source text, I could use > #+ATTR_LaTeX (well actually maybe not, because there's no way to *remove* > the width, but at least I could set it as desired.) But in the situation > above, where the filename is coming from the exporter running the code > block, there's no place for me to put the ATTR_LaTeX that works. > > Any ideas, exporter gurus? > Does this post help at all? - http://lists.gnu.org/archive/html/emacs-orgmode/2012-08/msg01225.html This would be if your compilation of that block is spitting out a #+results block. Is that the case? Also, per a recent use of that same concept, I got updated advice to use :wrap since the above wasn't working for me anymore: - http://lists.gnu.org/archive/html/emacs-orgmode/2013-03/msg01599.html So, basically if you're generating plots, you can just print the Org-mode include file syntax ([[filename.ext]]) into a results block and should also be able to pass it the #+attr_latex stuff as well. Something like: print("#+attr_latex: :width Xcm \n [[filename.ext]]") Would that work? John > -- > Gary