emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Re: Figure and table captions in org-odt.el
       [not found] <1331991533.26771.5.camel@basil>
@ 2012-03-17 16:11 ` Jambunathan K
  2012-03-17 17:11   ` Jambunathan K
  2012-03-19  8:11   ` Martin Gürtler
  0 siblings, 2 replies; 3+ messages in thread
From: Jambunathan K @ 2012-03-17 16:11 UTC (permalink / raw)
  To: Martin Gürtler; +Cc: Orgmode

Hello Martin

> Hi,
>
> I was trying to localise the captions of figures or tables. This seems
> not to be built-in (in contrast to the built-in localisation of
> table-of-contents). I wonder whether it is easily possible to get
> "Abbildung 1: ..." instead of the automatic "Figure 1: ..."  in figure
> (and table) captions.

Currently there is no custom setting for it.

For now, you can try out the following.

Locate your "OrgOdtContentTemplate.xml".  This file is located under the
styles directory.  See the *Messages* buffer for an output like this:

,---- *Messages*
| Debug (org-odt): Searching for OpenDocument styles files...
| Debug (org-odt): Trying c:/Documents and Settings/kjambunathan/My Documents/My Data/src/org-mode/etc/styles/...
| Debug (org-odt): Using styles under c:/Documents and Settings/kjambunathan/My Documents/My Data/src/org-mode/etc/styles/
`----

Towards the end of the file, you will find a
`<text:sequence-decls>...</text:sequence-decls>' block.  These are the
OpenDocument "variables" that are used for counting Figures, Tables etc.

Replace text:name="Figure" with text:name="Abbildung".  You can do
likewise for other categories.

,----
| diff --git a/etc/styles/OrgOdtContentTemplate.xml b/etc/styles/OrgOdtContentTemplate.xml
| index cd7ff0e..beeb7f8 100644
| --- a/etc/styles/OrgOdtContentTemplate.xml
| +++ b/etc/styles/OrgOdtContentTemplate.xml
| @@ -255,7 +255,7 @@
|  	<text:sequence-decl text:display-outline-level="0" text:name="Text"/>
|  	<text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
|  	<text:sequence-decl text:display-outline-level="0" text:name="Equation"/>
| -	<text:sequence-decl text:display-outline-level="0" text:name="Figure"/>
| +	<text:sequence-decl text:display-outline-level="0" text:name="Abbildung"/>
|        </text:sequence-decls>
|      </office:text>
|    </office:body>
`----

Now add the following to your init file.  You can compare the default
setting of `org-odt-category-map-alist' with the value below.  Here
also, you have replaced "Figure" with "Abbildung".

#+begin_src emacs-lisp
  (eval-after-load 'org-odt
    '(setq org-odt-category-map-alist
           '(("__Table__" "Table" "value")
             ("__Figure__" "Abbildung" "value")
             ("__MathFormula__" "Equation" "text")
             ("__DvipngImage__" "Equation" "value"))))
#+end_src

This should do what you want.  Let me know how it goes.

> Thanks,
>
> Martin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Figure and table captions in org-odt.el
  2012-03-17 16:11 ` Figure and table captions in org-odt.el Jambunathan K
@ 2012-03-17 17:11   ` Jambunathan K
  2012-03-19  8:11   ` Martin Gürtler
  1 sibling, 0 replies; 3+ messages in thread
From: Jambunathan K @ 2012-03-17 17:11 UTC (permalink / raw)
  To: Martin Gürtler; +Cc: Orgmode


A small side note:

Instead of modifying the default "OrgOdtContentTemplate.xml" *directly*,
you can do the following.  Make a *copy* of the file, do the required
modification and then customize `org-export-odt-content-template-file'
to point to the new template file.

> Locate your "OrgOdtContentTemplate.xml".  This file is located under the
> styles directory.  See the *Messages* buffer for an output like this:
>
> ,---- *Messages*
> | Debug (org-odt): Searching for OpenDocument styles files...
> | Debug (org-odt): Trying c:/Documents and Settings/kjambunathan/My
> | Documents/My Data/src/org-mode/etc/styles/...
> | Debug (org-odt): Using styles under c:/Documents and
> | Settings/kjambunathan/My Documents/My Data/src/org-mode/etc/styles/
> `----
>
> Towards the end of the file, you will find a
> `<text:sequence-decls>...</text:sequence-decls>' block.  These are the
> OpenDocument "variables" that are used for counting Figures, Tables etc.
>
> Replace text:name="Figure" with text:name="Abbildung".  You can do
> likewise for other categories.
>
> ,----
> | diff --git a/etc/styles/OrgOdtContentTemplate.xml b/etc/styles/OrgOdtContentTemplate.xml
> | index cd7ff0e..beeb7f8 100644
> | --- a/etc/styles/OrgOdtContentTemplate.xml
> | +++ b/etc/styles/OrgOdtContentTemplate.xml
> | @@ -255,7 +255,7 @@
> |  	<text:sequence-decl text:display-outline-level="0" text:name="Text"/>
> |  	<text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
> |  	<text:sequence-decl text:display-outline-level="0" text:name="Equation"/>
> | -	<text:sequence-decl text:display-outline-level="0" text:name="Figure"/>
> | +	<text:sequence-decl text:display-outline-level="0" text:name="Abbildung"/>
> |        </text:sequence-decls>
> |      </office:text>
> |    </office:body>
> `----

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Figure and table captions in org-odt.el
  2012-03-17 16:11 ` Figure and table captions in org-odt.el Jambunathan K
  2012-03-17 17:11   ` Jambunathan K
@ 2012-03-19  8:11   ` Martin Gürtler
  1 sibling, 0 replies; 3+ messages in thread
From: Martin Gürtler @ 2012-03-19  8:11 UTC (permalink / raw)
  To: Jambunathan K; +Cc: Orgmode

Hi,

this is doing what I want. I had already suspected
org-odt-category-map-alist, but I had missed the fact that the xml file
has to be changed as well.

Thanks,

Martin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-03-19  8:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1331991533.26771.5.camel@basil>
2012-03-17 16:11 ` Figure and table captions in org-odt.el Jambunathan K
2012-03-17 17:11   ` Jambunathan K
2012-03-19  8:11   ` Martin Gürtler

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).