From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: bug in new exporter Date: Mon, 03 Jun 2013 13:42:03 -0400 Message-ID: <87ip1vjdlg.fsf@pierrot.dokosmarshall.org> References: <87d2s388l2.fsf@pank.eu> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43536) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjZ3i-0002J7-8E for emacs-orgmode@gnu.org; Mon, 03 Jun 2013 14:00:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UjYvN-0000Ly-6Q for emacs-orgmode@gnu.org; Mon, 03 Jun 2013 13:52:06 -0400 Received: from plane.gmane.org ([80.91.229.3]:51312) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjYlz-0005Sg-3a for emacs-orgmode@gnu.org; Mon, 03 Jun 2013 13:42:23 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UjYlr-0004T6-QA for emacs-orgmode@gnu.org; Mon, 03 Jun 2013 19:42:15 +0200 Received: from pool-108-7-96-134.bstnma.fios.verizon.net ([108.7.96.134]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 03 Jun 2013 19:42:15 +0200 Received: from ndokos by pool-108-7-96-134.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 03 Jun 2013 19:42:15 +0200 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@gnu.org Rasmus writes: > Hi Marvin, > > Marvin Doyley writes: > >> Hi there, >> >> When I include the following in my org file >> >> #+attr_latex: scale=1.5, placement =[htb!] >> [[file:img/figure2.eps]] > > The syntax changes. Something like this might give you what you want. > > #+ATTR_LATEX: :placement [htb!] :options scale=1.5 > #+CAPTION: a float needs a caption > [[file:fig.pdf]] > One thing that I couldn't figure out is how to get rid of the width specification altogether. I can change the default [...,width=0.9\textwidth] with something like :width 10cm but if I scale the image (presumably by trial and error until it looks good to my eye), then I want to turn off the width option altogether (afaict, latex treats [scale=1.5,width=10cm] as [width=10cm] - scale is not considered at all, hence my desire to turn off width.) I tried :width nil and :width In these cases, I get the default. The code looks like this --8<---------------cut here---------------start------------->8--- (width (cond ((plist-get attr :width)) ((plist-get attr :height) "") ((eq float 'wrap) "0.48\\textwidth") (t org-latex-image-default-width))) --8<---------------cut here---------------end--------------->8--- and in these cases the plist-get returns nil, so the t clause triggers. I also tried :width "" which fails with a Wrong type argument: stringp, nil in this call (and I haven't chased it further): --8<---------------cut here---------------start------------->8--- (attr (org-export-read-attribute :attr_latex parent)) --8<---------------cut here---------------end--------------->8--- Is it possible to eliminate ``width'' from the options? > do check out: > > http://orgmode.org/org.html#LaTeX-specific-attributes > > From the source code, ox-latex.el, you should be able to get it to > accept placement without square brackets. I don't understand: what do you mean? AFAICT, you *have* to say :placement [htb!] *including* the square brackets, because the first clause of the cond triggers and that does not include the square brackets: --8<---------------cut here---------------start------------->8--- (cond (place (format "%s" place)) ((eq float 'wrap) "{l}{0.5\\textwidth}") ((eq float 'figure) (format "[%s]" org-latex-default-figure-position)) (t "")))) --8<---------------cut here---------------end--------------->8--- > It should also be possible > to set something like htb! as the default value of floats, if you so > desire. Check the variable org-latex-default-figure-position. > OTOH, here you don't want to include the square brackets because the format *does* add them. That seems to be a slight inconsistency. Org-mode version 8.0.3 (release_8.0.3-173-gd200d0 @ /home/nick/elisp/org-mode/lisp/) -- Nick