From: Pablo Rodriguez via ntg-context <ntg-context@ntg.nl>
To: Kalouguine Andre via ntg-context <ntg-context@ntg.nl>
Cc: Pablo Rodriguez <oinos@gmx.es>
Subject: Re: Subject: Leading spaces verbatim
Date: Sat, 28 Jan 2023 13:55:49 +0100 [thread overview]
Message-ID: <9a67ccd9-9075-6dde-1b0d-7ed42aeaa165@gmx.es> (raw)
In-Reply-To: <1fab8ba4d867e3968ce761a02dd1ea74@ens-lyon.fr>
On 1/28/23 03:01, Kalouguine Andre via ntg-context wrote:
> Good day to everyone,
>
> I'm trying to make a verbatim block of text with copiable leading spaces
> so that students can just copy my Python code snippets into their IDE.
Hi André,
I wonder whether I’m getting your point with the following sample:
\showframe
\setupinteraction[state=start]
\starttext
\startbuffer[abc]
def foo(x):
if x == 0:
bar()
else:
baz(x)
foo(x - 1)
\stopbuffer
\comment[location=leftmargin,
space=yes,
buffer=abc,
title={Python code}]
{}\typebuffer[abc]
\stoptext
This might solve what you need. At least, this is the approach that I
use to provide text that can be directly copied.
I’m on Linux and last time I tested on Windows there were extra lines in
the comments.
Just in case it might help,
Pablo
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage : https://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2023-01-28 12:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-28 2:01 Kalouguine Andre via ntg-context
2023-01-28 12:55 ` Pablo Rodriguez via ntg-context [this message]
2023-01-28 13:31 ` Kalouguine Andre via ntg-context
2023-01-28 16:37 ` Pablo Rodriguez via ntg-context
2023-01-28 20:26 ` Kalouguine Andre via ntg-context
2023-01-28 21:54 ` Hans Hagen via ntg-context
2023-01-29 16:58 ` Kalouguine Andre via ntg-context
2023-01-30 10:54 ` Pablo Rodriguez via ntg-context
2023-01-30 16:30 ` Ulrike Fischer via ntg-context
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=9a67ccd9-9075-6dde-1b0d-7ed42aeaa165@gmx.es \
--to=ntg-context@ntg.nl \
--cc=oinos@gmx.es \
/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).