![]() |
#1 |
Zealot
![]() ![]() Posts: 119
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 |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,130
Karma: 91256
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.
|
![]() |
![]() |
![]() |
#3 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#4 |
Zealot
![]() ![]() Posts: 119
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. |
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,130
Karma: 91256
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?
|
![]() |
![]() |
![]() |
#6 |
Zealot
![]() ![]() Posts: 119
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- |
![]() |
![]() |
![]() |
#7 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,130
Karma: 91256
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>[^<]*?) Code:
\g<footnote> \g<text> |
![]() |
![]() |
![]() |
#8 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
Quote:
Code:
'('+\g<footnote>+') '+\g<text> |
|
![]() |
![]() |
![]() |
#9 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,130
Karma: 91256
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.
|
![]() |
![]() |
![]() |
#10 |
Zealot
![]() ![]() Posts: 119
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 |
![]() |
![]() |
![]() |
#11 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,130
Karma: 91256
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>[^<]*) Code:
(\g<footnote>) \g<text> Post relevant examples of the HTML, and I'll see what I can do. |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |