* [NTG-context] VIM typing vs. Context environments
@ 2025-01-06 13:02 Ryszard Kubiak
2025-01-07 4:39 ` [NTG-context] " Aditya Mahajan
0 siblings, 1 reply; 3+ messages in thread
From: Ryszard Kubiak @ 2025-01-06 13:02 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 970 bytes --]
Hi,
I don't know whether the audience of this mailing list can help me with a
problem concerning the VIM module or I should personally ask Aditya for
help.
The problem is that when I define an environment based on VIM's mechanisms
and use this environment surrounded with ConTeXt's narrowing commands then
these commands are ignored. You can see this effect in the PDF obtained by
contexting the script given below.
Best Regards
Ryszard
\setupbodyfont[12pt]
\setuppagenumbering[state=stop]
\parindent=0pt\parskip=2ex
\usemodule[vim]
\definevimtyping[PY][syntax=python,
before={\bgroup\switchtobodyfont[9pt]},
after={\egroup}]
\starttext
Text before a narrowed block.
\startnarrower[left]
Text starting a narrowed block.
\startPY
#: The bonds file is absolutely vital for Fontplant to work. That's why we
#: define a function to verify its existence on disk.
\stopPY
Text finishing a narrowed block.
\stopnarrower
Text after a narrowed block.
\stoptext
[-- Attachment #1.2: Type: text/html, Size: 1225 bytes --]
[-- Attachment #2: Type: text/plain, Size: 511 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* [NTG-context] Re: VIM typing vs. Context environments
2025-01-06 13:02 [NTG-context] VIM typing vs. Context environments Ryszard Kubiak
@ 2025-01-07 4:39 ` Aditya Mahajan
2025-01-07 7:00 ` Ryszard Kubiak
0 siblings, 1 reply; 3+ messages in thread
From: Aditya Mahajan @ 2025-01-07 4:39 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Mon, 6 Jan 2025, Ryszard Kubiak wrote:
> Hi,
>
> I don't know whether the audience of this mailing list can help me with a
> problem concerning the VIM module or I should personally ask Aditya for
> help.
>
> The problem is that when I define an environment based on VIM's mechanisms
> and use this environment surrounded with ConTeXt's narrowing commands then
> these commands are ignored. You can see this effect in the PDF obtained by
> contexting the script given below.
See https://github.com/adityam/filter/blob/dev/vim-README.md#adding-left-margin
You need to add `margin=1.5em` to change the left margin of the vimtyping environment.
The reason for this is that the vim typing environment includes a `\forgetall` at the start, due to which the current value of \leftskip is lost.
Aditya
PS: You can set font size by using `style={\switchtobodyfont[9pt]}` instead of adding it in the before and after key.
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* [NTG-context] Re: VIM typing vs. Context environments
2025-01-07 4:39 ` [NTG-context] " Aditya Mahajan
@ 2025-01-07 7:00 ` Ryszard Kubiak
0 siblings, 0 replies; 3+ messages in thread
From: Ryszard Kubiak @ 2025-01-07 7:00 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 1740 bytes --]
Hi Aditya,
Thank you for your prompt response and the helpful suggestions.
Best Wishes,
Ryszard
wt., 7 sty 2025 o 05:48 Aditya Mahajan <adityam@umich.edu> napisał(a):
> On Mon, 6 Jan 2025, Ryszard Kubiak wrote:
>
> > Hi,
> >
> > I don't know whether the audience of this mailing list can help me with
> a
> > problem concerning the VIM module or I should personally ask Aditya for
> > help.
> >
> > The problem is that when I define an environment based on VIM's
> mechanisms
> > and use this environment surrounded with ConTeXt's narrowing commands
> then
> > these commands are ignored. You can see this effect in the PDF obtained
> by
> > contexting the script given below.
>
> See
> https://github.com/adityam/filter/blob/dev/vim-README.md#adding-left-margin
>
> You need to add `margin=1.5em` to change the left margin of the vimtyping
> environment.
>
> The reason for this is that the vim typing environment includes a
> `\forgetall` at the start, due to which the current value of \leftskip is
> lost.
>
> Aditya
>
> PS: You can set font size by using `style={\switchtobodyfont[9pt]}`
> instead of adding it in the before and after key.
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
>
> ___________________________________________________________________________________
>
[-- Attachment #1.2: Type: text/html, Size: 2778 bytes --]
[-- Attachment #2: Type: text/plain, Size: 511 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-07 7:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-06 13:02 [NTG-context] VIM typing vs. Context environments Ryszard Kubiak
2025-01-07 4:39 ` [NTG-context] " Aditya Mahajan
2025-01-07 7:00 ` Ryszard Kubiak
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).