From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Size and placement of images in table in PDF export Date: Fri, 02 Mar 2012 23:02:11 -0500 Message-ID: <4912.1330747331@alphaville> References: <1330734025.40991.YahooMailNeo@web161903.mail.bf1.yahoo.com> Reply-To: nicholas.dokos@hp.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]:41469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3gAj-0005Am-CY for emacs-orgmode@gnu.org; Fri, 02 Mar 2012 23:02:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3gAh-0008PO-Dl for emacs-orgmode@gnu.org; Fri, 02 Mar 2012 23:02:16 -0500 Received: from g1t0029.austin.hp.com ([15.216.28.36]:6364) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3gAh-0008PI-6e for emacs-orgmode@gnu.org; Fri, 02 Mar 2012 23:02:15 -0500 In-Reply-To: Message from Michael Hannon of "Fri\, 02 Mar 2012 16\:20\:25 PST." <1330734025.40991.YahooMailNeo@web161903.mail.bf1.yahoo.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: Michael Hannon Cc: nicholas.dokos@hp.com, Org-Mode List Michael Hannon wrote: > Greetings.=C2=A0 I've got another export question.=C2=A0 If I put two sma= ll images into > an Org-mode table and export the containing document to HTML, I see the t= wo > images displayed side-by-side in an area of the page that is at least rou= ghly > the actual size of the concatenated images. >=20 > 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. >=20 > I'm not sure how to provide a simple, self-contained example of this.=C2= =A0 The > structure of the table is: >=20 > =C2=A0=C2=A0=C2=A0 | [[./x1.jpg]] | [[./x2.jpg]] | >=20 > The images themselves are "small": >=20 > =C2=A0 $ identify x*.jpg > =C2=A0 x1.jpg JPEG 189x142 189x142+0+0 8-bit DirectClass 9.56KB 0.000u 0:= 00.000 > =C2=A0 x2.jpg[1] JPEG 190x160 190x160+0+0 8-bit DirectClass 55.6KB 0.000u= 0:00.000 >=20 > If I just print the images from an image viewer, each of them comes out on > paper at about 2.5in (~64 mm) in width. >=20 > Is there some way to override the default size/placement of the images in= PDF > export? >=20 The trouble is that the default option says "width=3D.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=3D.4\\linewidth 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.) The following variation does work however: --8<---------------cut here---------------start------------->8--- #+BIND: org-export-latex-image-default-option "width=3D.4\\linewidth" * foo | col1 | col2 | |--------------+--------------| | [[./x1.jpg]] | [[./x2.jpg]] | | | | --8<---------------cut here---------------end--------------->8--- Of course, if you try to put three images on the line, you'll have to recalibrate the factor (you can also use absolute dimensions: width=3D3cm). There is also this second variation, which uses height, rather than width: = the latex exporter thinks height is not relevant to tables, so it does not try to give that attribute to the table, just to the images: --8<---------------cut here---------------start------------->8--- * foo #+ATTR_LaTeX: height=3D2cm | col1 | col2 | |--------------+--------------| | [[./x1.jpg]] | [[./x2.jpg]] | | | | --8<---------------cut here---------------end--------------->8--- but you can also use the BIND form too: #+BIND: org-export-latex-image-default-option "height=3D2cm" Note btw, that the width in the first case (and the height in the second case) is the same for both images. AFAICT, there is no way to give different dimensions to the two images - except for the following variation. The third variation allows the two images to have their "natural" dimensions: --8<---------------cut here---------------start------------->8--- #+BIND: org-export-latex-image-default-option "" * foo | col1 | col2 | |--------------+--------------| | [[./x1.jpg]] | [[./x2.jpg]] | | | | --8<---------------cut here---------------end--------------->8--- Nick