| 
			
			 | 
		#1 | 
| 
			
			
			
			 Junior Member 
			
			![]() Posts: 6 
				Karma: 10 
				Join Date: Apr 2014 
				
				
				
				Device: Kindle 
				
				
				 | 
	
	
	
		
		
			
			 
				
				TOC conversion with images as Chapter Heading
			 
			
			
			I want to create a TOC in Mobi and ePub when converting through Calibre.  My chapter headings in file are images, no actual text headers.   
		
	
		
		
		
		
		
		
		
		
		
		
	
	<p class="chapter" align="right"> <img src="/Users/Desktop/book/Chapter 2.jpg" alt="Chapter 2" width="236" height="148"/></p> This is the format in file. I am not sure how to create, or force create a TOC with images as headings. I'm using Textmate as editor. Any thoughts would be appreciated. I've tried unsuccessfully using XPath - book starts with Chapter 7, and then list TOC as all unnamed. Thanks  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#2 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,269 
				Karma: 16544702 
				Join Date: Sep 2009 
				Location: UK 
				
				
				Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Try <p title="Chapter 2" class="... etc> in your source html before calibre conversion.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| Advert | |
| 
         | 
    
| 
			
			 | 
		#3 | |
| 
			
			
			
			 Well trained by Cats 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,267 
				Karma: 61916422 
				Join Date: Aug 2009 
				Location: The Central Coast of California 
				
				
				Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 You want to convert and modify<p class="chapter" to a <p class="chapter" title="\2" I suggest the book-editor Not tested (REGEX)Search: Code: 
	<p class="chapter" align="right">\s+(<img src="/Users/Desktop/book/.+.jpg" alt=)"(.+?)" (.+?)/>)</p> Code: 
	<p class="chapter" align="right" title="\2">\1"\2" \3</p> Second phase is to replace the P tag pair with a H# pair Note I would also move the align right to .chapter in the CSS BIG NOTE: src="/Users/Desktop ![]() That path will break your book as soon as you move the book  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#4 | 
| 
			
			
			
			 Junior Member 
			
			![]() Posts: 6 
				Karma: 10 
				Join Date: Apr 2014 
				
				
				
				Device: Kindle 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Hi.  Thanks for the replies.  I actually inserted  
		
	
		
		
		
		
		
		
		
		
		
		
	
	<p class="chapter hidden">Chapter 1</p> before each image, with the settings : p.hidden { display: none; visibility: hidden; } Then I entered the path for Chapter creation in Calibre, and it worked. I emailed G. Henkel (big help), and he provided me with this solution. As far as the location of the picture file, BIG NOTE: src="/Users/Desktop That path will break your book as soon as you move the book: I am a newbie to this html / css coding, and am learning on the fly. I don't know all the tips, tricks, and "the right way to do things", but I sure appreciate you more experienced / knowledgeable people helping me and others out. I'm not sure what you mean by break the book, I assume you mean it won't work unless it is in that folder location (correct)? I thought after converting the book to a mobi / ePub I wouldn't need that original folder / file anymore.?? You want to convert and modify<p class="chapter" to a <p class="chapter" title="\2" I have been scouring the internet for tips and tricks, and solutions to all the issues I have come up with in the past few days. I'm not sure what the title="/2" does? I'm just trying to figure out what all the different classes, div, etc. mean and how they work. Do you have a trusted website or book that you would recommend I read. Thanks again.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#5 | 
| 
			
			
			
			 Well trained by Cats 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,267 
				Karma: 61916422 
				Join Date: Aug 2009 
				Location: The Central Coast of California 
				
				
				Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			\2 is (whatever was in) the second capture group replacement 
		
	
		
		
		
		
		
		
		
		
		
		
	
	Read the REGEX sicky at the top of THIS forum group Search (This)\s+(is)\s+(fine) Replace: \3 \2 \1 =fine is This  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| Advert | |
| 
         | 
    
| 
			
			 | 
		#6 | |
| 
			
			
			
			 null operator (he/him) 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,018 
				Karma: 30277294 
				Join Date: Mar 2012 
				Location: Sydney Australia 
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Also have a look at http://www.w3schools.com/ a lot of the 'stuff' that's used on websites is not applicable to ebooks - so you don't need to know all that's at W3C. BR  | 
|
| 
		
 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
    
| Tags | 
| toc creation, toc images | 
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| how to build toc when chapter headers are just images | cybmole | Sigil | 17 | 04-02-2012 06:03 AM | 
| Conversion turns chapter heading BOLD | Bobosmite | Conversion | 5 | 03-05-2012 01:12 PM | 
| Images resizing in epub to pdf conversion + TOC not creating | brontus | Conversion | 2 | 10-30-2011 01:30 AM | 
| the toc goto next chapter feature disappears on conversion | alansplace | Calibre | 5 | 08-06-2011 04:58 PM | 
| Controlling chapter heading sizes? | Djehuty | Calibre | 3 | 04-27-2009 09:02 PM |