emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* behavior of org-image-actual-size with units in attr_* :width
@ 2014-09-30 21:09 John Kitchin
  2014-10-01 19:26 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: John Kitchin @ 2014-09-30 21:09 UTC (permalink / raw)
  To: emacs-orgmode

I have set this in my init file

(setq org-image-actual-width '(600))

It works great, unless I use:
#+attr_latex: :width 4in

This makes my images 4 inches wide in LaTeX, but it sets my images to
approximately 4 pixels wide!

I feel like it is worth modifying the regexp that gets the width to
catch these cases and fall back on the variable value when they
exist. Any thoughts?


-- 
-----------------------------------
John Kitchin
http://kitchingroup.cheme.cmu.edu

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: behavior of org-image-actual-size with units in attr_* :width
  2014-09-30 21:09 behavior of org-image-actual-size with units in attr_* :width John Kitchin
@ 2014-10-01 19:26 ` Nicolas Goaziou
  2014-10-01 23:51   ` John Kitchin
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2014-10-01 19:26 UTC (permalink / raw)
  To: John Kitchin; +Cc: emacs-orgmode

Hello,

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> I have set this in my init file
>
> (setq org-image-actual-width '(600))
>
> It works great, unless I use:
> #+attr_latex: :width 4in
>
> This makes my images 4 inches wide in LaTeX, but it sets my images to
> approximately 4 pixels wide!
>
> I feel like it is worth modifying the regexp that gets the width to
> catch these cases and fall back on the variable value when they
> exist. Any thoughts?

I wonder if this kludge makes any sense in the general case. As you
noticed, units given in a LaTeX attributes line will probably be
different from pixels.

What about limiting the regexp to ATTR_HTML lines only?


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: behavior of org-image-actual-size with units in attr_* :width
  2014-10-01 19:26 ` Nicolas Goaziou
@ 2014-10-01 23:51   ` John Kitchin
  2014-10-03  8:03     ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: John Kitchin @ 2014-10-01 23:51 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

is it the case that ATTR_HTML width attributes are only in pixels? If
so, that is certainly an easier modification to make, and would solve my
problem (we almost exclusively use attr_latex for that export).

Your comment inspired me to solve it this way:

#+attr_latex: :width 4in :placement [H]
#+attr_org: :width 400
[[./images/batch-multiple.png]]


For inline images, the attr_org is found first, but in latex export it
is ignored and it gets the width there.

Maybe no change is needed at all.


> Hello,
>
> John Kitchin <jkitchin@andrew.cmu.edu> writes:
>
>> I have set this in my init file
>>
>> (setq org-image-actual-width '(600))
>>
>> It works great, unless I use:
>> #+attr_latex: :width 4in
>>
>> This makes my images 4 inches wide in LaTeX, but it sets my images to
>> approximately 4 pixels wide!
>>
>> I feel like it is worth modifying the regexp that gets the width to
>> catch these cases and fall back on the variable value when they
>> exist. Any thoughts?
>
> I wonder if this kludge makes any sense in the general case. As you
> noticed, units given in a LaTeX attributes line will probably be
> different from pixels.
>
> What about limiting the regexp to ATTR_HTML lines only?
>
>
> Regards,

-- 
-----------------------------------
John Kitchin
Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: behavior of org-image-actual-size with units in attr_* :width
  2014-10-01 23:51   ` John Kitchin
@ 2014-10-03  8:03     ` Nicolas Goaziou
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2014-10-03  8:03 UTC (permalink / raw)
  To: John Kitchin; +Cc: emacs-orgmode

Hello,

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
>
> is it the case that ATTR_HTML width attributes are only in pixels? 

No, but it's the only export back-end dedicated to on-screen display.
So, in-buffer width is probably only meaningful there.

> If so, that is certainly an easier modification to make, and would
> solve my problem (we almost exclusively use attr_latex for that
> export).
>
> Your comment inspired me to solve it this way:
>
> #+attr_latex: :width 4in :placement [H]
> #+attr_org: :width 400
> [[./images/batch-multiple.png]]
>
>
> For inline images, the attr_org is found first, but in latex export it
> is ignored and it gets the width there.
>
> Maybe no change is needed at all.

It works but is certainly hackish.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-03  8:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-30 21:09 behavior of org-image-actual-size with units in attr_* :width John Kitchin
2014-10-01 19:26 ` Nicolas Goaziou
2014-10-01 23:51   ` John Kitchin
2014-10-03  8:03     ` Nicolas Goaziou

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).