emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <ndokos@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: bug in new exporter
Date: Mon, 03 Jun 2013 13:42:03 -0400	[thread overview]
Message-ID: <87ip1vjdlg.fsf@pierrot.dokosmarshall.org> (raw)
In-Reply-To: 87d2s388l2.fsf@pank.eu

Rasmus <rasmus@gmx.us> writes:

> Hi Marvin,
>
> Marvin Doyley <m.doyley@rochester.edu> 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	other threads:[~2013-06-03 18:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-03 15:50 bug in new exporter Marvin Doyley
2013-06-03 16:25 ` Rasmus
2013-06-03 17:42   ` Nick Dokos [this message]
2013-06-03 20:23     ` Rasmus
2013-06-03 21:03       ` Nick Dokos
2013-06-03 22:12         ` Rasmus
2013-06-05 12:26           ` Nicolas Goaziou
2013-06-05 16:28             ` Nick Dokos
2013-06-05 21:45               ` Nick Dokos
2013-06-11 12:08                 ` Nicolas Goaziou
2013-06-11 17:09                   ` Nick Dokos
2013-06-16 20:53                     ` Nicolas Goaziou
2013-06-11 12:05               ` Nicolas Goaziou
  -- strict thread matches above, loose matches on Subject: below --
2013-06-03 17:22 Marvin Doyley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ip1vjdlg.fsf@pierrot.dokosmarshall.org \
    --to=ndokos@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).