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

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 06-04-2017, 03:49 AM   #1
rodneylives
Junior Member
rodneylives began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jun 2017
Device: none
Question Seeking advice on avoiding style cruft

Hey, I've defined a stylesheet that I really like and want to use in my books. I want to use it pretty much for everything.

However, I've noticed that as I work on files in Book View, Sigil tends to add its own styles to my text. At best, this results in things like font-size attributes being added to <p> tags. Sometimes it adds spurious <span>s, looking like: <span style="font-size: 16px; line-height: 1.5em;">

These attributes generally match the ones in my stylesheet, so there's no problem in terms of display usually. But I don't want it to add them, it increases file size and makes it harder to work with the code! And sometimes it uses a <div> instead of a <p>, and I'd really like it not to do that.

What am I doing wrong? Is there some setting I can use to get it to use the simplest code possible? I scanned through the FAQ in the Sigil user guide and the first couple of pages of topics here in the forum and didn't see anything that applies to the issue, so my apologizes if this is something that's been covered before that everyone knows the answer to.
rodneylives is offline   Reply With Quote
Advert
Old 06-04-2017, 04:18 AM   #2
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,379
Karma: 117701645
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
The answer is very simple actually. Stop using Book View and only use Code View. You have all the control and none of the unwanted conversions.

You can use the Preview panel to get an idea how it will look instead of the Book View.
Toxaris is online now   Reply With Quote
Old 06-04-2017, 09:23 AM   #3
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,071
Karma: 480516
Join Date: Dec 2012
Device: Kindle
Preview Panel sometimes overlays Code View, so you have to grab the bar at the top of it and tertivate it. After an agonizing while, you'll hit it just right and pop! you will have three panels in a row: Book Browser, Code View, and Preview Panel. Now there's no reason ever to use Book View, because you've got a permanent WYSIWYG display sitting there on the right.

