emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jambunathan K <kjambunathan@gmail.com>
To: Rainer Stengele <rainer.stengele@diplan.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: question about ODT export behavior
Date: Fri, 15 Jul 2011 11:24:01 +0530	[thread overview]
Message-ID: <81oc0w9jie.fsf@gmail.com> (raw)
In-Reply-To: <87wrfkx3wo.fsf@gnu.org> (Bastien's message of "Thu, 14 Jul 2011 17:44:55 +0200")


>> Can you give me a hint where I can find some documentation about
>> changing the styles.xml?
>
> You can have a look at contrib/odt/README.org.  Jambunathan points 
> to this message, which can help:
>
>   http://lists.gnu.org/archive/html/emacs-orgmode/2011-03/msg01460.html

Here is the relevant variable.

,----[ C-h v org-export-odt-styles-file RET ]
| org-export-odt-styles-file is a variable defined in `org-odt.el'.
| Its value is nil
| 
| Documentation:
| Default style file for use with ODT exporter.
| Valid values are path to an styles.xml file or a path to a valid
| *.odt or a *.ott file or a list of the form (FILE (MEMBER1
| MEMBER2 ...)). In the last case, the specified FILE is unzipped
| and MEMBER1, MEMBER2 etc are copied in to the generated odt
| file. The last form is particularly useful if the styles.xml has
| reference to additional files like header and footer images.
| 
| 
| You can customize this variable.
| 
| [back]
`----

Here is a specific example:

,----
| (setq org-export-odt-styles-file
|       '("~/tmp-orgmode/Thu Thong Bao - Trai Ve Nguon XV (2011).odt"
|         ("styles.xml" "Pictures/10000000000002740000034B83A526F3.png")))
| 
| the styles.xml and header images would get copied on to the generated
| odt file. 
| 
| If the desired styles.xml makes no references to other files (as in the
| example above) then the above variable could be set to 
| 
| (setq org-export-odt-styles-file
|       "~/tmp-orgmode/Thu Thong Bao - Trai Ve Nguon XV (2011).odt")
| 
| or 
| 
| (setq org-export-odt-styles-file "~/elisp/styles.xml")
`----

I am seeing that customization interface for org-export-odt-styles-file
variable is only partially done. If the customization interface doesn't
do the right thing for you, you can use the setq form temporarily.

The default styles file used by the odt exporter is:
org-root-dir/contrib/odt/styles/OrgOdtStyles.xml

There is also an automatic styles file in there.


If you are interested in customizing the styles you could do this:

1. Export test.org to test.odt

2. Open test.odt and use the OpenOffice stylist to change the
   user-defined styles. The Org-specific user stlyes have `Org' as a
   prefix. 

   Hint: One can use M-x occur RET Org RET in OrgOdtStyles.xml buffer to
   see the Org specific styles.

   Caution: The style-names used in the styles.xml are the style-names
   written out in content.xml. So it is important that the style-names
   be not changed at all. 

3. Save the newly styled test.odt as say ~/.emacs.d/org-odt/custom.odt
   or ~/.emacs.d/org-odt/custom.ott file.

4. Use one of the following:

   1. Customize org-export-odt-styles-file to the custom.odt or
      custom.ott file.

   2. If you are a bit adventurous, you can open the newly saved
      test.odt in an archive-mode, extract the styles.xml and save it to
      ~/.emacs.d/org-odt/user-styles.xml.

      Then customize org-export-odt-styles-file to point to the above
      styles.xml file.

I anticipate more questions and follow-on enhancements to styles
interface as more and more people start using it. So all inputs are
welcome.

Jambunathan K.

>
> HTH,

-- 

  reply	other threads:[~2011-07-15  5:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-13 13:20 question about ODT export behavior Rainer Stengele
2011-07-13 14:23 ` Bastien
2011-07-13 15:04   ` Rainer Stengele
2011-07-13 16:14     ` Bastien
2011-07-13 20:18       ` Jambunathan K
2011-07-13 16:55 ` Jambunathan K
2011-07-13 20:15   ` Jambunathan K
2011-07-14  6:50     ` Rainer Stengele
2011-07-14 15:44       ` Bastien
2011-07-15  5:54         ` Jambunathan K [this message]
2011-07-15 20:34           ` Renzo Been
2011-07-16 20:13             ` ODT Charset/Encoding issues (was question about ODT export behavior) Jambunathan K
2011-07-17 14:12               ` Renzo Been
2011-07-17 19:13                 ` Jambunathan K
2011-07-18  8:59                   ` Bastien
2011-07-22 14:38           ` [PATCH 1/2] org-odt: Improve customization of org-export-odt-styles-file Jambunathan K
2011-07-22 15:49             ` Bastien

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=81oc0w9jie.fsf@gmail.com \
    --to=kjambunathan@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rainer.stengele@diplan.de \
    /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).