Splitting Scenes Results in Lost Formatting

98 views
Skip to first unread message

Loni

unread,
Mar 9, 2024, 3:53:40 PMMar 9
to yWriter
I've recently decided to add quotes to the beginning of each chapter, but I wanted to have them in their own scene in case I decided to get rid of them. I put them all in one scene, centered and italicized:
quote-scene.png

Then I ran Split Scene:
split-scene-menu.png
This resulted in this for the first scene (note only the first line is centered and there are no italics):
first-split.png
All the subsequent scenes are all left aligned and non-italic. 

I doubt this is a common use, but figured I would bring it up. 

Loni

unread,
Mar 9, 2024, 3:58:31 PMMar 9
to yWriter
I also notice that with the scenes it created, it didn't keep the carriage return, as a result, when I Ctrl+A and hit Center and Italics, then hit Next to move to the Next screen, it doesn't keep the formatting for the last line, and reverts it to left aligned and non-italics. If I add a carriage return so that there's a blank last line, it keeps my formatting. 

Loni

unread,
Mar 9, 2024, 6:20:42 PMMar 9
to yWriter
Alright, I guess I can't even manually adjust the second line in the 2-line scene. No matter what I do, it deletes the carriage returns, left aligns, and removes italics. 

Peter T.

unread,
Mar 10, 2024, 4:01:06 AMMar 10
to yWriter
Could it be that you have centred your entire scene with the collection of quotes from beginning to end? 
Then there is a centre start tag under the engine bonnet at the very beginning and one at the end. When splitting, yWriter will probably replace the "missing" end tag in the first scene, but from the second scene onwards it will no longer know that it continues centred. 
You could try to centre only the two lines of the quotations and leave the scene delimiters left-aligned so that the split scenes also have all the centre tags. 

Theoretically, this should also apply to italics. The scene editor has a tab with the raw code, i.e. including the [c], [/c], [i], [/i] tags. You should be able to see the tags there, which might make it easier to check.  

Peter T.

unread,
Mar 10, 2024, 4:22:23 AMMar 10
to yWriter
Actually, it looks like the scope of formatting specifications should not exceed the scene separators. 

But I would approach it a little differently if I wanted to put quotes in front of the chapters. Depending on the desired output format, I would define project variables with code, which then also produces wider margins (for multi-line quotations) and a decorative character for separation, as well as the appropriate spacing to the following text.  
Always remember, it doesn't have to look good in the scene editor, but in the final published result.

Cheers, 
Peter

Loni

unread,
Mar 10, 2024, 9:06:31 AMMar 10
to yWriter
I'm on the fence with the quotes, which is why I was keeping them in their own scenes, but your last suggestion sounds intriguing. Unfortunately, I have no idea what implementing that would look like. The only variables I have are the global ones for keeping the centering when I export to HTML.

Would you be able to walk me through setting up that suggestion? Would it still work if I kept it its own scene and chose "append to previous scene" on the main body of the chapter for exporting?

Loni

unread,
Mar 10, 2024, 9:17:27 AMMar 10
to yWriter
I've looked at the raw markup and it appears the tags are improperly placed.
The process: I have my two-line scene, I Ctrl+A to select everything, I click the  to italicize (and I have also used Ctrl+I), and I click the C to center. That results in the formatting below:

[c][i]Their eyes are worlds in and of themselves--moving landscapes as alive and reactive as the land around us.
[/c][c] --The World According to Han Kade[/i][/c]

Hitting Save and Exit corrects the formatting to:
[c][i]Their eyes are worlds in and of themselves--moving landscapes as alive and reactive as the land around us.
[/c][/i]  --The World According to Han Kade

It seems that it keeps deleting the [/c] at the end, even if I try to open and close each line individually.

Peter T.

unread,
Mar 10, 2024, 2:44:38 PMMar 10
to yWriter
On Sunday, March 10, 2024 at 2:06:31 PM UTC+1 Loni wrote:
Would you be able to walk me through setting up that suggestion? Would it still work if I kept it its own scene and chose "append to previous scene" on the main body of the chapter for exporting?

