[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org ee40458 25/41: lisp/ox-latex.el: Allow arbitrary fl
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org ee40458 25/41: lisp/ox-latex.el: Allow arbitrary float environments |
Date: |
Sun, 16 May 2021 04:57:20 -0400 (EDT) |
branch: externals/org
commit ee40458d0071f6ebe21da780c56bbbcd93b9d494
Author: Thomas S. Dye <tsd@tsdye.online>
Commit: Bastien <bzg@gnu.org>
lisp/ox-latex.el: Allow arbitrary float environments
* lisp/ox-latex.el (org-latex--inline-image)
(org-latex--decorate-table): Recognize arbitrary :float value.
* etc/ORG-NEWS: Announce new :float capability.
LaTeX users are able to define arbitrary float types.
This patch makes them accessible from Org mode.
---
etc/ORG-NEWS | 9 ++++++++-
lisp/ox-latex.el | 25 +++++++++++++++++++------
2 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index b987b7a..ab96ec3 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -178,7 +178,7 @@ See [[msg:875z8njaol.fsf@protesilaos.com][this thread]].
See [[msg:87im57fh8j.fsf@gmail.com][this thread]].
-*** =ob-python= improvements to =:return= header argument
+*** =ob-python= improvements to =:return= header argument
The =:return= header argument in =ob-python= now works for session
blocks as well as non-session blocks. Also, it now works with the
@@ -250,6 +250,13 @@ Example:
: #+startup: show3levels
+*** LaTeX attribute ~:float~ now passes through arbitrary values
+
+LaTeX users are able to define arbitrary float types, e.g. with the
+float package. The Org mode LaTeX exporter is now able to process and
+export arbitrary float types. The user is responsible for ensuring
+that Org mode configures LaTeX to process any new float type.
+
*** New =u= table formula flag to enable Calc units simplification mode
A new =u= mode flag for Calc formulas in Org tables has been added to
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index c3fc83b..316bbb6 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -2384,8 +2384,8 @@ used as a communication channel."
((string= float "sideways") 'sideways)
((string= float "multicolumn") 'multicolumn)
((and (plist-member attr :float) (not float)) 'nonfloat)
- ((or float
- (org-element-property :caption parent)
+ (float float)
+ ((or (org-element-property :caption parent)
(org-string-nw-p (plist-get attr :caption)))
'figure)
(t 'nonfloat))))
@@ -2477,6 +2477,18 @@ used as a communication channel."
nil t))))
;; Return proper string, depending on FLOAT.
(pcase float
+ ((and (pred stringp) env-string)
+ (format "\\begin{%s}%s
+%s%s
+%s%s
+%s\\end{%s}"
+ env-string
+ placement
+ (if caption-above-p caption "")
+ (if center "\\centering" "")
+ comment-include image-code
+ (if caption-above-p "" caption)
+ env-string))
(`wrap (format "\\begin{wrapfigure}%s
%s%s
%s%s
@@ -3207,9 +3219,9 @@ centered."
(defun org-latex--decorate-table (table attributes caption above? info)
"Decorate TABLE string with caption and float environment.
-ATTRIBUTES is the plist containing is 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
+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."
@@ -3218,7 +3230,8 @@ Return new environment, as a string."
(cond ((and (not float) (plist-member attributes :float)) nil)
((member float '("sidewaystable" "sideways")) "sidewaystable")
((equal float "multicolumn") "table*")
- ((or float (org-string-nw-p caption)) "table")
+ (float float)
+ ((org-string-nw-p caption) "table")
(t nil))))
(placement
(or (plist-get attributes :placement)
- [elpa] externals/org e53572e 18/41: Fix code typo in 06c064e9, (continued)
- [elpa] externals/org e53572e 18/41: Fix code typo in 06c064e9, ELPA Syncer, 2021/05/16
- [elpa] externals/org c6d1150 19/41: Fix code typo in 06c064e9 (take 2), ELPA Syncer, 2021/05/16
- [elpa] externals/org f0447de 22/41: Set org-adapt-indentation explicitly in some tests, ELPA Syncer, 2021/05/16
- [elpa] externals/org cbc450d 31/41: lisp/org-list.el: Fix bug wrt updating statistics, ELPA Syncer, 2021/05/16
- [elpa] externals/org 81c7a2d 23/41: lisp/org-agenda.el: Use "09:00" instead of " 9:00", ELPA Syncer, 2021/05/16
- [elpa] externals/org 72894cd 24/41: Allow moving inlinetasks using org-metaup/down, ELPA Syncer, 2021/05/16
- [elpa] externals/org c77066d 32/41: etc/ORG-NEWS: Add a news entry about ditaa.jar not being bundled, ELPA Syncer, 2021/05/16
- [elpa] externals/org f63cbd3 34/41: lisp/org.el: Fix bug in `org-sort-remove-invisible', ELPA Syncer, 2021/05/16
- [elpa] externals/org 8f39743 16/41: Use cache in org-up-heading-safe, ELPA Syncer, 2021/05/16
- [elpa] externals/org 83ab852 27/41: etc/ORG-NEWS: Various enhancements, ELPA Syncer, 2021/05/16
- [elpa] externals/org ee40458 25/41: lisp/ox-latex.el: Allow arbitrary float environments,
ELPA Syncer <=
- [elpa] externals/org 336efd6 37/41: lisp/*: Use version number when obsoleting, ELPA Syncer, 2021/05/16
- [elpa] externals/org fdd7072 38/41: Merge branch 'master' of code.orgmode.org:bzg/org-mode, ELPA Syncer, 2021/05/16
- [elpa] externals/org 70d98b5 41/41: Merge branch 'master' of code.orgmode.org:bzg/org-mode, ELPA Syncer, 2021/05/16
- [elpa] externals/org df9b509 28/41: lisp/org-attach-git.el: New option `org-attach-git-dir', ELPA Syncer, 2021/05/16
- [elpa] externals/org c7be27d 29/41: Merge remote-tracking branch 'savannah/bugfix', ELPA Syncer, 2021/05/16
- [elpa] externals/org 91373e1 26/41: ox-latex.el: Support specific attributes for verse block, ELPA Syncer, 2021/05/16
- [elpa] externals/org ef495b7 30/41: ox-html: Fix typography in a docstring, ELPA Syncer, 2021/05/16
- [elpa] externals/org 53b5af2 39/41: Merge branch 'maint', ELPA Syncer, 2021/05/16
- [elpa] externals/org b413355 36/41: lisp/ol.el: Enhance message when the link has already been stored, ELPA Syncer, 2021/05/16
- [elpa] externals/org b91e934 33/41: lisp/org.el: Minor enhancement to `org-priority', ELPA Syncer, 2021/05/16