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

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 01-27-2011, 08:47 AM   #1
schuster
Zealot
schuster doesn't litterschuster doesn't litter
 
Posts: 116
Karma: 100
Join Date: Jan 2011
Location: Germany / NRW /Köln
Device: prs-650 / prs-350 /kindle 3
change position of footnotes

is it possible?

as an example i would insert the footnote (marked with a star)
into the main text.

__________________________________________________ ____________
original

Das Mädchen war über sich selbst hinausgewachsen. Johnny
konnte es nur bewundern. Trotz der Angst war Kathy* nicht
durchgedreht. Beide hatten genau das Richtige getan. Nicht die
Helden spielen, sondern das Haus verlassen und flüchten. Kathy
hatte sich einfach ein Rad

* Siehe John Sinclair Nr. 1027: „Der Traum vom Schwarzen Tod“
__________________________________________________ _____________

html view:

<br>
Das Mädchen war über sich selbst hinausgewachsen. Johnny konnte es <br>
nur bewundern. Trotz der Angst war Kathy* nicht durchgedreht. Beide <br>
hatten genau das Richtige getan. Nicht die Helden spielen, sondern das <br>
Haus verlassen und flüchten. Kathy hatte sich einfach ein Rad <br>
<br>
* Siehe John Sinclair Nr. 1027: „Der Traum vom Schwarzen Tod“ <br>
<hr>

__________________________________________________ _____________

inserted view:

Das Mädchen war über sich selbst hinausgewachsen. Johnny
konnte es nur bewundern. Trotz der Angst war Kathy (Siehe
John Sinclair Nr. 1027: „Der Traum vom Schwarzen Tod“) nicht
durchgedreht. Beide hatten genau das Richtige getan. Nicht die
Helden spielen, sondern das Haus verlassen und flüchten. Kathy
hatte sich einfach ein Rad

__________________________________________________ _____________


i've got no idea how to do this.

can anyone help me, please ???????

olaf


(calibre 742, win)

Last edited by schuster; 01-27-2011 at 11:09 AM. Reason: missing asterisk
schuster is offline   Reply With Quote
Old 01-27-2011, 09:38 AM   #2
Manichean
Wizard
Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!
 
Manichean's Avatar
 
Posts: 3,130
Karma: 80520
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
This should be, I believe, possible to do with the search & replace feature. Are the books you're trying to convert out of copyright? If so, could you attach a test case? If not, PM me.
Manichean is offline   Reply With Quote
 
Enthusiast
Old 01-27-2011, 10:30 AM   #3
Manichean
Wizard
Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!
 
Manichean's Avatar
 
Posts: 3,130
Karma: 80520
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Quote:
Originally Posted by schuster View Post
<br>
Das Mädchen war über sich selbst hinausgewachsen. Johnny konnte es <br>
nur bewundern. Trotz der Angst war Kathy nicht durchgedreht. Beide <br>
hatten genau das Richtige getan. Nicht die Helden spielen, sondern das <br>
Haus verlassen und flüchten. Kathy hatte sich einfach ein Rad <br>
<br>
* Siehe John Sinclair Nr. 1027: „Der Traum vom Schwarzen Tod“ <br>
<hr>
Did you miss the asterisk behind "Kathy" in this snippet? If so, I have an idea, otherwise, I'm both confused and out of ideas
Manichean is offline   Reply With Quote
Old 01-27-2011, 10:45 AM   #4
schuster
Zealot
schuster doesn't litterschuster doesn't litter
 
Posts: 116
Karma: 100
Join Date: Jan 2011
Location: Germany / NRW /Köln
Device: prs-650 / prs-350 /kindle 3
no,
i want to insert the footnote-text in place after "Kathy" that it looks like in my example "inserted view".
if an asterisk appear in the text and there is a footnote, than the asterisk should be replaced with the text of the footnote.
schuster is offline   Reply With Quote
Old 01-27-2011, 10:53 AM   #5
Manichean
Wizard
Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!
 
Manichean's Avatar
 
Posts: 3,130
Karma: 80520
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
What I meant was that in your original text, an asterisk appears behind the name "Kathy". In your HTML view, it doesn't. Is that an error or is the asterisk really not present in the HTML view?
Manichean is offline   Reply With Quote
Old 01-27-2011, 11:08 AM   #6
schuster
Zealot
schuster doesn't litterschuster doesn't litter
 
