emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [PATCH] ob-R.el, ox-latex.el: support for tikz graphics


From: Aaron Ecay
Subject: Re: [O] [PATCH] ob-R.el, ox-latex.el: support for tikz graphics
Date: Tue, 26 Feb 2013 14:21:21 -0500
User-agent: Notmuch/0.15.2+36~ge30b9e0 (http://notmuchmail.org) Emacs/24.3.50.1 (x86_64-unknown-linux-gnu)

2013ko otsailak 26an, Nicolas Goaziou-ek idatzi zuen:
> 
> I'm not questioning the usefulness of the patch. I want to know if
> `org-latex--inline-image' is the appropriate function to provide that
> feature or if the feature should be provided through another function.
> 
> In particular, `org-latex--inline-image' provide options to wrap the
> picture in wrapfigure environment, or to set width optional argument
> for includegraphics. If it doesn't make sense in this case, the code
> could as well be moved into another function, like
> `org-latex--input-file', which would handle options specific for
> \input.

As Achim pointed out, it is useful to wrap the \input{...} in figure,
wrapfig, etc. environments.  For resizing, one needs to use a \resizebox
command or similar.  (Also as Achim pointed out.)

In the message with id address@hidden, you pointed out the
possibility to factor out :width (and presumably :height) from :options.
This is the logical thing to do in order to support resizing of tikz
images.  (Putting aside the issue of text sizes becoming too big or too
small – but this is also a problem for the resizing of non-tikz images,
of course.)

Thus, I’ve implemented this (patch to follow, on top of the tikz support
patch).

I decided to use \resizebox for all width and height-setting, instead of
trying to condition on whether we’re using \includegraphics or \input.
This means that the code in its purest form is backwards-incompatible
with old documents that might be using :options width=... to set the
width of images, since the width would be set twice (once explicitly by
the options, once by default in the \resizebox).

I’ve thus left the default value of the org-latex-image-default-option
variable alone.  It should eventually be changed to move the width
setting to org-latex-image-default-width, but I’m not sure how long we
want the grace period to be.  (Maybe it should be short, since the new
exporter already introduced some incompatibilities).

People who want to do things the new way should set ...-default-option
to “” (or some value not making reference to width) and
...-default-width to “0.9\linewidth” in their initialization file.

(It’s possible to try to code around the problem by detecting if
someone’s options have width= in them, etc. – but I couldn’t figure out
how to do so without having an ugly mess of code.)

WDYT?

-- 
Aaron Ecay



reply via email to

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