Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 11-28-2017, 05:54 PM   #1
PHigby
Junior Member
PHigby began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jun 2016
Location: Michigan
Device: none
How to keep blank underscore within a statement

I'm working on a language learning textbook. In one of the exercises, there are underscore markers where the student needs to provide the missing word. The author has (blank underscore) ________ as his formatting, but when I export to flowable epub out of Indesign it's gone and doesn't show.

Any suggestions how to retain the formatting?
PHigby is offline   Reply With Quote
Old 11-28-2017, 07:08 PM   #2
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,539
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by PHigby View Post
I'm working on a language learning textbook. In one of the exercises, there are underscore markers where the student needs to provide the missing word. The author has (blank underscore) ________ as his formatting, but when I export to flowable epub out of Indesign it's gone and doesn't show.

Any suggestions how to retain the formatting?
I don't know if I understand you well but if you want something like "________" in your epub, that is easy to get with the css property "text-decoration: underline;". For example:

1. In your css stylesheet:

Code:
.underscore {
    text-decoration: underline;
}
2. In your .xhtml file:

Code:
<p>This is an example <span  class="underscore">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p>
Another way to get the same result is by using the property "display: inline-block;". For example:

1. In your css stylesheet:

Code:
.underscore {
    display: inline-block;
    width: 8em; /* here you can set the length of the underscore */
    border-bottom: 1px solid black;
}
2. In your .xhtml file:

Code:
<p>This is an example <span  class="underscore"></span> very easy</p>
Maybe this solution is more elegant but the the blank underscore will have the same length in all cases and with the previous method, you can control that by using so many & nbsp; as the length of the word of your choice.

I hope this help you.

Regards
Rubén
RbnJrg is online now   Reply With Quote
Advert
Old 11-29-2017, 02:13 AM   #3
doubleshuffle
Unicycle Daredevil
doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.
 
doubleshuffle's Avatar
 
Posts: 13,923
Karma: 185041098
Join Date: Jan 2011
Location: Planet of the Pudding Brains
Device: Aura HD (R.I.P. After six years the USB socket died.) tolino shine 3
Quote:
Originally Posted by RbnJrg View Post
Maybe this solution is more elegant but the the blank underscore will have the same length in all cases and with the previous method, you can control that by using so many & nbsp; as the length of the word of your choice.
But one could still use your far more elegant method by setting different classes of underscore span:

Code:
.underscore3 {
    display: inline-block;
    width: 3em; 
    border-bottom: 1px solid black;
}
.underscore4 {
    display: inline-block;
    width: 4em; 
    border-bottom: 1px solid black;
}
etc.
doubleshuffle is offline   Reply With Quote
Old 11-29-2017, 04:35 AM   #4
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Perhaps I'm missing something obvious, but why not just use underscore characters? ie ________ ? It's an ASCII character and should never be "stripped out" by any software.
HarryT is offline   Reply With Quote
Old 11-29-2017, 04:48 AM   #5
doubleshuffle
Unicycle Daredevil
doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.
 
doubleshuffle's Avatar
 
Posts: 13,923
Karma: 185041098
Join Date: Jan 2011
Location: Planet of the Pudding Brains
Device: Aura HD (R.I.P. After six years the USB socket died.) tolino shine 3
Quote:
Originally Posted by HarryT View Post
Perhaps I'm missing something obvious, but why not just use underscore characters? ie ________ ? It's an ASCII character and should never be "stripped out" by any software.
Depending on the font, you may get tiny gaps between the individual characters, which doesn't look particularly nice.
doubleshuffle is offline   Reply With Quote
Advert
Old 11-29-2017, 04:57 AM   #6
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Quote:
Originally Posted by doubleshuffle View Post
Depending on the font, you may get tiny gaps between the individual characters, which doesn't look particularly nice.
Sometimes, though, the simple solutions really are the best. In situations where you want to indicate that this is a place where the user should "fill in the blanks", small gaps between letters are exactly what you do want to indicate the letters.

