Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 02-12-2022, 10:16 PM   #1
Fahara
Junior Member
Fahara began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2022
Device: Sony eReader
Automatically adding line breaks in editor?

First time editing an ePub with calibre and I’m wondering if there is a way to automatically add <br> line breaks? The style of the book is for each piece of dialogue to be on its own line and at the moment I’m facing manually adding the <br> tag which is going to take forever. Is there a tool I’m missing that does this automatically where the line breaks already appear visually in the text? To be clear, I’m not talking about paragraphs! Just single line breaks within a para. Please help a newbie out! Thank you.
Fahara is offline   Reply With Quote
Old 02-12-2022, 11:06 PM   #2
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Well, you are talking about paragraphs. A single line of dialog is usually represented as a separate paragraph (in English at least). You would normally see something like:

Code:
<p>"But, I wan't space between," the OP said.</p>
<p>"Then us a paragraph," the replier said.</p>
<p>"Are you sure?"</p>
<p>"Yes, and if you want spacing between the paragraphs, use a style. And when someone comes along and tells you that this is a bad idea, just ignore him."</p>
That's what you would expect the code to look like in English. The styles for the p tag are used to set any space between the paragraphs and/or an indent.

Using a br tag to do this is generally considered to be bad code. There are plenty of examples using it, but, it isn't a good idea.

As to doing this, you should do it in the source document. The calibre editor is not really intended to write a book from scratch. Create the book in your preferred editor or word processor and then convert to epub. If you do this in Word, then it is a simple as pressing enter at the end of a paragraph. And calibre can convert this to an epub that matches the document within the constraints of how an epub works.
davidfor is offline   Reply With Quote
Old 02-13-2022, 09:31 AM   #3
Fahara
Junior Member
Fahara began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2022
Device: Sony eReader
Thanks for replying @davidfor! To clarify, I'm not creating from scratch in editor, the book I'm trying to tidy up has been written and formatted in Word, but when I tried simply pasting into the body copy of an editor file none of the line breaks/paras carried across in the preview (though they show in the editor window) so I assumed I had to add manually, am I missing something? So for instance text that looks like this in Word:

“Nibh caedis quia Dui, rem usus d fruges pede, enim O rem rerum lius eum” Eripere eros ea sed louor ad iste Lacus. Equestri iste est custodes saevire vel hic nec, A landem modernas gothica ea ea lacus cum ab natoque parum.
“Eius hic iure at autem ex, eget’o ullo dis venenatis” Ab parum et pygmaeus. Pede sit arcu justo assum si devotiones id qui.
“Nam nibh ex sit mi hac, eum est noverca” Eu quae, species est mus neque sed similia supremum mi.
Methodo per E enim si lius sem Mazim class te dicta id ea. Apparet desiderat mi dis vitae gravatam.
“Sed nec urna?” Me quam.
“Quod, nisi, eum nam eius eu quas?” W quo hic. Se porta unde sint dui nec.
“Cum amet restat mus p modo ullo?” eu pede.


Comes out as a solid block of unbroken text like this:

“Nibh caedis quia Dui, rem usus d fruges pede, enim O rem rerum lius eum” Eripere eros ea sed louor ad iste Lacus. Equestri iste est custodes saevire vel hic nec, A landem modernas gothica ea ea lacus cum ab natoque parum.“Eius hic iure at autem ex, eget’o ullo dis venenatis” Ab parum et pygmaeus. Pede sit arcu justo assum si devotiones id qui. “Nam nibh ex sit mi hac, eum est noverca” Eu quae, species est mus neque sed similia supremum mi. Methodo per E enim si lius sem Mazim class te dicta id ea. Apparet desiderat mi dis vitae gravatam. “Sed nec urna?” Me quam. “Quod, nisi, eum nam eius eu quas?” W quo hic. Se porta unde sint dui nec. “Cum amet restat mus p modo ullo?” eu pede.

Any advice gratefully received! Would love to be able to just drop everything in, neatly formatted from Word and just leave it at that!
Fahara is offline   Reply With Quote
Old 02-13-2022, 11:33 AM   #4
Sunlite
Addict
Sunlite ought to be getting tired of karma fortunes by now.Sunlite ought to be getting tired of karma fortunes by now.Sunlite ought to be getting tired of karma fortunes by now.Sunlite ought to be getting tired of karma fortunes by now.Sunlite ought to be getting tired of karma fortunes by now.Sunlite ought to be getting tired of karma fortunes by now.Sunlite ought to be getting tired of karma fortunes by now.Sunlite ought to be getting tired of karma fortunes by now.Sunlite ought to be getting tired of karma fortunes by now.Sunlite ought to be getting tired of karma fortunes by now.Sunlite ought to be getting tired of karma fortunes by now.
 
Sunlite's Avatar
 
