ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \installprettytype problem
@ 2015-08-20 20:43 Matthieu Leroy
  2015-08-20 22:21 ` Renaud AUBIN
  0 siblings, 1 reply; 8+ messages in thread
From: Matthieu Leroy @ 2015-08-20 20:43 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 546 bytes --]

Hello,

I want to use the " C-Pretty-Printing
<http://modules.contextgarden.net/pret-c>" module.
According to the "Verbatim" page of the Context garden, I have to use
the \installprettytype command, but this one doesn't work (error :
"undefined control sequence").

I'm using the 2015.08.13 19:33 Context version.

Example :

\installprettytype[C][C]

\definetyping[C][option=C]

\startC
  int func(int a){
    if(a > 4)
      return 0; // comment
    else        /* comment */
      return 10;
  }
\stopC


Thank you.

[-- Attachment #1.2: Type: text/html, Size: 1281 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: \installprettytype problem
  2015-08-20 20:43 \installprettytype problem Matthieu Leroy
@ 2015-08-20 22:21 ` Renaud AUBIN
  2015-08-21  9:54   ` Matthieu Leroy
  2015-08-21 18:54   ` Eric Détrez
  0 siblings, 2 replies; 8+ messages in thread
From: Renaud AUBIN @ 2015-08-20 22:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Bonsoir Matthieu,

Give a try to https://github.com/nibua-r/pretty-c and tell me if anything goes wrong…

It's basically a rewrite of Peter's module adapted to mkiv + new verbatim (new at the time of writing)

I'll test it tomorrow… Anyway, you're welcome to contribute and/or submit issues.

Best regards,
Renaud

Le 20 août 2015 10:43 PM, Matthieu Leroy <matt57.leroy@orange.fr> a écrit :
>
> Hello,
>
> I want to use the "
> C-Pretty-Printing" module. 
> According to the "Verbatim" page of the Context garden, I have to use the \installprettytype command, but this one doesn't work (error : "undefined control sequence").
>
> I'm using the 2015.08.13 19:33 Context version.
>
> Example :
>
> \installprettytype[C][C]
>
> \definetyping[C][option=C]
>
> \startC
>   int func(int a){
>     if(a > 4)
>       return 0; // comment
>     else        /* comment */
>       return 10;
>   }
> \stopC
>
>
> Thank you.
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: \installprettytype problem
  2015-08-20 22:21 ` Renaud AUBIN
@ 2015-08-21  9:54   ` Matthieu Leroy
  2015-08-21 11:30     ` root
  2015-08-21 11:43     ` Renaud AUBIN
  2015-08-21 18:54   ` Eric Détrez
  1 sibling, 2 replies; 8+ messages in thread
From: Matthieu Leroy @ 2015-08-21  9:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1710 bytes --]

Bonjour Renaud,

Thank you !
It works but there is some problem with the "<=" or "<" operator. Please
see the attached files.

Regards,

Matthieu

Le 21/08/15 00:21, Renaud AUBIN a écrit :
> Bonsoir Matthieu,
>
> Give a try to https://github.com/nibua-r/pretty-c and tell me if anything goes wrong…
>
> It's basically a rewrite of Peter's module adapted to mkiv + new verbatim (new at the time of writing)
>
> I'll test it tomorrow… Anyway, you're welcome to contribute and/or submit issues.
>
> Best regards,
> Renaud
>
> Le 20 août 2015 10:43 PM, Matthieu Leroy <matt57.leroy@orange.fr> a écrit :
>> Hello,
>>
>> I want to use the "
>> C-Pretty-Printing" module. 
>> According to the "Verbatim" page of the Context garden, I have to use the \installprettytype command, but this one doesn't work (error : "undefined control sequence").
>>
>> I'm using the 2015.08.13 19:33 Context version.
>>
>> Example :
>>
>> \installprettytype[C][C]
>>
>> \definetyping[C][option=C]
>>
>> \startC
>>   int func(int a){
>>     if(a > 4)
>>       return 0; // comment
>>     else        /* comment */
>>       return 10;
>>   }
>> \stopC
>>
>>
>> Thank you.
> ___________________________________________________________________________________
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________


[-- Attachment #2: test_pretty_c.pdf --]
[-- Type: application/pdf, Size: 11789 bytes --]

[-- Attachment #3: test_pretty_c.tex --]
[-- Type: application/x-tex, Size: 859 bytes --]

[-- Attachment #4: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: \installprettytype problem
  2015-08-21  9:54   ` Matthieu Leroy
