ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* (again) issues with typing
@ 2017-08-16 21:45 Pablo Rodriguez
  2017-08-16 22:00 ` Aditya Mahajan
  2017-08-16 22:46 ` Alan Braslau
  0 siblings, 2 replies; 5+ messages in thread
From: Pablo Rodriguez @ 2017-08-16 21:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear list,

sorry for insisting, but I need to solve this.

I have to explain to newcomers (in my Spanish introduction to ConTeXt)
what comments are and multiple lines don’t affect the final PDF document.

I have the following sample:

    \setuptyping[lines=yes]
    \starttext
    \startTEXpage[offset=1em]
    \startTEX
    This is text. % and this is a comment
    \stopTEX

    \startXML
    <p>This is text.<!--and this is a comment--></p>
    \stopXML

    \startLUA
    if code=="code" then --this is a comment

    --[[
    this is a

    multiline comment
    --]]

    ---[[
    this isn’t a


    multiline comment
    --]]
    \stopLUA
    \stopTEXpage
    \stoptext

I have three questions:

1. How do I enable that multiple blank lines are displayed as more than
a single one?

The Lua code contains one, two and three blank lines and they are
displayed always as separation from single lines.

I thought lines=yes should do that, but it doesn’t.

2. I accidentally discovered that the block comment opening (--[[)
removes break with next line. I think it should be fixed.

3. The most important issue is that the whole comment (both markers and
content) is displayed with \darkyellow.

I wonder why comments aren’t display in typing as in any other editor.
All comment characters should be displayed the same, since none of them
would affect to the final output.

How can I get the same color for the whole comment (again, both markers
and content)?

Many thanks for your help,

Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: (again) issues with typing
  2017-08-16 21:45 (again) issues with typing Pablo Rodriguez
@ 2017-08-16 22:00 ` Aditya Mahajan
  2017-08-17  6:28   ` Pablo Rodriguez
  2017-08-16 22:46 ` Alan Braslau
  1 sibling, 1 reply; 5+ messages in thread
From: Aditya Mahajan @ 2017-08-16 22:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 735 bytes --]

On Wed, 16 Aug 2017, Pablo Rodriguez wrote:

> sorry for insisting, but I need to solve this.

I don't know how to answer your questions with the default syntax 
highlighting in ConTeXt, but are you willing to consider t-vim module for 
typesetting code. The output for your example is attached.

All you need to do is add the following in the document preamble:

\usemodule[vim]
\definevimtyping[TEX][syntax=context]
\definevimtyping[XML][syntax=xml]
\definevimtyping[LUA][syntax=lua]

If you have lot of code snippets, you may want to create a directory to 
store temporary files. You can do this using

\setupvimtyping[directory=output]

and then create a directory called "output" in the folder from which you 
run ConTeXt.

Aditya

[-- Attachment #2: Type: APPLICATION/pdf, Size: 7100 bytes --]

[-- Attachment #3: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: (again) issues with typing
  2017-08-16 21:45 (again) issues with typing Pablo Rodriguez
  2017-08-16 22:00 ` Aditya Mahajan
@ 2017-08-16 22:46 ` Alan Braslau
  2017-08-17  6:37   ` Pablo Rodriguez
  1 sibling, 1 reply; 5+ messages in thread
From: Alan Braslau @ 2017-08-16 22:46 UTC (permalink / raw)
  To: Pablo Rodriguez; +Cc: mailing list for ConTeXt users

On Wed, 16 Aug 2017 23:45:30 +0200
Pablo Rodriguez <oinos@gmx.es> wrote:

> I have to explain to newcomers (in my Spanish introduction to ConTeXt)
> what comments are and multiple lines don’t affect the final PDF
> document.

For such a document, it can be very useful to put code snippets into
buffers and then use
\typeTEXbuffer
or
\typeLUAbuffer
and then
\getbuffer

Alan
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: (again) issues with typing
  2017-08-16 22:00 ` Aditya Mahajan
@ 2017-08-17  6:28   ` Pablo Rodriguez
  0 siblings, 0 replies; 5+ messages in thread
From: Pablo Rodriguez @ 2017-08-17  6:28 UTC (permalink / raw)
  To: ntg-context

On 08/17/2017 12:00 AM, Aditya Mahajan wrote:
> On Wed, 16 Aug 2017, Pablo Rodriguez wrote:
> 
>> sorry for insisting, but I need to solve this.
> 
> I don't know how to answer your questions with the default syntax 
> highlighting in ConTeXt, but are you willing to consider t-vim module for 
> typesetting code. The output for your example is attached.
Many thanks for your reply, Aditya,

your t-vim module is really useful, but I’m afraid it isn’t what I needed.

I have to use \xmlprettyprinttext (input sources for most of my
documents in ConTeXt are XML files).

Besides, I think that the code highlighting in ConTeXt is clearer than
the one that vim provides.

Many thanks for your help,

Pablo


> All you need to do is add the following in the document preamble:
> 
> \usemodule[vim]
> \definevimtyping[TEX][syntax=context]
> \definevimtyping[XML][syntax=xml]
> \definevimtyping[LUA][syntax=lua]
> 
> If you have lot of code snippets, you may want to create a directory to 
> store temporary files. You can do this using
> 
> \setupvimtyping[directory=output]
> 
> and then create a directory called "output" in the folder from which you 
> run ConTeXt.
> 
> Aditya


-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: (again) issues with typing
  2017-08-16 22:46 ` Alan Braslau
@ 2017-08-17  6:37   ` Pablo Rodriguez
  0 siblings, 0 replies; 5+ messages in thread
From: Pablo Rodriguez @ 2017-08-17  6:37 UTC (permalink / raw)
  To: ntg-context

On 08/17/2017 12:46 AM, Alan Braslau wrote:
> On Wed, 16 Aug 2017 23:45:30 +0200 Pablo Rodriguez wrote:
> 
>> I have to explain to newcomers (in my Spanish introduction to ConTeXt)
>> what comments are and multiple lines don’t affect the final PDF
>> document.
> 
> For such a document, it can be very useful to put code snippets into
> buffers and then use
> \typeTEXbuffer
> or
> \typeLUAbuffer
> and then
> \getbuffer

Many thanks for your reply, Alan.

I use buffers and ConTeXt types them. But I don’t want to provide
compiled examples (\getbuffer).

I have two reasons for that:

The first one is to motivate the user to try it.

The second one is that I also offer the document in ePub format.

Many thanks for your advice,

Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-08-17  6:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-16 21:45 (again) issues with typing Pablo Rodriguez
2017-08-16 22:00 ` Aditya Mahajan
2017-08-17  6:28   ` Pablo Rodriguez
2017-08-16 22:46 ` Alan Braslau
2017-08-17  6:37   ` Pablo Rodriguez

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).