Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book General > Writers' Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 01-23-2026, 12:16 PM   #1
mdpeterson42
Enthusiast
mdpeterson42 began at the beginning.
 
Posts: 27
Karma: 10
Join Date: May 2024
Device: Kindle
LibreOffice Style Formatting Question

I wrote my first book in HTML and had several issues creating the epub to pass the checks. I got it figured out, thanks to a lot of help from people on this forum, but it took weeks. Several people said it was easier to just format in styles and convert on Calibre. I am going to try that, but there are a couple points of which I am unsure.

First, in HTML, I set it so that the book would use whatever font the reader preferred. My LibreOffice style has a font, obviously. How do I make that conversion?

Second, similarly, my HTML did not dictate font size, other than that chapter headings were comparatively larger than the text. How do I set that up?

Third, some of the text will be "redacted." Will setting up a style with black highlighting accomplish that? Or will that run afoul of people who like dark mode? Is there a style that actually redacts?

Thank you all!
mdpeterson42 is offline   Reply With Quote
Old 01-23-2026, 07:33 PM   #2
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,755
Karma: 9501034
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
I'll get the ball rolling with my thoughts...

You will not get a perfect conversion from from .odt to epub, so I wouldn't stress about making the settings perfect. Even after conversion the CSS will end up with so many styles that you will be sitting there scratching your head wondering where they all came from.

Make sure you use Styles in LibreOffice so everything is correctly tagged then fix the styling in the epub.

Your questions:
Font - Change the font entry in the CSS to font-family: serif; after conversion
Size - In the CSS, set the font size to font-size: 1em; in the body {}.
Redacted - Probably use strikethrough in odt, then change that to the <del> tag in the epub and your css would be...

del {
text-decoration: line-through;
text-decoration-thickness: 1em;
}
Karellen is offline   Reply With Quote
Old 01-24-2026, 12:09 AM   #3
mdpeterson42
Enthusiast
mdpeterson42 began at the beginning.
 
Posts: 27
Karma: 10
Join Date: May 2024
Device: Kindle
Awesome, thank you!
mdpeterson42 is offline   Reply With Quote
Old 01-24-2026, 01:58 AM   #4
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,755
Karma: 9501034
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
You are welcome.

One correction though, as I misread your intent.
Font - Delete any font-family: entries to ensure users can select a font that is provided by their reader.
Only use a font-family entry where you want to force a particular font style. eg in headings or maybe tables depending on what data they are displaying.
Karellen is offline   Reply With Quote
Old Yesterday, 10:11 PM   #5
retiredbiker
Evangelist
retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.
 
retiredbiker's Avatar
 
Posts: 461
Karma: 3886916
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Kobo Forma
Quote:
Originally Posted by mdpeterson42 View Post
I wrote my first book in HTML and had several issues creating the epub to pass the checks. I got it figured out, thanks to a lot of help from people on this forum, but it took weeks. Several people said it was easier to just format in styles and convert on Calibre. I am going to try that, but there are a couple points of which I am unsure.

First, in HTML, I set it so that the book would use whatever font the reader preferred. My LibreOffice style has a font, obviously. How do I make that conversion?

Second, similarly, my HTML did not dictate font size, other than that chapter headings were comparatively larger than the text. How do I set that up?

Third, some of the text will be "redacted." Will setting up a style with black highlighting accomplish that? Or will that run afoul of people who like dark mode? Is there a style that actually redacts?

Thank you all!
If you want a really seamless way to get from a Writer file in LibreOffice to an epub, preserving your styles right down to their names, you might want to look into trying Sigil and their odt file import plugin. Here is the setup I use, copied from an old post:

Quote:
Make a Writer template file, an .ott file, with the custom styles you normally use.

Make a css file in a text editor that matches the style names in the Writer template. Only for each style, do the epub-ish styling you want. (Example: I have a style in the template called "indent" that makes a paragraph indented and spaced in Writer to make it easy to proof on screen. The "indent" style in the css is styled in ems, not cms, with spacing, margins, and so on to look good on my Kobo.)

Put this text css in the ODTImport plugin directory as "epub.css". It will show up in the imported book as "styles.css", alongside the css file generated by the plugin -- "styles1.css".

Use the .ott template file to make your book, and use only your custom styles. (You may need a new style not in the template, so just add it.)

With this is set up correctly, I can now import a book, simply delete the "styles1.css" made by the import,*and have all my custom styles now active in their epub versions. This is amazing! It works so well for me it is hard to believe.

What else though?

--If you have added a new style in your Writer doc, you need to add it to the "styles.css". It will show up in "styles1.css" but with dimensions and whatever Writer had.

--Images will need attention. The import is pretty crude. I have some image styles using width % and height=auto in my epub.css, so a little search and replace can fix them easily.

All this saves so much time and effort compared to other methods I have used, I am just amazed.
retiredbiker is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Style question Owl_ KOReader 3 03-24-2021 01:37 AM
CSS Style Question Enterio Recipes 5 10-24-2019 05:29 AM
Sigil won't copy source formatting from LibreOffice la_tantan Sigil 10 04-09-2017 07:54 AM
Epub style question - TOC luthar28 ePub 4 08-04-2010 08:19 PM
line formatting formatting question daesdaemar Workshop 9 02-06-2009 12:47 PM


All times are GMT -4. The time now is 11:55 PM.


MobileRead.com is a privately owned, operated and funded community.