|
|
#1 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() 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:
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? |
|
|
|
|
|
#2 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
|
|
|
|
|
#3 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() 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: What I DO NOT WANT: Hope this helps. |
|
|
|
|
|
#4 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() 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.
|
|
|
|
|
|
#5 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() Posts: 111
Karma: 530
Join Date: Nov 2025
Device: none
|
And if you know how to do this, I'm interested in learning that as well.
|
|
|
|
|
|
#6 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
|
|
|
|
|
#7 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() Posts: 111
Karma: 530
Join Date: Nov 2025
Device: none
|
I see, thanks.
|
|
|
|
|
|
#8 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
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> 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;
}
|
|
|
|
![]() |
|
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 |