I think project variables would be the right thing in this case.
I would define two project variables, one ("q") to open the quote and one ("/q") to close the quote. You already know how to define project variables, don't you?
You could try it with the HTML blockquote tag and then add a css instruction elsewhere, for instance in the HTML header, or with a linked stylesheet.
 
"q" example:  
<HTM <blockquote> /HTM>

"/q" example:
<HTM <p style="margin-top: 2em">♥</p></blockquote> /HTM>


Whether you use your own ""appended"" scenes is entirely up to you. Actually, this helps to clearly assign the quotes to the chapters, while you can still rearrange the subsequent scenes.

I hope this helps,
Peter 
 

Loni

unread,
Mar 10, 2024, 3:46:29 PMMar 10
to yWriter
What is the RTF for a carriage return?

Paragraph tags break up my blockquote if I have the text on separate lines, so I'm trying to circumvent that:

[q]You will bring this world to its knees with your war, and I approve.<HTM <br/>/HTM>--The World According to Han Kade[/q]

However, I don't know what the rtf equivalent to the <br/> is or how to inject it. 
Current q:
<HTM <blockquote> /HTM>[c][i]
Current /q:
<HTM </blockquote> /HTM>[/i][/c]

Peter T.

unread,
Mar 11, 2024, 4:00:44 AMMar 11
to yWriter
On Sunday, March 10, 2024 at 8:46:29 PM UTC+1 Loni wrote:
What is the RTF for a carriage return?

Paragraph tags break up my blockquote if I have the text on separate lines, so I'm trying to circumvent that:

[q]You will bring this world to its knees with your war, and I approve.<HTM <br/>/HTM>--The World According to Han Kade[/q]

However, I don't know what the rtf equivalent to the <br/> is or how to inject it. 
Current q:
<HTM <blockquote> /HTM>[c][i]
Current /q:
<HTM </blockquote> /HTM>[/i][/c]

You can't inject RTF code into HTM sections, I'm afraid. Besides,  RTF code injection used not to work in former yWriter versions. Is that fixed now? I haven't installed the current yWriter, so I can't reproduce the problem on my PC at the moment. 

Regular linebreaks outsides the <HTM ... /HTM> sections should be converted into HTML paragraphs, which can be nested with blockquote this way:

<blockquote> 
<p> </p> 
</blockquote>
 
So it's not the blockquote that breaks the paragraphs. I guess, the problem is, that yWriter's HTML converter encloses the lines with the <HTM ... /HTM> section with paragraph tags, thus nesting <p> and <blockquote> improperly, like so:

<p><blockquote></p> 
<p></blockquote></p>

You could try to break up the auto-inserted paragraphs, like so:

<HTM </p><blockquote><p> /HTM>[c][i]
and
<HTM </p></blockquote><p> /HTM>[/i][/c]

Make sure to put the [c] and [/c] tags on their own lines. Then you don't need to use additional HTML linebreaks. However, this would add an extra blank paragraph to the HTML code. 
If this does not work for you, take a look at the generated HTML result. 


Simon Haynes

unread,
Mar 11, 2024, 4:47:00 AMMar 11
to ywr...@googlegroups.com
You can use <RTF and  /RTF> to enclose raw rtf code.

RTF is a horrible format to work with, but \r\n should add a paragraph break.



 

--
You received this message because you are subscribed to the Google Groups "yWriter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ywriter+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ywriter/f166c988-5b87-47c8-a8d7-2c2a415f5442n%40googlegroups.com.


--

--
Visit Spacejock Software, the home of yWriter, FCharts and more
Visit spacejock.com.au for my articles on writing and publishing novels.

Peter T.

unread,
Mar 11, 2024, 6:20:55 AMMar 11
to yWriter
Addendum: 
When it comes to more demanding tasks, I recommend the engineering approach. 
  • First of all, you might want to make a specification in the form of working HTML code that corresponds to your desired end result. Here an example: 

<html>
<head>
<title>Quotation example</title>
<style type="text/css">
    <!--
    body{
        max-width: 960px;
        margin: 1in;
        }
    h2{text-align: center;}
   
    blockquote {
        font-style: italic;
        text-align: center;
        margin-top: 3em;
        margin-bottom: 3em;
        margin-left: 1in;
        margin-right: 1in;
        }
    -->
