All formatting lost in .odt after each closing-reopening

This behaviour is specific to Ubuntu only (32-bit, 12.04/13.10, with LibreOffice 4.0.2.2), I haven’t encountered it on my Windows machine.

It amounts to this: all formatting (that is all possible formatting) in .odt documents is gone after the file is closed and reopened. Upon reopening the file presents itself in pure, default, DejaVu Sans Mono 10 pt with absolutely no trace of previous formatting. It is also recursive: let’s say I redo everything, after saving, closing and reopening, everything is back to bare-bone defaults.

This makes .odt in Ubuntu useless for me. Frustratingly, .doc/.docx and .rtf work just fine. What I found is that “exporting” from .doc/.docx to .odt, as opposed to creating and building on an original .odt, makes the problem disappear - you get a fully functional document that preserves everything you throw at it.

Test samples:

link:odt original

link:pdf snapshot

link:docx copy

You are not saving to the ODT format. Notice how the file size is tiny?

$ ls -l formatting-test.*
-rw-r--r-- 1 oweng users  4380 May 29 08:40 formatting-test.docx
-rw-r--r-- 1 oweng users   618 May 29 08:39 formatting-test.odt
-rw-r--r-- 1 oweng users 51274 May 29 08:39 formatting-test.pdf

The ODT is Encoded Text (UTF-8 with byte order mark encoding):

$ file formatting-test.odt 
formatting-test.odt: UTF-8 Unicode (with BOM) text
$ file -bi formatting-test.odt 
text/plain; charset=utf-8
$ hexdump -n 128 -C formatting-test.odt 
00000000  ef bb bf 52 6f 6d c3 a2  6e c4 83 0a 4d 61 6a 6f  |...Rom..n...Majo|
00000010  72 69 74 61 74 65 61 20  66 75 6e 63 c8 9b 69 6f  |ritatea func..io|
00000020  6e 61 72 69 6c 6f 72 20  64 65 20 73 74 61 74 20  |narilor de stat |
00000030  65 73 74 65 20 61 6c 63  c4 83 74 75 69 74 c4 83  |este alc..tuit..|
00000040  20 64 69 6e 20 70 65 72  73 6f 61 6e 65 20 61 70  | din persoane ap|
00000050  72 6f 70 69 61 74 65 20  63 65 6c 65 69 6c 61 6c  |ropiate celeilal|
00000060  74 65 20 70 c4 83 72 c8  9b 69 2e 0a 52 69 64 69  |te p..r..i..Ridi|
00000070  63 c4 83 2d c8 9b 69 20  62 6c 75 7a 6f 6e 75 6c  |c..-..i bluzonul|

You appear to have set your default file format to UTF-8 text. Tools > Options… > Load/Save > General > Default file format and ODF settings section > *Always save as ODF Text Document OR when saving make sure you are not selecting a File Type of “Text Encoded”.

Everything’s set up properly but, at the same time, you’re right! I’ve been doing a stupid thing for some time, right-clicking new “empty” documents and stamping them with odt extensions in Ubuntu, without giving it any thought, as the simpler way of getting documents created where I wanted them. I was wondering why they’re so small but kept saying to myself LO/Ubuntu are probably to blame, since a 0 byte file should be taken care of (proper headers etc.) upon its first run in Writer etc. Thanks

Could you please attach an example document, something like this text is bold, this is italic so I could take a look and see if the information is in the document.

Hi, I added samples: the original .odt, a .pdf and a .docx export. Sadly, as per my other question posted here earlier, on my Windows machine the .odt suffers from bad character encoding. Hope this helps.