From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: position figures side by side in PDF output Date: Wed, 20 May 2015 22:03:43 +0100 Message-ID: References: <874mn7i4eo.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvBAD-0006FT-6g for emacs-orgmode@gnu.org; Wed, 20 May 2015 17:04:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YvBA9-0001XE-Uj for emacs-orgmode@gnu.org; Wed, 20 May 2015 17:04:29 -0400 Received: from plane.gmane.org ([80.91.229.3]:35543) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvBA9-0001X5-Nr for emacs-orgmode@gnu.org; Wed, 20 May 2015 17:04:25 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YvBA6-0007l6-ME for emacs-orgmode@gnu.org; Wed, 20 May 2015 23:04:22 +0200 Received: from cpc33-cmbg15-2-0-cust4.5-4.cable.virginm.net ([81.102.136.5]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 20 May 2015 23:04:22 +0200 Received: from andreas.leha by cpc33-cmbg15-2-0-cust4.5-4.cable.virginm.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 20 May 2015 23:04:22 +0200 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: emacs-orgmode@gnu.org Hi Zhihao, Rasmus writes: > Hi Zhihao, > > Zhihao Ding writes: > >> Could anyone give me some advice on how to position figures side by side in PDF output? >> I am trying to write a report, while my figures were all originally produced individually. I’d like >> to put them, mostly two, sometimes three, side by side sharing a same caption and label. >> Below is the syntax I am using now, which can only do one figure. > > Does this thread answer your question? It would give you individual > subcaptions, but you need not use them. > > https://lists.gnu.org/archive/html/emacs-orgmode/2014-11/msg00548.html > > Otherwise you could use e.g. imagemagick to stick together figures. > As an alternative you could use a table. + easy + orgmode only (should work across backends) - no scaling of images - it is a table for latex (i.e. will appear in list of tables, etc.) Here is a short example for the table approach and an imagemagick-based solution as proposed by Rasmus. --8<---------------cut here---------------start------------->8--- * generate images :noexport: #+name: image1 #+begin_src R :results graphics :file img1.pdf plot(1:10) #+end_src #+results: image1 [[file:img1.pdf]] #+name: image2 #+begin_src R :results graphics :file img2.pdf plot(1:5) #+end_src #+results: image2 [[file:img2.pdf]] * export side-by-side ** table #+caption: stitching side-by-side using tables | [[file:img1.pdf]] | [[file:img2.pdf]] | ** using imagemagick *** function :noexport: #+name: sidebyside #+begin_src sh :session none :results file replace :var im1="im1.png" :var im2="im2.png" :var outname="out.png" convert "$im1" "$im2" +append "$outname" echo "$outname" #+end_src *** test #+name: combinedfig #+call: sidebyside(im1="img1.pdf", im2="img2.pdf") :results file #+caption: stitching side-by-side using imagemagick #+results: combinedfig [[file:out.png]] --8<---------------cut here---------------end--------------->8--- Regards, Andreas