From: Andreas Leha <andreas.leha@med.uni-goettingen.de>
To: emacs-orgmode@gnu.org
Subject: Re: position figures side by side in PDF output
Date: Wed, 20 May 2015 22:03:43 +0100 [thread overview]
Message-ID: <oluegmbhsgg.fsf@med.uni-goettingen.de> (raw)
In-Reply-To: 874mn7i4eo.fsf@gmx.us
Hi Zhihao,
Rasmus <rasmus@gmx.us> writes:
> Hi Zhihao,
>
> Zhihao Ding <zhihao.ding@imm.ox.ac.uk> 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
next prev parent reply other threads:[~2015-05-20 21:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-20 16:30 position figures side by side in PDF output Zhihao Ding
2015-05-20 16:45 ` Rasmus
2015-05-20 21:03 ` Andreas Leha [this message]
2015-05-21 8:45 ` Zhihao Ding
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=oluegmbhsgg.fsf@med.uni-goettingen.de \
--to=andreas.leha@med.uni-goettingen.de \
--cc=emacs-orgmode@gnu.org \
/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).