Still, the OP now has a range of options and can use whichever they prefer.
HarryT is offline   Reply With Quote
Old 11-29-2017, 10:50 AM   #7
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,539
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by doubleshuffle View Post
But one could still use your far more elegant method by setting different classes of underscore span:

Code:
.underscore3 {
    display: inline-block;
    width: 3em; 
    border-bottom: 1px solid black;
}
.underscore4 {
    display: inline-block;
    width: 4em; 
    border-bottom: 1px solid black;
}
etc.
Ok, you're right But in that case, would be a bit more efficient to use the following code:

Code:
.underscore {
    display: inline-block;
    border-bottom: 1px solid black;
}

.width3 {
    width: 3em; 
}

.width4 {
    width: 4em; 
}

etc.
And to apply them in the .xhtml file by using for example:

Code:
<p>This is an example <span  class="underscore width4"></span> very easy</p>
Regards
Rubén
RbnJrg is online now   Reply With Quote
Old 11-29-2017, 05:36 PM   #8
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by RbnJrg View Post
Code:
<p>This is an example <span  class="underscore width4"></span> very easy</p>
That would make for a more streamlined CSS sheet, but a more complex class name. I thought I read somewhere on MR that SOME apps/readers may have problems with the compound class name??? My reader of choice (Marvin) displays them correctly so I do occasionally use this technique. YMMV
Turtle91 is offline   Reply With Quote
Old 11-29-2017, 06:24 PM   #9
dwig
Wizard
dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.
 
dwig's Avatar
 
Posts: 1,613
Karma: 6718479
Join Date: Dec 2004
Location: Paradise (Key West, FL)
Device: Current:Surface Go & Kindle 3 - Retired: DellV8p, Clie UX50, ...
Quote:
Originally Posted by HarryT View Post
Sometimes, though, the simple solutions really are the best. In situations where you want to indicate that this is a place where the user should "fill in the blanks", small gaps between letters are exactly what you do want to indicate the letters.

Still, the OP now has a range of options and can use whichever they prefer.
True, but I wonder if the OP's issue has to deal with InDesign getting fancy and replacing simple underscores with some special on-the-fly graphic underline entity, as MS Word does, and then failing to decompose it successfully in its ePub export. The OP may well need to create the Id file with some replacement text (e.g. "#_#_#_") that will successfully export. They can then do a search and replace in an ePub editor (e.g. Sigil or calibre Editor) to replace any "#_" with a simple underscore or if the Id blanks are uniform in length replace with some fancier styled <span>.
dwig is offline   Reply With Quote
Old 12-02-2017, 11:36 PM   #10
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,460
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by doubleshuffle View Post
Depending on the font, you may get tiny gaps between the individual characters, which doesn't look particularly nice.
I would also add, because I am dealing with something along these lines now, if the end result here will be a MOBI file, you can get VERY weird lengths due to the justification algorithm taking liberties with the length/width of the nbsps. AND the algo can also create the appearance of space BETWEEN the spaces that effect (yes, I mean effect, not affect, thank you) the underscores. Not a great result.

FWIW.

Hitch
Hitch is offline   Reply With Quote
Old 12-04-2017, 06:09 PM   #11
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,897
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
For lines where you need the underscores, use a monospace font.
JSWolf is offline   Reply With Quote
Old 12-04-2017, 06:42 PM   #12
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,460
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by JSWolf View Post
For lines where you need the underscores, use a monospace font.
YES, that ^ too. I meant to say that, but brain-farted it.

Hitch
Hitch is offline   Reply With Quote
Old 12-04-2017, 06:53 PM   #13
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,897
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
And any text on that line needs to be monospace.
JSWolf is offline   Reply With Quote
Reply

Tags
flowable epub, indesign cs6, text-formatting, underscore


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove underscore when exporting from library deadman36g Calibre 4 08-01-2015 12:15 AM
Save to Disc - Folder name - Period changes to Underscore Gutenberg Library Management 4 09-17-2012 10:48 AM
Underscore to Italics in OpenOffice Moejoe Workshop 8 05-23-2009 02:34 PM


All times are GMT -4. The time now is 11:25 PM.


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