Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 12-28-2013, 10:12 PM   #1
Geoff_C8
Member
Geoff_C8 began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Dec 2013
Location: Sydney, Australia
Device: Kindle
Spaces being altered by Book View in 0.7.4

I realise this topic has been covered in another thread, but my experience is slightly different, and i thought it worth posting because I suspect many others will discover this the hard way.

I was forced to upgrade from 0.7.1 to 0.7.4 because I had installed Maverick 10.9.1 on my MacBook. I immediately found that making any edits in Book View caused   to be replaced initially by
Code:
$#160; where $ is &
and later to just a space. As I had rather lazily used the construct <p height="40">&nbsp;</p> to achieve a certain size spacing, this was eventually rendered useless.

I took the advice given in the other thread to add to my css so that I could create the spaces I needed by adding a class to those elements where a space was needed either above, or below. So I am no longer bothered that this behaviour occurs, although I did have to put in a few hours to recode over 20,000 lines. But I feel sorry for any folks creating books in French.

I have found Sigil a very useful tool, and so I am glad I have a work around.

thanks
Geoff

Last edited by Geoff_C8; 12-28-2013 at 10:23 PM. Reason: trying to retain code element
Geoff_C8 is offline   Reply With Quote
Old 12-29-2013, 08:10 AM   #2
Alt68er
Member
Alt68er began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Dec 2013
Device: Pocketbook touch lux (623)
Hi Geoff,

great that you are sharing information / solutions.

But: it still would be greater resp. more helpful (at least for me as newbie) if you would have put a link to the thread where you found the hint for the css-file. I'd like to modify my stylesheet but don't know how.

Please be so kind and post the link.

Thanks a lot,
Peter
Alt68er is offline   Reply With Quote
Advert
Old 12-29-2013, 11:47 AM   #3
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Just add a margin-bottom or margin-top for a paragraph style and apply that style.
Toxaris is offline   Reply With Quote
Old 12-29-2013, 07:52 PM   #4
Geoff_C8
Member
Geoff_C8 began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Dec 2013
Location: Sydney, Australia
Device: Kindle
Quote:
Originally Posted by Alt68er View Post

Please be so kind and post the link.

Thanks a lot,
Peter
Hi Peter,

As already indicated, a margin top or margin bottom setting is required. This is the code I used, to create two classes that can be used:

Code:
 .spacetop {
		margin-top: 3em;
		text-indent: 0
   }

  .spacebot {
		margin-bottom: 3em;
		text-indent: 0
   }
Obviously I could also have modified an existing specific element, but that did not suit me in this case. This code is applied simply by using

Code:
<p class="spacetop"> 

or <h4 class="spacebot"> and so on
Geoff

Last edited by Geoff_C8; 12-29-2013 at 07:55 PM.
Geoff_C8 is offline   Reply With Quote
Old 12-30-2013, 12:26 PM   #5
Alt68er
Member
Alt68er began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Dec 2013
Device: Pocketbook touch lux (623)
Thanks to both of you.

Sorry, but that was a misunderstanding because I thought that you had found a solution for the replacement of nbsp by #160....

But thanks again!

Peter
Alt68er is offline   Reply With Quote
Advert
Old 12-30-2013, 12:35 PM   #6
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Alt68er View Post
Thanks to both of you.

Sorry, but that was a misunderstanding because I thought that you had found a solution for the replacement of nbsp by #160....

But thanks again!

Peter
Unless there's some really strange situation going on (or just an aesthetic preference), there's no real need for a "solution." The named and numeric entities achieve an identical result.

