How to format "computer text" in a Lit story

Bramblethorn

Sleep-deprived
Joined
Feb 16, 2012
Posts
18,001
Every so often we get questions here asking "how do I control the font for my Literotica story?" and the usual answer is "you can't, apart from bold and italics".

But my new story for the "AI Era" event includes a lot of email and chat logs, and I wanted a way to distinguish them from the rest of the text. So I looked at the options, and what do you know? It's possible to do this in a Literotica story, if you're willing to insert the HTML tags yourself:

attachment.php


The trick is using the <kbd> tag. Here's what I submitted to generate the above, as pasted into the story text box:

After that I went back inside, poured myself a glass of Merlot, and sat down at my keyboard to type. (It's an old-lady thing; when you've been typing as long as I have, it feels wrong not to have the click-clack of keys pushing back against one's fingers.)

<Kbd>> Hello cabbage, I’m home.</kbd>
<kbd>> Darling, I missed you. How was it?</kbd>
<kbd>> Not bad, as funerals go. There were some lovely tributes, and I think you would have liked the flowers. I left Toby with you. Emilie gave a beautiful speech, I’ll get you a transcript tomorrow.</kbd>

It's not strictly required to close out and reopen the <kbd> tags with every line break. I did this to avoid trouble just in case a Literotica page break fell in the middle of one of these sections.

My beta readers caught a couple of spots where I'd messed up my tags, and after fixing those I previewed carefully to make sure there weren't any more. Then I submitted, with a note to the moderator mentioning that I was using these tags and to let me know if there were any problems. Apparently there weren't.

I'm not entirely decided whether I like the look, but if you want the option, it's there.

Strictly speaking, <kbd> isn't setting a specific font. Rather, it tells the reader's browser: "this next bit represents keyboard input, so please format it however your user likes that kind of content to be formatted". This usually defaults to a monospaced font as shown in the screenshot above, but some users/browsers will have their own ways of rendering it. For technical wonks, googling on "semantic vs. non-semantic HTML tags" should find you some explanation on why it's best to do it this way instead of trying to dictate a specific font.
 

Attachments

  • Screen Shot 2021-10-13 at 6.26.57 pm.jpg
    Screen Shot 2021-10-13 at 6.26.57 pm.jpg
    44.7 KB · Views: 217
Nice discovery!

Any info on how it looks in the lit app? (I don’t have a way to check that myself).
 
Very interesting. It makes me wonder if there are more formatting HTML tags that can be used to format text in Literotica stories that most of us don't know about. Is there a good one-stop source that lists formatting tags that one could consult to try them out?

Also, aside from uploading the story file to Literotica to preview how it looks, what is a good app one can use to preview how an HTML code formatted document would look? I imagine there must be one but I don't know what it is.
 
@simon, if you’re on a computer and you save it as something.html, one way is to just point your browser to the file location, even though it’s just a file on your computer.

Often it’s easier to make or put it in c:/temp, assuming windows, since there are variations in exactly where exactly the My Documents folder is. (An optional tip, not necessary assuming you know your way around your files and folders)
 
That's cool. I struggle with representing text message exchanges. I've done it three different ways now.

Generally I restrict myself to dead-tree publishing formatting conventions.
 
Nice discovery!

Any info on how it looks in the lit app? (I don’t have a way to check that myself).

I haven't tested (don't have the app). But if it doesn't even render italics, I would be surprised if it recognises <kbd>. I expect it'll just ignore it.

Very interesting. It makes me wonder if there are more formatting HTML tags that can be used to format text in Literotica stories that most of us don't know about. Is there a good one-stop source that lists formatting tags that one could consult to try them out?

Something like this, I guess: https://developer.mozilla.org/en-US/docs/Web/HTML/Element

Also, aside from uploading the story file to Literotica to preview how it looks, what is a good app one can use to preview how an HTML code formatted document would look? I imagine there must be one but I don't know what it is.

One option is to save the formatted file, change the file extension to .html, and then just right-click on it and open with your web browser of choice. There will be some differences - the most obvious being that HTML ignores carriage returns, so it turns into one gigantic run-along paragraph - but aside from that, it's helpful figuring out how things might look.

(HTML uses <br> tags instead, and Lit automatically converts line breaks into <br> when you submit a story.)

You could also try pasting into something like this: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/kbd
 
And now I'm wondering when they will be banned by management? ;)

If none of us users knew about these, I wonder if the powers that be knew about them when the created the scripts to parse stories for un-allowed html tags. And will this particular one become a no-no. :eek:
 