</style>
</head>
<body>
<h2>Chapter heading placeholder</h2>

<p>
</p><blockquote><p>
</p>
<p>Once in the saddle, I used to go dashing, once in the saddle, I used to go gay.
I first took to drinking, and then to cards playing. Got shot through the body, and now here I lie.</p>
<p></p>
<p>--A sad cowboy</p>
</p></blockquote><p>
</p>
<p>It was a dark and stormy night ...</p>
</body>
</html>


  • Next, write your example quote without any formatting in a yWriter scene and export the whole thing as HTML.
  • Compare the generated HTML code with your specification. 
  • Insert the missing HTML code in your yWriter scene. Export and check the result. 
  • If you are satisfied, create project variables or global variables. Check again. 
Good luck, 
Peter


Simon Haynes

unread,
Mar 11, 2024, 7:18:54 AMMar 11
to ywr...@googlegroups.com
Also, don't forget you can export the default project CSS file to the current project folder, and modify/extend it.  This should let you control pretty much everything in the finished HTML file, without having to insert html code in the project.



--
You received this message because you are subscribed to the Google Groups "yWriter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ywriter+u...@googlegroups.com.

Loni

unread,
Mar 11, 2024, 8:56:03 AMMar 11
to yWriter
The RTF tags don't seem to work. I opted for the RTF export over DOCX because DOCX doesn't keep my second line of italics, and that's not something I want to manually fix. 

RTF:
codes_rtf.png

