emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Aaron Ecay <aaronecay@gmail.com>
To: Nicolas Goaziou <n.goaziou@gmail.com>, Achim Gratz <Stromeko@NexGo.DE>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] ob-R.el, ox-latex.el: support for tikz graphics
Date: Tue, 26 Feb 2013 14:21:21 -0500	[thread overview]
Message-ID: <87obf63mq6.fsf@gmail.com> (raw)
In-Reply-To: <87d2vnqkgh.fsf@gmail.com>

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 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 – 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

  parent reply	other threads:[~2013-02-26 21:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-24 18:51 [PATCH] ob-R.el, ox-latex.el: support for tikz graphics Aaron Ecay
2013-02-25 15:19 ` Nicolas Goaziou
2013-02-26 10:50   ` Achim Gratz
2013-02-26 12:25     ` Myles English
2013-02-26 13:21     ` Nicolas Goaziou
2013-02-26 14:33       ` Achim Gratz
2013-02-26 19:21       ` Aaron Ecay [this message]
2013-02-26 19:22         ` [PATCH] ox-latex: provide width and height options for images Aaron Ecay
2013-02-26 23:04           ` Rasmus
2013-02-27  2:02             ` Aaron Ecay
2013-02-27 18:40             ` Achim Gratz
2013-02-27  8:23           ` Nicolas Goaziou
2013-03-06  4:02             ` aaronecay
2013-03-06  4:04               ` [PATCH] ox-latex: Support tikz images, :width, and :height Aaron Ecay
2013-03-06  8:35               ` [PATCH] ox-latex: provide width and height options for images Nicolas Goaziou
2013-02-26 18:25 ` [PATCH] ob-R.el, ox-latex.el: support for tikz graphics Achim Gratz
2013-02-26 19:49   ` Aaron Ecay

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=87obf63mq6.fsf@gmail.com \
    --to=aaronecay@gmail.com \
    --cc=Stromeko@NexGo.DE \
    --cc=emacs-orgmode@gnu.org \
    --cc=n.goaziou@gmail.com \
    /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).