Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 04-08-2012, 07:25 AM   #46
mmat1
Berti
mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.
 
mmat1's Avatar
 
Posts: 1,197
Karma: 4985964
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
Quote:
Originally Posted by roger64 View Post
@mmat No, getting strange results..
I'll look on your source.

@perkin:You're right, Sigil shouldn't do this, but sometimes it does unexpected things...
mmat1 is offline   Reply With Quote
Old 04-08-2012, 07:29 AM   #47
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
Until the css is sorted, you can just use mmat1's solution with(out) the combined let1/2 styles.

Code:
<p class="let">([A-Z])(\w{0,20}\s)((\w{0,20}\s){3})

<p class="let"><span class="let1"><span class="let2">\1</span></span><span class="smcpTypeV">\2\3</span>
That should do. At least it's only one step - which is what you asked for originally .
Perkin is offline   Reply With Quote
Advert
Old 04-08-2012, 07:43 AM   #48
mmat1
Berti
mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.
 
mmat1's Avatar
 
Posts: 1,197
Karma: 4985964
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
Quote:
Originally Posted by Perkin View Post
Until the css is sorted, you can just use mmat1's solution with(out) the combined let1/2 styles.
A last suggestion from my side, i notice that it will not work, if there are accented characters, so search should better look like this:

Code:
<p class="let">([A-Z])([^ ]{0,20}\s)(([^ ]{0,20}\s){3})
mmat1 is offline   Reply With Quote
Old 04-08-2012, 07:51 AM   #49
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
And I've noticed that if/because the spans are combined, the measurements are now from the new fontsize, which is 4.6em rather from default fontsize
Perkin is offline   Reply With Quote
Old 04-08-2012, 08:04 AM   #50
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)
First thanks to the three of you for your quick and efficient help.

Quote:
Originally Posted by mmat1 View Post
A last suggestion from my side, i notice that it will not work, if there are accented characters, so search should better look like this:

Code:
<p class="let">([A-Z])([^ ]{0,20}\s)(([^ ]{0,20}\s){3})
Thanks a lot, this time it's working!! And yes, I did not use \w because I needed to take care of accented characters, punctuation signs, apostroph and so on which can all be found in the first four words of French texts.

I will study it and check Perkin's measurements.

Have some of you any idea how to execute one after another, in automatic mode, several regex? (not related to each other like these two) Is there a tool that can do it?
roger64 is offline   Reply With Quote
Advert
Old 04-08-2012, 08:10 AM   #51
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
Right, create a new style in the css (or adapt your existing one)
Code:
.let3{
  display      : block;
  float        : left;
  margin-left  : 0.28em;
  margin-top   : -0.18em; /* essayer -0.20em pour deux lignes */
  margin-right : 0.0em;
  font-family  : 'Times New Roman';
  font-size    : 4.6em;   /* essayer 3.33em pour deux lignes */
  height       : 1em;
}
Edit: I don't know if you want to change the french comments

Then using
Code:
<p class="let">([A-Z])([^ ]{0,20}\s)(([^ ]{0,20}\s){3})
Code:
<p class="let"><span class="let3">\1</span><span class="smcpTypeV">\2\3</span>

Last edited by Perkin; 04-08-2012 at 08:15 AM.
Perkin is offline   Reply With Quote
Old 04-08-2012, 08:33 AM   #52
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
Quote:
Originally Posted by roger64 View Post
Have some of you any idea how to execute one after another, in automatic mode, several regex? (not related to each other like these two) Is there a tool that can do it?
It's easier to do on the html before you get it into Sigil, but one tool that can work on multiple files as well as running multiple S&R's is PowerGREP

It's not as complicated as it first looks, once you get to using it. If you do a sequence, that runs multiple s&r's over any files etc.

They also do a few other brilliant regex products (testing/building/explaining) and a texteditor (which is my preferred editor).
Perkin is offline   Reply With Quote
Old 04-08-2012, 09:46 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)
@Perkin

After successive refinements, this looks better indeed. I will try this to morrow.

I go straight from odt to EPUB. I just tweak the EPUB a little after converting, but most of the work is done without touching directly any html file.

I am a Linux user, but I see now which kind of tool can do it. My idea was to add to our existing EPUB converting program a kind of editable super macro (the user could insert or modify any Regex inside). But, if the user needs Power Grep to use it, it would be a self-defeating purpose. On the other hand, if Power Grep can help me prepare this kind of super macro which later could be used without it, as a kind of program, yes it would be worthwhile.

Last edited by roger64; 04-08-2012 at 09:49 AM.
roger64 is offline   Reply With Quote
Old 04-08-2012, 09:56 AM   #54
mmat1
Berti
mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.
 
mmat1's Avatar
 
Posts: 1,197
Karma: 4985964
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
Quote:
Originally Posted by roger64 View Post
Have some of you any idea how to execute one after another, in automatic mode, several regex? (not related to each other like these two) Is there a tool that can do it?
Powergrep looks really powerful at first glance, at second glance I saw the price ...

