Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 05-26-2012, 03:01 PM   #46
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: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by JSWolf View Post
But some books don't use the work Chapter. So you can get One, Two, Three, etc.. for your chapter titles.
Sorry for any confusion, but I was only addressing your specific example... the one where it wouldn't make any sense to use a two step process that required manual intervention. But even taking into account other situations, I've found that if you dig deep enough, there's almost always something unique in the code that will allow you to isolate the chapter headings (or at the very least the vast majority of them) with regex.
DiapDealer is offline   Reply With Quote
Old 05-26-2012, 03:03 PM   #47
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: 73,974
Karma: 128903378
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 theducks View Post
Because I might want to use h2 for other things (Sigil does allow them to be marked not in TOC ) with other style.

My chapno usually has Chapter head Margins (and padding for off center placement).
Sheesh! that bloat is minimal. There are lots more frequently (mis)used styling in every single paragraph.
If you use <h2> for something else you can use <h2 class="myclass">. But you could use <h3> for the something else instead and even give it the same font size as <h2>.

As for the other bloat, I've been dealing with that. <p class="para"> becomes <p> and that <a id="page10" /> get removed as I don't care about print page numbers. Also, when we get <h2 class="chapterNumber" id="id_01"> that gets fixed to remove the bloat so the id goes away. I do remove excess <div> that have no need at all. Publishers do put in a lot of bloat. The CSS they usually use is a catchall and has all kinds of crap in it.
JSWolf is online now   Reply With Quote
Old 05-26-2012, 03:05 PM   #48
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: 73,974
Karma: 128903378
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 DiapDealer View Post
Sorry for any confusion, but I was only addressing your specific example... the one where it wouldn't make any sense to use a two step process that required manual intervention. But even taking into account other situations, I've found that if you dig deep enough, there's almost always something unique in the code that will allow you to isolate the chapter headings (or at the very least the vast majority of them) with regex.
Sometimes chapter headers have nothing special to differentiate them. Most of the times, they do even if it's just a useless bloated id tag.
JSWolf is online now   Reply With Quote
Old 05-26-2012, 03:17 PM   #49
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: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Sometimes chapter headers have nothing special to differentiate them.
That's a situation I just don't run into often enough to really worry about. If they (the chapter headers) look different than the regular text when rendered... then they are different in the code... and if they are different in the code... I can most likely isolate them with regex. *shrugs*

