Centering when exporting to HTML

63 views
Skip to first unread message

Loni

unread,
Jan 22, 2024, 12:34:21 PMJan 22
to yWriter
This has been an existing problem, but it hasn't been so problematic for me that I felt the need to bring it up. But since I'm plaguing you with all my woes, I figured I'd mention it now.

Scenario: Project > Export Project... > to HTML

If there are multiple centered lines in a row, only the first one is centered. 

It's not that big of a deal, because I mostly use that export to listen with text-to-speech reader in Edge (where centering doesn't matter), or to copy and paste into a critique exchange site (where I can correct it before hitting submit). But I figured I'd mention it if you're already working on fixing things.

Simon Haynes

unread,
Jan 22, 2024, 12:52:29 PMJan 22
to ywr...@googlegroups.com
I'll look into it.

What you can do in the meantime is include this in the scene before:

<HTM <center> /HTM>

and after:

<HTM </center> /HTM>


You can also use global variables to create more html code inserts instead of pasting a copy each time. e.g.

[HtmlCentreOn] and [HtmlCentreOff]





--
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/2ef9cf45-5069-4321-917f-cde22fad8273n%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,
Jan 22, 2024, 1:06:17 PMJan 22
to yWriter
Funny enough, you even can override the internal [c] and [/c] tags with those HTML code snippets, so you don't have to insert any code manually. 
Then centering works for HTML export as expected, but no longer for RTF. 

Loni

unread,
Jan 22, 2024, 1:13:19 PMJan 22
to yWriter
I think I'll use the HTML tags. I only have a few places where I have multiple lines centered, and I think I'd go for adding the extra step than breaking my RTF export. 

Thank you, both of you.

Simon Haynes

unread,
Jan 22, 2024, 1:18:59 PMJan 22
to ywr...@googlegroups.com
The <HTM stuff is removed automatically when exporting to any other format.



Peter T.

unread,
Jan 22, 2024, 1:21:51 PMJan 22
to yWriter
I just found out that you also can extend the internal tags with project variables. 
This works for HTML as well as for RTF export, and it doesn't require any manual "tag" input:

center01.png

center02.png

This should solve the problem elegantly. In the example, I have chosen project variables; global variables would of course be better. 

Loni

unread,
Jan 22, 2024, 1:27:10 PMJan 22
to yWriter
I have confirmed that this solution works. I went with Global for my variables. 

Thank you!

Simon Haynes

unread,
Jan 22, 2024, 1:29:34 PMJan 22
to ywr...@googlegroups.com
Clever tweak - it'll work as long as I replace variables first and formatting after.

(You shouldn't need the [c] on the right inside the variable declaration)


Simon Haynes

unread,
Jan 22, 2024, 1:30:35 PMJan 22
to ywr...@googlegroups.com
Something I never thought of myself. Good idea, and now I see why you added the [c] on the right.




Simon Haynes

unread,
Jan 22, 2024, 1:31:43 PMJan 22
to ywr...@googlegroups.com
Yep, until you see they added the [c] after the closing html tag ;-) Smart, as I said.


Peter T.

unread,
Jan 22, 2024, 1:41:09 PMJan 22
to yWriter
Well, my first try was to override the tag (without the [c]), the second try was to extend it. It's always fun to explore the hidden possibilities of yWriter.
On the other hand, the problem mentioned with HTML export is that the [c] short tag is translated into a paragraph property. 

Simon Haynes

unread,
Jan 25, 2024, 3:37:09 AMJan 25
to ywr...@googlegroups.com
BTW yWriter has built-in text to speech, but it can't use the latest MS voices unless you use a registry hack.

On Tue, 23 Jan 2024 at 01:34, Loni <lo...@lonitownsend.com> wrote:
--
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/2ef9cf45-5069-4321-917f-cde22fad8273n%40googlegroups.com.

Loni

unread,
Jan 25, 2024, 8:25:07 AMJan 25
to yWriter
While Microsoft David has been my bud for a while, I have found Microsoft Christopher Online (which I've only found in Edge) to be easier to listen to. I would be interested in this registry hack of yours, though.

Peter Barns

unread,
Jan 25, 2024, 10:23:24 AMJan 25
to ywr...@googlegroups.com
Yes. Me too.

Pete

Simon Haynes

unread,
Jan 25, 2024, 10:49:37 AMJan 25
to ywr...@googlegroups.com
My email to the group with a link to the instructions was rejected as spam. Nice one, google. (it's not a spam site, but I think the mention of the editing procedure was enough ...)


Simon Haynes

unread,
Jan 25, 2024, 10:51:01 AMJan 25
to ywr...@googlegroups.com
If you do a web search for "Can SAPI voices be used with the Microsoft Speech API?" the first result is the one you want.


On Thu, 25 Jan 2024 at 23:23, Peter Barns <pe...@boddaert.co.uk> wrote:
Reply all
Reply to author
Forward
0 new messages