From: Pablo Palazon <pablo.palazon@gmail.com>
To: Pablo Palazon <pablo.palazon@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: [PATCH] Add margin option to float for figure in ox-latex.el
Date: Fri, 15 May 2020 19:02:32 +0200 [thread overview]
Message-ID: <CAOKwhjukiLfnfmSx-K4haVDcPdjCXeQKrPK=LeJA9+FMpkLs_w@mail.gmail.com> (raw)
In-Reply-To: <877dxd75jl.fsf@ucl.ac.uk>
[-- Attachment #1.1: Type: text/plain, Size: 300 bytes --]
Thanks eric, I've done the changes and I attach all the patches.
On Fri, May 15, 2020 at 2:21 PM Eric S Fraga <e.fraga@ucl.ac.uk> wrote:
> Just a minor point: in the patch for the documentation, change "imagen"
> to "image".
> --
> : Eric S Fraga via Emacs 28.0.50, Org release_9.3.6-631-g48b223
>
[-- Attachment #1.2: Type: text/html, Size: 616 bytes --]
[-- Attachment #2: 0003-org-manual.org-Fix-type-error.patch --]
[-- Type: text/x-patch, Size: 792 bytes --]
From 46a7fcecf5d2735f3f6f18481b302d4b4f887120 Mon Sep 17 00:00:00 2001
From: Pablo Palazon <pablo.palazon@gmail.com>
Date: Fri, 15 May 2020 18:25:21 +0200
Subject: [PATCH 3/3] org-manual.org: Fix type error
* doc/org-manual.org (Images in LaTeX export): Fix typo error on image
---
doc/org-manual.org | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/org-manual.org b/doc/org-manual.org
index e0c41f13e..b792f588a 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -13572,8 +13572,8 @@ attribute to one of the following:
- =margin= ::
- For use the =marginfigure= environment. This environment shows the imagen in
- the margin
+ For use the =marginfigure= environment. This environment shows the
+ image in the margin
- =nil= ::
--
2.26.2
[-- Attachment #3: 0002-ox-latex.el-Add-documentation-to-margin-option-in-fl.patch --]
[-- Type: text/x-patch, Size: 865 bytes --]
From 5c3eee89e501140460ea974195249a432b213bb2 Mon Sep 17 00:00:00 2001
From: Pablo Palazon <pablo.palazon@gmail.com>
Date: Thu, 14 May 2020 16:55:19 +0200
Subject: [PATCH 2/3] ox-latex.el: Add documentation to margin option in float
* doc/org-manual.org: Add documentation
---
doc/org-manual.org | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/doc/org-manual.org b/doc/org-manual.org
index 673bb11c5..e0c41f13e 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -13570,6 +13570,11 @@ attribute to one of the following:
For a new page with the image sideways, rotated ninety degrees, in
a =sidewaysfigure= environment; overrides =:placement= setting.
+- =margin= ::
+
+ For use the =marginfigure= environment. This environment shows the imagen in
+ the margin
+
- =nil= ::
To avoid a =:float= even if using a caption.
--
2.26.2
[-- Attachment #4: 0001-ox-latex.el-Add-margin-to-float-option-for-attr_late.patch --]
[-- Type: text/x-patch, Size: 1528 bytes --]
From a4ff98eb82397721a152b3c3e51f6a993947140d Mon Sep 17 00:00:00 2001
From: Pablo Palazon <pablo.palazon@gmail.com>
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
next prev parent reply other threads:[~2020-05-15 17:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-14 16:06 [PATCH] Add margin option to float for figure in ox-latex.el Pablo Palazon
2020-05-15 12:21 ` Eric S Fraga
2020-05-15 17:02 ` Pablo Palazon [this message]
2020-05-16 6:37 ` Kyle Meyer
2020-05-16 7:17 ` Louis Gostiaux
2020-05-16 16:46 ` Kyle Meyer
2020-05-16 18:00 ` Thomas S. Dye
2020-05-16 20:35 ` Kyle Meyer
2020-05-17 16:48 ` Thomas S. Dye
2020-05-23 9:12 ` Bastien
[not found] <mailman.39.1589558407.15748.emacs-orgmode@gnu.org>
2020-05-15 16:47 ` Pablo Palazon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAOKwhjukiLfnfmSx-K4haVDcPdjCXeQKrPK=LeJA9+FMpkLs_w@mail.gmail.com' \
--to=pablo.palazon@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).