emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] bug in new exporter


From: Nick Dokos
Subject: Re: [O] bug in new exporter
Date: Mon, 03 Jun 2013 13:42:03 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Rasmus <address@hidden> writes:

> Hi Marvin,
>
> Marvin Doyley <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]