And now I'm wondering when they will be banned by management? ;)

If none of us users knew about these, I wonder if the powers that be knew about them when the created the scripts to parse stories for un-allowed html tags. And will this particular one become a no-no. :eek:

I hope not Zeb, I like the ability. I might go back and edit my story so the text messaging between my characters uses the tags. It would make it more clear.
 
And now I'm wondering when they will be banned by management? ;)

If none of us users knew about these, I wonder if the powers that be knew about them when the created the scripts to parse stories for un-allowed html tags. And will this particular one become a no-no. :eek:

I specifically mentioned in the notes field that I was doing it, so I guess Laurel's cool with it for now.
 
One option is to save the formatted file, change the file extension to .html, and then just right-click on it and open with your web browser of choice. There will be some differences - the most obvious being that HTML ignores carriage returns, so it turns into one gigantic run-along paragraph - but aside from that, it's helpful figuring out how things might look.
What someone posted on this forum long ago was keeping a stub HTML file and pasting your story into that. Here's the stub I use:
Code:
<html><head><title>Story Formatting Test</title></head>****** text="#000000" vlink="#0000FF" alink="#FC0000"><font size="2" face="Verdana,Arial,Helvetica, sans-serif">
</body></html>

(HTML uses <br> tags instead, and Lit automatically converts line breaks into <br> when you submit a story.)
What Literotica does is add to the start of each paragraph "<p>" and "</p>" to the end of each paragraph.
Code:
<p>First paragraph of your story.</p>

You can create the same effect by putting a "<p>" at the end of each paragraph.
Code:
First paragraph of your story.<p>

So a test html file would look like:
Code:
<html><head><title>Story Formatting Test</title></head>****** text="#000000" vlink="#0000FF" alink="#FC0000"><font size="2" face="Verdana,Arial,Helvetica, sans-serif">
<p>First paragraph of your story.</p>
<p>Second paragraph of your story.</p>
</body></html>

Or:
Code:
<html><head><title>Story Formatting Test</title></head>****** text="#000000" vlink="#0000FF" alink="#FC0000"><font size="2" face="Verdana,Arial,Helvetica, sans-serif">
First paragraph of your story.<p>
Second paragraph of your story.<p>
</body></html>
 
Whoops, right you are.
As far as I can tell, the website does a lot of massaging of stories once you submit them through the text box. For example, my stories have slanted quotes (“”) in my submission, but the website converts them to plain quotes (""). Looking at my second to last submission, it has <i></i> and <br> tags that made it through to the published story. In my last submission, the <i></i> has been converted to <em></em> and the <br> tags have been converted to <p></p>.

In my last submission, I had a section which should have been appeared as indented paragraphs with no line spacing between paragraphs. That's what showed up in the Story Preview. But all the embedded HTML (  and <br> tags) I did to give that section that look was striped out in the massaging process.

So I'd say that your <kbd></kdb> makes it through that massaging process now, but there's no guarantee that it will do so in the future. And the way you'll find out that it didn't make it through the massaging process is when that story formatting doesn't appear in your published story.
 
I haven't tested (don't have the app). But if it doesn't even render italics, I would be surprised if it recognises <kbd>. I expect it'll just ignore it.
<snip>

Correct. The Android app ignores your italics and the monospace. It does at least include the ">" at the head of each line of text, so it does stand out for that reason.

Per the recent discussion where a poster was distraught because their story that extensively used italics for inner dialogue was rendered without italics. Apparently they were using the app, but on other viewers it was perfectly formatted.

Something to keep in mind. I've no idea how many readers solely use the app, but none of them will see any fancy formatting.

attachment.php
 

Attachments

  • BramblethornStory.png
    BramblethornStory.png
    73 KB · Views: 95
As far as I can tell, the website does a lot of massaging of stories once you submit them through the text box. For example, my stories have slanted quotes (“”) in my submission, but the website converts them to plain quotes (""). Looking at my second to last submission, it has <i></i> and <br> tags that made it through to the published story. In my last submission, the <i></i> has been converted to <em></em> and the <br> tags have been converted to <p></p>.

I have mixed feelings about the <i>-<em> autoconversion. I suspect on average it's improving the coding of stories, since most of the stuff tagged as <i> really ought to be <em>. But it does introduce errors in the other direction, when italics are being used for purpose other than emphasis.

