Function: org-latex--decorate-table

org-latex--decorate-table is a byte-compiled function defined in ox-latex.el.gz.

Signature

(org-latex--decorate-table TABLE ATTRIBUTES CAPTION ABOVE? INFO)

Documentation

Decorate TABLE string with caption and float environment.

ATTRIBUTES is the plist containing LaTeX attributes. CAPTION is its caption, as a string or nil. It is located above the table if ABOVE? is non-nil. INFO is the plist containing current export parameters.

Return new environment, as a string.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox-latex.el.gz
(defun org-latex--decorate-table (table attributes caption above? info)
  "Decorate TABLE string with caption and float environment.

ATTRIBUTES is the plist containing LaTeX attributes.  CAPTION is
its caption, as a string or nil.  It is located above the table
if ABOVE? is non-nil.  INFO is the plist containing current
export parameters.

Return new environment, as a string."
  (let* ((float-environment
	  (let ((float (plist-get attributes :float)))
	    (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))))
	 (placement
	  (or (plist-get attributes :placement)
	      (format "[%s]" (plist-get info :latex-default-figure-position))))
	 (center? (if (plist-member attributes :center)
		      (plist-get attributes :center)
		    (plist-get info :latex-tables-centered)))
	 (fontsize (let ((font (plist-get attributes :font)))
		     (and font (concat font "\n")))))
    (concat (cond
	     (float-environment
	      (concat (format "\\begin{%s}%s\n" float-environment placement)
		      (if above? caption "")
		      (when center? "\\centering\n")
		      fontsize))
	     (caption
	      (concat (and center? "\\begin{center}\n" )
		      (if above? caption "")
		      (cond ((and fontsize center?) fontsize)
			    (fontsize (concat "{" fontsize))
			    (t nil))))
	     (center? (concat "\\begin{center}\n" fontsize))
	     (fontsize (concat "{" fontsize)))
	    table
	    (cond
	     (float-environment
	      (concat (if above? "" (concat "\n" caption))
		      (format "\n\\end{%s}" float-environment)))
	     (caption
	      (concat (if above? "" (concat "\n" caption))
		      (and center? "\n\\end{center}")
		      (and fontsize (not center?) "}")))
	     (center? "\n\\end{center}")
	     (fontsize "}")))))