From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: [odt] [PATCH] Anchoring image to a page Date: Fri, 25 Nov 2011 01:51:43 +0530 Message-ID: <817h2pxodk.fsf_-_@gmail.com> References: <81pqgh4bon.fsf@gmail.com> <86ipm9gvgq.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:57379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTfo8-0004FE-8K for emacs-orgmode@gnu.org; Thu, 24 Nov 2011 15:22:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTfo6-0002Sv-GO for emacs-orgmode@gnu.org; Thu, 24 Nov 2011 15:22:08 -0500 Received: from mail-iy0-f169.google.com ([209.85.210.169]:47724) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTfo6-0002Sh-AN for emacs-orgmode@gnu.org; Thu, 24 Nov 2011 15:22:06 -0500 Received: by iaek3 with SMTP id k3so4630518iae.0 for ; Thu, 24 Nov 2011 12:22:02 -0800 (PST) In-Reply-To: <86ipm9gvgq.fsf@gmail.com> (=?utf-8?B?IkrDqXLDqW15?= Compostella"'s message of "Thu, 24 Nov 2011 20:40:37 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?utf-8?B?SsOpcsOpbXk=?= Compostella Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Jeremy > What about the second patch ? I'm very interested in seeing it > merged. I did a quick run of the attached patch (authored by you). When I do this: #+ATTR_ODT: :anchor page [[./org-mode-unicorn.png]] I see that the image is anchored to the page as expected. But the moment I attach a caption and label to it like this: #+CAPTION: caption #+LABEL: label #+ATTR_ODT: :anchor page [[./org-mode-unicorn.png]] the image is no longer anchored to the page. I need to make additional modifications to achieve the desired effect for captioned images. (Let me do this modification myself.) I am wondering what your use case is. For example, when someone does this: #+ATTR_ODT: :anchor page [[./org-mode-unicorn.png]] some text #+ATTR_ODT: :anchor page [[./org-mode-unicorn.png]] what do you think should be the desired behaviour. Practically, I see that the images get super-posed one on top of the other on the same page (i.e, effectively I see only one image). I am wondering what the trick is to embed multiple page anchored images in the document. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-odt.el-Add-page-anchor-image-type-support.patch >From 213cfc2a9c44a93639afe460fe2f8dbee793bcd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Compostella?= Date: Fri, 18 Nov 2011 16:39:17 +0100 Subject: [PATCH] org-odt.el: Add page anchor image type support. This patch enables : - The possibility to select the image anchor type with the ATTR_ODT tag - The "page" anchor type This patch is very useful to get "floating pictures". --- contrib/lisp/org-odt.el | 15 +++++++++------ contrib/odt/styles/OrgOdtStyles.xml | 5 +++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/contrib/lisp/org-odt.el b/contrib/lisp/org-odt.el index 81abf5d..1d60b13 100644 --- a/contrib/lisp/org-odt.el +++ b/contrib/lisp/org-odt.el @@ -1495,12 +1495,12 @@ ATTR is a string of other attributes of the a element." (latex-frag (org-find-text-property-in-string 'org-latex-src src)) (category (and latex-frag "__DvipngImage__")) - (embed-as (or embed-as - (if latex-frag - (or (org-find-text-property-in-string - 'org-latex-src-embed-type src) 'character) - 'paragraph))) (attr-plist (org-lparse-get-block-params attr)) + (embed-as (cond (embed-as) + (latex-frag (or (org-find-text-property-in-string + 'org-latex-src-embed-type src) 'character)) + ((plist-get attr-plist :anchor)) + ('paragraph))) (size (org-odt-image-size-from-file src (plist-get attr-plist :width) (plist-get attr-plist :height) @@ -1514,6 +1514,7 @@ ATTR is a string of other attributes of the a element." (case embed-as (paragraph (org-odt-format-entity "DisplayImage" href width height)) (character (org-odt-format-entity "InlineImage" href width height)) + (page (org-odt-format-entity "PageImage" href width height)) (t (error "Unknown value for embed-as %S" embed-as)))) (t (org-odt-format-entity @@ -1565,6 +1566,7 @@ ATTR is a string of other attributes of the a element." (defvar org-odt-entity-frame-styles '(("InlineImage" "__Figure__" ("OrgInlineImage" nil "as-char")) ("DisplayImage" "__Figure__" ("OrgDisplayImage" nil "paragraph")) + ("PageImage" "__Figure__" ("OrgPageImage" nil "page")) ("CaptionedDisplayImage" "__Figure__" ("OrgCaptionedImage" " style:rel-width=\"100%\" style:rel-height=\"scale\"" "paragraph") @@ -1619,7 +1621,8 @@ ATTR is a string of other attributes of the a element." (defvar org-export-odt-default-image-sizes-alist '(("character" . (5 . 0.4)) - ("paragraph" . (5 . 5))) + ("paragraph" . (5 . 5)) + ("page" . (5 . 5))) "Hardcoded image dimensions one for each of the anchor methods.") diff --git a/contrib/odt/styles/OrgOdtStyles.xml b/contrib/odt/styles/OrgOdtStyles.xml index 5ec868a..df4f3f4 100644 --- a/contrib/odt/styles/OrgOdtStyles.xml +++ b/contrib/odt/styles/OrgOdtStyles.xml @@ -375,6 +375,11 @@ + + + + + -- 1.7.5.4 --=-=-= Content-Type: text/plain -- --=-=-=--