(and if they don't render differently than the regular text... then how were they even chapter headers?)
DiapDealer is offline   Reply With Quote
Old 05-26-2012, 04:07 PM   #50
Serpentine
Evangelist
Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.
 
Posts: 416
Karma: 1045911
Join Date: Sep 2011
Location: Cape Town, South Africa
Device: Kindle 3
I just use h1 for title page, h2 for chapters and fore/aft areas. In a few cases I've needed to give specific h2 classes for chapter headers where I wanted to style things nicely... but it's pretty rare.

So yeah, most of the time I just use the tags directly in css. No mess, no fuss, lower cross-section for quirks and problems. At the end of the day, I also have a strong opinion that minimal markup is something that people develop a subconscious appreciation of, and one of the things that I am fond of mobi for.
Serpentine is offline   Reply With Quote
Old 05-26-2012, 06:53 PM   #51
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: 73,974
Karma: 128903378
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 DiapDealer View Post
That's a situation I just don't run into often enough to really worry about. If they (the chapter headers) look different than the regular text when rendered... then they are different in the code... and if they are different in the code... I can most likely isolate them with regex. *shrugs*

(and if they don't render differently than the regular text... then how were they even chapter headers?)
Could be a poor conversion or a poor source.
JSWolf is online now   Reply With Quote
Old 05-26-2012, 07:08 PM   #52
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: 29,801
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Code:
<p>IX</p>
Not too hard
theducks is online now   Reply With Quote
Old 05-30-2012, 02:10 AM   #53
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Hi,

Guido Henkel's idea implemented here in a slightly different way using writer2xhtml and Sigil - in French -. It's about underlining a h2 title with an ornament.


https://www.mobileread.com/forums/sho...&postcount=147

1. In your odt file, insert image under the first h2 title, anchored to paragraph, without border, 30% size

2. Once your odt file has been converted to EPUB, open the EPUB with Sigil and insert the 30 remaining images using this Regex (all html files). It looks complex but in fact you just have to copy the code that writer2xhtml wrote for you for the first image...
Search </h2>
Replace</h2><div style="text-align:center"><img alt="images3" class="frameGraphics" id="images3graphic" src="../Images/image003.png" style="width:30%" /></div>

3. Then you adjust the lower margin of the ornament on the main style sheet (here: margin-bottom: 1em)


You can adjust in the same way, the h2 margin-bottom if need be.

Last edited by roger64; 05-30-2012 at 03:14 AM.
roger64 is offline   Reply With Quote
Old 05-30-2012, 07:19 AM   #54
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,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
But please:

Change alt="images3" to alt="" the alt attribute is what would be used by a screen reader program, or what would be displayed if images are disabled... and you don't want "images3" to be read aloud or shown. The alt attribute should only be used (i.e. non-blank) when an image needs some kind of description (and beware of duplicating the caption, if there's one).

The id="images3graphic" is probably not needed at all, unless you want to specifically link to the image. Also, if there are several chapters in a single file, they should have different id attributes.

Optionally, move the style="width: 30%" to the stylesheet.
Jellby is offline   Reply With Quote
Old 05-30-2012, 10:50 AM   #55
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: 29,801
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
I would also move the div style to the stylesheet and possibly condense the whole lot into a simpler <h2 class="chaphead"> style since this is being used in every chapter. and 1 change would have you back changing every chapter

CSS = Define it once, use many times
theducks is online now   Reply With Quote
Old 05-30-2012, 12:31 PM   #56
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
@Jellby and theducks
Thanks for your very informative corrections and proposals.

I was happy to obtain at first try a working solution in ADE. The fact is that I use images usually once. This time the same image has to be used 31 times and you are right to pinpoint that this asks for some adjustments.

I will now have also a more elegant solution. I will post a v2 ( v1 are just made for this).
roger64 is offline   Reply With Quote
Old 05-31-2012, 11:45 AM   #57
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Coming back after trial.

I implemented the first two remarks from Jellby since it's to delete useless stuff.

Finally I did not change anything else.

If I move the style=width="30%" down to the main stylesheet in frameGraphics, I remarked in Sigil that the image of the ornament does not scale well while it does scale in its current place. So, I kept it this way even if it's written 30 times...

Using % or em instead of px as suggested by theducks would indeed be an improvement. In fact writer2xhtml has for now % only for font-size and images and tables. I hope they will introduce this feature soon. As it is, it works.

I join the text. Even if I cleaned up the stylesheet, I only performed minor changes, so I do not call it a v2. If somebody finds something else ugly inside, please do tell me. I am quite open for this and really thankful.
Attached Files
File Type: epub Les débutantes.epub (418.6 KB, 157 views)

Last edited by roger64; 05-31-2012 at 11:52 AM.
roger64 is offline   Reply With Quote
Old 05-31-2012, 06:51 PM   #58
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: 29,801
Karma: 54830978
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 roger64 View Post

If I move the style=width="30%" down to the main stylesheet in frameGraphics, I remarked in Sigil that the image of the ornament does not scale well while it does scale in its current place. So, I kept it this way even if it's written 30 times...
Please tell me you did not put style= into the stylesheet

the entry should read:
Code:
width: 30%;
or a fixed value (px) as images should not be allowed to scale unlimited (a max-width: n property might be desireable
theducks is online now   Reply With Quote
Old 06-01-2012, 06:32 AM   #59
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)


I am not used to tweak a lot my stylesheet, and probably I did this mistake. I agree that the detailed implementation you just gave me is both good and shorter.

I take good note of it. The standard procedure used by writer2xhtml works well for standalone images but should be improved for repetitive images to keep a compact code. These ones should be treated in a slightly different way.

I will submit a proposal to the author to take care of this.
roger64 is offline   Reply With Quote
Old 06-04-2012, 08:48 PM   #60
Thalia Helikon
Enthusiast
Thalia Helikon figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.Thalia Helikon figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.Thalia Helikon figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.Thalia Helikon figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.Thalia Helikon figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.Thalia Helikon figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.Thalia Helikon figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.Thalia Helikon figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.Thalia Helikon figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.Thalia Helikon figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.Thalia Helikon figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.
 
Thalia Helikon's Avatar
 
Posts: 35
Karma: 110336
Join Date: Dec 2011
Location: Los Angeles, CA
Device: Kindle n-T, Nook Color Tablet, Nexus 6
Quote:
Originally Posted by JSWolf View Post
But some books don't use the work Chapter. So you can get One, Two, Three, etc.. for your chapter titles. ... The way I suggested uses the heading option to change the chapter headers from <p to <h2 and that gives you then the way to do the search/replace easily.
I have used search and replace to find a number followed by a paragraph break-- when the chapter doesn't have the word "Chapter" You could also search for the word "one" followed by paragraph break, and then continue to find twenty-one, thirty-one, etc.

then apply the heading style of your choice
Thalia Helikon is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre: Chapter Headings Paxman53 Introduce Yourself 5 10-22-2011 09:13 AM
Chapter Headings Paxman53 Conversion 3 10-12-2011 12:31 PM
Chapter Headings on their own page? Help! Lee5150 Calibre 3 10-06-2011 08:12 AM
Why H1 and H2 Chapter Headings? Ransom Calibre 11 08-10-2011 04:29 PM
Help converting chapter headings p3aul Conversion 6 04-03-2011 12:56 PM


All times are GMT -4. The time now is 08:25 AM.


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