emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Fraga <e.fraga@ucl.ac.uk>
To: nicholas.dokos@hp.com
Cc: Michael Hannon <jm_hannon@yahoo.com>,
	Org-Mode List <emacs-orgmode@gnu.org>
Subject: Re: Size and placement of images in table in PDF export
Date: Wed, 25 Apr 2012 16:38:10 +0930	[thread overview]
Message-ID: <87lilkmgpx.fsf@ucl.ac.uk> (raw)
In-Reply-To: <4912.1330747331@alphaville> (Nick Dokos's message of "Fri, 2 Mar 2012 23:02:11 -0500")

Nick Dokos <nicholas.dokos@hp.com> writes:

> Michael Hannon <jm_hannon@yahoo.com> wrote:
>
>> Greetings.  I've got another export question.  If I put two small images into
>> an Org-mode table and export the containing document to HTML, I see the two
>> images displayed side-by-side in an area of the page that is at least roughly
>> the actual size of the concatenated images.
>> 
>> If I export the same document to PDF, the two images are again displayed
>> side-by-side, but image on the left is magnified to take up most of the
>> horizontal space on the page; the image on the right is also magnified and
>> runs off the page to the right.

[...]

>> Is there some way to override the default size/placement of the images in PDF
>> export?
>> 
>
> The trouble is that the default option says "width=.9\\linewidth" so
> if you try to put two of them on the same "line", they end up overflowing
> the page. For an image not inside a table, you could reset that with
>
> #+ATTR_LaTeX: width=.4\\linewidth

By the way, there should be only one \ in this line as org or emacs do
not need the \ escaped in this context.

>
> but this is a rather blunt instrument: for images inside a table, it
> applies not only to the images but also to the table (and it ends up
> producing a syntactically incorrect latex program - that's probably
> a bug in the latex exporter.)

There is indeed a problem with figures inside tables in that the same
construct is used to pass arguments to \includegraphics
and \begin{tabular}.  Not ideal at all.  We really should have different
constructs for each...

For the above problem from the OP, the best solution in latex directly
would have been to specify the widths of the columns using p{2.5cm}
column formats, say.  If that is done, the default width for images,
based on \linewidth, would work just fine as \linewidth is the width of
the text within the actual latex structure (as opposed to \textwidth or
\columnwidth, say).  This works because the "p" tabular format changes
\linewidth within that column.

However, it is not possible to specify table attributes *if* you have
images inside the table as the same latex attributes are passed to both
table and images...

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.1.50.1
: using Org-mode version 7.8.06 (release_7.8.06.181.g67694.dirty)

  reply	other threads:[~2012-04-25  7:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-03  0:20 Size and placement of images in table in PDF export Michael Hannon
2012-03-03  4:02 ` Nick Dokos
2012-04-25  7:08   ` Eric Fraga [this message]
2012-04-25  7:30     ` Michael Hannon

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=87lilkmgpx.fsf@ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=jm_hannon@yahoo.com \
    --cc=nicholas.dokos@hp.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).