Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 12-20-2023, 02:12 PM   #1
begtognen
Junior Member
begtognen began at the beginning.
 
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.)
begtognen is offline   Reply With Quote
Old 12-20-2023, 04:59 PM   #2
retiredbiker
Addict
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: 387
Karma: 1638210
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.
Attached Thumbnails
Click image for larger version

Name:	styleedit.jpg
Views:	73
Size:	50.4 KB
ID:	205355  

Last edited by retiredbiker; 12-20-2023 at 05:02 PM.
retiredbiker is offline   Reply With Quote
Old 12-21-2023, 05:40 AM   #3
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,171
Karma: 85874891
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.
Quoth is offline   Reply With Quote
Old 12-21-2023, 08:09 AM   #4
begtognen
Junior Member
begtognen began at the beginning.
 
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.
begtognen is offline   Reply With Quote
Old 12-21-2023, 08:14 AM   #5
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,037
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by begtognen View Post
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.)
What I do for a section break is I use a 20% wide 2px line via <hr/> and CSS code. What you can do is put some word that's not in the book where your section breaks are and in the ePub editor, replace that with <hr/> and add in the CSS code and it will work perfectly. I have a 0.8em top/bottom margin around the line. It works perfectly. If you do this, it will not be an issue as it's not blank space. Also, blank space for a section break is no longer really used. Depending on how you do your space, it can get lost at the top/bottom of the page. Oh and after the section break, I have the next paragraph not indented.
JSWolf is offline   Reply With Quote
Old 12-21-2023, 03:51 PM   #6
begtognen
Junior Member
begtognen began at the beginning.
 
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.
begtognen is offline   Reply With Quote
Old 12-21-2023, 04:55 PM   #7
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,513
Karma: 145557716
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
So use something like
Code:
<p class="sectionbreak">& #160;</p>
in the html files and the following in the stylesheet:

Code:
.sectionbreak  {
  padding-top: 1.4em;
  padding-bottom: 1.4em;
}
I've also seen ebooks where the creator has added a couple of paragraph styles for before and after section break (basically add the padding-bottom to the above and padding-top to the below but I prefer the section break since it allows me more options such as adding an fleuron or other image.

Edit: remove the space between the & and # since it's only there to allow the text to be displayed.
DNSB is offline   Reply With Quote
Old 12-23-2023, 01:55 PM   #8
nabsltd
Evangelist
nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.
 
Posts: 417
Karma: 6913952
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe
Quote:
Originally Posted by DNSB View Post
So use something like
Code:
<p class="sectionbreak">& #160;</p>
in the html
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.
nabsltd is offline   Reply With Quote
Old 12-23-2023, 02:18 PM   #9
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,513
Karma: 145557716
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by nabsltd View Post
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.
For Kindle's, I have a pair of div's that surround the sectionbreak and seems to work quite well for azw3/KFX. For epub's I prefer the simpler choice.
DNSB is offline   Reply With Quote
Old 12-23-2023, 05:09 PM   #10
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,037
Karma: 129333114
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>
CSS
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;
}
JSWolf is offline   Reply With Quote
Old 12-24-2023, 01:28 AM   #11
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Hey begtognen. Welcome to MobileRead.

Quote:
Originally Posted by begtognen View Post
I'm in the process of converting my DOCX file into an ebook.

[...]

Now, though, all of my blank lines that are meant to be there (like between two scenes) are gone.
What you want is called a "scenebreak".

These are gaps or symbols after the previous scene ended and the new one begins.

- - -

Personally, I'd STRONGLY:
  • recommend using centered asterisks (or some other symbol)
  • be AGAINST using just "a gap" / "blank lines"

especially in the case of ebooks.

YES to asterisks/symbols:

Code:
   And then he got shot.

            * * *

Diane woke up in bed the next day.
NO to simple gap + noindent:

Code:
   And then he got shot.


Diane woke up in bed the next day.
I explained all the pros/cons + exact reasoning how/why in this 2019 thread:

Quote:
Originally Posted by begtognen View Post
(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.)
LibreOffice? Fantastic!

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:
  • scenebreak
    • = centered + have a gap above/below.
    • Apply this to your asterisks/symbols.
  • first
    • = no indent.
    • Apply this to the very first line of your chapters/scenes.

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
Bing, bang, boom. Problem solved. This will transfer over nicely from LibreOffice into your ebook.

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:
  • Styles Tex2002ans site:reddit.com/r/LibreOffice
  • scenebreaks Tex2002ans site:mobileread.com

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":

Click image for larger version

Name:	LibreOffice.7.6.4.-.Spotlight.Styles.Highlighter.OFF.png
Views:	76
Size:	79.3 KB
ID:	205389 Click image for larger version

Name:	LibreOffice.7.6.4.-.Spotlight.Styles.Highlighter.ON.png
Views:	58
Size:	82.6 KB
ID:	205388

You get to it by:
  • View > Styles (F11)
  • Alllll the way in the bottom right, you should see a little checkbox called "Spotlight".

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:
Originally Posted by begtognen View Post
I do have the paragraph styles set correctly in Writer [...] but the indent didn't appear in the converted Calibre ebook [...]
You may also be interested in my comment from 2022:

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>
and tweaking your CSS:

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 02:20 AM.
Tex2002ans is offline   Reply With Quote
Old 12-25-2023, 08:30 AM   #12
begtognen
Junior Member
begtognen began at the beginning.
 
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.
begtognen is offline   Reply With Quote
Old 12-25-2023, 12:44 PM   #13
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,513
Karma: 145557716
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by begtognen View Post
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.
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.
DNSB is offline   Reply With Quote
Old 12-25-2023, 01:14 PM   #14
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,171
Karma: 85874891
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 01:17 PM.
Quoth is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create TOC from page breaks? Skydog Editor 9 03-31-2022 08:41 PM
Line breaks on Kindle, no line breaks on 4 PC Siavahda Kindle Formats 0 10-20-2012 05:50 AM
How do I Create Page Breaks? jdanniel Sigil 15 09-18-2012 06:15 AM
Create proper paragraph breaks in ereader2html acj412 Workshop 2 08-10-2009 11:02 PM
No line breaks ecpepper Amazon Kindle 3 08-09-2009 06:42 PM


All times are GMT -4. The time now is 12:26 AM.


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