org-latex: `org-latex-default-figure-position' for default figure position

* lisp/org-latex.el (org-latex-default-figure-position): New defcustom
  for default placement of latex figures.
  (org-export-latex-tables): Positioning tables using the new
  defcustom variable.
  (org-export-latex-format-image): Positioning images using the new
  defcustom variable.
This commit is contained in:
Eric Schulte 2011-01-28 08:59:47 -07:00
parent 5d9023b384
commit b2ae35471f
1 changed files with 8 additions and 2 deletions

View File

@ -478,6 +478,11 @@ and `org-export-with-tags' instead."
:group 'org-export-latex :group 'org-export-latex
:type 'string) :type 'string)
(defcustom org-latex-default-figure-position "htb"
"Default position for latex figures."
:group 'org-export-latex
:type 'string)
(defcustom org-export-latex-tabular-environment "tabular" (defcustom org-export-latex-tabular-environment "tabular"
"Default environment used to build tables." "Default environment used to build tables."
:group 'org-export-latex :group 'org-export-latex
@ -1785,7 +1790,8 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
(stringp attr) (stringp attr)
(string-match "[ \t]*\\<placement=\\(\\S-+\\)" attr)) (string-match "[ \t]*\\<placement=\\(\\S-+\\)" attr))
(match-string 1 attr) (match-string 1 attr)
"[htb]")) (concat
"[" org-latex-default-figure-position "]")))
(setq caption (and caption (org-export-latex-fontify-headline caption))) (setq caption (and caption (org-export-latex-fontify-headline caption)))
(setq lines (org-split-string raw-table "\n")) (setq lines (org-split-string raw-table "\n"))
(apply 'delete-region (list beg end)) (apply 'delete-region (list beg end))
@ -2105,7 +2111,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
(setq placement (setq placement
(cond (cond
(wrapp "{l}{0.5\\textwidth}") (wrapp "{l}{0.5\\textwidth}")
(floatp "[htb]") (floatp (concat "[" org-latex-default-figure-position "]"))
(t ""))) (t "")))
(when (and attr (stringp attr) (when (and attr (stringp attr)