DOCX (note my line The Last Day):
codes_docx.png
HTML (which has all the italics/breaks/alignment I'm looking for):
codes_html.png

My quote scene:
[q]You will bring this world to its knees with your war, and I approve.[br]--The World According to Han Kade[/q]

My variables:
c: <HTM <center> /HTM>[c]
/c: <HTM </center> /HTM>[/c]
q: <HTM </p><blockquote> /HTM>[c][i]
/q: [/i][/c]<HTM </blockquote><p> /HTM>
br: <HTM <br/> /HTM><RTF \r\n /RTF>

I have the Project.css downloaded, with the blockquote added:
    blockquote {
        font-style: italic;
        text-align: center;
        margin-bottom: 2em;
    }

I haven't gotten fancy with it yet because I'm just trying to get the alignment, breaking, and italics to work first.

I can accomplish the center italics if I style the text in the editor, so long as I don't edit it again. I do this by adding my two lines with the break before the dash, centering, italicizing, and then adding another blank line after that with no formatting. If I go open that scene and then hit Save and Exit, I lose my second-line centering because it trims that blank line at the bottom. If I hit Save and Exit again, I lose the second-line italics. Sometimes, if it's not just right, I lose the formatting on the second line all together and I have to do it again.  

Peter T.

unread,
Mar 11, 2024, 9:47:56 AMMar 11
to yWriter
As already mentioned, inlining RTF does not work with yWriter.
Have you already tried to import the HTML output with your word processor and save a document as DOCX? So far, this has been a useful alternative to RTF export.
Anyway, what it looks like in the yWriter scene editor is not that important, is it?

Simon Haynes

unread,
Mar 11, 2024, 9:57:38 AMMar 11
to ywr...@googlegroups.com
It's supposed to work - I'll have to take a look and find out why.



--
You received this message because you are subscribed to the Google Groups "yWriter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ywriter+u...@googlegroups.com.
Message has been deleted

Loni

unread,
Mar 11, 2024, 10:16:43 AMMar 11
to yWriter
"Anyway, what it looks like in the yWriter scene editor is not that important, is it?" - It's not, but it does directly impact what gets exported. If it's left and non-italic in the editor, it's left and non-italic in the export. With it changing my last line any time I Save and Exit, it makes it so that I can't rely on the editor to keep my formatting. The project variables are a work around for HTML, and yes, I could take that and import it into my word processor, but it would be nice if the RTF and DOCX exports worked. 

Simon Haynes

unread,
Mar 11, 2024, 11:26:40 AMMar 11
to ywr...@googlegroups.com
I plan to fix them, but pls remind me if I don't do it in the next 7 days. Got a lot on at the moment.




Loni

unread,
Mar 11, 2024, 11:39:32 AMMar 11
to yWriter
I appreciate it, Simon. 

Just to follow up, here is the situation: I have a scene with 2 lines. I highlight both lines, hit italics, hit center, hit Save and Exit. It removes the formatting for the second line. I've tried hitting center first and then italics, but I get the same result. When I look at the Raw Markup, it looks like this:

[c][i]To call it humbling is too kind. Crushing is more like it.
[/c][c]--The World According to Han Kade
[/c][/i]

Seeing that the i tags are improperly nested, I started over with the unformatted 2 lines, left aligned. To get the scene to save correctly, I have to add a new line to the bottom, and apply the centering and italics to each line individually instead of as a 2-line group. I can then hit Save and Exit and retain my formatting so long as I don't edit that scene again. If I do enter that scene again and hit Save and Exit or Next, I lose my centering. As a result, I have been looking for workarounds, which led me to the project variables. 

Peter T.

unread,
Mar 11, 2024, 12:00:04 PMMar 11
to yWriter
On Monday, March 11, 2024 at 3:16:43 PM UTC+1 Loni wrote:
"Anyway, what it looks like in the yWriter scene editor is not that important, is it?" - It's not, but it does directly impact what gets exported. If it's left and non-italic in the editor, it's left and non-italic in the export. 

I'm afraid I have to disagree. The basic concept of yWriter, as far as I understand it, is the ability to export documents for publication via HTML and LaTeX.
RTF is basically just a fallback solution with an incredible number of disadvantages.

If you use additional HTML tags with css, as in the example above, not only the browser understands this. If you are lucky, your word processor can also convert this into its native "quote" style. This allows you to easily change the look of all your quotes afterwards by editing the style. You can't do that with RTF or DOCX export. 
The prerequisite is, of course, that you do not use any additional centering and italic formatting tags.  

Simon Haynes

unread,
Mar 11, 2024, 12:34:01 PMMar 11
to ywr...@googlegroups.com
RTF only exists in yWriter so people can export to a word processor to send the result off to proofreaders, editors, etc, but I still want it to work properly.

Historically, yWriter used to store text internally in RTF, but the format is falling by the wayside.

Last year I added Docx which I recommend using instead of RTF. Unlike the old DOC format, it's an open standard.  I want to add ODT as well, but given Libre/open office can read DocX just fine, there's no real need.




--
You received this message because you are subscribed to the Google Groups "yWriter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ywriter+u...@googlegroups.com.

Loni

unread,
Mar 11, 2024, 12:54:52 PMMar 11
to yWriter
I would use DOCX, if it kept my formatting past the first line when there is a group of centered/italic lines. I have a song in one chapter. It is centered and italics. When I export to DOCX, only the first line is centered and italics, and all the rest are non-italic and left aligned. I lose my centering any time I have more than one centered line in a row. It works in the RTF export, though, which is why I went back to RTF. The c and /c global variable modifications fix it for HTML, and I'm willing to do the import from HTML to my word processor, but yes, I'm aiming to produce a file for beta readers soon and that is why I'm using the other exports. 

Peter T.

unread,
Mar 11, 2024, 2:06:51 PMMar 11
to yWriter
Simon, the problem mentioned above, that only the first paragraph of a formatted section has this formatting after the DOCX export, is due to the nature of the DOCX (and also the ODT) file format. Here, character formatting ends with the end of the paragraph. Chracter formatting that spans several paragraphs, as is possible with yWriter, must start again for each paragraph during conversion. 

Loni, you can give your manuscript to the proofreaders even if you have converted it via HTML to DOCX or something else.
Apart from that, I'm afraid there's been a misunderstanding. The point of my suggestion to use the "blockquote" tag is precisely so that you can use css and thus dispense with the "hard" formatting with italics and centering. If you try my HTML example above, you will see that the quote is centered and italicized, even though these tags are not explicitly set.  

'nuff said.
Reply all
Reply to author
Forward
0 new messages