From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Gray Subject: multicolumn figures in latex Date: Thu, 06 May 2010 13:20:33 +0200 Message-ID: <86mxwdcm4e.fsf@portan.ibr.cs.tu-bs.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O9z8j-00024R-Ma for emacs-orgmode@gnu.org; Thu, 06 May 2010 07:21:13 -0400 Received: from [140.186.70.92] (port=42692 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9z8i-00021S-Cj for emacs-orgmode@gnu.org; Thu, 06 May 2010 07:21:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O9z8c-0004Mr-N3 for emacs-orgmode@gnu.org; Thu, 06 May 2010 07:21:12 -0400 Received: from lo.gmane.org ([80.91.229.12]:56299) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9z8c-0004MO-Cx for emacs-orgmode@gnu.org; Thu, 06 May 2010 07:21:06 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1O9z8Z-0007p3-OK for emacs-orgmode@gnu.org; Thu, 06 May 2010 13:21:03 +0200 Received: from portan.ibr.cs.tu-bs.de ([134.169.34.77]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 06 May 2010 13:21:03 +0200 Received: from chrismgray by portan.ibr.cs.tu-bs.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 06 May 2010 13:21:03 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi, I wanted to make a figure that spanned multiple lines in LaTeX. The way to do that is via the figure* environment. Since org-mode didn't seem to support that, I hacked it in. The patch is attached. Cheers, Chris commit 4cb1a153245189aa062db4545dad76bdf413a1e1 Author: Chris Gray Date: Thu May 6 12:58:00 2010 +0200 Add support for multicolumn figures in LaTeX. Modified lisp/ChangeLog diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7f1a507..74ee48d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-05-06 Chris Gray + + * org-latex.el (org-export-latex-format-image): Add support + for multicolumn figures in LaTeX. + 2010-05-02 Dan Davison * org-src.el (org-edit-src-code): allow-write-back-p had Modified lisp/org-latex.el diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 2051de1..22833b2 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -1881,14 +1881,17 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." (defun org-export-latex-format-image (path caption label attr) "Format the image element, depending on user settings." - (let (ind floatp wrapp placement figenv) + (let (ind floatp wrapp multicolumnp placement figenv) (setq floatp (or caption label)) (setq ind (org-get-text-property-any 0 'original-indentation path)) (when (and attr (stringp attr)) (if (string-match "[ \t]*\\" attr) (setq wrapp t floatp nil attr (replace-match "" t t attr))) (if (string-match "[ \t]*\\" attr) - (setq wrapp nil floatp t attr (replace-match "" t t attr)))) + (setq wrapp nil floatp t attr (replace-match "" t t attr))) + (if (string-match "[ \t]*\\" attr) + (setq multicolumnp t attr (replace-match "" t t attr)))) + (setq placement (cond @@ -1912,6 +1915,11 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." \\includegraphics[%attr]{%path} \\caption{%labelcmd%caption} \\end{wrapfigure}") + (multicolumnp "\\begin{figure*}%placement +\\centering +\\includegraphics[%attr]{%path} +\\caption{%labelcmd%caption} +\\end{figure*}") (floatp "\\begin{figure}%placement \\centering \\includegraphics[%attr]{%path}