ODT to HTML, formatting

Writing a book, Automating Document Production - Discuss your special needs here
Post Reply
ufoplus
Posts: 2
Joined: Thu Oct 15, 2020 9:43 pm

ODT to HTML, formatting

Post by ufoplus »

Hi all,

I'm new here, but would love some advice please.

I'm working on an ODT text doc, with various headings and paragraphs, which I save separately as an HTML file
- and looks great when viewed as a web page in my browser.

In the ODT version, I create indents for my paragraphs & headings, using the tab key & the space bar on my Mac keyboard, and they look fine.
But when I view a saved HTML copy, all those same indents I've created have disappeared - they don't show up, no matter what I try.

Does anyone know what keys I need to use to retain them in the HTML version?

Thanks
OpenOffice 4.1.3
Mac OS High Sierra
User avatar
robleyd
Moderator
Posts: 5082
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: ODT to HTML, formatting

Post by robleyd »

Use Styles to create your indents, setting the first line indent to a suitable value. There is an existing style First line indent which might suit your purposes.

Web browsers treat tabs, line breaks and multiple spaces differently from what you might expect - they are all considered white space and simply rendered as a single space character.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers
Bill
Volunteer
Posts: 8933
Joined: Sat Nov 24, 2007 6:48 am

Re: ODT to HTML, formatting

Post by Bill »

Using tabs and spaces to indent paragraphs is a legacy technique that was used on typewriters. A look at the HTML code produced by Writer reveals that tabs and spaces at the beginning of a paragraph are not exported by Writer, so tabs and spaces can not be used to indent paragraphs.

Using Writer, the indents should be set as paragraph attributes in the paragraph style. These indent settings are exported in the HTML document using the HTML Style attribute.
AOO 4.1.14 on Ubuntu MATE 22.04
ufoplus
Posts: 2
Joined: Thu Oct 15, 2020 9:43 pm

Re: ODT to HTML, formatting

Post by ufoplus »

Thank you - that helped !
OpenOffice 4.1.3
Mac OS High Sierra
Post Reply