emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] ox-latex.el: Wrap table into figure environment
@ 2013-07-02  6:36 Xavier Garrido
  2013-07-02  9:20 ` Rasmus
  0 siblings, 1 reply; 2+ messages in thread
From: Xavier Garrido @ 2013-07-02  6:36 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

Hi Orgers,

Since I did not find another way to do it, I would like to submit the 
following patch

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 09928a4..3da2dd5 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -2333,6 +2333,7 @@ This function assumes TABLE has `org' as its 
`:type' property and
  			 ((and (not float) (plist-member attr :float)) nil)
  			 ((string= float "sidewaystable") "sidewaystable")
  			 ((string= float "multicolumn") "table*")
+			 ((string= float "figure") "figure")
  			 ((or float (org-element-property :caption table))
  			  "table")))))
  	 ;; Extract others display options.

Maybe it is quite "counterintuitive" to use =figure= environment inside 
=table= env. but I heavily use tabular to put figures side-by-side or on 
a grid array (I guess I am not the only one). There may be a better way 
to achieve that...

Cheers,
Xavier

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ox-latex.el: Wrap table into figure environment
  2013-07-02  6:36 [PATCH] ox-latex.el: Wrap table into figure environment Xavier Garrido
@ 2013-07-02  9:20 ` Rasmus
  0 siblings, 0 replies; 2+ messages in thread
From: Rasmus @ 2013-07-02  9:20 UTC (permalink / raw)
  To: emacs-orgmode

Xavier,

> Since I did not find another way to do it, I would like to submit the
> following patch

Great!

> diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
> index 09928a4..3da2dd5 100644
> --- a/lisp/ox-latex.el
> +++ b/lisp/ox-latex.el
> @@ -2333,6 +2333,7 @@ This function assumes TABLE has `org' as its
> :type' property and
>  			 ((and (not float) (plist-member attr :float)) nil)
>  			 ((string= float "sidewaystable") "sidewaystable")
>  			 ((string= float "multicolumn") "table*")
> +			 ((string= float "figure") "figure")
>  			 ((or float (org-element-property :caption table))
>  			  "table")))))
>  	 ;; Extract others display options.



> Maybe it is quite "counterintuitive" to use =figure= environment
> inside =table= env. but I heavily use tabular to put figures
> side-by-side or on a grid array (I guess I am not the only one). There
> may be a better way to achieve that...

Yeah, you should do it with the package subfigure or subcaption.  I
use the latter mostly, recently.  Do /not/ use the package subfig!  Is
there support for this now?  I have no idea.  I've usually just added
it manually, with #+LATEX-lines.  But I agree that support might be
nice.  It could probably be handled how matrices are handled
(i.e. with no newline between the lines tables and #+LATEX_ATTR lines
they are put into the same math environment).  

I don't know how often people requires side-by-side floats, but for me
it would certainly be of interest.  I lack time experimenting with it
right now, though.

–Rasmus

-- 
May contains speling mistake

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-02  9:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-02  6:36 [PATCH] ox-latex.el: Wrap table into figure environment Xavier Garrido
2013-07-02  9:20 ` Rasmus

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).