10-18-2013, 04:19 PM | #1 | |
Member
Posts: 10
Karma: 10
Join Date: Sep 2013
Device: Kindle
|
Style poetry - line break on verse
Hi, I am stylizing a poetry book that is in spanish, but I am having problems with lines breaks. The problem is similar to this. But in spanish the verses breaks must have a opening bracket ([) before it stars the new line, and also it has to be with right align. For example:
Quote:
P. S. Obviously the verse breaks when the reader increase the size of the font, or when the verse does not fit on the screen... Last edited by ramsaa; 10-18-2013 at 04:22 PM. |
|
10-18-2013, 06:32 PM | #2 | ||
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Without knowing that, it's hard to say what to do. You obviously will have to create a flush-right style for the indented lines, and you can do a regex to put the brackets in there, permanently (for the deliberately-indented lines), but for the not-deliberately-indented lines, you have other issues, if you need the bracket for those, too--ebooks don't really add characters to themselves on the fly. Not even with pseudo-classes, but I'd have to think about that. Is it your intent to do this ePUB also for Amazon? Quote:
I feel for you; we're dealing with one right now we've had in-house since last December, and he just told us to make a boatload of edits to his ePUB, thinking that because the line breaks (as he sees them, without altering the size of his viewing pane or the font) are different, that we "changed" his PDF. So he's added title case to words, and commas, not understanding that this is going to be completely different again when we make the MOBI. I'm hundreds of bucks, if not over a thousand, down on this project, and it's the straw that broke the camel's back--we no longer accept poetry, because it's just not profitable. And the poet-client is never happy. Never. (Or: I should say, sure, we'll accept poetry, if we can make it in fixed-format and charge for it.) If you'll reply about the unintended line breaks and brackets, I'm sure we'll all have ideas to assist you. Hitch |
||
Advert | |
|
10-19-2013, 02:50 AM | #3 | |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
Code:
First verse is a long line that could be [broken due to limited space Second verse shorter, indented. Code:
First verse is a long line that could be broken due to [limited space Second verse shorter, indented. The old mobi format used to have the possibility of right-aligned broken lines (mobipocket.com, see bottom of the page), but without the bracket, and I didn't see it working in the PC reader or in my Cybook Gen3. For ePub, I made a suggestion 4 years ago, but it doesn't seem anything has happened to it since then... |
|
10-19-2013, 04:48 AM | #4 | |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
the bracket itself is the indicator that the line is broken due to lack of space; it's not something "else," e.g., an indicator of emphasis, or something like that. Yes, I agree with you, Jellby; I don't think it can be done at this time, with the currently-available technolgy (unless, as I said, the book is done in fixed-format, so that it does not reflow). I can't think of any way to effectively create an "if-then" scenario so that the first reflowed letter is preceded by the bracket, I really cannot. Doesn't mean it can't be done; but as you can't wrap the "to-be-reflowed" portion (as we don't know what it is) with anything that would allow any of the trickier things (inheritances, child-ofs, pseudo-elements, etc.) to work...I just don't see it. Many someone else will come along with better tricks, but if Jellby doesn't know--I don't think anyone does. Hitch |
|
10-19-2013, 09:09 AM | #5 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
WARNING! Do not try this at home! Keep out of the reach of children!
Code:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ops="http://www.idpf.org/2007/ops" xml:lang="en"> <head> <title>Testdoc</title> <style type="text/css"> div.poetry { margin: 1em 0 1em 2em; } div.poetry div.line { margin: 0; padding-left: 3em; text-indent: -3em; text-align: left; } div.poetry div.line:before{ background-color: white; content: " "; position: relative; z-index: -1; float: left; width: 4em; margin-left: -4em; } div.poetry span.word:after { content: "["; position: relative; z-index: -2; float: left; width: 0; margin-left: 2.5em; margin-right: -2.5em; } </style> </head> <body> <div class="poetry"> <div class="line"><span class="word">Lorem </span><span class="word">ipsum </span><span class="word">dolor </span><span class="word">sit </span><span class="word">amet, </span><span class="word">consectetur </span><span class="word">adipiscing </span><span class="word">elit.</span></div> <div class="line"><span class="word">In </span><span class="word">sit </span><span class="word">amet </span><span class="word">orci </span><span class="word">eros.</span></div> </div> </body> </html> - ADE does not support :before and :after pseudo-elements. - I'd bet ADE does not support z-index either, which is not a required ePub 2.0.1 property. It's anyway an ugly and unsatisfactory solution: - The wrapped part of the line is still not right-aligned, but indented a fixed amount. - It only works with some specified background: white here, needed to hide the bracket in the first part of the line. - It requires wrapping every word (or every allowed break point) in a <span>. - It can still fail in some cases. |
Advert | |
|
10-19-2013, 11:56 AM | #6 |
Member
Posts: 10
Karma: 10
Join Date: Sep 2013
Device: Kindle
|
Thanks for your replies.
Hitch, I also do not like to stylizing poetry for EPUB, but I accepted because I thought that it would be nice to have some solution for others proyects. But I realized that may be I was wrong. Jellby, actually I found that witt JavaScript it can be done, but obviously it won't work for EPUBs. In other hand, I found some neer solution and it goes like this: Code:
p { font-family: Arial, Sans-Serif; font-size: 1.25em; } .wrap-cont { font-family: Courier New, Monospace; margin-bottom: 16px; } .wrap-cont p { background: url(../Images/corchete.png) no-repeat bottom left; background-size: 1%; text-indent: -100px; margin: 0 0 0 100px; } Code:
<body> <div class="wrap-cont"> <p>Some_really_long_command line "with parameters" "that just go on and on" " that should all be typed on one line" "but need to be wrapped for display and I'd like the text style to indicate that it has wrapped"</p> <p>Some_really_long_command line "with parameters" "that just go on and on" " that should all be typed on one line" "but need to be wrapped for display and I'd like the text style to indicate that it has wrapped"</p> </div> </body> I do not know if it is a good idea to have this big bracket, or if it would be better smaller. Now, the client only wants the opening bracket, he does not care the right-align. But as you can see, it does not display well, any suggestion? Last edited by ramsaa; 10-19-2013 at 11:59 AM. |
10-19-2013, 02:55 PM | #7 | |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Code:
.wrap-cont p {
background: url(../Images/corchete.png) no-repeat bottom left;
background-size: 0.33em;
text-indent: -100px;
margin: 0 0 0 100px;
}
Also you could use a .svg image instead of a .png and with "a space" on the right including. Regards Rubén Last edited by RbnJrg; 10-19-2013 at 03:00 PM. |
|
10-19-2013, 02:59 PM | #8 |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Um....something seems to have gone amiss with this image?
Hitch |
10-20-2013, 02:50 AM | #9 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
The image is an oversized bracket. But if it's going to be a simple square bracket, you gain nothing by increasing the resolution so much, it could be a small ~20 pixel image (would you noticed any pixellation with this particular image?). If it were a round parenthesis or brace, it would be different.
If I understand it correctly, that method would only work with a single "continuation line", with more lines you'd get something like: Code:
First verse is a long line that could be broken due [to limited space Second verse shorter, indented. |
10-20-2013, 10:17 AM | #10 | |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
|
|
10-20-2013, 07:21 PM | #11 | |
Member
Posts: 10
Karma: 10
Join Date: Sep 2013
Device: Kindle
|
Quote:
Code:
.wrap-cont p { background: url(../Images/corchete.png) repeat-y bottom left; background-size: 0.5em; padding: 0 0 0 .25em; text-indent: -100px; margin: 0 0 0 100px; } |
|
10-21-2013, 02:37 PM | #12 | |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Hitch |
|
10-21-2013, 02:49 PM | #13 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Here in the Netherlands it is mostly Kobo and Sony. Some others like the old BeBook is still found and a small portion of Kindle. I do expect a bigger share of Kindle in the future now it officially sells here, but so far it is mostly Kobo and Sony.
|
10-22-2013, 01:35 PM | #14 | |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Quote:
Dale |
|
10-22-2013, 03:55 PM | #15 |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
|
Tags |
break, poetry, spanish, style, verse |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Line break - noob question | alanHd | Sigil | 19 | 05-02-2013 01:33 PM |
Line break within Headers? | Lori Reeser | Sigil | 7 | 02-15-2013 07:27 PM |
Break Document at Paragraph Style | BatGrfx | Writers' Corner | 2 | 09-10-2011 02:46 PM |
Simple code for verse breaks in poetry using Sigil? | pstjmack | ePub | 14 | 08-13-2011 01:18 PM |
how to insert break-line | schuster | Recipes | 1 | 05-24-2011 03:19 PM |