emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Problem with org-mode odt exporter for styling exported src code blocks
@ 2019-08-15 10:51 Laurent Geneste
  2019-08-15 11:34 ` Fraga, Eric
  0 siblings, 1 reply; 2+ messages in thread
From: Laurent Geneste @ 2019-08-15 10:51 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1115 bytes --]

------------------------------------------------------------------------
Hello all,

I posted the following message in StackOverflow 
(https://emacs.stackexchange.com/q/51800/9245):

    I try to change the style of src code blocks export with odt
    exporter but it does not work as expected.

    I first exported my org  file to an odt document. Then I changed the
    style of *OrgSrcBlock* (red background) and saved my document as a
    template file (let's say |mystyle.odt|).

    Finally I added |#+ODT_STYLES_FILE: "mystyle.odt"| in the org file
    and re-exported but nothing changed in the resulting odt document.

    I tried the same procedure for the OrgTile style and it works as
    expected (the style is correctly applied in the resulting odt document).

    I'm using Org mode version 9.2.4.

I had no clear answer and I wonder if this is a normal behavior of if it 
could be a bug in the odt exporter. The behavior is the same with Org 
mode version 9.2.5. I attached a set of files (org file, style file, 
exported file) to illustrate the problem.

Laurent




[-- Attachment #1.2: Type: text/html, Size: 1675 bytes --]

[-- Attachment #2: codeml.org --]
[-- Type: text/plain, Size: 301 bytes --]

* Code 

#+name: test
#+begin_src python :results output :exports both
print("First Line")
print("Second Line")
#+end_src

#+RESULTS: test
: First Line
: Second Line

* Config                                   :noexport:

#+options: toc:nil
#+Title: Test ODT exporter
#+ODT_STYLES_FILE: "mystyle.odt"

[-- Attachment #3: mystyle.odt --]
[-- Type: application/vnd.oasis.opendocument.text, Size: 14617 bytes --]

[-- Attachment #4: codeml.odt --]
[-- Type: application/vnd.oasis.opendocument.text, Size: 14556 bytes --]

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

* Re: Problem with org-mode odt exporter for styling exported src code blocks
  2019-08-15 10:51 Problem with org-mode odt exporter for styling exported src code blocks Laurent Geneste
@ 2019-08-15 11:34 ` Fraga, Eric
  0 siblings, 0 replies; 2+ messages in thread
From: Fraga, Eric @ 2019-08-15 11:34 UTC (permalink / raw)
  To: Laurent Geneste; +Cc: emacs-orgmode@gnu.org

On Thursday, 15 Aug 2019 at 12:51, Laurent Geneste wrote:
>    I try to change the style of src code blocks export with odt
>    exporter but it does not work as expected.

It doesn't work for me either.  I struggled with this some time ago and
never did figure it out.  I did learn a lot about the xml files ODT
uses, mind you.  ;-)

Looking at you two .odt files, the styles.xml files differ *only* in the
OrgSrcBlock definition.  Is org maybe overriding this somehow/somewhere?
Maybe have a look at ox-odt.el and look for the colour "#38393d".


-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.4-401-gfabd6d

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

end of thread, other threads:[~2019-08-15 11:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-15 10:51 Problem with org-mode odt exporter for styling exported src code blocks Laurent Geneste
2019-08-15 11:34 ` Fraga, Eric

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