@ 2015-08-21 11:30     ` root
  2015-08-21 11:43     ` Renaud AUBIN
  1 sibling, 0 replies; 8+ messages in thread
From: root @ 2015-08-21 11:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

I'm on it…

Le 2015-08-21 11:54, Matthieu Leroy a écrit :
> Bonjour Renaud,
> 
> Thank you !
> It works but there is some problem with the "<=" or "<" operator. 
> Please
> see the attached files.
> 
> Regards,
> 
> Matthieu
> 
> Le 21/08/15 00:21, Renaud AUBIN a écrit :
>> Bonsoir Matthieu,
>> 
>> Give a try to https://github.com/nibua-r/pretty-c and tell me if 
>> anything goes wrong…
>> 
>> It's basically a rewrite of Peter's module adapted to mkiv + new 
>> verbatim (new at the time of writing)
>> 
>> I'll test it tomorrow… Anyway, you're welcome to contribute and/or 
>> submit issues.
>> 
>> Best regards,
>> Renaud
>> 
>> Le 20 août 2015 10:43 PM, Matthieu Leroy <matt57.leroy@orange.fr> a 
>> écrit :
>>> Hello,
>>> 
>>> I want to use the "
>>> C-Pretty-Printing" module.
>>> According to the "Verbatim" page of the Context garden, I have to use 
>>> the \installprettytype command, but this one doesn't work (error : 
>>> "undefined control sequence").
>>> 
>>> I'm using the 2015.08.13 19:33 Context version.
>>> 
>>> Example :
>>> 
>>> \installprettytype[C][C]
>>> 
>>> \definetyping[C][option=C]
>>> 
>>> \startC
>>>   int func(int a){
>>>     if(a > 4)
>>>       return 0; // comment
>>>     else        /* comment */
>>>       return 10;
>>>   }
>>> \stopC
>>> 
>>> 
>>> Thank you.
>> ___________________________________________________________________________________
>> 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://tex.aanhet.net
>> archive  : http://foundry.supelec.fr/projects/contextrev/
>> wiki     : http://contextgarden.net
>> ___________________________________________________________________________________
> 
> 
> ___________________________________________________________________________________
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: \installprettytype problem
  2015-08-21  9:54   ` Matthieu Leroy
  2015-08-21 11:30     ` root
@ 2015-08-21 11:43     ` Renaud AUBIN
  2015-08-21 11:58       ` Matthieu Leroy
  1 sibling, 1 reply; 8+ messages in thread
From: Renaud AUBIN @ 2015-08-21 11:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Replace "+ V("ltgtstring")" by "-- + V("ltgtstring")" at L175 of 
t-pretty-c.lua as a temporary workaround…

Le 2015-08-21 11:54, Matthieu Leroy a écrit :
> Bonjour Renaud,
> 
> Thank you !
> It works but there is some problem with the "<=" or "<" operator. 
> Please
> see the attached files.
> 
> Regards,
> 
> Matthieu
> 
> Le 21/08/15 00:21, Renaud AUBIN a écrit :
>> Bonsoir Matthieu,
>> 
>> Give a try to https://github.com/nibua-r/pretty-c and tell me if 
>> anything goes wrong…
>> 
>> It's basically a rewrite of Peter's module adapted to mkiv + new 
>> verbatim (new at the time of writing)
>> 
>> I'll test it tomorrow… Anyway, you're welcome to contribute and/or 
>> submit issues.
>> 
>> Best regards,
>> Renaud
>> 
>> Le 20 août 2015 10:43 PM, Matthieu Leroy <matt57.leroy@orange.fr> a 
>> écrit :
>>> Hello,
>>> 
>>> I want to use the "
>>> C-Pretty-Printing" module.
>>> According to the "Verbatim" page of the Context garden, I have to use 
>>> the \installprettytype command, but this one doesn't work (error : 
>>> "undefined control sequence").
>>> 
>>> I'm using the 2015.08.13 19:33 Context version.
>>> 
>>> Example :
>>> 
>>> \installprettytype[C][C]
>>> 
>>> \definetyping[C][option=C]
>>> 
>>> \startC
>>>   int func(int a){
>>>     if(a > 4)
>>>       return 0; // comment
>>>     else        /* comment */
>>>       return 10;
>>>   }
>>> \stopC
>>> 
>>> 
>>> Thank you.
>> ___________________________________________________________________________________
>> 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://tex.aanhet.net
>> archive  : http://foundry.supelec.fr/projects/contextrev/
>> wiki     : http://contextgarden.net
>> ___________________________________________________________________________________
> 
> 
> ___________________________________________________________________________________
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: \installprettytype problem
  2015-08-21 11:43     ` Renaud AUBIN
@ 2015-08-21 11:58       ` Matthieu Leroy
  0 siblings, 0 replies; 8+ messages in thread