Posts: 206
Karma: 547516
Join Date: Mar 2008
Location: Berlin, Germany
Device: KObo Clara, Kobo Aura, PRS-T1, PB602, CyBook Gen3
The pros will likely show up later on and correct me or add more information.

To make it easier aon yourself, save your document from Word in docx format. In the Editor there is a option to import an docx file and create a ebup (or azw) from it.

If you used styles in Word for all your formatings, you should get a reasonable clean epub file.
Sunlite is offline   Reply With Quote
Old 02-13-2022, 11:44 PM   #5
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Fahara View Post
Thanks for replying @davidfor! To clarify, I'm not creating from scratch in editor, the book I'm trying to tidy up has been written and formatted in Word, but when I tried simply pasting into the body copy of an editor file none of the line breaks/paras carried across in the preview (though they show in the editor window) so I assumed I had to add manually, am I missing something? So for instance text that looks like this in Word:

“Nibh caedis quia Dui, rem usus d fruges pede, enim O rem rerum lius eum” Eripere eros ea sed louor ad iste Lacus. Equestri iste est custodes saevire vel hic nec, A landem modernas gothica ea ea lacus cum ab natoque parum.
“Eius hic iure at autem ex, eget’o ullo dis venenatis” Ab parum et pygmaeus. Pede sit arcu justo assum si devotiones id qui.
“Nam nibh ex sit mi hac, eum est noverca” Eu quae, species est mus neque sed similia supremum mi.
Methodo per E enim si lius sem Mazim class te dicta id ea. Apparet desiderat mi dis vitae gravatam.
“Sed nec urna?” Me quam.
“Quod, nisi, eum nam eius eu quas?” W quo hic. Se porta unde sint dui nec.
“Cum amet restat mus p modo ullo?” eu pede.


Comes out as a solid block of unbroken text like this:

“Nibh caedis quia Dui, rem usus d fruges pede, enim O rem rerum lius eum” Eripere eros ea sed louor ad iste Lacus. Equestri iste est custodes saevire vel hic nec, A landem modernas gothica ea ea lacus cum ab natoque parum.“Eius hic iure at autem ex, eget’o ullo dis venenatis” Ab parum et pygmaeus. Pede sit arcu justo assum si devotiones id qui. “Nam nibh ex sit mi hac, eum est noverca” Eu quae, species est mus neque sed similia supremum mi. Methodo per E enim si lius sem Mazim class te dicta id ea. Apparet desiderat mi dis vitae gravatam. “Sed nec urna?” Me quam. “Quod, nisi, eum nam eius eu quas?” W quo hic. Se porta unde sint dui nec. “Cum amet restat mus p modo ullo?” eu pede.

Any advice gratefully received! Would love to be able to just drop everything in, neatly formatted from Word and just leave it at that!
To paraphrase Nike, "Just don't". Copying and pasting like that is going to lose the formatting. And the previewer is showing what is supposed to. The line breaks are ignored. If you look in the code area, you will see the broken lines. You could use a search-and-replace to change the line end character to "</p><p>" and make sure you add the start and end tags as well.

But, what @Sunlite said is the way to do it. Finish writing it in Word. Then save the DOCX, add it to calibre and do a conversion. You will get a better result. The formatting should come across with no issues. If there are issues, you should fix them in the DOCX and try again
davidfor is offline   Reply With Quote
Old 02-14-2022, 07:46 AM   #6
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: 12,352
Karma: 92073397
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
And "shift enter" in Word or LO Writer might do <br/>, but enter in ANY wordprocessor gives a new paragraph in current style and if docx is used, gives <p>my text</p>

Using "shift enter" to give <br/> might be used to split a long heading to two lines, or a fake list or maybe a verse of poetry/song (but enter) between verses.
Dialogue always uses a paragraph (regular enter).

Copy/Paste into a HTML editor is a bit mad for ebooks.
Quoth is offline   Reply With Quote
Old 02-16-2022, 01:38 PM   #7
Fahara
Junior Member
Fahara began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2022
Device: Sony eReader
Thank you everyone, I'll try creating it as a new word doc and go from there.
Fahara is offline   Reply With Quote
Reply

Tags
formatting, html, line breaks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to automatically create chapter titles and breaks in an epub file? memenow Conversion 2 11-27-2012 10:54 PM
Line breaks on Kindle, no line breaks on 4 PC Siavahda Kindle Formats 0 10-20-2012 06:50 AM
KindleGen Adding Line Breaks after every <a> and <span> NoYouDo Kindle Formats 1 01-23-2012 12:34 AM
Find/Replace bogus line breaks in Text editor, w/Regular Expression scubaddictions Conversion 15 07-21-2011 09:52 AM
Adding page breaks in Calibre breaks ePubcheck validation bookraft Conversion 16 03-01-2011 02:23 PM


All times are GMT -4. The time now is 05:03 PM.


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