In my last submission, I had a section which should have been appeared as indented paragraphs with no line spacing between paragraphs. That's what showed up in the Story Preview. But all the embedded HTML (  and <br> tags) I did to give that section that look was striped out in the massaging process.

Huh. My AI Era story uses several   at one point (in the middle of page 6). I mentioned it in the notes just in case, so it's possible Laurel overrode automated stripping there, but it also looked fine in preview before it ever went to Laurel. I'd hope the preview mode is consistent with the final process!

It'd be nice to have a clearer idea of what does and doesn't require manual intervention on Laurel's part, so I can distinguish between things I can use willy-nilly and things I should use sparingly. OTOH, maybe if the "possible with manual intervention" options were more prominently documented, people would overuse them.

So I'd say that your <kbd></kdb> makes it through that massaging process now, but there's no guarantee that it will do so in the future. And the way you'll find out that it didn't make it through the massaging process is when that story formatting doesn't appear in your published story.

Yep. For that reason, I think it's a good idea to use the Notes field to give a heads-up about anything unusual that we're doing with the formatting, even if it looks good in preview.
 
Correct. The Android app ignores your italics and the monospace. It does at least include the ">" at the head of each line of text, so it does stand out for that reason.

Yep. I only included the >s for that first conversation, not for later ones which are presented as logs, but in hindsight maybe I should have done the same for the logged ones.

Compatibility with the app isn't a high priority for me, though. The whole point of having things like HTML standards is so that we don't need to consider how each individual web page might interact with each individual way of viewing it; if my story follows the standard, and the app can't deal with that standard, then the problem lies with the app.
 
Yep. I only included the >s for that first conversation, not for later ones which are presented as logs, but in hindsight maybe I should have done the same for the logged ones.

Compatibility with the app isn't a high priority for me, though. The whole point of having things like HTML standards is so that we don't need to consider how each individual web page might interact with each individual way of viewing it; if my story follows the standard, and the app can't deal with that standard, then the problem lies with the app.

Multiple things can be true. I spent years contributing to standards through the ITU and other bodies. I like standards. They're useful.

It would certainly be useful for the site to publish a reliable and official set of standards for authors who want to go to the effort to do more intricate formatting.

It would then be quite nice for the site's 'official' app to support those standards. So for now, anyone who cares should keep in mind its limitations.

Right now, it's all a crapshoot once you go beyond the minimal basics :eek: since this discussion highlights we're all hunting and pecking in the dark.
 
I hope not Zeb, I like the ability. I might go back and edit my story so the text messaging between my characters uses the tags. It would make it more clear.

I specifically mentioned in the notes field that I was doing it, so I guess Laurel's cool with it for now.

And if they didn't know about this ability until someone mentions it on the forums...

Yet again as it really doesn't mess with their CSS and only queries the browser for what to display, it might be okay.
 
*Bangs forehead on desk*
I've been looking for a way to place a horizontal line at the end of the story so I can add author's notes beneath it and all this time a simple <hr> would have worked
 
And now I'm wondering when they will be banned by management? ;)

If none of us users knew about these, I wonder if the powers that be knew about them when the created the scripts to parse stories for un-allowed html tags. And will this particular one become a no-no. :eek:
I knew about them, I just never thought to apply them
I just considered Lit an HTML nullspace where formatting is limited and links outside of Lit were violations of the time/space continuum
 
This is odd because I simply typed in this without a problem
"Hannah parked up and made her way to the station concourse. As she stood stamping her feet against the cold, it occurred that her text to Kay might have been open to misinterpretation.

She pulled her phone out to check.

< Train arr 15.07 with you. I'll come to your dept. OK? >

< I'll meet you - cu soon >

She cussed to herself. Was Kay suggesting she'd make her own way to the University? "
I suspect I'm missing the point about the font style but different OS will render those differently. Anyways, it worked in 2021 :)
<hr> ;)
 
Last edited:
This is odd because I simply typed in this without a problem
"Hannah parked up and made her way to the station concourse. As she stood stamping her feet against the cold, it occurred that her text to Kay might have been open to misinterpretation.

She pulled her phone out to check.

< Train arr 15.07 with you. I'll come to your dept. OK? >

< I'll meet you - cu soon >

She cussed to herself. Was Kay suggesting she'd make her own way to the University? "
I suspect I'm missing the point about the font style but different OS will render those differently. Anyways, it worked in 2021 :)
<hr> ;)
I think Bramble also got a different, plain, font.

I do what you do: < signifies a text message >