(Well, you can't test the TOC in Preview Panel, so you might want to call up Book View for that.)

Other stuff can creep in. I often get a few faux hyperlinks in a book file, probably created by Word somehow. And recently I discovered that a book (maybe all my books?) was full of invisible soft hyphens, so I had to make them visible (&shy in order to delete them.

And yes, rarely, Sigil will create a new style if you are pushing inline styling too far; it prefers that there be a class for it, so creates one at the top of that particular file and will repeat it every time you split off a new file. You can either leave them be or add it to your style sheet.
Notjohn is offline   Reply With Quote
Old 06-04-2017, 09:55 AM   #4
Turtle91
Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 1,460
Karma: 11526836
Join Date: Dec 2012
Location: Altus, Oklahoma today
Device: iPhone 6/5/iPad 1,2 & Air/Surface Pro/Kindle PW
Quote:
Originally Posted by Notjohn View Post
And yes, rarely, Sigil will create a new style if you are pushing inline styling too far; it prefers that there be a class for it, so creates one at the top of that particular file and will repeat it every time you split off a new file. You can either leave them be or add it to your style sheet.
Another great reason to RARELY use inline styles!
Turtle91 is online now   Reply With Quote
Old 06-04-2017, 10:00 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: 48,625
Karma: 39003673
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
Quote:
Originally Posted by Turtle91 View Post
Another great reason to RARELY use inline styles!
There's no reason to use inline styles.
JSWolf is online now   Reply With Quote
Advert
Old 06-04-2017, 10:28 AM   #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: 16,458
Karma: 86260124
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Notjohn View Post
And yes, rarely, Sigil will create a new style if you are pushing inline styling too far; it prefers that there be a class for it, so creates one at the top of that particular file and will repeat it every time you split off a new file.
You're mistaken. The current Sigil has no such "preference." You're describing the behavior attributed to HTMLTidy and older versions of Sigil. The current Sigil's Book View WILL create inline styles when editing, but it will NOT create css in the header section of xhtml files. That particular quirk went away with Tidy.

Last edited by DiapDealer; 06-04-2017 at 10:35 AM.
DiapDealer is offline   Reply With Quote
Old 06-04-2017, 10:33 AM   #7
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: 16,458
Karma: 86260124
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by JSWolf View Post
There's no reason to use inline styles.
Except when you don't know how (or want) to write xhtml/css and you rely on a WYSIWYG editor to automatically write the code that produces the typographical effect you desire FOR you. Then ... you takes what what you gets.

Last edited by DiapDealer; 06-04-2017 at 12:21 PM.
DiapDealer is offline   Reply With Quote
Old 06-04-2017, 08:28 PM   #8
Turtle91
Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 1,460
Karma: 11526836
Join Date: Dec 2012
Location: Altus, Oklahoma today
Device: iPhone 6/5/iPad 1,2 & Air/Surface Pro/Kindle PW
Quote:
Originally Posted by JSWolf View Post
There's no reason to use inline styles.
No...that's not true. Just no reason you like. I don't care for them, but there are a couple, rare, occasions where it may make more sense.
Turtle91 is online now   Reply With Quote
Old 06-05-2017, 03:30 PM   #9
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: 48,625
Karma: 39003673
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
Quote:
Originally Posted by Turtle91 View Post
No...that's not true. Just no reason you like. I don't care for them, but there are a couple, rare, occasions where it may make more sense.
What are these rare cases?
JSWolf is online now   Reply With Quote
Old 06-05-2017, 03:51 PM   #10
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: 16,458
Karma: 86260124
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
If you wish to have a discussion damning/praising the use of inline styles, feel free to start a thread about it in the Epub, or Workshop forum.
DiapDealer is offline   Reply With Quote
Old 06-06-2017, 09:30 PM   #11
rodneylives
Junior Member
rodneylives began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jun 2017
Device: none
Ah, thanks for the info. I was afraid this might be the case. Use Code View and stare at markup when you just want to write, or use Book View and risk having it capriciously adding superfluous code. Yay.
rodneylives is offline   Reply With Quote
Old 06-07-2017, 01:11 AM   #12
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 5,315
Karma: 49372483
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, and NookColor. 2 Droid, 1 Win8 ePUB rdrs
Quote:
Originally Posted by rodneylives View Post
Ah, thanks for the info. I was afraid this might be the case. Use Code View and stare at markup when you just want to write, or use Book View and risk having it capriciously adding superfluous code. Yay.
Well, Rodney:

Sigil is not, nor does it pretend to be, an authoring tool or an word-processor. It is neither. It's not intended to be used, "to write." The intent is that you'll use a tool intended to write, for writing, and then, when done, you'll export that to HTML, and then put that HTML into Sigil to make into an ePUB.

It's unfortunate that it doesn't work the way that you want, but you are using it outside of its intended and designated use.

Hitch
Hitch is offline   Reply With Quote
Old 06-07-2017, 05:58 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: 16,458
Karma: 86260124
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
The "I don't want to have to deal with code; except that I want the code (that I don't want to deal with) to look a particular way" mindset always confuses me a bit.
DiapDealer is offline   Reply With Quote
Old 06-07-2017, 07:30 PM   #14
nabsltd
Groupie
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: 160
Karma: 4345678
Join Date: Aug 2013
Location: Hamden, CT
Device: Onyx Boox M92
Quote:
Originally Posted by JSWolf View Post
What are these rare cases?
There are HTML display engines with bugs. One of them ignores <style> elements.

So, for this HTML engine, if you want to do a quick one-off styling, you have to use inline styles. The only time I have found it really matters is in the cover page created by Calibre, which uses the <style> element at the top of the page to center the image.

Every EPUB I clean up, I do so with least-common-denominator HTML and CSS, so that it works on the widest possible number of devices/engines. I lose a few things I would like to have, but none are very crucial.
nabsltd is offline   Reply With Quote
Old 06-08-2017, 12:24 AM   #15
rodneylives
Junior Member
rodneylives began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jun 2017
Device: none
Yeah yeah sure. Thing is though:

1. When I write in some word processor and paste into Sigil, which I imagine is using it as intended, I'm likely to drag in that WP's own cruft along with it. I write in Sigil because I'm not really sure what workflow will result in the cleanest code, other than just doing it in Notepad++. I know from experience that Word and Windows Scrivener (which is basically an RTF editor with extra stuff added in) are not great for this. Any suggestions for this? What do you guys use?

2. I don't see how even its intended use case is helped by randomly choosing whether to add a <p> or a <div> when typing in Book View. I'm sure there's some distinguishing feature, something I'm doing that's causing one to happen instead of the other, but darn if I know what it is. (If I knew what it was, I could avoid it. That'd probably be the best scenario actually, figuring out what I'm doing that triggers it....)

Last edited by rodneylives; 06-08-2017 at 12:31 AM. Reason: Adding plea for understanding at end.
rodneylives is offline   Reply With Quote
Reply

Tags
code, newbie, sigil, stylesheet, tags

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Seeking Advice MicS Calibre 5 04-18-2013 08:23 AM
Seeking Layout Advice GrannyGrump ePub 8 12-13-2012 09:03 AM
Seeking tech advice wyndslash Lounge 13 08-26-2011 07:56 PM
Student Seeking advice Stabiliser Which one should I buy? 3 04-28-2009 09:33 AM
Yet another noob seeking advice Voice of Reason Which one should I buy? 6 04-01-2008 03:49 PM


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


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