emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [odt] [PATCH] Anchoring image to a page


From: Jambunathan K
Subject: Re: [O] [odt] [PATCH] Anchoring image to a page
Date: Mon, 26 Dec 2011 16:31:50 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (windows-nt)

Jeremy

> Jambunathan K <address@hidden> writes:
>
>> 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.)
> OK.
>
>> 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.
> You get the "correct" behavior :) The trick is : you write text and text
> and text. Sometimes, you want to add a picture but you don't want a page
> break. For example, you want to add a big illustration. To render
> correctly, the picture needs its own page but you don't want to break
> the page. In this case you need to anchor the picture to the "page". I
> made an example based on the road book I'm working on :
> http://www.jerryland.fr/tatw/WorldTrip.odt. Quick example visible on
> pages 20 and 23. For information, the first map inclusion was at the
> beginning of 2.1.1 and the second map inclusion at the beginning of
> 2.3.1.
>
> Obviously if you anchor consecutively two pictures to the "same page",
> you could be disappointed by the result but it's an issue you have to
> address with some others parameters which I do not know actually.

I have added support for page-anchored images based on your
suggestions. I have also added support for associating custom frame
styles to the images.

The attached org file and odt file will serve as an illustration.

Thanks for working on this patch and suggesting improvements to the odt
exporter.

Jambunathan K.

#+TITLE:     page.org
#+AUTHOR:    Jambunathan K
#+EMAIL:     address@hidden
#+DATE:      2011-12-25 Sun
#+DESCRIPTION:
#+KEYWORDS:
#+LANGUAGE:  en
#+OPTIONS:   H:3 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS:   TeX:t LaTeX:dvipng skip:nil d:nil todo:t pri:nil tags:not-in-toc

#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport
#+LINK_UP:   
#+LINK_HOME: 
#+XSLT:


* Image1
#+ATTR_ODT: :scale 0.5 :anchor "page" 
#+CAPTION: Centered Image
  [[./org-mode-unicorn.png]]

* Image2
#+ATTR_ODT: :scale 0.5 :anchor "page" :style "OrgPageBottomImage"
  [[./org-mode-unicorn.png]]

  ="OrgPageBottomImage"= is a custom frame style that is defined as
  below in =OrgOdtStyles.xml=.

#+begin_src nxml
  <style:style style:name="OrgPageBottomImage" style:family="graphic" 
style:parent-style-name="Graphics">
   <style:graphic-properties text:anchor-type="page" fo:margin-top="0.21cm" 
fo:margin-bottom="0.21cm" style:vertical-pos="bottom" style:vertical-rel="page" 
style:horizontal-pos="center" style:horizontal-rel="page" 
fo:background-color="transparent" style:background-transparency="100%" 
style:shadow="none" style:mirror="none" fo:clip="rect(0cm, 0cm, 0cm, 0cm)" 
draw:luminance="0%" draw:contrast="0%" draw:red="0%" draw:green="0%" 
draw:blue="0%" draw:gamma="100%" draw:color-inversion="false" 
draw:image-opacity="100%" draw:color-mode="standard">
    <style:background-image/>
   </style:graphic-properties>
  </style:style>
#+end_src




Attachment: page.odt
Description: page.odt


reply via email to

[Prev in Thread] Current Thread [Next in Thread]