From: Matthieu Leroy @ 2015-08-21 11:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users

That's fine, thank you,

Le 21/08/15 13:43, Renaud AUBIN a écrit :
>
> Replace "+ V("ltgtstring")" by "-- + V("ltgtstring")" at L175 of
> t-pretty-c.lua as a temporary workaround…
>
> Le 2015-08-21 11:54, Matthieu Leroy a écrit :

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: \installprettytype problem
  2015-08-20 22:21 ` Renaud AUBIN
  2015-08-21  9:54   ` Matthieu Leroy
@ 2015-08-21 18:54   ` Eric Détrez
  2015-08-21 20:51     ` Aditya Mahajan
  1 sibling, 1 reply; 8+ messages in thread
From: Eric Détrez @ 2015-08-21 18:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Le 21-08-2015 00:21, Renaud AUBIN a écrit :
> Bonsoir Matthieu,
> 
> Give a try to https://github.com/nibua-r/pretty-c and tell me if
> anything goes wrong…
> 
> It's basically a rewrite of Peter's module adapted to mkiv + new
> verbatim (new at the time of writing)

> Le 20 août 2015 10:43 PM, Matthieu Leroy <matt57.leroy@orange.fr> a 
> écrit :
>> 
>> Hello,
>> 
>> I want to use the "
>> C-Pretty-Printing" module.
>> According to the "Verbatim" page of the Context garden, I have to use 
>> the \installprettytype command, but this one doesn't work (error : 
>> "undefined control sequence").


Nobody did mention the use of vim package ?
You have to installe vim in your system
The package asks vim to get the lexed source code.
Next the package color it.
It doesn't seem obvious to change the colors.

Doc at
http://modules.contextgarden.net/dl/t-vim/doc/context/third/vim/vim.txt

\usemodule[vim]

\definevimtyping [C]  [syntax=c]

\starttext
\startC
   int func(int a){
     if(a > 4)
       return 0; // comment
     else        /* comment */
       return 10;
   }
\stopC
\stoptext

-- 
Eric Détrez
Informatique
Lycée Faidherbe, Lille
http://eric-detrez.fr
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: \installprettytype problem
  2015-08-21 18:54   ` Eric Détrez
@ 2015-08-21 20:51     ` Aditya Mahajan
  0 siblings, 0 replies; 8+ messages in thread
From: Aditya Mahajan @ 2015-08-21 20:51 UTC (permalink / raw)
  To: info, mailing list for ConTeXt users

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

On Fri, 21 Aug 2015, Eric Détrez wrote:

> Le 21-08-2015 00:21, Renaud AUBIN a écrit :
>
> Nobody did mention the use of vim package ?
> You have to installe vim in your system
> The package asks vim to get the lexed source code.
> Next the package color it.
> It doesn't seem obvious to change the colors.

To change the color scheme, simply define a new color scheme following

https://github.com/adityam/filter/blob/master/t-vim.tex#L280

Two color schemes are pre-defined: pscolor and blackandwhite.

Aditya

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2015-08-21 20:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-20 20:43 \installprettytype problem Matthieu Leroy
2015-08-20 22:21 ` Renaud AUBIN
2015-08-21  9:54   ` Matthieu Leroy
2015-08-21 11:30     ` root
2015-08-21 11:43     ` Renaud AUBIN
2015-08-21 11:58       ` Matthieu Leroy
2015-08-21 18:54   ` Eric Détrez
2015-08-21 20:51     ` Aditya Mahajan

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