emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Charles Berry <ccberry@ucsd.edu>
To: emacs-orgmode@gnu.org
Subject: Re: LaTeX export: images subplots
Date: Thu, 12 Sep 2013 04:45:42 +0000 (UTC)	[thread overview]
Message-ID: <loom.20130912T062059-594@post.gmane.org> (raw)
In-Reply-To: BLU168-W115EF94D3194076FF55B3189A3A0@phx.gbl

Martin Leduc <mart_00 <at> hotmail.com> writes:

> 
>

> Hi all,

> I am using org-mode to write a report with several figures. I would
> like to group some images into a same figure, let say a 2x2 panel. I
> know that I can directly embed latex code in my org file, for
> example by using the subfloats (from the latex subfig package).
> However, I would prefer to use an org-based solution of inserting
> the image links in order to keep the convenient way of previewing
> images right into the buffer with C-c C-x C-v.

> The only solution I found is by using tables such as:
> 
> #+CAPTION: Insert caption here.
> #+ATTR_LATEX: :align p{0.5\textwidth}p{0.5\textwidth}
> | [[pathtoimage]] | [[pathtoimage]] |
> | [[pathtoimage]] | [[pathtoimage]] |
> 

> where the size of the images is controled by p{} and C-cxv is
> working.  However, in the exported TeX file, it is a table, not a
> figure. Is there a cleaner way to make image panels that would
> preserve the figure environment in the exported TeX file ?


I think you are close.

Use 

#+BEGIN_SRC org :exports none
#+name: imtable
<insert-your-table-here>
#+END_SRC


This gives you the images in a form you can view and a way to access the
links so you can export them in a different form.

For example,

#+BEGIN_SRC emacs-lisp :var a=imtable :exports results :results raw
  (mapconcat (lambda(y) 
               (mapconcat 
                (lambda(x) (org-export-string-as x 'latex t)) y "")) a "")
#+END_SRC

exports as 

\includegraphics[width=.9\linewidth]{img3070YH.png}
\includegraphics[width=.9\linewidth]img307BjN.png}
\includegraphics[width=.9\linewidth]img307OtT.png}
\includegraphics[width=.9\linewidth]img307b3Z.png}

when the elements in the table are the image paths img*.png as shown.


HTH,

Chuck

  parent reply	other threads:[~2013-09-12  4:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-12  1:56 LaTeX export: images subplots Martin Leduc
2013-09-12  2:47 ` John Hendy
2013-09-12  3:13   ` Martin Leduc
2013-09-12  3:19     ` John Hendy
2013-09-13  3:32       ` Martin Leduc
2013-09-13 11:02   ` Suvayu Ali
2013-09-12  4:45 ` Charles Berry [this message]
2013-09-12 10:38 ` Rasmus

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=loom.20130912T062059-594@post.gmane.org \
    --to=ccberry@ucsd.edu \
    --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).