Two characters seems so much easier than all this html stuff. Anyway, the words are the same, and it's words tell the story. Or is that just me?
 
I think Bramble also got a different, plain, font.

Yep - monospaced "computer" font. The exact appearance will vary from system to system depending on their defaults for rendering <kbd>, but that's fine - each system should have some concept of "computer text" and that's all I'm aiming for.

I do what you do: < signifies a text message >

Two characters seems so much easier than all this html stuff. Anyway, the words are the same, and it's words tell the story. Or is that just me?

Depends on the story. For a lot of purposes, that style is fine, and normally I do stick to something simple for text conversations - for Red Scarf, I think I just italicised them.

But for Loss Function, it didn't work with what I wanted to do. The computer chat logs are a key part of that story, and Patricia spends a lot of time submerged in her old conversations with Nadja, so I wanted to immerse the reader in that.

Words tell the story, but THE CHOICES WE MAKE ABOUT HOW READERS EXPERIENCE THOSE WORDS sometimes affect how the words land. I believe stylistic tricks should be used sparingly, but there's a time and a place for them (vis. Pratchett, for instance).
 
Words tell the story, but THE CHOICES WE MAKE ABOUT HOW READERS EXPERIENCE THOSE WORDS sometimes affect how the words land. I believe stylistic tricks should be used sparingly, but there's a time and a place for them (vis. Pratchett, for instance).

For me, Hubert Selby Jr. is a writer whose form defines the reader’s experience as much as the content. Some people say that he’s unreadable, but for me, reading his work was a revelation in creating reader immersion. Same goes for William S. Burroughs, Henry Miller, Kathy Acker, Marco Vassi, Rimbaud, and Baudelaire, to name a few other favourites off the top of my head.

That being said, it can be a trap for writers. When I was much younger, I spent years trying to perfect form and style, tear down the rules to define a voice, push language forward like my heroes did. I ended up driving myself to a nervous breakdown, and stopped writing for many years.

So yeah, be careful playing with form, because it can become consuming, and distract us from what’s really important.
 
For me, Hubert Selby Jr. is a writer whose form defines the reader’s experience as much as the content. Some people say that he’s unreadable, but for me, reading his work was a revelation in creating reader immersion. Same goes for William S. Burroughs, Henry Miller, Kathy Acker, Marco Vassi, Rimbaud, and Baudelaire, to name a few other favourites off the top of my head.

That being said, it can be a trap for writers. When I was much younger, I spent years trying to perfect form and style, tear down the rules to define a voice, push language forward like my heroes did. I ended up driving myself to a nervous breakdown, and stopped writing for many years.

So yeah, be careful playing with form, because it can become consuming, and distract us from what’s really important.
I found Hubert Selby's Last Exit to Brooklyn very readable, very innovative; then his next novel was so utterly forgettable I barely managed to finish it. If it didn't have his name on the cover, you'd think it was written by a completely different author. Did he write anything else? Without jumping on Wikipedia, I don't know.

Kathy Acker is fine, except when she's not - she tries too hard, I think, she's a bit "Look at me, aren't I clever", written as a statement, not a question.

I've read something by Marco Vassi but no idea what, and probably should read some Burroughs and Miller. Does listening to Burroughs on a Lauri Anderson album count?
 
I found Hubert Selby's Last Exit to Brooklyn very readable, very innovative; then his next novel was so utterly forgettable I barely managed to finish it. If it didn't have his name on the cover, you'd think it was written by a completely different author. Did he write anything else? Without jumping on Wikipedia, I don't know.

His second novel, “The Room”, is tough going. It’s written entirely as the internal monologue of a prisoner in solitary confinement. I appreciate its ambition, but it’s a very difficult read.

He published a few more novels, most notably “Requiem for a Dream”, but was most prolific in short fiction. “Song of the Silent Snow” is a great anthology published in the mid-80s.

Kathy Acker is fine, except when she's not - she tries too hard, I think, she's a bit "Look at me, aren't I clever", written as a statement, not a question.

I give her a lot of leeway here, considering how many of her male precursors and contemporaries were none too shy about proclaiming their own genius. I appreciate the confrontational aspect of her work as a woman going in swinging with the boys.

I've read something by Marco Vassi but no idea what, and probably should read some Burroughs and Miller. Does listening to Burroughs on a Lauri Anderson album count?

Listening to Burroughs always counts. So much of his work was written to be spoken in that laconic Midwestern drawl.
 
Back
Top