04-07-2012, 07:48 PM | #1 |
Cynic
Posts: 75
Karma: 51078
Join Date: Feb 2012
Device: Kindle
|
How to mark chapter headings
Setting chapter heading lines with the Headings attributes in Sigil seems to be a one at a time process. Very time consuming if there are a lot of chapters. (One document has 100 chapters. Others 30 or 40.)
How can I set it up to mark all of the chapter lines then automatically run through and set them all at one time with the Headings attribute? |
04-07-2012, 08:22 PM | #2 | |
Well trained by Cats
Posts: 30,442
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:
Do the headings ONLY have 'Chapter n'? (n being numbers) Regex is about finding patterns to trigger on |
|
Advert | |
|
04-08-2012, 02:14 PM | #3 | |
Cynic
Posts: 75
Karma: 51078
Join Date: Feb 2012
Device: Kindle
|
Quote:
Unique class (style)? Assigned? I don't even know what a class (style) is, let alone a unique one. And assigning attributes is what _I_ am doing - very slowly. Yes, I believe most of them are 'Chapter n'. One or two may have 'Chapter [one, two, etc.]'. Some of them have Chapter titles following them on the same line. The titles show up in the TOC, which is what I want, but that's all details. My concern is the time involved. There seems to be a pile of stuff out there about Regex. But since I had a stroke at age 47 (decades ago) I can't even program stuff I already went to school for, let alone study something new. I've figured out how to set and use heading attributes, but it takes a very long time to manually set 100+ chapter headings one at a time. So I'm asking how to set them automatically. What I've tried so far, highlighting the lines with CTRL, doesn't work, because when you set one line it erases all the other highlights. (NOT what CTRL is supposed to do.) I could do it in OOo in a blink, but I haven't found a program to convert it into HTML without stripping all the headings attributes out. Last edited by JimLL; 04-08-2012 at 02:17 PM. Reason: clarifying |
|
04-08-2012, 02:58 PM | #4 |
Addict
Posts: 206
Karma: 547516
Join Date: Mar 2008
Location: Berlin, Germany
Device: KObo Clara, Kobo Aura, PRS-T1, PB602, CyBook Gen3
|
The only way in Sigil is through search&replace using regular expressions. The Book view (WYSIWYG editor) in Sigil is a lot less developed than the Code view (HTML editor).
If you can do what you want in OO, you should do so and then save as html. I just tested it with a sample and the html produced by OO is not bad. It is not perfect, but a lot better than even the filtered version of Word's html. You can then open the html file in Sigil and go from there. If you prefer a WYSIWYG editor, maybe you should try to do as much as you can in OO and only use Sigil to turn the html into epub and set the meta information and create the TOC as a last step. |
04-08-2012, 03:15 PM | #5 | |
Cynic
Posts: 75
Karma: 51078
Join Date: Feb 2012
Device: Kindle
|
Quote:
Search & replace is the first thing I tried, but I never figured how to put an h1 setting operation into the replace line. (I use only h1.) If there's a way, I'm listening. I can't use OOo to output HTML, because it makes a separate HTML for each chapter, and that throws more complication into Sigil than I can handle. If there's a way to stop that, I don't know it. Yeah, I stumbled across the fact that TOC needs to be last. |
|
Advert | |
|
04-08-2012, 04:52 PM | #6 |
Addict
Posts: 206
Karma: 547516
Join Date: Mar 2008
Location: Berlin, Germany
Device: KObo Clara, Kobo Aura, PRS-T1, PB602, CyBook Gen3
|
As I said the only way I'm aware of in Sigil would be to set <h1> tags through S&E in Code view.
If I save even a very long file in OO through 'Save as' and 'html Document', not allowing the file type to be re-set to odt, it does not get separated in different files. Which way to save as html do you use in OO that produces more than one file? Could you maybe give an example of the file(s) that make problems for you? A short snipped, that shows the wrong behavior, would be best. I'll go to bed now, but I can try to help you more tomorrow. |
04-08-2012, 06:20 PM | #7 |
Bookmaker & Cat Slave
Posts: 11,494
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Flailing around here, using an ePUB-editing and creation tool, which is specifically designed for people who already have an understanding of html, xhtml, CSS and regex is just going to frustrate you further. Having seen this post, it explains, (but does not excuse) a lot of your behavior over on the other thread (although I've yet to see the "disaster thread" you mentioned). You are attempting to run a marathon before you have learned to walk, and, moreover, you fundamentally misunderstand what Sigil does; what an ePUB is; how it works or what you should be using before you even get to Sigil. You've been asked repeatedly what html editor you're using, or asked why you're not using one, and I don't think you understand that you NEED one. To put this as simply as I can: Sigil is not a Word Processing ePUB maker. It's not an authorial tool. Nor is it really a tool for amateurs who don't have the patience to learn the fundamentals. I am not trying to be rude--but you are honestly in way over your head, if you don't know what a class style is. I strenuously recommend that you reconsider using a tool more suited for your current skill level, to achieve your current goal, rather than trying to force Sigil to adapt to you. It's obvious you are on a budget, In the alternative, try the Calibre forum. There are a lot of people over there who shortcut by using Calibre to create ePUBs (somehow--I honestly don't know the method) from what are essentially word-processing files, I think from OO or from OO-exported html or rtf--and maybe that will give you a leg up. And, yes, OO can bastardize header styles upon export, BUT, if you were using a proper html editor, you could easily regex (search and replace) all of them in a snap in either an html editor OR, for that matter, Sigil. You might consider an investment in "Regex Buddy," which is actually a SUPER learning tool, OR read the regex wiki sources here at MR. I hope something there helped you. I'm not trying to be mean, but really--you're driving yourself nuts because you don't yet know what you don't know. Hitch |
04-08-2012, 06:40 PM | #8 | |
Well trained by Cats
Posts: 30,442
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:
Search (the tag might look like): <p class="chapno">(Chapter \d+)</p> The paren is the 'capture' area, the \d+ matches any amount of consecutive digits. Replace (using REGEX) <h1 class="mychapterheadclass">\1</h1> the \1 puts what was captured (includes the digits) in this place (between tags) |
|
04-10-2012, 12:28 AM | #9 | |
Cynic
Posts: 75
Karma: 51078
Join Date: Feb 2012
Device: Kindle
|
Quote:
Save as is much better. I'll see if I can get headings set in OO and keep them. Thanks. |
|
04-10-2012, 01:16 AM | #10 | ||||||||
Cynic
Posts: 75
Karma: 51078
Join Date: Feb 2012
Device: Kindle
|
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Last edited by JimLL; 04-10-2012 at 01:20 AM. |
||||||||
04-10-2012, 03:43 AM | #11 | ||||||
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Quote:
Quote:
It is more than a zipped HTML. It can also contains stylesheets, images, fonts and more. Also, it is nor restricted to one HTML fortunatly. Quote:
Quote:
If you want more complex stuff of advanced Search&Replace, you have to learn more. Not Sigil's fault, since this cannot be made a lot easier. Quote:
Quote:
The tutorial is here. Last edited by Toxaris; 04-10-2012 at 04:12 AM. |
||||||
05-13-2012, 01:43 PM | #12 |
Enthusiast
Posts: 35
Karma: 110336
Join Date: Dec 2011
Location: Los Angeles, CA
Device: Kindle n-T, Nook Color Tablet, Nexus 6
|
I'm still learning Sigil, and I don't know HTML or CSS.
Here are the steps that I use to assign <h1> class to all chapters. Please note the key secret-- you don't need to fix the closing HTML. Sigil will find your opening mark-up code, and automatically re-assign the correct closing code!!!!
|
05-13-2012, 03:00 PM | #13 | |
Evangelist
Posts: 416
Karma: 1045911
Join Date: Sep 2011
Location: Cape Town, South Africa
Device: Kindle 3
|
Quote:
If you want to do bulk chapter headings and such, I would really suggest extracting the epub and doing the work in something like RegexBuddy (use the grep function to run it on all files). The test area is a good place to get to grips with regex and getting it right. Personally, the way I do chapters is usually to merge the entire book into a single html file (so that editing the <head>er and such will be applied correctly), then using regex, strip the existing markup and place header tags around the headings, as well as a sigil chapter marker before the header. Once that's done, throw it back into Sigil and break split the file at the chapter markers. |
|
05-15-2012, 05:51 PM | #14 |
Connoisseur
Posts: 70
Karma: 187210
Join Date: Sep 2010
Location: UK
Device: Sony PRS T1, Kindle 4 NT, Kobo Touch, Kobo Clara HD
|
Useful HTML primer
I found the following introductory guide by Guido Henkel very clear, and recommend it:
http://guidohenkel.com/2010/12/take-...ook-formatting Martin |
05-15-2012, 06:55 PM | #15 | |
Resident Curmudgeon
Posts: 76,370
Karma: 136466962
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre: Chapter Headings | Paxman53 | Introduce Yourself | 5 | 10-22-2011 10:13 AM |
Chapter Headings | Paxman53 | Conversion | 3 | 10-12-2011 01:31 PM |
Chapter Headings on their own page? Help! | Lee5150 | Calibre | 3 | 10-06-2011 09:12 AM |
Why H1 and H2 Chapter Headings? | Ransom | Calibre | 11 | 08-10-2011 05:29 PM |
Help converting chapter headings | p3aul | Conversion | 6 | 04-03-2011 01:56 PM |