From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: [PATCH] ob-R.el, ox-latex.el: support for tikz graphics Date: Tue, 26 Feb 2013 14:21:21 -0500 Message-ID: <87obf63mq6.fsf@gmail.com> References: <1361731894-2738-1-git-send-email-aaronecay@gmail.com> <87621gfmkb.fsf@gmail.com> <87d2vnqkgh.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:41908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAS1E-0007ZU-H2 for emacs-orgmode@gnu.org; Tue, 26 Feb 2013 16:25:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UAS1C-0006SQ-Py for emacs-orgmode@gnu.org; Tue, 26 Feb 2013 16:25:00 -0500 Received: from mail-qa0-f52.google.com ([209.85.216.52]:56518) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAQ5d-0001ft-Em for emacs-orgmode@gnu.org; Tue, 26 Feb 2013 14:21:25 -0500 Received: by mail-qa0-f52.google.com with SMTP id bs12so2716301qab.18 for ; Tue, 26 Feb 2013 11:21:24 -0800 (PST) In-Reply-To: <87d2vnqkgh.fsf@gmail.com> 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: Nicolas Goaziou , Achim Gratz Cc: emacs-orgmode@gnu.org 2013ko otsailak 26an, Nicolas Goaziou-ek idatzi zuen: >=20 > 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. >=20 > 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 877gm98irg.fsf@gmail.com, 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 =E2=80=93 but this is also a problem for the resizing of non-tikz ima= ges, of course.) Thus, I=E2=80=99ve implemented this (patch to follow, on top of the tikz su= pport patch). I decided to use \resizebox for all width and height-setting, instead of trying to condition on whether we=E2=80=99re using \includegraphics or \inp= ut. This means that the code in its purest form is backwards-incompatible with old documents that might be using :options width=3D... 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=E2=80=99ve thus left the default value of the org-latex-image-default-opt= ion variable alone. It should eventually be changed to move the width setting to org-latex-image-default-width, but I=E2=80=99m 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 =E2=80=9C=E2=80=9D (or some value not making reference to width) and ...-default-width to =E2=80=9C0.9\linewidth=E2=80=9D in their initializatio= n file. (It=E2=80=99s possible to try to code around the problem by detecting if someone=E2=80=99s options have width=3D in them, etc. =E2=80=93 but I could= n=E2=80=99t figure out how to do so without having an ugly mess of code.) WDYT? --=20 Aaron Ecay