org-mode-ox-odt
org-mode-ox-odt copied to clipboard
How to create a Landscape document with a table on it's own page. Add OrgLandscape page style to default style
How to create a Landscape document with a table on it's own page?
See attachment
Add OrgLandscape page style to default style
Yes, I will add it.
Thanks for the example
Uwe
It kind of worked, but now it does not. I restarted emacs I unzipped again Uwe.zip I try to convert as I did before your file test.org but now I receive OpenDocument export failed: Format specifier doesn’t match argument type
(with-eval-after-load 'ox-html
(unless (featurep 'ox-odt)
(require 'ox-odt))
(add-to-list
'org-export-filter-parse-tree-functions
(defun org-html--translate-list-tables (tree backend info)
(if (eq backend 'html)
(org-odt--translate-list-tables tree backend info)
tree))))
That blog post talks about HTML exporter. That is why the recipe there talks about adding a function--specifically org-odt--translate-list-tables
--that is available in ox-odt
export as a parse tree filter for use with HTML exporter. If you are only interested in ODT export then that filter is already there by default, and you don't have to do anything. See https://github.com/kjambunathan/org-mode-ox-odt/blob/f022150f3a046511dba18a509de621ec35daf075/lisp/ox-odt.el#L95 and few lines following it. You can see for yourself that there is no such thing in the HTML exporter.
Shall i set explictly the path to the directory via (setq load-path (cons (expand-file-name "~/.emacs.d/elpa/od-odt-9.3.7.320") load-path)) shall i open a new issue
What you have done above is the best solution.
I have very little control over how a user's init file are setup and how the modules are getting loaded. That said,
In my .emacs, I have set up my own load-path
and it is followed up by (package-activate-all)
. I see that (package-activate-all)
pushes in to load-path
and the elpa packages take precedence over the repo or system-wide files. (This is news to me, and it surprises me. Anyways, as a developer, I always do a manual load-file
. So, I never had an opportunity to examine the load-path
in closer detail.)
When I have time I will dig in to
(info "(emacs) Package Installation")
and
(info "(emacs) Early Init File")
specifically the package-specific defcustom
variables and the handling of package-activate-all
etc.
(TBH, I never bothered about what all package
does all these days)
From what you say it looks like ox-odt
is getting autoloaded by some other library, much before even you setup the load-path
.
If you are really curious who is loading the ox-odt
exporter, try the suggestions you see below from the reddit thread titled How find out what code is loading a package
(with-eval-after-load 'the-package
(debug))
Alternatively, for after the fact, you can try M-x unload-feature the-package RET
and youshould get an error message along the lines of Loaded libraries (".../dir/foo.elc" ".../dir/bar.elc") depend on .../dir/the-package.elc
Look at the value of variable load-history
. Search for the
library you're interested, to seen when it's loaded, and what is
loaded before it etc.
You could try adding something like the following in your init:
(add-hook 'after-load-functions
(lambda (path)
(when (equal path "path/to/the/file")
(debug))))
Trace the loading by add-variable-watcher
to 'load-file-name`.
I am curious to know what you find. Other people have reported similar issues. AFAIK, @QiangF is the only one user who uses ox-odt exporter regularly. I am not sure how he has set things up ....
Shall i set explictly the path to the directory via (setq load-path (cons (expand-file-name "~/.emacs.d/elpa/od-odt-9.3.7.320") load-path)) shall i open a new issue
You can also do an explicit
(load-file ".....")
towards the bottom of init file. This way you don't have to bother about load-path
even. I don't really release ox-odt
much often. So, it shouldn't be much of a problem.
Another solution would be to overwrite the Emacs / Org provided ox-odt
with the one from this repo.
"JK" == Jambunathan K @.***> writes:
Shall i set explictly the path to the directory via (setq load-path (cons (expand-file-name "~/.emacs.d/elpa/od-odt-9.3.7.320") load-path)) shall i open a new issue
What you have done above is the best solution.
Ok, I will stick to that for the moment, since I am very busy, but I will debug it, when time permits it, promised.
Just to see whether I understand the landscape issue correctly.
I export the org file in question to odt. I change in libreoffice the page setting to landscape. I save the odt file as ott (I also changed the name to landscape.ott)
I add to the org file
#+odt_styles_file: landscape.ott
Change the org file if necessary and export it again. Now all pages are in landscape format, as I desired.
At least this is what I did and it worked, am I right? I did not change anything else in the org file besides the call
#+odt_styles_file: landscape.ott
It seems not the same what you proposed but it works.
Uwe