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

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old Today, 01:17 AM   #1
icearch
Zealot
icearch will become famous soon enoughicearch will become famous soon enoughicearch will become famous soon enoughicearch will become famous soon enoughicearch will become famous soon enoughicearch will become famous soon enough
 
Posts: 111
Karma: 530
Join Date: Nov 2025
Device: none
Want more elegant way to do this (too long to fit in title)

Here I have some play script, I want to format it like this:

Click image for larger version

Name:	a96026ad-2f36-4913-bf47-7990ac920c25.png
Views:	17
Size:	61.8 KB
ID:	221870

That is: character name and their line should have in-paragraph spacing, not between-paragraph sapcing. And the line should have 2em indentation.

I can think two ways to do this:

1. Using < br/ >, and add lots of & #160; which is so dumb.

2. Using two < p >, and set margin-bottom of the upper paragraph and margin-top of the lower paragraph to 0, and set lower paragraph text-indent to 2em. Which is to much code to my taste.

So I want to know is there any more elegant way to achieve this outcome?
icearch is offline   Reply With Quote
Old Today, 02:16 AM   #2
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,790
Karma: 9501034
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
I think the Chinese writing is throwing me, so I don't really understand what is different to what you want.

The image shows what you want. ie,
Name: (on first line)
->->-> Character line on second line (with a 2em spacing)

But then you write you want in paragraph spacing for name and line which I assume means
Name: ->->-> Character line (on same line)
Name 2nd: --> Character line of 2nd character. (so character lines sort of line up with each other?)

Can you be a bit clearer? Because if it is the first one, that is so simple I don't really know why you are confused.
Karellen is offline   Reply With Quote
Old Today, 02:25 AM   #3
icearch
Zealot
icearch will become famous soon enoughicearch will become famous soon enoughicearch will become famous soon enoughicearch will become famous soon enoughicearch will become famous soon enoughicearch will become famous soon enough
 
Posts: 111
Karma: 530
Join Date: Nov 2025
Device: none
Sure thing, forgive my bad wording, I don't really know the specific terms.

Here are pics to help understand.

What I WANT:

Click image for larger version

Name:	want.png
Views:	11
Size:	48.3 KB
ID:	221871

What I DO NOT WANT:

Click image for larger version

Name:	unwant.png
Views:	10
Size:	50.2 KB
ID:	221872

Hope this helps.
icearch is offline   Reply With Quote
Old Today, 02:27 AM   #4
icearch
Zealot
icearch will become famous soon enoughicearch will become famous soon enoughicearch will become famous soon enoughicearch will become famous soon enoughicearch will become famous soon enoughicearch will become famous soon enough
 
Posts: 111
Karma: 530
Join Date: Nov 2025
Device: none
I am not a professional, just do formatting occasionally, so the answer might be easy, don't over think it.
icearch is offline   Reply With Quote
Old Today, 02:37 AM   #5
icearch
Zealot
icearch will become famous soon enoughicearch will become famous soon enoughicearch will become famous soon enoughicearch will become famous soon enoughicearch will become famous soon enoughicearch will become famous soon enough
 
Posts: 111
Karma: 530
Join Date: Nov 2025
Device: none
Quote:
Originally Posted by Karellen View Post
But then you write you want in paragraph spacing for name and line which I assume means
Name: ->->-> Character line (on same line)
Name 2nd: --> Character line of 2nd character. (so character lines sort of line up with each other?)
And if you know how to do this, I'm interested in learning that as well.
icearch is offline   Reply With Quote
Old Today, 03:26 AM   #6
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,790
Karma: 9501034
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Have a look at the three samples in the attached epub. Feel free to ask questions.

Other members will also contribute their methods. Pick the one that works best for you.
Attached Files
File Type: epub Unknown - Unknown.epub (5.1 KB, 3 views)
Karellen is offline   Reply With Quote
Old Today, 03:47 AM   #7
icearch
Zealot
icearch will become famous soon enoughicearch will become famous soon enoughicearch will become famous soon enoughicearch will become famous soon enoughicearch will become famous soon enoughicearch will become famous soon enough
 
Posts: 111
Karma: 530
Join Date: Nov 2025
Device: none
I see, thanks.
icearch is offline   Reply With Quote
Old Today, 05:29 AM   #8
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: 82,446
Karma: 151278869
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Simple code really. The text is just random text from a story.

Click image for larger version

Name:	sample.jpg
Views:	5
Size:	123.9 KB
ID:	221875

HTML:
Code:
<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" lang="en-US" xml:lang="en-US">
<head>
<title>Sample</title>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
</head>
<body>
<h2>Sample</h2>
<p class="name">Person One:</p>
<p>That was nothing new to him. He was used to it. He liked it. It meant no one could hurt him. He was in the dark. He didn’t mind that, either.</p>
<p class="name">Person Two:</p>
<p>Charles Clifford was two miles away from Lucas as the crow—or, as Clifford preferred, the vulture—flies. He was also alone. Also in the dark. Also battling the heat.</p>
<p class="name">Person Three:</p>
<p>But he didn’t have the chance to strip down to his underwear. Not yet. Because he was out on the street, lurking in the shadows, watching a couple who had just staggered out of a bar.</p>
<p class="name">Person Two:</p>
<p>Clifford knew the town was called Maynard’s Creek, though he hadn’t seen any bodies of water in the eight hours he’d been there. He’d read that the place had been pretty lively in its heyday, back when the nearby copper mines had been running at full pelt.</p>
</body>
</html>
CSS:
Code:
body {
  widows: 1;
  orphans: 1;
  margin-top: 0;
  margin-right: 0;
  margin-bottom: 0;
  margin-left: 0;
  text-align: justify;
}
h2 {
  text-align: center;
  text-indent: 0;
  margin-top: 0.8em;
  margin-bottom: 0.8em;
}
p {
  margin-top: 0;
  margin-bottom: 0;
  widows: 1;
  orphans: 1;
  text-indent: 1.2em;
}
h2 + p {
  text-indent: 0;
}
.name {
  margin-top: 0.5em;
  text-indent: 0;
}
JSWolf 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
How do I center the TITLE PAGE of my ePub files and make them fit the entire frame? CrankyLamb Editor 5 01-02-2024 09:19 AM
More elegant way of writing my plugboard Space Dracula Library Management 0 01-29-2017 02:00 PM
Save to Disk Long Title Problem benwj Library Management 11 10-01-2013 08:32 AM
ERROR: Could not open ebook: cannot fit 'long' into an index-sized integer Mr_IT Library Management 2 11-30-2012 09:01 PM
This long thread title is intended to reflect my thought's incredible complexity. Prestidigitweeze Lounge 11 04-20-2012 06:28 AM


All times are GMT -4. The time now is 09:49 AM.


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