So I may mention the command-line oriented unix-tools sed or awk, which are available for windows as well. With awk you can do nearly anything, but you'll have to build some skills first...
mmat1 is offline   Reply With Quote
Old 04-08-2012, 10:12 AM   #55
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
Quote:
Originally Posted by mmat1 View Post
Powergrep looks really powerful at first glance, at second glance I saw the price ...

So I may mention the command-line oriented unix-tools sed or awk, which are available for windows as well. With awk you can do nearly anything, but you'll have to build some skills first...
I agree, need to learn more regex fu. I haven't used PowerGrep for ages, and must have been demo, didn't realise it was that dear. My toolbar and smilies aren't working, had to add < b > tags myself, was working earlier though.
Perkin is offline   Reply With Quote
Old 04-08-2012, 12:02 PM   #56
mmat1
Berti
mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.
 
mmat1's Avatar
 
Posts: 1,197
Karma: 4985964
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
Quote:
Originally Posted by Perkin View Post
I agree, need to learn more regex fu. I haven't used PowerGrep for ages, and must have been demo, didn't realise it was that dear. My toolbar and smilies aren't working, had to add < b > tags myself, was working earlier though.
Uhm, did I state correctly what i meant ? "Building skills" is meant in order going to use "awk". That has nothing to do with regex, it's just the art of tricky skript-programming. With awk, you can have a html as input and get a list of primes as output (each word replaced by a prime in order).
And it was not stated in any context of your skills, if it was understood this way i must apologize.
mmat1 is offline   Reply With Quote
Old 04-08-2012, 12:56 PM   #57
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
Quote:
Originally Posted by mmat1 View Post
Uhm, did I state correctly what i meant ? "Building skills" is meant in order going to use "awk". That has nothing to do with regex, it's just the art of tricky skript-programming. With awk, you can have a html as input and get a list of primes as output (each word replaced by a prime in order).
And it was not stated in any context of your skills, if it was understood this way i must apologize.
No need for apology, half my fault at not reading it correctly.
Not having used awk I just thought it was another grep style prog using regex - again my fault.
(My brain is only half working at moment 'cause of medicaton - at least that's what I'm blaming it on - I think I've used today's lucidity quota up earlier, on the actual regex problem and css adjustment.)
Perkin is offline   Reply With Quote
Old 04-08-2012, 04:12 PM   #58
mmat1
Berti
mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.
 
mmat1's Avatar
 
Posts: 1,197
Karma: 4985964
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
Quote:
Originally Posted by Perkin View Post
I just thought it was another grep style prog using regex - again my fault.
"Sed" is a grep-style regex tool, "awk" is much more, it's actually a script-programming environment.

I hope, you'll be better soon.
mmat1 is offline   Reply With Quote
Old 04-09-2012, 12:42 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 tried your solutions: both are working.

I have rather stay with mmat's though because with the second one I found it a little more tricky to finetune the dropcap position. BTW, a good part of my short science on dropcaps come from here.

Thanks again and take care.

NB: I'll have a look at "awk".

Last edited by roger64; 04-09-2012 at 01:06 AM.
roger64 is offline   Reply With Quote
Old 04-17-2012, 10:39 AM   #60
mncowboy
Wanderer
mncowboy ought to be getting tired of karma fortunes by now.mncowboy ought to be getting tired of karma fortunes by now.mncowboy ought to be getting tired of karma fortunes by now.mncowboy ought to be getting tired of karma fortunes by now.mncowboy ought to be getting tired of karma fortunes by now.mncowboy ought to be getting tired of karma fortunes by now.mncowboy ought to be getting tired of karma fortunes by now.mncowboy ought to be getting tired of karma fortunes by now.mncowboy ought to be getting tired of karma fortunes by now.mncowboy ought to be getting tired of karma fortunes by now.mncowboy ought to be getting tired of karma fortunes by now.
 
mncowboy's Avatar
 
Posts: 106
Karma: 472218
Join Date: Jan 2011
Device: Kindle 3, PaperWhite 2
I have a few documents in MS Word that I'm going to convert to ebooks. The documents have a lot of endnotes, and as usual, Word puts out a lot of junk when saved a html. I am very new to regex, and was wondering if I could get help. I want to search on:
Code:
<a href="#_edn1" name="_ednref1" title=""><span class="MsoEndnoteReference"><span class="MsoEndnoteReference"><b><span style="font-size:8.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black">[1]</span></b></span></span></a>
and replace it with:
Code:
<a href="#_edn1" name="_ednref1" title=""><sup>[1]</sup></a>
The endnote numbers are from 1 to 125. Is there a single regex that can do this in Sigil?
Thanks in advance.

Last edited by mncowboy; 04-17-2012 at 10:53 AM.
mncowboy is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Examples of Subgroups emonti8384 Lounge 32 02-26-2011 07:00 PM
Accessories Pen examples Gunnerp245 enTourage Archive 15 02-21-2011 04:23 PM
Stylesheet examples? Skitzman69 Sigil 15 09-24-2010 09:24 PM
Examples kafkaesque1978 iRiver Story 1 07-26-2010 04:49 PM
Looking for examples of typos in eBooks Tonycole General Discussions 1 05-05-2010 05:23 AM


All times are GMT -4. The time now is 03:43 AM.


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