From 45e881f925498e4da71f395c2cf17a7d245ffe8e Mon Sep 17 00:00:00 2001
From: Greg Tucker-Kellogg <gtuckerkellogg@gmail.com>
Date: Sun, 6 Apr 2014 12:00:16 +0800
Subject: [PATCH 2/2] Documented and standardised "sideways" options for tables
 and figures for LaTeX exporter.

---
 doc/org.texi     | 14 ++++++++++----
 lisp/ox-latex.el |  9 +++++----
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index 9205abb..18178d3 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -11696,10 +11696,11 @@ task, you can use @code{:caption} attribute instead.  Its value should be raw
 @LaTeX{} code.  It has precedence over @code{#+CAPTION}.
 @item :float
 @itemx :placement
-Float environment for the table.  Possible values are @code{sidewaystable},
-@code{multicolumn}, @code{t} and @code{nil}.  When unspecified, a table with
-a caption will have a @code{table} environment.  Moreover, @code{:placement}
-attribute can specify the positioning of the float.
+The @code{:float} specifies the float environment for the table.  Possible values are @code{sideways},
+(or equivalently @code{sidewaystable}), @code{multicolumn}, @code{t} and @code{nil}.  When unspecified, a table with
+a caption will have a @code{table} environment.  Moreover, the @code{:placement}
+attribute can specify the positioning of the float. Note: @code{:placement} is
+ignored for sidewaystable.
 @item :align
 @itemx :font
 @itemx :width
@@ -11802,6 +11803,11 @@ environment.
 @code{wrap}: if you would like to let text flow around the image.  It will
 make the figure occupy the left half of the page.
 @item
+@code{sideways}: if you would like the image to appear alone on a separate
+page rotated ninety degrees using the @code{sidewaysfigure}
+environment. Setting this @code{:float} option will ignore the
+@code{:placement} setting.
+@item
 @code{nil}: if you need to avoid any floating environment, even when
 a caption is provided.
 @end itemize
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index c05ffb6..eccfa3d 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -1801,7 +1801,7 @@ used as a communication channel."
 	 (float (let ((float (plist-get attr :float)))
 		  (cond ((and (not float) (plist-member attr :float)) nil)
 			((string= float "wrap") 'wrap)
-			((string= float "sidewaysfigure") 'sidewaysfigure)
+			((string= float "sideways") 'sideways)
 			((string= float "multicolumn") 'multicolumn)
 			((or float
 			     (org-element-property :caption parent)
@@ -1877,10 +1877,10 @@ used as a communication channel."
 \\centering
 %s%s
 %s\\end{wrapfigure}" placement comment-include image-code caption))
-      (sidewaysfigure (format "\\begin{sidewaysfigure}%s
+      (sideways (format "\\begin{sidewaysfigure}
 \\centering
 %s%s
-%s\\end{sidewaysfigure}" placement comment-include image-code caption))
+%s\\end{sidewaysfigure}" comment-include image-code caption))
       (multicolumn (format "\\begin{figure*}%s
 \\centering
 %s%s
@@ -2552,7 +2552,8 @@ This function assumes TABLE has `org' as its `:type' property and
 		      (let ((float (plist-get attr :float)))
 			(cond
 			 ((and (not float) (plist-member attr :float)) nil)
-			 ((string= float "sidewaystable") "sidewaystable")
+			 ((or (string= float "sidewaystable")
+			      (string= float "sideways")) "sidewaystable")
 			 ((string= float "multicolumn") "table*")
 			 ((or float
 			      (org-element-property :caption table)
-- 
1.8.4.3

