ODT to HTML, formatting

Writing a book, Automating Document Production - Discuss your special needs here

ODT to HTML, formatting

Postby ufoplus » Thu Oct 15, 2020 10:10 pm

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?

OpenOffice 4.1.3
Mac OS High Sierra
Posts: 2
Joined: Thu Oct 15, 2020 9:43 pm

Re: ODT to HTML, formatting

Postby robleyd » Fri Oct 16, 2020 12:10 am

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.
Apache OpenOffice 420m2(Build:9821) - Slackware 14.2 - 64 bit
LibreOffice (SlackBuild for 6.4.6 by Eric Hameleers) - Slackware 14.2 - 64 bit
Apache OpenOffice 4.1.4 - Windows 7 Virtual machine
User avatar
Posts: 3953
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: ODT to HTML, formatting

Postby Bill » Fri Oct 16, 2020 10:13 am

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.10 on Ubuntu MATE 21.04
Posts: 8243
Joined: Sat Nov 24, 2007 6:48 am

Re: ODT to HTML, formatting

Postby ufoplus » Sun Oct 18, 2020 12:51 am

Thank you - that helped !
OpenOffice 4.1.3
Mac OS High Sierra
Posts: 2
Joined: Thu Oct 15, 2020 9:43 pm

Return to Advanced Uses

Who is online

Users browsing this forum: No registered users and 4 guests