9front - general discussion about 9front
 help / color / mirror / Atom feed
From: ygrex <ygrex@ygrex.ru>
To: 9front@9front.org
Subject: Re: [9front] Re: Any way to insert code verbatim bypassing the rest of parsing in troff?
Date: Mon, 3 Jun 2024 09:21:23 +0300	[thread overview]
Message-ID: <20240603092123.5457b1a9@ygrex-t550.ygrex.ru> (raw)
In-Reply-To: <Zlz3zWycnjYSnxVB@alice>

Thank you everyone for the suggestions.

On Sun, 2 Jun 2024 15:53:01 -0700
Anthony Martin <ality@pbrane.org> wrote:

> You can turn off filling and disable the escape mechanism with:
> 
> .nf
> .eo
> some text with backslashes like \ and \foo.
> 
> and empty lines like above.
> just don't start a line with a control character:
> 	.this is good
> \.as is this
> .but not this
> 'or this.
> see?
> .ec
> .fi
> 

This seems exactly what I needed. To make it look more like a
code block I ended up with the following incantation:

.RS
.fw CW
.nf
.eo

code follows here

.ec
.fi
.ft
.RE

It results in being indented and in constant width font.
Some precautions needed if it gets spanned to the next page though, .bp
helps to save formatting.

-- 
Sincerely yours,

Igor Bogomazov
Saint Petersburg, Russia


      reply	other threads:[~2024-06-03  6:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-02 18:47 [9front] " ygrex
2024-06-02 18:54 ` sl
2024-06-02 22:53 ` [9front] " Anthony Martin
2024-06-03  6:21   ` ygrex [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240603092123.5457b1a9@ygrex-t550.ygrex.ru \
    --to=ygrex@ygrex.ru \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).