The only way to stop non-breaking spaces (either the character or the named entity) from ever being converted to its decimal entity equivalent (#160) is to revert to Sigil v0.7.3 (or earlier), or to alter the source for v0.7.4 and compile your own custom version.

Last edited by DiapDealer; 12-30-2013 at 12:40 PM.
DiapDealer is offline   Reply With Quote
Old 12-31-2013, 02:00 AM   #7
Geoff_C8
Member
Geoff_C8 began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Dec 2013
Location: Sydney, Australia
Device: Kindle
Quote:
Originally Posted by DiapDealer View Post
Unless there's some really strange situation going on (or just an aesthetic preference), there's no real need for a "solution." The named and numeric entities achieve an identical result.

The only way to stop non-breaking spaces (either the character or the named entity) from ever being converted to its decimal entity equivalent (#160) is to revert to Sigil v0.7.3 (or earlier), or to alter the source for v0.7.4 and compile your own custom version.
Well that would be true, excepting I have observed, but not actually discerned exactly what causes it, that eventually all the numeric entities are converted into a real space, and that then means the reader ignores that line. The decimal equivalent is not the issue, and I did note that above, but perhaps not stress enough, its the final conversion into a plain old text space that is the issue. In the first thread talking about this, the OP said it went from &nbsp; to " " In my case it had an interim translation to the numeric equivalent before going to " "

The forum thread I first found this discussed was here: http://www.mobileread.mobi/forums/sh...d.php?t=212681

Geoff

Last edited by Geoff_C8; 12-31-2013 at 02:09 AM.
Geoff_C8 is offline   Reply With Quote
Old 12-31-2013, 03:54 AM   #8
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Sorry, I've never experienced the issue of the numeric entity being changed to a normal space in 0.7.4 before. I DO remember there being an issue with previous incarnations of Sigil where the nbsp named entity was being converted to a normal space, though. The thread you linked to was a problem where the unicode non-breaking space character was being converted to a normal space. That was a whole different ball of wax (and since fixed).

The exact steps to duplicate the problem would be helpful if you can nail it down.

Last edited by DiapDealer; 12-31-2013 at 04:01 AM.
DiapDealer is offline   Reply With Quote
Old 12-31-2013, 11:38 PM   #9
Geoff_C8
Member
Geoff_C8 began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Dec 2013
Location: Sydney, Australia
Device: Kindle
Quote:
Originally Posted by DiapDealer View Post
The exact steps to duplicate the problem would be helpful if you can nail it down.
Sure thing, but I am not optimistic there, especially as basically I no longer have any permanent &nbsp;

I have certainly seen them disappear to text space at least twice, but it was not at all clear how, or even when it happened. It does not seem to happen "frequently" whatever that means. LOL. I will repost if I figure it. I am going to have to revisit a number of older epubs so its possible I might figure it.

VERY SHORTLY THEREAFTER

Lol and behold. Thinking out loud helped a lot. I don't create the TOC frequently. I just recreated it, and it took my example # 160 and made it into a text space. But it did not touch the &nsbp; in that file. So it looks like a two stage process. Edit in Book View gives you the numeric space, and building the TOC trashes those to text space. BUT, there is something else. Because when I then added a couple of test # 160s and redid the TOC (but there were no new headers) nothing changed. I will come back when I have some more headers in my file and complete this.

Geoff

Last edited by Geoff_C8; 12-31-2013 at 11:48 PM. Reason: found the answer
Geoff_C8 is offline   Reply With Quote
Old 01-01-2014, 12:00 AM   #10
Geoff_C8
Member
Geoff_C8 began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Dec 2013
Location: Sydney, Australia
Device: Kindle
Yes that is it. Editing in Book View turns &nbsp; into the numeric # 160 equivalent, and creating a TOC with at least one new heading turns those into text space.

Geoff

Last edited by Geoff_C8; 01-01-2014 at 12:02 AM.
Geoff_C8 is offline   Reply With Quote
Old 01-01-2014, 12:42 AM   #11
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I'll see what I can see. For what it's worth, the nbsp being changed to #160 when editing in book view is the expected behavior of 0.7.4. The decision to convert non-breaking space characters and named entities to the #160 numeric entity was just about the sole reason for releasing 0.7.4, in fact.

Obviously, the conversion of those #160s to normal spaces when creating a TOC (under certain circumstances) is an unintended side effect. I assume you mean generating the ncx toc rather than an html toc?
DiapDealer is offline   Reply With Quote
Old 01-01-2014, 01:17 AM   #12
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,443
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by DiapDealer View Post
I'll see what I can see. For what it's worth, the nbsp being changed to #160 when editing in book view is the expected behavior of 0.7.4. The decision to convert non-breaking space characters and named entities to the #160 numeric entity was just about the sole reason for releasing 0.7.4, in fact.

Obviously, the conversion of those #160s to normal spaces when creating a TOC (under certain circumstances) is an unintended side effect. I assume you mean generating the ncx toc rather than an html toc?
Why would a nbsp be needed in a NCX?
It does not justify.
Not all devices support line wrapping of the NCX TOC so a newline/break is not expected
theducks is offline   Reply With Quote
Old 01-01-2014, 01:34 AM   #13
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by theducks View Post
Why would a nbsp be needed in a NCX?
It does not justify.
Not all devices support line wrapping of the NCX TOC so a newline/break is not expected
It's NOT needed.

It's my understanding that the conversions from nbsp to #160 to normal spaces is happening in the html files, not the NCX file. The #160 to normal space substitution is purported to be happening when (re)generating the NCX (and only in those html files where there are new headings to be parsed for the ncx).

I haven't had the opportunity to see if I can duplicate the behavior yet.
DiapDealer is offline   Reply With Quote
Old 01-01-2014, 04:54 AM   #14
Geoff_C8
Member
Geoff_C8 began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Dec 2013
Location: Sydney, Australia
Device: Kindle
Quote:
Originally Posted by DiapDealer View Post
I assume you mean generating the ncx toc rather than an html toc?
Yes it goes the moment you create the ncx toc and its happening in the html file that holds the new header that gets indexed. I generally do both, the ncx first, simply because I thought one should. I use the html one, in the file obviously. As I am heading to a mobi file as my final result, I am not sure the ncx is relevant? I have only ever created mobi's.

Geoff

Last edited by Geoff_C8; 01-01-2014 at 05:01 AM.
Geoff_C8 is offline   Reply With Quote
Old 01-01-2014, 05:04 AM   #15
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,536
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by theducks View Post
Why would a nbsp be needed in a NCX?
It does not justify.
Not all devices support line wrapping of the NCX TOC so a newline/break is not expected
The fact that "not all devices" support NCX linewrapping is not a reason not no add a nbsp to prevent linewraps in devices that do (if any), is it?
Jellby is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Enter text in Book View or Code View ronaldl Sigil 5 10-29-2012 04:12 PM
replace in book view changes view to code view cybmole Sigil 4 10-28-2012 02:20 PM
Sigil highlight Book View No Longer Shows in Code View Themus Sigil 4 10-04-2012 08:54 PM
quotes differences book view & code view cybmole Sigil 13 03-29-2011 02:53 AM
lock book view & code view windows into synch cybmole Sigil 5 01-19-2011 11:30 PM


All times are GMT -4. The time now is 07:34 AM.


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