Browse Source

ox-latex: Add a `t' value for `:float' in tables and figures

* org-latex--inline-image: default `figure' environment
* org-latex--decorate-table: default table environment
* doc/org-manual.org (Tables in LaTeX export): add `t' and arbitrary
`:float' values
* doc/org-manual.org (Images in LaTeX export): add `t' and arbitrary
`:float' values
Juan Manuel Macias 3 years ago
parent
commit
1291e89d2d
2 changed files with 15 additions and 3 deletions
  1. 13 3
      doc/org-manual.org
  2. 2 0
      lisp/ox-latex.el

+ 13 - 3
doc/org-manual.org

@@ -13572,7 +13572,12 @@ include:
 
   The table environments by default are not floats in LaTeX.  To make
   them floating objects use =:float= with one of the following
-  options: =sideways=, =multicolumn=, =t=, and =nil=.
+  options: =t= (for a default =table= environment), =sideways= (for a
+  =sidewaystable= environment), =multicolumn= (to span the table
+  across multiple columns of a page in a =table*= environment) and
+  =nil=.  In addition to these three values, =:float= can pass through
+  any arbitrary value, for example a user-defined float type with the
+  =float= LaTeX package.
 
   LaTeX floats can also have additional layout =:placement=
   attributes.  These are the usual =[h t b p ! H]= permissions
@@ -13686,8 +13691,7 @@ attribute to one of the following:
 
 - =t= ::
 
-  For a standard =figure= environment; used by default whenever an
-  image has a caption.
+  For a default =figure= environment.
 
 - =multicolumn= ::
 
@@ -13708,6 +13712,12 @@ attribute to one of the following:
 
   To avoid a =:float= even if using a caption.
 
+- Any arbitrary value ::
+
+  For example, a user-defined float type with the =float= LaTeX
+  package.
+
+
 Use the =placement= attribute to modify a floating environment's
 placement.
 

+ 2 - 0
lisp/ox-latex.el

@@ -2414,6 +2414,7 @@ used as a communication channel."
 		  (cond ((string= float "wrap") 'wrap)
 			((string= float "sideways") 'sideways)
 			((string= float "multicolumn") 'multicolumn)
+                        ((string= float "t") 'figure)
 			((and (plist-member attr :float) (not float)) 'nonfloat)
                         (float float)
 			((or (org-element-property :caption parent)
@@ -3269,6 +3270,7 @@ Return new environment, as a string."
 	    (cond ((and (not float) (plist-member attributes :float)) nil)
 		  ((member float '("sidewaystable" "sideways")) "sidewaystable")
 		  ((equal float "multicolumn") "table*")
+                  ((string= float "t") "table")
                   (float float)
 		  ((org-string-nw-p caption) "table")
 		  (t nil))))