From a4ff98eb82397721a152b3c3e51f6a993947140d Mon Sep 17 00:00:00 2001 From: Pablo Palazon Date: Thu, 14 May 2020 16:33:53 +0200 Subject: [PATCH 1/3] ox-latex.el: Add margin to float option for attr_latex in images * lisp/ox-latex.el (org-latex--inline-image): Include margin option to create marginfigure environment for figures. It's useful for tufte latex class, where with this environment shows the figure in the margin. TINYCHANGE --- lisp/ox-latex.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 6535d59f8..4b9281e1a 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -2374,6 +2374,7 @@ used as a communication channel." (cond ((string= float "wrap") 'wrap) ((string= float "sideways") 'sideways) ((string= float "multicolumn") 'multicolumn) + ((string= float "margin") 'marginfigure) ((and (plist-member attr :float) (not float)) 'nonfloat) ((or float (org-element-property :caption parent) @@ -2494,6 +2495,15 @@ used as a communication channel." (if center "\\centering" "") comment-include image-code (if caption-above-p "" caption))) + (`marginfigure (format "\\begin{marginfigure}%s +%s%s +%s%s +%s\\end{marginfigure}" + placement + (if caption-above-p caption "") + (if center "\\centering" "") + comment-include image-code + (if caption-above-p "" caption))) (`figure (format "\\begin{figure}%s %s%s %s%s -- 2.26.2