Score:0

How can I convert text in an Emacs buffer, to a .odt file, from there usable by LibreOffice?

us flag

Assume I've got an ordinary text file in an Emacs buffer. I want to convert it to a .odt file, possibly adding italics and/or boldface characters. From lisp I can do anything Emacs can do; also, I can pass bash commands to a bash window, as needed. Once I've created the .odt version I assume LibreOffice can be used without too much aggravation. How do you suggest I proceed?

24601 avatar
in flag
please read [ask] then [edit] your question accordingly in particular, the version of ubuntu you are using and your versions of Emacs and LO. Why can't you just open LO Write and `paste` the text?
Score:2
it flag

I do this often. Copy the text into Emacs's kill buffer (ESC < ESC > ESC w), open a LibreOffice text document, Paste.

Much easier than trying to generate .odt format inside Emacs.

daveboss avatar
us flag
I should have said: part of my copied text was italicized [italic text property applied]. The
Score:2
cn flag

To convert plain text in a text buffer to an .odt file, you will need to study the file format of the .odt file format. Essentially, an .odt is a zip-compressed file, containing text and graphics of the document organized in a specified folder structure. Thus, that will require some research from your part and some Lisp programming if nobody did this before and published the code.

Ask yourself whether there are likely better ways. If you save to a plain text file, you will be able to open it in LibreOffice without effort. Text could also be copied to the clipboard and pasted.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.