12-20-2023, 03:12 PM | #1 |
Junior Member
Posts: 4
Karma: 10
Join Date: Dec 2023
Device: none
|
How to create line breaks?
I'm in the process of converting my DOCX file into an ebook.
In order to get Calibre to pay attention to my indents, I checked "remove spacing between paragraphs" and unchecked "insert blank line between paragraphs" under Convert / Look and Feel. Now, though, all of my blank lines that are meant to be there (like between two scenes) are gone. Any ideas on how I can get the purposeful blank lines back? Thanks for any suggestions. (I don't know another way to get the indents to work, as I'm using LibreOffice Writer, not Word, and haven't been able to find the styles info that's available for Word about alternative indents for LibreOffice Writer.) |
12-20-2023, 05:59 PM | #2 |
Evangelist
Posts: 420
Karma: 2737916
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Jutoh, Kobo Forma
|
The answer, as you hint in the last line of your post, is in styles - paragraph styles, to be specific.
99.999% of your text in Writer should be controlled by paragraph styles. Only short bits of italic or bold should be done from the toolbars.The paragraph styles will control spacing between paragraphs, indentation, and everything else. The style settings will become the css controlling the ebub that Calibre will convert to. Part of this, of course, is do not ever use blank lines (i.e. hitting "enter") for spacing in Writer. Set the spacing you want in a paragraph style. Likewise, no tabs or spaces for indentation. If there are no intelligent style settings in the text, conversion has almost nothing to work with. How do you edit a paragraph style? One easy way to get there is right click on a paragraph in Writer, go down the menu and select "paragraph", then run down again and hit "edit style" at the bottom. You will get a panel like the attachment, where you can control---everything, for that style. You can find all sorts of tutorials for using paragraph styles by simple searching. And spend a while exploring the Styles menu. They styles that come with Writer are OK for some types of documents, but you will probably want to make a few custom ones for your particular needs. The LO help system is also really good with Styles. Last edited by retiredbiker; 12-20-2023 at 06:02 PM. |
12-21-2023, 06:40 AM | #3 |
the rook, bossing Never.
Posts: 12,342
Karma: 92073397
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
Also only edit an odt in LO Writer and save an extra docx for Calibre. Only ever edit a docx once on import to LO from Word. Because LO will convert the docx on every open and save if you edit it instead of an odt.
I have two docked windows: Top is Style browser, showing only applied styles. Lower is Outline browser, showing all headings, bookmarks, links and images. |
12-21-2023, 09:09 AM | #4 |
Junior Member
Posts: 4
Karma: 10
Join Date: Dec 2023
Device: none
|
This is really helpful, thank you.
I do have the paragraph styles set correctly in Writer (Format / Paragraphs / Indents and Spacing) but the indent didn't appear in the converted Calibre ebook, which is why I checked "remove spacing between paragraphs" and unchecked "insert blank line between paragraphs" under Convert / Look and Feel. When I did that, the indents appeared. Now my blank spaces have disappeared. I did some searching after reading your replies but couldn't find any way to create blank lines using Writer Styles, any pointers are appreciated. Thanks for your time. |
12-21-2023, 09:14 AM | #5 | |
Resident Curmudgeon
Posts: 76,370
Karma: 136466962
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
12-21-2023, 04:51 PM | #6 |
Junior Member
Posts: 4
Karma: 10
Join Date: Dec 2023
Device: none
|
Thanks for your reply. What I'm trying to accomplish is empty space between two paragraphs.
|
12-21-2023, 05:55 PM | #7 |
Bibliophagist
Posts: 40,475
Karma: 156982136
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
So use something like
Code:
<p class="sectionbreak">& #160;</p> Code:
.sectionbreak { padding-top: 1.4em; padding-bottom: 1.4em; } Edit: remove the space between the & and # since it's only there to allow the text to be displayed. |
12-23-2023, 02:55 PM | #8 |
Evangelist
Posts: 459
Karma: 7897546
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe
|
Note that if converting to a Kindle format after finishing with edits, your "sectionbreak" paragraph will not be displayed at all, since Kindle properly trims all white space from the beginning and end of lines, and it treats a non-breaking space as if it is normal white space. I'm pretty sure that the spec doesn't prevent this, as a non-breaking space should be treated as white space, but just not a possible line break choice. But, most other renderers treat a non-breaking space as a special character that just happens to be an empty glyph.
|
12-23-2023, 03:18 PM | #9 | |
Bibliophagist
Posts: 40,475
Karma: 156982136
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
|
|
12-23-2023, 06:09 PM | #10 |
Resident Curmudgeon
Posts: 76,370
Karma: 136466962
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
The way I do it works perfectly well in ePub and KF8/KFX.
HTML Code:
<p>Some line.</p> <hr/> <p class="noindent">Some other paragraph.</p> Code:
body { widows: 1; orphans: 1; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; text-align: justify; } hr { margin-top: 0.9em; margin-right: 40%; margin-bottom: 0.9em; margin-left: 40%; border-top: 2px solid; } p { margin-top: 0; margin-bottom: 0; widows: 1; orphans: 1; text-indent: 1.2em; } |
12-24-2023, 02:28 AM | #11 | |||
Wizard
Posts: 2,303
Karma: 12126963
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Hey begtognen. Welcome to MobileRead.
Quote:
These are gaps or symbols after the previous scene ended and the new one begins. - - - Personally, I'd STRONGLY:
especially in the case of ebooks. YES to asterisks/symbols: Code:
And then he got shot. * * * Diane woke up in bed the next day. Code:
And then he got shot. Diane woke up in bed the next day. Quote:
I've written over a thousand step-by-step LibreOffice tutorials and posts within the past 2 years. How to Create Scenebreaks Using Styles I strongly suggest creating 2 simple Styles:
Then you just mark all your Styles: Code:
Chapter 1: The Beginning <---- "Heading 2" Style It was a dark and stormy night. All <---- "first" Style was quiet in the western front. This was the tale of intrigue <---- "Text Body" Style and espionage. * * * <---- "scenebreak" Style Tommy woke up in a cold sweat. <---- "first" Style I wrote about this exact thing way back in: Since then, I went on a complete streak over on the LibreOffice subreddit: If you need more, I strongly recommend typing this in your favorite search engine:
That'll lead you to hundreds and hundreds of posts where I/we covered this topic in detail over the years. - - - Side Note: And, make sure you're on the latest LibreOffice 7.6. They added this really fantastic "Styles Highlighter" feature called "Spotlight": You get to it by:
After turning it on, it numbers/colors all the Styles currently used in your document. This easily lets you see+tag+clean them up. It was first described back in 2019 in this blog post: and finally made it into LibreOffice in 2023. - - - Quote:
Good idea going from LibreOffice into a temporary DOCX, then converting that to EPUB. The ODT->EPUB tools, sadly, aren't as clean as the DOCX->EPUB tools, so a lot of stuff like Styles get broken in the conversion. But, if you designed your original document super cleanly with Styles, so much of that stuff should transfer over to ebook. Then, you just need to understand the basics of HTML+CSS in order to tweak your EPUB code slightly. For example, if you marked all your "first" paragraphs + "scenebreaks", then it would be as simple as going into the HTML and seeing this: Code:
<h2>Chapter 1: The Beginning</h2> <p class="first">It was a dark and stormy night. All was quiet in the western front.</p> <p>This was the tale of intrigue and espionage.</p> <p class="scenebreak">* * *</p> <p class="first">Tommy woke up in a cold sweat.</p> Code:
p.first { text-indent: 0; } p.scenebreak { margin-top: 1em; margin-below: 1em; text-align: center; text-indent: 0; } Last edited by Tex2002ans; 12-24-2023 at 03:20 AM. |
|||
12-25-2023, 09:30 AM | #12 |
Junior Member
Posts: 4
Karma: 10
Join Date: Dec 2023
Device: none
|
Thanks everyone, for taking the time to send such detailed replies. I really appreciate it.
On the off chance that the issue was LibreOffice Writer, I asked a friend to save it in Word, then ran it through the converter. No issues, it converted perfectly. |
12-25-2023, 01:44 PM | #13 |
Bibliophagist
Posts: 40,475
Karma: 156982136
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Did you try @Quoth's suggestion about saving as .docx from LibreOffice before converting? I've found that converting the .odt file does not work as well as converting the .docx file though LibreOffice Writer was used to generate both.
|
12-25-2023, 02:14 PM | #14 |
the rook, bossing Never.
Posts: 12,342
Karma: 92073397
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
I edit only odt and use an extra Save As docx just for Calibre as the odt conversion is older & not maintained (Kovid wrote a while ago).
Don't be editing the docx in LO Writer as it will convert on every load and save! Also for anything not epub2, convert docx to epub2 and then convert the epub (inc epub3). Also the editor and viewer work best with epub. Last edited by Quoth; 12-25-2023 at 02:17 PM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Create TOC from page breaks? | Skydog | Editor | 9 | 03-31-2022 09:41 PM |
Line breaks on Kindle, no line breaks on 4 PC | Siavahda | Kindle Formats | 0 | 10-20-2012 06:50 AM |
How do I Create Page Breaks? | jdanniel | Sigil | 15 | 09-18-2012 07:15 AM |
Create proper paragraph breaks in ereader2html | acj412 | Workshop | 2 | 08-11-2009 12:02 AM |
No line breaks | ecpepper | Amazon Kindle | 3 | 08-09-2009 07:42 PM |