Posts: 116
Karma: 100
Join Date: Jan 2011
Location: Germany / NRW /Köln
Device: prs-650 / prs-350 /kindle 3
ahh,
now i understand!
thats an error from my side.
the asterisk is present behind "Kathy"

sorry,

-update-
schuster is offline   Reply With Quote
Old 01-27-2011, 11:19 AM   #7
Manichean
Wizard
Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!
 
Manichean's Avatar
 
Posts: 3,130
Karma: 80520
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
In that, case, here's my idea:
The assumption here is that each footnote is first marked by an asterisk where it should be in the text, followed by some text, followed by an asterisk and the actual footnote. I assume, as in your example, that the footnote itself contains no markup- you'd need to adapt accordingly if that varies for other books.
In the search & replace conversion setting, use the search pattern
Code:
(?s)\*(?P<text>[^*]*?)*(?P<footnote>[^<]*?)
and the replacement string
Code:
\g<footnote> \g<text>
The caveat is that I haven't tested it. When you test the regular expression in the wizard, the text from the first asterisk to the end of the footnote should be highlighted.
Manichean is offline   Reply With Quote
Old 01-28-2011, 06:20 AM   #8
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Quote:
Originally Posted by Manichean View Post
and the replacement string
Code:
\g<footnote> \g<text>
The caveat is that I haven't tested it. When you test the regular expression in the wizard, the text from the first asterisk to the end of the footnote should be highlighted.
The replacement needs to be slightly different from that I think:
Code:
'('+\g<footnote>+') '+\g<text>
The parentheses may need to be escaped by a '\' if you get an error. I haven't tested it either, but I'm pretty sure the first won't work without the plus signs, and of course you want to wrap the footnote in some identifier.
ldolse is offline   Reply With Quote
Old 01-28-2011, 07:10 AM   #9
Manichean
Wizard
Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!
 
Manichean's Avatar
 
Posts: 3,130
Karma: 80520
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Something is seriously wonky here. I'm just testing the expression. I suspect my understanding is wrong somehow, I'll post back when I finish testing.
Manichean is offline   Reply With Quote
Old 01-28-2011, 07:24 AM   #10
schuster
Zealot
schuster doesn't litterschuster doesn't litter
 
Posts: 116
Karma: 100
Join Date: Jan 2011
Location: Germany / NRW /Köln
Device: prs-650 / prs-350 /kindle 3
yes,
tested right now.
the result makes me not happy.
if you posting a new expression, please be patient to monday morning.
had to make a little holiday this weekend with my kids.

have you any idea to make an expression work with 2 or more footnotes too??
have a little library with tech-books and science, where will be more than one footnote .



greetings
schuster is offline   Reply With Quote
Old 01-28-2011, 07:26 AM   #11
Manichean
Wizard
Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!
 
Manichean's Avatar
 
Posts: 3,130
Karma: 80520
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Okay, I finished testing this. (I used Python directly, not Calibre, but since I used the exact same function, the results should be the same.)
Use this search pattern:
Code:
(?s)\*\s*(?P<text>[^*]*?)\s*\*\s*(?P<footnote>[^<]*)
The replacement pattern is:
Code:
(\g<footnote>) \g<text>
I made the same assumptions as in my earlier post.

Quote:
Originally Posted by schuster View Post
have you any idea to make an expression work with 2 or more footnotes too??
have a little library with tech-books and science, where will be more than one footnote .
Post relevant examples of the HTML, and I'll see what I can do.
Manichean is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Old Thread] (viewer) Ignoring left-off position sciurius Calibre 10 09-08-2011 08:19 AM
What's Your Favorite Position? foreverjuly Amazon Kindle 11 09-16-2010 05:38 PM
Variable position / anchor for images? jharker ePub 1 08-31-2010 04:40 AM
Last read position not saved after shut-down? SmartyPants Astak EZReader 9 04-20-2010 11:08 PM
your current position regarding the 505 hello Sony Reader 1 10-06-2007 05:37 AM


All times are GMT -4. The time now is 12:20 PM.


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