[NTG-context] Searching unwanted paragraph breaks

2019-03-22 Thread Jaroslav Hajtmar
Hello ConTeXist.
I apologize in advance for a generic question without a minimum example.
I use a large library of linked macros when I typeset documents. In some cases, 
unwanted paragraph breaks are inserted during typing. Is there a way to remove 
this ie something like \removeunwantedparbreak (alternative of 
\removeunwantedspaces) or some kind of tracing that would help me to find where 
the error is? 
I don't have much experience with tracing and I can't find anything on the wiki.
I've been looking for her for a few hours without success. It is even possible 
that a paragraph break inserts some regular ConTeXt macro.
Can anyone give me a strategy?
Thanks very much.
Jaroslav Hajtmar
___
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
___


Re: [NTG-context] Disproportion in initializing user counters

2018-07-15 Thread Jaroslav Hajtmar
Thank very much to explain the problem and to example with labels - very useful 
information for me.
Thanks to all.
Jaroslav Hajtmar

15. 7. 2018 v 19:20, Wolfgang Schuster 
mailto:schuster.wolfg...@gmail.com>>:

Hi Pablo,

when you use the label mechanism to create a counter context ensures to print 
the right counter value in the table.

___
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
___

[NTG-context] Disproportion in initializing user counters

2018-07-15 Thread Jaroslav Hajtmar
Hello ConTeXist.
I encountered a disproportion in initializing user counters. Why initialization 
at the beginning of the source text does not work and what is the mechanism of 
how the user counters work.

Thanx Jaroslav Hajtmar

Here is a sample example:

\definecounter[mycounter]

\def\getmycounter{\incrementcounter[mycounter]\getnumber[mycounter]}

\startbuffer[groups]
\startxrow
\startxcell \getmycounter\stopxcell
\startxcell Content of column\stopxcell
\stopxrow
\stopbuffer



\starttext

%\setcounter[mycounter][0] % initializing at this point not working (the 
counter is 10 more than it should be). WHY?



\startxtable
\startxrow
\startxcell Column 1\stopxcell
\startxcell Column 2\stopxcell
\stopxrow

\setcounter[mycounter][0] % initializing at this point works fine
\dorecurse{5}{\getbuffer[groups]}
\stopxtable

\stoptext

___
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
___

[NTG-context] Merging source ConTeXt files during compilation of main file

2018-02-19 Thread Jaroslav Hajtmar
Hello ConTeXist.
I have one main file and a large number of component files. I would like to 
merge all files in the right order without having to do it manually.
Is there a way to automatically merge several source files during the 
compilation of ConTeXt source text, which are loading using the input command 
or the component command? Example:

\starttext

Source code of main source….

\component file1
\component file2
\component file3 % etc.

Source code of main source….

\stoptext


The result should be one single source file that is created by merging all 
files and which can be compiled as one file:

\starttext

Source code of main source….

Contents of  file1

Contents of  file2

Contents of  file3

% etc.

Source code of main source….

\stoptext


Consequently, this file can be compiled, for example, with the online version 
of ConTeXt at live.contextgarden.net<http://live.contextgarden.net/>.

Thanx for any advice.

Jaroslav Hajtmar
___
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
___

[NTG-context] Merging source ConTeXt files during compilation of main file

2018-02-19 Thread Jaroslav Hajtmar
Hello ConTeXist.
I have one main file and a large number of component files. I would like to 
merge all files in the right order without having to do it manually.
Is there a way to automatically merge several source files during the 
compilation of ConTeXt source text, which are loading using the input command 
or the component command? Example:

\starttext

Source code of main source….

\component file1
\component file2
\component file3 % etc.

Source code of main source….

\stoptext


The result should be one single source file that is created by merging all 
files and which can be compiled as one file:

\starttext

Source code of main source….

Contents of  file1

Contents of  file2

Contents of  file3

% etc.

Source code of main source….

\stoptext


Consequently, this file can be compiled, for example, with the online version 
of ConTeXt at live.contextgarden.net.

Thanx for any advice.

Jaroslav Hajtmar





___
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
___

[NTG-context] Search problems in large source code (unwanted paragraph breaks)

2017-08-27 Thread Jaroslav Hajtmar
Hello ConTeXist.
During the compilation of a large source code that contains many macros, I get 
paragraph break in output. For a long time, I am looking for a place where this 
problem occurs. I've tested manual checks and turned on many different trackers 
(for example use \enabletrackers[context.trace] from wiki) to see where the 
problem is, but I can not figure out the solution. Does anyone know how this 
problem can be addressed?

In connection with this, I want to ask if there is something like 
\removeunwantedbreaks ???

Thanx Jaroslav Hajtmar

___
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
___

[NTG-context] Search problems in large source code (unwanted paragraph breaks)

2017-08-27 Thread Jaroslav Hajtmar
Hello ConTeXist.
During the compilation of a large source code that contains many macros, I get 
paragraph break in output. For a long time, I am looking for a place where this 
problem occurs. I've tested manual checks and turned on many different trackers 
(use \enabletrackers[] from wiki) to see where the problem is, but I can not 
figure out the solution. Does anyone know how this problem can be addressed?

In connection with this, I want to ask if there is something like 
\removeunwantedbreaks ???

Thanx Jaroslav Hajtmar


___
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
___

Re: [NTG-context] Bug in wiki \doifsamestringselse vs \doifsamestringelse

2017-07-25 Thread Jaroslav Hajtmar
Thanx for reply and for fixed too. 
Jaroslav Hajtmar


Dne 24.07.17 23:06, ntg-context za uživatele Henri <ntg-context-boun...@ntg.nl 
za uživatele henrime...@gmail.com> napsal(a):

On Mon, 2017-07-24 at 16:54 +, Jaroslav Hajtmar wrote:
> Hello ConTeXist
>  
> I add wiki information. In wiki on page 
http://wiki.contextgarden.net/System_Macros/Branches_and_D
> ecisions is bug (I think) in caption 
\doifsamestringselse,\doifsamestring,\doifnotsamestring.
>  
> Right information is 
\doifsamestringelse,\doifsamestring,\doifnotsamestring (without s in first
> keyword).
> Macro \doifsamestringselse not work.
>  
> Is there anybody, that fix this bug?

It's just a simple typo.  I fixed it for you.  You can also fix things like 
this yourself by making
an account on the wiki and editing the page.

>  
> Jaroslav Hajtmar
>  
>  
>  
> 
___
> 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
> 
___

___
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

___

___
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
___

[NTG-context] Bug in wiki \doifsamestringselse vs \doifsamestringelse

2017-07-24 Thread Jaroslav Hajtmar
Hello ConTeXist

I add wiki information. In wiki on page 
http://wiki.contextgarden.net/System_Macros/Branches_and_Decisions is bug (I 
think) in caption \doifsamestringselse,\doifsamestring,\doifnotsamestring.

Right information is \doifsamestringelse,\doifsamestring,\doifnotsamestring 
(without s in first keyword).
Macro \doifsamestringselse not work.

Is there anybody, that fix this bug?

Jaroslav Hajtmar



___
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
___

Re: [NTG-context] Compare contents of macros via \doif etc. alternatives

2017-07-22 Thread Jaroslav Hajtmar

Thanx Hans for reply.


also, it depends on what you want to achieve ... maybe comparing macros is not 
needed at all

You have right, that anytime compares are not needed, but for my very needed 
compares is not working in next eight examples. Problem is in expansions macros 
with optional argument. For “normal” macros are compares without problem as you 
see in last four examples….


mymacro

\doifelse{\mymacro}{123}{equal content}{not equal content}

\doifsamestringelse{\mymacro}{123}{equal content}{not equal content}

\doifinstringelse{\mymacro}{123}{equal content}{not equal content}

\doifincsnameelse{\mymacro}{123}{equal content}{not equal content}


\hairline

mymacro[123]

\doifelse{\mymacro[123]}{123}{equal content}{not equal content}

\doifsamestringelse{\mymacro[123]}{123}{equal content}{not equal content}

\doifinstringelse{\mymacro[123]}{123}{equal content}{not equal content}

\doifincsnameelse{\mymacro[123]}{123}{equal content}{not equal content}



\hairline


myothermacro

\doifelse{\myothermacro}{123}{equal content}{not equal content}

\doifsamestringelse{\myothermacro}{123}{equal content}{not equal content}

\doifinstringelse{\myothermacro}{123}{equal content}{not equal content}

\doifincsnameelse{\myothermacro}{123}{equal content}{not equal content}



there is not that much benefit defining these at the lua end if you directly 
feed back into tex anyway

sure, but I need define some macros automatically from luacode (is part of 
custom lua library)

Thanx
Jaroslav Hajtmar




22. 7. 2017 v 13:23, Hans Hagen <pra...@wxs.nl<mailto:pra...@wxs.nl>>:

On 7/22/2017 3:58 AM, Henri wrote:
On Fri, 2017-07-21 at 11:25 +0000, Jaroslav Hajtmar wrote:
Hello ConTeXist.
Is there any way to evaluate of contents of two macros as I am showing in my 
minimal example?
I know, that problem is in expansion, but I dont know to resolve it.
My minimal example consist of piece lua code, because I am solving my problem 
in mixed codes (TeX
& Lua)
Something similar has been asked before and it is not possible.  The 
interfaces.definecommand
function defines a new macro using \protected\def.  To compare as equal in a 
\doif context, both
operands have to _expand_ to the same thing (here 123).  Here \mymacro is not 
expandable and thus
only \doifelse{\mymacro}{\mymacro} will ever compare true.
Furthermore, scanning for optional arguments (i.e. [...]) is inherently 
non-expandable.  To get
something expandable you must at least switch to mandatory arguments (i.e. 
{...}).  Still, using
interfaces.definecommand will still not be possible.  I believe that scanning 
arguments is better
done on the macro level than in Lua, but that's just my opinion.

also, it depends on what you want to achieve ... maybe comparing macros is not 
needed at all

Thanx for help.
Jaroslav Hajtmar
   \starttext
 \startluacode
interfaces.definecommand ("domymacro", {
arguments = { { "option", "string" }  },
macro = function (opt_1)
   if #opt_1>0 then
   context(opt_1)
   else
   context("123")
   end
end
   })
interfaces.definecommand("mymacro", {
macro = function ()
  context.dosingleempty()
  context["domymacro"]()
end
   })
\stopluacode

there is not that much benefit defining these at the lua end if you directly 
feed back into tex anyway

\def\myothermacro{123}
 \hairline
 \mymacro[123]
 \mymacro
 \myothermacro
 \hairline
 \doifelse{\mymacro}{\mymacro[123]}{equal content}{not equal content}
 \doifsamestringelse{\mymacro}{\mymacro[123]}{equal content}{not equal content}
 \doifinstringelse{\mymacro}{\mymacro[123]}{equal content}{not equal content}
 \doifincsnameelse{\mymacro}{\mymacro[123]}{equal content}{not equal content}
   \hairline
 \doifelse{\mymacro}{\myothermacro}{equal content}{not equal content}
 \doifsamestringelse{\mymacro}{\myothermacro}{equal content}{not equal content}
 \doifinstringelse{\mymacro}{\myothermacro}{equal content}{not equal content}
 \doifincsnameelse{\mymacro}{\myothermacro}{equal content}{not equal content}
 \stoptext
 
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl<mailto: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
___
__

[NTG-context] Compare contents of macros via \doif etc. alternatives

2017-07-22 Thread Jaroslav Hajtmar
Hello ConTeXist.

Is there any way to evaluate of contents of two macros as I am showing in my 
minimal example? 

I know, that problem is in expansion, but I dont know to resolve it.

My minimal example consist of piece lua code, because I am solving my problem 
in mixed codes (TeX & Lua)

 

Thanx for help.

Jaroslav Hajtmar

 

 

\starttext

 

\startluacode

    interfaces.definecommand ("domymacro", {

        arguments = { { "option", "string" }  },

        macro = function (opt_1)

       if #opt_1>0 then

   context(opt_1)

   else

   context("123")

   end

        end

   })

    interfaces.definecommand("mymacro", {

        macro = function ()

      context.dosingleempty()

      context["domymacro"]()

        end

   })

\stopluacode

 

\def\myothermacro{123}

 

\hairline

 

\mymacro[123]

 

\mymacro

 

\myothermacro

 

\hairline

 

\doifelse{\mymacro}{\mymacro[123]}{equal content}{not equal content}

 

\doifsamestringelse{\mymacro}{\mymacro[123]}{equal content}{not equal content}

 

\doifinstringelse{\mymacro}{\mymacro[123]}{equal content}{not equal content}

 

\doifincsnameelse{\mymacro}{\mymacro[123]}{equal content}{not equal content}

 

 

\hairline

 

\doifelse{\mymacro}{\myothermacro}{equal content}{not equal content}

 

\doifsamestringelse{\mymacro}{\myothermacro}{equal content}{not equal content}

 

\doifinstringelse{\mymacro}{\myothermacro}{equal content}{not equal content}

 

\doifincsnameelse{\mymacro}{\myothermacro}{equal content}{not equal content}

 

 

 

\stoptext

___
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
___

Re: [NTG-context] Compare contents of macros via \doif etc. alternatives

2017-07-21 Thread Jaroslav Hajtmar
Thanks to Henri for the answer. To I admit, I thought it a bit technically that 
it would not be technically possible. At least I know why I was tearing my 
teeth while trying to test ... 
One more thanx.
Jaroslav Hajtmar


Dne 22.07.17 3:58, ntg-context za uživatele Henri <ntg-context-boun...@ntg.nl 
za uživatele henrime...@gmail.com> napsal(a):

On Fri, 2017-07-21 at 11:25 +, Jaroslav Hajtmar wrote:
> Hello ConTeXist.
> Is there any way to evaluate of contents of two macros as I am showing in 
my minimal example? 
> I know, that problem is in expansion, but I dont know to resolve it.
> My minimal example consist of piece lua code, because I am solving my 
problem in mixed codes (TeX
> & Lua)

Something similar has been asked before and it is not possible.  The 
interfaces.definecommand
function defines a new macro using \protected\def.  To compare as equal in 
a \doif context, both
operands have to _expand_ to the same thing (here 123).  Here \mymacro is 
not expandable and thus
only \doifelse{\mymacro}{\mymacro} will ever compare true.

Furthermore, scanning for optional arguments (i.e. [...]) is inherently 
non-expandable.  To get
something expandable you must at least switch to mandatory arguments (i.e. 
{...}).  Still, using
interfaces.definecommand will still not be possible.  I believe that 
scanning arguments is better
done on the macro level than in Lua, but that's just my opinion.

    > Thanx for help.
> Jaroslav Hajtmar
>  
>  
> \starttext
>  
> \startluacode
> interfaces.definecommand ("domymacro", {
> arguments = { { "option", "string" }  },
> macro = function (opt_1)
>if #opt_1>0 then
>context(opt_1)
>else
>context("123")
>end
> end
>})
> interfaces.definecommand("mymacro", {
> macro = function ()
>   context.dosingleempty()
>   context["domymacro"]()
> end
>})
> \stopluacode
>  
> \def\myothermacro{123}
>  
> \hairline
>  
> \mymacro[123]
>  
> \mymacro
>  
> \myothermacro
>  
> \hairline
>  
> \doifelse{\mymacro}{\mymacro[123]}{equal content}{not equal content}
>  
> \doifsamestringelse{\mymacro}{\mymacro[123]}{equal content}{not equal 
content}
>  
> \doifinstringelse{\mymacro}{\mymacro[123]}{equal content}{not equal 
content}
>  
> \doifincsnameelse{\mymacro}{\mymacro[123]}{equal content}{not equal 
content}
>  
>  
> \hairline
>  
> \doifelse{\mymacro}{\myothermacro}{equal content}{not equal content}
>  
> \doifsamestringelse{\mymacro}{\myothermacro}{equal content}{not equal 
content}
>  
> \doifinstringelse{\mymacro}{\myothermacro}{equal content}{not equal 
content}
>  
> \doifincsnameelse{\mymacro}{\myothermacro}{equal content}{not equal 
content}
>  
>  
>  
> \stoptext
>  
>  
>  
> 
___
> 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
> 
___

___
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

___

___
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
___

[NTG-context] Compare contents of macros via \doif etc. alternatives

2017-07-21 Thread Jaroslav Hajtmar
Hello ConTeXist.
Is there any way to evaluate of contents of two macros as I am showing in my 
minimal example?
I know, that problem is in expansion, but I dont know to resolve it.
My minimal example consist of piece lua code, because I am solving my problem 
in mixed codes (TeX & Lua)

Thanx for help.
Jaroslav Hajtmar


\starttext

\startluacode
interfaces.definecommand ("domymacro", {
arguments = { { "option", "string" }  },
macro = function (opt_1)
   if #opt_1>0 then
   context(opt_1)
   else
   context("123")
   end
end
   })
interfaces.definecommand("mymacro", {
macro = function ()
  context.dosingleempty()
  context["domymacro"]()
end
   })
\stopluacode

\def\myothermacro{123}

\hairline

\mymacro[123]

\mymacro

\myothermacro

\hairline

\doifelse{\mymacro}{\mymacro[123]}{equal content}{not equal content}

\doifsamestringelse{\mymacro}{\mymacro[123]}{equal content}{not equal content}

\doifinstringelse{\mymacro}{\mymacro[123]}{equal content}{not equal content}

\doifincsnameelse{\mymacro}{\mymacro[123]}{equal content}{not equal content}


\hairline

\doifelse{\mymacro}{\myothermacro}{equal content}{not equal content}

\doifsamestringelse{\mymacro}{\myothermacro}{equal content}{not equal content}

\doifinstringelse{\mymacro}{\myothermacro}{equal content}{not equal content}

\doifincsnameelse{\mymacro}{\myothermacro}{equal content}{not equal content}



\stoptext



___
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
___

Re: [NTG-context] Overarc etc. symbols

2017-07-02 Thread Jaroslav Hajtmar
Thanx Henri.
This is very useful for me.
Jaroslav Hajtmar


Dne 02.07.17 23:38, ntg-context za uživatele Henri Menke 
<ntg-context-boun...@ntg.nl za uživatele henrime...@gmail.com> napsal(a):

On Sun, 2017-07-02 at 08:38 +, Jaroslav Hajtmar wrote:
> Thanx Henri, 
> that's exactly what I needed. Is there in any place on Wiki table of all 
ConTeXt math symbols?
> Sometimes I look for something and I explore, that few LaTeX symbols not 
work in ConTeXt.

Most (all?) delimiters are defined in these files.


https://github.com/contextgarden/context-mirror/blob/beta/tex/context/base/mkiv/math-stc.mkvi

https://github.com/contextgarden/context-mirror/blob/beta/tex/context/base/mkiv/math-fen.mkiv

Otherwise I just look up the symbol in this file

http://texdoc.net/texmf-dist/doc/latex/unicode-math/unimath-symbols.pdf

and then search the ConTeXt source for the Unicode slot to get the name in 
ConTeXt.  But in many
cases the names from unimath-symbols also work in ConTeXt.

> 
> Thanx again.
    > Jaroslav Hajtmar
> 
> 
> Dne 02.07.17 9:46, ntg-context za uživatele Henri Menke 
<ntg-context-boun...@ntg.nl za uživatele h
> enrime...@gmail.com> napsal(a):
> 
> $\overparent{AVB}$
> 
> 
> Dne 02.07.17 9:46, ntg-context za uživatele Henri Menke 
<ntg-context-boun...@ntg.nl za uživatele h
> enrime...@gmail.com> napsal(a):
> 
> On 07/02/2017 07:18 PM, Jaroslav Hajtmar wrote:
> > Hello ConTeXist.
> > 
> > Can someone advise me how to lay an arc over three letters AVB.
> > 
> > It's about the LaTeX equivalent of \overarc or \widearc macro. Is 
there any table of similar
> ConTeXt symbols?
> 
> Maybe like this?
> 
> \starttext
> 
> $\overparent{AVB}$
    > 
> $\underparent{AVB}$
> 
> \stoptext
> 
> > 
> > Thanks Jaroslav Hajtmar
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> > 
> > 
> > 
___
> > 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
> > 
___
> > 
> 
> 
___
> 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
> 
___
> 
> 
___
> 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
> 
___

___
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

___

___
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
___

Re: [NTG-context] Overarc etc. symbols

2017-07-02 Thread Jaroslav Hajtmar
Thanx Henri, 
that's exactly what I needed. Is there in any place on Wiki table of all 
ConTeXt math symbols? Sometimes I look for something and I explore, that few 
LaTeX symbols not work in ConTeXt.

Thanx again.
Jaroslav Hajtmar


Dne 02.07.17 9:46, ntg-context za uživatele Henri Menke 
<ntg-context-boun...@ntg.nl za uživatele henrime...@gmail.com> napsal(a):

$\overparent{AVB}$


Dne 02.07.17 9:46, ntg-context za uživatele Henri Menke 
<ntg-context-boun...@ntg.nl za uživatele henrime...@gmail.com> napsal(a):

On 07/02/2017 07:18 PM, Jaroslav Hajtmar wrote:
> Hello ConTeXist.
> 
> Can someone advise me how to lay an arc over three letters AVB.
> 
> It's about the LaTeX equivalent of \overarc or \widearc macro. Is there 
any table of similar ConTeXt symbols?

Maybe like this?

\starttext

$\overparent{AVB}$

$\underparent{AVB}$

\stoptext

    > 
> Thanks Jaroslav Hajtmar
> 
>  
> 
>  
> 
>  
> 
> 
> 
> 
___
> 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
> 
___
> 


___
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

___

___
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
___

Re: [NTG-context] Overarc etc. symbols

2017-07-02 Thread Jaroslav Hajtmar
Thanx Henri, 
that's exactly what I needed. Is there in any place on Wiki table of all 
ConTeXt math symbols? Sometimes I look for something and I explore, that few 
LaTeX symbols not work in ConTeXt.

Thanx again.
Jaroslav Hajtmar


> On 02.07.17 9:46, ntg-context za uživatele Henri Menke 
> <ntg-context-boun...@ntg.nl za uživatele henrime...@gmail.com> napsal(a):

>$\overparent{AVB}$



Dne 02.07.17 9:46, ntg-context za uživatele Henri Menke 
<ntg-context-boun...@ntg.nl za uživatele henrime...@gmail.com> napsal(a):

On 07/02/2017 07:18 PM, Jaroslav Hajtmar wrote:
> Hello ConTeXist.
> 
> Can someone advise me how to lay an arc over three letters AVB.
> 
> It's about the LaTeX equivalent of \overarc or \widearc macro. Is there 
any table of similar ConTeXt symbols?

Maybe like this?

\starttext

$\overparent{AVB}$

$\underparent{AVB}$

    \stoptext

> 
> Thanks Jaroslav Hajtmar
> 
>  
> 
>  
> 
>  
> 
> 
> 
> 
___
> 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
> 
___
> 


___
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

___

___
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
___

[NTG-context] Overarc etc. symbols

2017-07-02 Thread Jaroslav Hajtmar
Hello ConTeXist.
Can someone advise me how to lay an arc over three letters AVB.
It's about the LaTeX equivalent of \overarc or \widearc macro. Is there any 
table of similar ConTeXt symbols?

Thanks Jaroslav Hajtmar



___
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
___

Re: [NTG-context] Problem with macro with optional parameter

2017-06-27 Thread Jaroslav Hajtmar
Thanx Henri for answer.
Maybe I have been explaining wrong my problem. I would need a variant without a 
parameter and concurrently without braces. Command without braces swallows the 
break of the paragraph.

\def\Command#1%
  {\expdoifelse{#1}{}{100}{#1}}

\starttext

1. \Command{5} % OK

2. \Command  % OK

3. As You see, Command without braces swallows the break of the paragraph.

1. \dorecurse{\Command{5}}{\recurselevel\crlf} % not working

2. \dorecurse{\Command{}}{\recurselevel\crlf}  % not working

\stoptext


Jaroslav Hajtmar





Dne 27.06.17 13:05, ntg-context za uživatele Henri Menke 
<ntg-context-boun...@ntg.nl za uživatele henrime...@gmail.com> napsal(a):

On Tue, 2017-06-27 at 08:58 +, Jaroslav Hajtmar wrote:
> Hello ConTeXist.
> I'm not able to solve a macros problem with one optional argument. I need 
the macro to return a
> value that can be used as a dorecurse loop parameter.
> Is there possibility create macro with optional parameter and parameter 
is concurrently inside in
> braces? (in nonsquare brackets)?
> I've tried to experiment with examples from the wiki, but I'm not clear 
about it.
>  
    > Thanx for help.
> Jaroslav Hajtmar
>  
> Here is minimal example:
>  
> \def\DoCommand[#1]%
>   {\iffirstargument#1\else100\fi}
>  
> \def\Command%
>   {\dosingleargument\DoCommand}
>  
> %\def\DoAnotherCommand{#1}%
> %  {\iffirstargument#1\else100\fi}
>  
> %\def\AnotherCommand%
> %  {\dosingleargument\DoAnotherCommand}
>   
> \starttext
>  
> 1. \Command[5] % OK
>  
> 2. \Command  % OK
>  
>  
>  
>  
> %1. \dorecurse{\Command[5]}{\recurselevel\crlf} % not working
>  
> %2. \dorecurse{\Command}{\recurselevel\crlf}  % not working

The first argument to \dorecurse has to expand to a number.  Therefore it 
has to be fully-
expandable.  Scanning for optional brackets is never expandable.  You have 
to do it this way:

\def\Command#1%
  {\expdoifelse{#1}{}{100}{#1}}

\starttext

1. \Command{5} % OK

2. \Command{}  % OK

1. \dorecurse{\Command{5}}{\recurselevel\crlf} % not working

2. \dorecurse{\Command{}}{\recurselevel\crlf}  % not working

\stoptext


> \stoptext
> 
___
> 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
> 
___

___
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

___

___
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
___

[NTG-context] Problem with macro with optional parameter

2017-06-27 Thread Jaroslav Hajtmar
Hello ConTeXist.
I'm not able to solve a macros problem with one optional argument. I need the 
macro to return a value that can be used as a dorecurse loop parameter.
Is there possibility create macro with optional parameter and parameter is 
concurrently inside in braces? (in nonsquare brackets)?
I've tried to experiment with examples from the wiki, but I'm not clear about 
it.

Thanx for help.
Jaroslav Hajtmar

Here is minimal example:

\def\DoCommand[#1]%
  {\iffirstargument#1\else100\fi}

\def\Command%
  {\dosingleargument\DoCommand}

%\def\DoAnotherCommand{#1}%
%  {\iffirstargument#1\else100\fi}

%\def\AnotherCommand%
%  {\dosingleargument\DoAnotherCommand}

\starttext

1. \Command[5] % OK

2. \Command  % OK




%1. \dorecurse{\Command[5]}{\recurselevel\crlf} % not working

%2. \dorecurse{\Command}{\recurselevel\crlf}  % not working


\stoptext
___
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
___

[NTG-context] \savebuffer to merge of save contents

2017-03-21 Thread Jaroslav Hajtmar
Hello ConTeXist.

Is there any possibility or modifications that will allow to savebuffer to 
work, so that will add (merge) the buffer contents into a file (Which content 
of the previous buffer)?

For inspiration, it is possible use a solution that wrote before year ago 
Wolfgang for Lukas Prochazka – ie 
https://mailman.ntg.nl/pipermail/ntg-context/2016/087657.html


Thanx
Jaroslav Hajtmar


Here is source code of Wolfgangs solution:


\unexpanded\def\startcontentexport
   {\dosingleempty\dostartcontentexport}

\def\dostartcontentexport[#1]%
   {\iffirstargument
  \edef\contentexportfile{#1}%
\else
  \let\contentexportfile\empty
\fi
\grabbufferdata[contentexport][startcontentexport][stopcontentexport]}

\def\stopcontentexport

{\doifsomething{\contentexportfile}{\savebuffer[list=contentexport,prefix=no,file=\contentexportfile]}%
\getbufferdata[contentexport]}

\starttext

A

\startcontentexport[Test.mkiv]
   Basic content …
   \startitemize
 \item Item
   \stopitemize
\stopcontentexport

B

\startcontentexport[Test.mkiv]
   Add this text into Test.mkiv file
   \startitemize
 \item Item
   \stopitemize
\stopcontentexport

C

\startcontentexport[Test.mkiv]
  And this text add into Test.mkiv file too.
   \startitemize
 \item Item
   \stopitemize
\stopcontentexport

\stoptext




___
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
___

Re: [NTG-context] coma in an argument

2017-02-21 Thread Jaroslav Hajtmar
Hello Pablo.
Of course – it was my wrong example see:
\executesystemcommand{context --result invoice-\cA.pdf --arguments = "cA 
={\cA}" servingfile.tex}. Braces are of course important.
Thanx to Hans for his correction.

Jaroslav Hajtmar





Dne 21.02.17 19:15, ntg-context za uživatele Pablo Rodriguez 
<ntg-context-boun...@ntg.nl za uživatele oi...@gmx.es> napsal(a):

On 02/21/2017 07:09 PM, Hans Hagen wrote:
> On 2/21/2017 6:57 PM, Pablo Rodriguez wrote:
>>  contextjit --arguments="cA=a, b" a.tex
> 
>   contextjit --arguments="cA={a, b}" a.tex

Hans,

many thanks for the fast reply and your help.

The answer is simple, but my mind seems to be simpler right now ;-).

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

___

___
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
___

Re: [NTG-context] generate multiple files from one source

2017-02-19 Thread Jaroslav Hajtmar
Hello Pablo,
I am using a new calling of ConTeXt ie. compile new source code from the main 
source code. It is possible due \executesystemcommand macro. Necessary 
parameters You can pass to new compiling source. For example:

\executesystemcommand{context --result invoice-\cA.pdf --arguments = "cA = \cA" 
servingfile.tex}.  

This possibility create a particular PDF file for recipient \cA. 

PS 2Pablo only: This option is possible with handleCSV module. The possibility 
of using handleCSV module I will publish to GitLab repository as soon as 
possible - today or tomorrow. I was very busy this weekend.

Jaroslav Hajtmar







Dne 18.02.17 23:27, ntg-context za uživatele Pablo Rodriguez 
<ntg-context-boun...@ntg.nl za uživatele oi...@gmx.es> napsal(a):

Dear list,

I have the following sample:

\setuppapersize[A8, landscape]
\starttext
\dorecurse{10}{
\startpagemakeup[align=center]
This is invoice number \recurselevel.

Customer name from CSV file.

Other data from the same CSV file.
\stoppagemakeup}
\stoptext

How can I get new PDF documents with a one invoice per document instead
of new page breaks?

I need PDF documents with only one invoice (but with the correct number)
and also a single PDF document with all invoices.

Of course, my real documents are more complex. What I need is a file
breaking command. Appending -1, -2, -3... -n to the PDF file name would
be fine for me.

How could I achieve this in the ConTeXt compilation?

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

___

___
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
___

Re: [NTG-context] Asymptote or Metapost and ConTeXt parameters.

2016-12-23 Thread Jaroslav Hajtmar
Hello Adytia.
It seems now, that everything at this time works as intended. Many thanks for 
your support. Below is a minimal example. Attached is a PDF sample result.
I tried also to experiment with the choice "object = no", as suggested by Hans, 
but without success. I would asking  if you make any changes in filter module?
Or have I misunderstood Your opinion? 
Thank you once again
Jaroslav Hajtmar


Here is minimal example:

\usemodule[filter]

\unprotect
\appendtoks
   \setuevalue{set\currentexternalfilter 
buffer}{\externalfilter@set[\currentexternalfilter]}%
\to \everydefineexternalfilter

\unexpanded\def\externalfilter@set
   {\dodoubleargument\externalfiter@set_indeed}

\starttexdefinition externalfiter@set_indeed [#1][#2]#3
% #1 = filter
% #2 = options

\begingroup
\edef\currentexternalfilter{#1}

\setupexternalfilter[#1][\c!name=,#2]

\externalfilter@set_filenames
\setbuffer[\externalfilter@buffer_name]#3\endbuffer

\externalfilter@process_filter
  \stoptexdefinition
\protect

\defineexternalfilter
   [ASY]
   [
 filtercommand={asy -tex context \externalfilterinputfile\space -o 
\externalfilteroutputfile}, output=\externalfilterbasefile.pdf,
 purge=no, 
 cache=yes,
 readcommand=\ReadImage,
   ]

\define[1]\ReadImage{\externalfigure[#1]}

\define[1]\mycircle{
\setASYbuffer{
import graph;
draw(Circle((0,0),#1));
}}


\starttext

\startASY
 import graph;
 draw((0,0)--(100,100));
\stopASY

\mycircle{10}

\mycircle{20}

\mycircle{30}

\stoptext







Dne 23.12.16 20:22, ntg-context za uživatele Aditya Mahajan 
<ntg-context-boun...@ntg.nl za uživatele adit...@umich.edu> napsal(a):

On Fri, 23 Dec 2016, Jaroslav Hajtmar wrote:

> Thanks for sending Your code. It seems that it works with Asymptote. 
> Unfortunately, when I am trying to multiple call a macro then I get 
> fatal error, and then compile collapse. I do not know what it could be.

When called for the first time, the code generates test-ASY.pdf file and 
includes it. After the second call, a new test-ASY.pdf is generated. 
ConTeXt generates an error because the name of the files is the same, but 
the content is not.

There should be an option for \externalfigure to disable this check, but I 
couldn't find it. Here is an alternative approach, that changes the name 
of the PDF.

\usemodule[filter]

\unprotect
\appendtoks
   \setuevalue{set\currentexternalfilter 
buffer}{\externalfilter@set[\currentexternalfilter]}%
\to \everydefineexternalfilter

\unexpanded\def\externalfilter@set
   {\dodoubleargument\externalfiter@set_indeed}

\starttexdefinition externalfiter@set_indeed [#1][#2]#3
% #1 = filter
% #2 = options

\begingroup
\edef\currentexternalfilter{#1}

\setupexternalfilter[#1][\c!name=,#2]

\externalfilter@set_filenames
\setbuffer[\externalfilter@buffer_name]#3\endbuffer

\externalfilter@process_filter
  \stoptexdefinition
\protect

\defineexternalfilter
 [MARKDOWN]
 [
   filtercommand={pandoc -f markdown -t context 
\externalfilterinputfile\space -o \externalfilteroutputfile},
   cache=yes,
   purge=no,
 ]

\define[1]\NEW
 {\setMARKDOWNbuffer{This is #1}}

\traceexternalfilters

\starttext
\startMARKDOWN
   This is **one**
\stopMARKDOWN

\NEW{**ONE**}

\NEW{_TWO_}
\stoptext

Note that this has the same limitation as using \type{...}. The contents of
\NEW{...} must have matched braces. If this works, I can include the code in
t-filter (mkiv only, as I no longer want to maintain the mkii branch).

Aditya

___
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

___



AsymptoteCodeInConTeXt03a-Adytia.pdf
Description: AsymptoteCodeInConTeXt03a-Adytia.pdf
___
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
___

Re: [NTG-context] Asymptote or Metapost and ConTeXt parameters.

2016-12-23 Thread Jaroslav Hajtmar
Hello Adytia.
Thanks for sending Your code. It seems that it works with Asymptote. 
Unfortunately, when I am trying to multiple call a macro then I get fatal 
error, and then compile collapse. I do not know what it could be. Is it 
possible that my code is wrong. But it is possible that there is a stack 
overflow etc. It would be a need to look at why the fatal error occurs - It 
probably can evaluate Hans. Thanks again for your support. Below is my code. If 
removed commentary characters occurs advised error.

Jaroslav Hajtmar


\usemodule[filter]

\defineexternalfilter
   [ASY]
   [
 filtercommand={asy -tex context \externalfilterinputfile\space -o 
\externalfilteroutputfile}, output=\externalfilterbasefile.pdf,
 purge=no, 
 cache=yes,
 readcommand=\ReadImage,
   ]

\define[1]\ReadImage{\externalfigure[#1]}

\define[1]\mycircle{
#1 - XXX
\setbuffer[ASY]
import graph;
draw(Circle((0,0),#1));
\endbuffer
\processASYbuffer[ASY]
}

\starttext
AAA
\startASY
import graph;
draw((0,0)--(100,100));
\stopASY

BBB
\mycircle{100}


%CCC
%\mycircle{50}

%DDD
%\mycircle{200}

\stoptext





Dne 22.12.16 5:49, ntg-context za uživatele Aditya Mahajan 
<ntg-context-boun...@ntg.nl za uživatele adit...@umich.edu> napsal(a):

On Tue, 20 Dec 2016, Jaroslav Hajtmar wrote:

> very much for your Metapost example. This I certainly sufficient for the 
> production of simple images for my ideas.

> \define[1]\mycircle{
>   \startASY
>   import graph;
>   draw(Circle((0,0),#1));
>   \stopASY
> }
>
> \starttext
> \mycircle{20}
> \mycircle{30}
> \mycircle{40}
> \stoptext

It is already feasible to define something this simple using the filter 
module. I don't have asymptote installed on the machine that I am 
currently working on, but here is an example that uses pandoc.

\usemodule[filter]

\defineexternalfilter
 [MARKDOWN]
 [
   filtercommand={pandoc -f markdown -t context 
\externalfilterinputfile\space -o \externalfilteroutputfile},
   cache=yes,
   purge=no, % Just for testing. May be removed.
 ]

\define[1]\TEST
 {\setbuffer[MARKDOWN]This is #1\endbuffer
  \processMARKDOWNbuffer[MARKDOWN]}

\starttext
\startMARKDOWN
   This is **one**
\stopMARKDOWN

\TEST{**ONE**}

\TEST{_TWO_}
\stoptext

With this method, the results are not cached. Let me know if this works 
for your needs.

Aditya

___
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

___

___
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
___

Re: [NTG-context] Asymptote or Metapost and ConTeXt parameters.

2016-12-20 Thread Jaroslav Hajtmar
Thanx Aditya 
very much for your Metapost example. This I certainly sufficient for the 
production of simple images for my ideas. I attach source code, which outlines 
how I imagined inserting Asymptote images into Context. In the lower part of 
commented code is fully functional, compiled ConTEXt of TeX Live 2016 (included 
in the package is also Asymptote). My idea is that Asymptote code is part of my 
ConTeXt macro and parameters of macro are passed into Asymptote. My example 
does not work because Asymptote is probably not enough linked with Context. I 
am very grateful that You would to deal with my problem. 

I am not sure whether it will do Asymptote example as in the case Metapost. 
That's why I use  filter in my own example (taken from 
https://mailman.ntg.nl/pipermail/ntg-context/2015/080581.html ).


Thank you once again.

Jaroslav Hajtmar



\usemodule[filter]

\defineexternalfilter
   [ASY]
   [
 filter={asy -tex "context" -outformat pdf
 -outname \externalfilteroutputfile},
 output=\externalfilterbasefile.pdf,
 cache=yes,
 readcommand=\ReadImage,
   ]

\define[1]\ReadImage{\externalfigure[#1]}

\define[1]\mycircle{
\startASY
import graph;
draw(Circle((0,0),#1));
\stopASY
}

\starttext
\mycircle{20}
\mycircle{30}
\mycircle{40}
\stoptext


%% simple asymptote example (compiled ConTeXt (LuaTeX) from TeX Live 2016)
%
%\usemodule[filter]
%
%\defineexternalfilter
%   [ASY]
%   [
% filter={asy -tex "context" -outformat pdf
% -outname \externalfilteroutputfile},
% output=\externalfilterbasefile.pdf,
% cache=yes,
% readcommand=\ReadImage,
%   ]
%
%\define[1]\ReadImage{\externalfigure[#1]}
%
%\starttext
%\startASY
%import graph;
%draw(Circle((0,0),20));
%\stopASY
%\stoptext


Dne 19.12.16 17:19, ntg-context za uživatele Aditya Mahajan 
<ntg-context-boun...@ntg.nl za uživatele adit...@umich.edu> napsal(a):

On Mon, 19 Dec 2016, Jaroslav Hajtmar wrote:

> There is a similar possibility, at least in Metapost? For simpler 
> pictures it would probably suffice 

The ability to pass parameters to metapost has been around since the 
beginning. See the metafun manual for details (search for MPvar). For 
simple images, you can also do:

\define[1]\Circle{\startMPcode draw fullcircle scaled #1*cm; \stopMPcode}

\Circle{1} \Circle{2} \Circle{3}

> Is there a way to pass the ConTeXt parameter which influenced the 
> creation of the Asymptote image? My point eg. the ability to define 
> macros, which gave its parameters to Asymptote procedure or function and 
> depending on these parameters, the image created by Asymptote looked 
> differently.

In principle, something similar to \MPvar can work for asymptote as well 
(or one could do parse the content in Lua rather than expand variables in 
TeX).

> Before starting work on an illustrative example I am asking, whether it 
> makes sense to deal with such a thing ... I suppose the impossibility of 
> combining asymptote code and such Lua code (or not?).

ConTeXt and Metapost are very well integrated, even in MkII. The same 
ideas could work with other graphic backends as well (Asymptote, tikz, and 
others). But it does require a good knowledge of the graphics package.

I am willing to write the code at the context end, if someone who knows 
asymptote can tell me what needs to be done at the asymptote end.

Aditya

___
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

___

___
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
___

[NTG-context] Asymptote or Metapost and ConTeXt parameters.

2016-12-18 Thread Jaroslav Hajtmar
Hello ConTeXtist,
I saw the opportunity to insert an Asymptote picture into Context source code 
(due filter).
For example here: https://mailman.ntg.nl/pipermail/ntg-context/2015/080581.html

Is there a way to pass the ConTeXt parameter which influenced the creation of 
the Asymptote image? My point eg. the ability to define macros, which gave its 
parameters to Asymptote procedure or function and depending on these 
parameters, the image created by Asymptote looked differently.

Before starting work on an illustrative example I am asking, whether it makes 
sense to deal with such a thing ... I suppose the impossibility of combining 
asymptote code and such Lua code (or not?).

There is a similar possibility, at least in Metapost? For simpler pictures it 
would probably suffice 

Thanx
Jaroslav Hajtmar

___
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
___

[NTG-context] Overlays and layers documentation?

2016-11-21 Thread Jaroslav Hajtmar
Hello ConTeXist.
Is there any documentation or manual, where I could read some details about 
using of overlays and layers in ConTeXt? I see on the Internet and wiki 
ConTeXtgarden some examples, but I would be interested in details relating to 
the default layers and their names, their order. Are there any restrictions 
(number, name, etc.)

Thanx
Jaroslav Hajtmar
___
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
___

Re: [NTG-context] Strange bug in the latest version of ConTeXt - start-stop table problem

2016-05-01 Thread Jaroslav Hajtmar
Thanx Wolfgang for the correction of my code. This error is probably 
more than 8 years old (inside predefined macros in any old library 
code). ConTeXt was all existing time generously tolerant for my bug :-).


One more thanx for their fix.

Jaroslav Hajtmar



Dne 01.05.16 v 9:50 Wolfgang Schuster napsal(a):

Jaroslav Hajtmar <mailto:hajt...@gyza.cz>
1. Mai 2016 um 07:52
Thanx Wolfgang for reply.
I looked for possible mistakes in my library, and finally I find out 
that described error that bug is reflecting when I use \starttable 
--- \stoptable environment. I am sending now an minimal example that 
illustrates the problem. I am aware that work with tables of this 
type is not recommended, however, I was surprised that in a previous 
version of standalone ConTeXt the bug did not show. Is there any 
changes in code, which is related with tables typing?


Thanks Jaroslav Hajtmar

Here is minimal example:



\starttext

\starttable[|l w50mm|c|]

You forgot the braces around the cell width:

\starttable[|lw(50mm)|c|]

\NC \NC {\bf } \MR

1. You forgot the \NC after the last cell.

2. You don’t need the braces for the font switch because font changes 
are always local to a cell.


\NC \NC \bf  \NC\MR

Wolfgang


___
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
___

Re: [NTG-context] Strange bug in the latest version of ConTeXt - start-stop table problem

2016-04-30 Thread Jaroslav Hajtmar

Thanx Wolfgang for reply.
I looked for possible mistakes in my library, and finally I find out 
that described error that bug is reflecting when I use \starttable --- 
\stoptable environment. I am sending now an minimal example that 
illustrates the problem. I am aware that work with tables of this type 
is not recommended, however, I was surprised that in a previous version 
of standalone ConTeXt the bug did not show. Is there any changes in 
code, which is related with tables typing?


Thanks Jaroslav Hajtmar

Here is minimal example:



\starttext

\starttable[|l w50mm|c|]
\NC \NC {\bf } \MR
\NC \NC XXX \MR
\stoptable


\stoptext




Dne 27.04.16 v 12:22 Wolfgang Schuster napsal(a):

Jaroslav Hajtmar <mailto:hajt...@gyza.cz>
26. April 2016 um 16:02
Hello ConTeXist.

I have just installed the latest version of ConTeXt standalone. When 
I compiled an my old source code, I received an error:



! You can't use `\Ustopmath' in restricted horizontal mode! You can't 
use `\Ustopmath' in restricted horizontal mode! You can't use 
`\Ustartmath' in restricted horizontal mode! Inline math should end 
with \Ustopmath



This strange error is caused something in my extensive library for 
handling CSV files. I'm not sure why, because in library I am not use 
with any mathematical mode.


I am sorry, but at this moment I am not able to reveal the mistake to 
be able make a minimal example. Some of the older versions (not 
necessarily penultimate) worked without problems. Is there someone 
who help me start look from which point look for a mistake in my code 
library? Thanks for the information.
It’s possible you’re using a math command without enabling math mode 
or you use
the a wrong catcode regime (where _ and ^ work only in math) but 
without a example

there is not much to say.

Wolfgang


___
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
___

[NTG-context] Strange bug in the latest version of ConTeXt

2016-04-26 Thread Jaroslav Hajtmar

Hello ConTeXist.

I have just installed the latest version of ConTeXt standalone. When I 
compiled an my old source code, I received an error:



! You can't use `\Ustopmath' in restricted horizontal mode! You can't 
use `\Ustopmath' in restricted horizontal mode! You can't use 
`\Ustartmath' in restricted horizontal mode! Inline math should end with 
\Ustopmath



This strange error is caused something in my extensive library for 
handling CSV files. I'm not sure why, because in library I am not use 
with any mathematical mode.


I am sorry, but at this moment I am not able to reveal the mistake to be 
able make a minimal example. Some of the older versions (not necessarily 
penultimate) worked without problems. Is there someone who help me start 
look from which point look for a mistake in my code library? Thanks for 
the information.


Jaroslav Hajtmar


___
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
___

Re: [NTG-context] Updating ConTeXt standalone problem on Mac OS X

2016-04-26 Thread Jaroslav Hajtmar

Thanks Monca and Hans for the reply.
I deleted the entire installation tree and I installed again the entire 
ConTeXt and it seems that everything is already OK.


Jaroslav Hajtmar


Dne 26.04.16 v 11:34 Mojca Miklavec napsal(a):

On 26 April 2016 at 11:21, Jaroslav Hajtmar wrote:

Hello ConTeXist
I have a problem with updating ConTeXt on my Mac OS X (El Captain). When you
run the update script to me an error message appears, which surprises me,
since I logged on as the system administrator. Can anyone advise me on what
could be the problem.

Running rsync as an administrator has an ugly consequence that you end
up copying the UID and GUID as-is, so you might end up with files
owned by very strange or perhaps even non-existing users.

Maybe you could play with
 --chown=USER:GROUP
when calling rsync from first-setup.sh to start with.

Who currently owns bin and bin/luatex?

It is not impossible that something changed yesterday though (I was
messing with the server), but the installation works for me. What
happens if you run the installation as a regular user (to a fresh
directory)?

We should look into it, but I need some proper diagnosis first.

Mojca
___
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
___

[NTG-context] Updating ConTeXt standalone problem on Mac OS X

2016-04-26 Thread Jaroslav Hajtmar

Hello ConTeXist
I have a problem with updating ConTeXt on my Mac OS X (El Captain). When 
you run the update script to me an error message appears, which 
surprises me, since I logged on as the system administrator. Can anyone 
advise me on what could be the problem. I note that I am a beginner on OS X.


Here is problematic report:


Jaroslav-MacBook-Air:context hajtmar$ sh first-setup.sh
receiving file list ... done
rsync: failed to set times on "/Users/hajtmar/context/bin": Operation 
not permitted (1)

bin/
rsync: mkstemp "/Users/hajtmar/context/bin/.luatex.y7B2Zy" failed: 
Permission denied (13)


etc....


Thanx
Jaroslav Hajtmar








___
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
___

Re: [NTG-context] For the Mac users: AppleScript to launch ConTeXt in a flexile way

2016-03-23 Thread Jaroslav Hajtmar

Thanks Thomas for the link. For me it will be helpful.

Jaroslav Hajtmar

Dne 24.03.16 v 5:13 Thomas Floeren napsal(a):

Hi,

A small fix for the Typeset Tool:

1.2.5 (64) / 2016-03-22
Notifications now working on El Capitan (10.11).

http://dflect.net/context-typeset-tool/


Best,

--
Tom



___
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
___

[NTG-context] Usedirectory and paths in OSX and Windows

2016-02-15 Thread Jaroslav Hajtmar

Hello ConTeXist.

I use standalone ConTeXt in both OS - Windows and Mac (OSX El Captain) 
together for my onedrive synchronized data. Can anyone advise me whether 
you can somehow arrange compatibility of paths to my libraries? For 
example the following:


In windows I have:

\usedirectory[c:/path/to/myown/library/directory/module/]
\usemodule[mymodule]


Where c:/ is root directory ...


Is there possible put path into library in any "compatibility mode" of 
both OS? Is there any possibility define starting point of path?


If the answer is trivial, than sorry. I note that I am a complete 
beginner MAC OSX and although I advanced user of Windows, then some 
basic things in OSX yet I reveal hardly.



Thanx Jaroslav Hajtmar


___
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
___

Re: [NTG-context] Last version standalone ConTeXt issue.

2016-02-09 Thread Jaroslav Hajtmar

Thanx Hans.
Great! It works fine now! For me it is very useful and important macro.
One more thanx for reply.

Jaroslav Hajtmar



Dne 09.02.16 v 19:50 Hans Hagen napsal(a):

On 2/9/2016 1:28 PM, Jaroslav Hajtmar wrote:

Hello ConTeXist.

In the latest version ConTeXt it stopped working my macros which
contents function  he once advised me Taco. It is low level lua code.
Can anyone advise me what the problem is, eventually. how to replace Lua
code in my function to make it work again? Macros worked at least 6
years and now crashes.

Here is my function:

function thirddata.handlecsv.texmacroisdefined(macroname) -- check
whether macroname macro is defined  in ConTeXt
-- function is used to test whether the user has defined the macro
\macroname. If not, it needs to define any default value
 if token.csname_name(token.create(macroname)) == macroname then
 return true
  else
 return false
 end
end

Is there any alternative (ConTeXt like), which is should be possible use
in Lua code?


\starttext

\startluacode

function interfaces.defined(name)
return token.get_cmdname(token.create(name)) ~= "undefined_cs"
end

if interfaces.defined("foo") then
context("foo")
else
interfaces.setmacro("foo","bar")
end

\stopluacode

\foo

\stoptext

I'll add interfaces.defined to the core.

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-
___ 

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
___

[NTG-context] Last version standalone ConTeXt issue.

2016-02-09 Thread Jaroslav Hajtmar

Hello ConTeXist.

In the latest version ConTeXt it stopped working my macros which 
contents function  he once advised me Taco. It is low level lua code. 
Can anyone advise me what the problem is, eventually. how to replace Lua 
code in my function to make it work again? Macros worked at least 6 
years and now crashes.


Here is my function:

function thirddata.handlecsv.texmacroisdefined(macroname) -- check 
whether macroname macro is defined  in ConTeXt
-- function is used to test whether the user has defined the macro 
\macroname. If not, it needs to define any default value

if token.csname_name(token.create(macroname)) == macroname then
return true
 else
return false
end
end

Is there any alternative (ConTeXt like), which is should be possible use 
in Lua code?


Thanx
Jaroslav Hajtmar


___
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
___

[NTG-context] Problem with rfc4180splitter

2016-01-27 Thread Jaroslav Hajtmar

Hello ConTeXist.
After some time I tried to run my older scripts using the latest version 
of the standalone ConTeXt and I found that my scripts crashing. When I 
testing, I discovered that the culprit is likely to be some change 
splitter utilities.parsers.rfc4180splitter. Can you please advise 
anybody that somehow did change the functionality of this script and 
aproximatelly in which date? The script is the cornerstone of my library 
and I need to find out what had changed in him. I want figure out what 
the problem is.


Thanx very much for help
Jaroslav Hajtmar


___
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
___

[NTG-context] Instalation ConTeXt to MAC - newbie problem

2016-01-17 Thread Jaroslav Hajtmar

Hello ConTeXist.
I am trying to install a standalone ConTeXt on MacBook. I am doing 
everything exactly as instructed on contextgarden.net, but the 
installation will fail. It seems that the problem is with rsync, with 
copying the installation script first-setup.sh into my Mac. Since I am a 
longtime Windows user and I'm a newbie on OS X, I'd like to find out 
what the problem may be. I dont know nothing about OS X, but I suppose 
that might be a problem with the firewall settings or access rights to 
the directories which  I use to install ConTeXt etc. Can someone please 
advise how to perform the installation? There is an option to download 
the installation package and install ConTeXt differently?

Thanks for replies.

Jaroslav Hajtmar

___
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
___

Re: [NTG-context] Instalation ConTeXt to MAC - newbie problem

2016-01-17 Thread Jaroslav Hajtmar

Hello Matthias.
Thank you for the quick response. During installation, no error occurs, 
even seems that rsync copied without error message first-setup.sh to my 
%HOME/context directory. When then I look into this directory, then 
there is no file. Subsequently command sudo sh ./first-setup.sh reports 
nonexistent file or directory. I tried to install it into your 
Applications folder too (I have administrative access), but not in this 
way I have not done.


(As you say: home directory should be safe and path no occure any 
problematic characters. My home directory is "hajtmar")


Thanx Jaroslav

Dne 17.01.16 v 13:27 Weber, Matthias napsal(a):

Hi Jaroslav,

could you explain a bit more what you mean by "the installation will fail”?

What error message do you get at what stage?

You need to make sure that you have write permission to the installation 
directory; anything inside your home directory should be safe.
Also, as a general precaution, make sure the path to your installation 
directory doesn’t contain unusual characters.

Matthias



On Jan 17, 2016, at 7:19 AM, Jaroslav Hajtmar <hajt...@gyza.cz> wrote:

Hello ConTeXist.
I am trying to install a standalone ConTeXt on MacBook. I am doing everything 
exactly as instructed on contextgarden.net, but the installation will fail. It 
seems that the problem is with rsync, with copying the installation script 
first-setup.sh into my Mac. Since I am a longtime Windows user and I'm a newbie 
on OS X, I'd like to find out what the problem may be. I dont know nothing 
about OS X, but I suppose that might be a problem with the firewall settings or 
access rights to the directories which  I use to install ConTeXt etc. Can 
someone please advise how to perform the installation? There is an option to 
download the installation package and install ConTeXt differently?
Thanks for replies.

Jaroslav Hajtmar

___
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
___

Re: [NTG-context] Instalation ConTeXt to MAC - newbie problem

2016-01-17 Thread Jaroslav Hajtmar

Hello.
Thanks to Otared and Matthias too for their solutions. Otared's method 
is working, Mathias method unfortunaly not working. ConTeXt is already 
installed on my MacBookAir. I dont know why, but It seems that for some 
reason rsync does not download the first-setup.sh file into my 
installation directory. After I put first-setup.sh file manually into 
install directory and then I run the installation script, then 
everything is all right till the end. At this moment, I still struggle 
with settings an appropriate environment variables so that everything 
worked like on my Windows PC installation. Running at (for me) an 
unfamiliar OS-X it is for me still long run (but adventurous) :-).
However installation on my MAC is currently commissioned and 
operational. Thanks for the advices.


Jaroslav Hajtmar



Dne 17.01.16 v 14:38 Otared Kavian napsal(a):

Hello Jaroslav,

Here is what I do on my Mac:

1) While in the Finder, create a folder named Context-standalone

2) Put the attached file « first-setup.sh »  in the folder Context-standalone

3) Open Terminal and issue the command

cd [Path-to-the-folder-Context-standalone]

4) Then in Terminal issue the command

ls first-setup.sh

you should see something beginning with:

-rwxr-xr-x

that is the file has an « x » in its or your rights, that is it is executable.

If this not the case, using the command below make sure it has that right:

chmod +x first-setup.sh

5) Once this is done, issue the command

sh first-setup.sh

6) In principle you should end up with all files necessary for Context working 
in the folder Context-standalone

7) If this is not the case, please report at which step things do not work as 
expected.

Best regards: OK







On 17 Jan 2016, at 14:08, Jaroslav Hajtmar <hajt...@gyza.cz> wrote:

Hello Matthias.
Thank you for the quick response. During installation, no error occurs, even 
seems that rsync copied without error message first-setup.sh to my 
%HOME/context directory. When then I look into this directory, then there is no 
file. Subsequently command sudo sh ./first-setup.sh reports nonexistent file or 
directory. I tried to install it into your Applications folder too (I have 
administrative access), but not in this way I have not done.

(As you say: home directory should be safe and path no occure any problematic characters. 
My home directory is "hajtmar")

Thanx Jaroslav

Dne 17.01.16 v 13:27 Weber, Matthias napsal(a):

Hi Jaroslav,

could you explain a bit more what you mean by "the installation will fail”?

What error message do you get at what stage?

You need to make sure that you have write permission to the installation 
directory; anything inside your home directory should be safe.
Also, as a general precaution, make sure the path to your installation 
directory doesn’t contain unusual characters.

Matthias



On Jan 17, 2016, at 7:19 AM, Jaroslav Hajtmar <hajt...@gyza.cz> wrote:

Hello ConTeXist.
I am trying to install a standalone ConTeXt on MacBook. I am doing everything 
exactly as instructed on contextgarden.net, but the installation will fail. It 
seems that the problem is with rsync, with copying the installation script 
first-setup.sh into my Mac. Since I am a longtime Windows user and I'm a newbie 
on OS X, I'd like to find out what the problem may be. I dont know nothing 
about OS X, but I suppose that might be a problem with the firewall settings or 
access rights to the directories which  I use to install ConTeXt etc. Can 
someone please advise how to perform the installation? There is an option to 
download the installation package and install ConTeXt differently?
Thanks for replies.

Jaroslav Hajtmar

___
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

Re: [NTG-context] Instalation ConTeXt to MAC - newbie problem

2016-01-17 Thread Jaroslav Hajtmar

Hello Otared.
Thanks for inspiring advice. Be sure that I will try everything setting 
up so that I ConTeXt work as on my PC and Windows. After 25 years of 
using Windows, I would never say that I will experiment with MacBook and 
OS-X. At the moment, I am pleased that I cease to be dependent on any OS 
platform and freely move between multiple computers with different 
operating systems. It's a super feeling that after twenty years, I feel 
that I am not dependent on a particular computer. With most of the 
software I have no problem, I just ConTeXt still missed on the MacBook. 
Now it's all OK.
Thanks for the advice, perhaps maybe I'll ever for you further advice 
about ConTeXt on OS-X.


Jaroslav Hajtmar

Dne 17.01.16 v 17:57 Otared Kavian napsal(a):

Hi Jaroslav,

On Mac, you can use TeXShop and your standalone Context very easily.
First create a specific « .engine » file for this and then in TeXShop 
use that engine.

Here is what I have when I typeset a file in TeXShop using mkiv ConTeXt:

% begin file mkiv.engine

#!/bin/bash

export PATH=/Volumes/OK/context-minimal/tex/texmf-osx-64/bin:$PATH
context --synctex=zipped --autogenerate "$1" --purgeall

% end file mkiv.engine

you should replace the line « export PATH=…. » by the path to your 
installation of ConTeXt. More precisely you should replace


/Volumes/OK/context-minimal

with the path going to the folder where your Context installation sits 
(in your case it is where you have put the file first-setup.sh).


Then this file « mkiv.engine » should be put in the folder

Library/TeXShop/Engines


Once this is done, you have three solutions in order to use TeXShop 
with your standalone Context. Here they are:


Solution 1: add the following line at the top of your source file:

%!TEX TS-program = mkiv

Note that in the above you may replace « mkiv » with whatever engine 
name known to your TeXShop installation (for instance « ContextSuite», 
or any other name you have, or (may God forgive both of us…) even « 
latex »…).

When you typeset with ConTeXt, then TeXShop will use the chosen engine.

Solution 2: when your source file is open, you should have, at the top 
of your window, a small menu named « Program ». Click on that menu and 
among the programs (that is the engines) choose the one you want.


Solution 3: open the TeXShop Preferences and in the « Typesetting » 
pane , on the upper left part of the resulting window, choose the 
radio button « Command listed below » and type the name of your 
preferred engine. This method makes a general default, so if you use 
some other typesetting packages for some files you have to modify 
things for those files.


Best regards: OK

On 17 Jan 2016, at 16:56, Jaroslav Hajtmar <hajt...@gyza.cz 
<mailto:hajt...@gyza.cz>> wrote:


Hello.
Thanks to Otared and Matthias too for their solutions. Otared's 
method is working, Mathias method unfortunaly not working. ConTeXt is 
already installed on my MacBookAir. I dont know why, but It seems 
that for some reason rsync does not download the first-setup.sh file 
into my installation directory. After I put first-setup.sh file 
manually into install directory and then I run the installation 
script, then everything is all right till the end. At this moment, I 
still struggle with settings an appropriate environment variables so 
that everything worked like on my Windows PC installation. Running at 
(for me) an unfamiliar OS-X it is for me still long run (but 
adventurous) :-).
However installation on my MAC is currently commissioned and 
operational. Thanks for the advices.


Jaroslav Hajtmar



Dne 17.01.16 v 14:38 Otared Kavian napsal(a):

Hello Jaroslav,

Here is what I do on my Mac:

1) While in the Finder, create a folder named Context-standalone

2) Put the attached file « first-setup.sh »  in the folder 
Context-standalone


3) Open Terminal and issue the command

cd [Path-to-the-folder-Context-standalone]

4) Then in Terminal issue the command

ls first-setup.sh

you should see something beginning with:

-rwxr-xr-x

that is the file has an « x » in its or your rights, that is it is 
executable.


If this not the case, using the command below make sure it has that 
right:


chmod +x first-setup.sh

5) Once this is done, issue the command

sh first-setup.sh

6) In principle you should end up with all files necessary for 
Context working in the folder Context-standalone


7) If this is not the case, please report at which step things do 
not work as expected.


Best regards: OK






On 17 Jan 2016, at 14:08, Jaroslav Hajtmar <hajt...@gyza.cz 
<mailto:hajt...@gyza.cz>> wrote:


Hello Matthias.
Thank you for the quick response. During installation, no error 
occurs, even seems that rsync copied without error message 
first-setup.sh to my %HOME/context directory. When then I look into 
this directory, then there is no file. Subsequently command sudo sh 
./first-setup.sh reports nonexistent file or directory. I tried to 

[NTG-context] Next problem with rfc4180splitter()

2015-09-28 Thread Jaroslav Hajtmar

Hello ConTeXist,

Some time ago, Hans solved my problem with the splitter. Now I solve 
correction an error in my module, which to me signaled Pablo Rodriguez. 
The problem is with jednosloupcovými CSV files, which thus do not 
contain separators row fields. Pablo say, that CSV files without colon 
contains separators, because line breaks are separators. Commas—or 
semicolons—are required when having more than a cell in the same line.
For example LibreOffice Calc spares the final semicolon when only the 
file only contains one column and this behavior seems to be right, 
according to the RFC4180: Common Format and MIME Type for 
Comma-Separated Values (CSV) Files. We think that the final comma 
separator should optional, not mandatory.


The following example shows, however, that rfc4180splitter () in 
onecolumn CSV file fails and falls with an error. Making I'm a mistake 
somewhere, or is something else wrong with the splitter?

Thanx Jaroslav Hajtmar

Here is minimal example:

\starttext

% mycsvfile.txt content one column data without separator:
% a
% b
% c
% d
% e
% f

% myothercsvfile.txt content two columns data:
% a,1
% b,2
% c,3
% d,4
% e,5
% f,6


\startluacode

local mycsvsplitter = utilities.parsers.rfc4180splitter()
-- local crap = io.loaddata("mycsvfile.txt") -- crashed (error code 
attempt to index field - a nil value)

local crap = io.loaddata("myothercsvfile.txt") -- work fine
local list, names = mycsvsplitter(crap)inspect(list) inspect(names)

l = list

for i = 1, 6 do
context(l[i][1]..', ')
end

\stopluacode


\stoptext

___
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
___

[NTG-context] Error notification on the wiki (Loops_and_Recursion)

2015-09-28 Thread Jaroslav Hajtmar

Hello ConTeXist.
Obviously, I discovered a mistake on the ConTeXt wiki. In section of 
cycles at URL 
http://wiki.contextgarden.net/System_Macros/Loops_and_Recursion are 
mentioned macros \looplevel and \loopdepth.

(In text: When needed, one can call for \looplevel and \loopdepth.)
It seems, that these macros are not defined. Or I make anything wrong?

Jaroslav Hajtmar

___
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
___

Re: [NTG-context] \doifnotmodeelse - undefined control sequence error?

2015-09-15 Thread Jaroslav Hajtmar

Thanx to Wolfgang and Aditya too,
I was a little confused, because in wiki is this command mentioned. 
Thanx for explanation and correction in wiki too.

Jaroslav Hajtmar


Dne 15. 9. 2015 v 15:49 Aditya Mahajan napsal(a):

On Tue, 15 Sep 2015, Wolfgang Schuster wrote:


Jaroslav Hajtmar <mailto:hajt...@gyza.cz>
15. September 2015 11:31
Hello ConTeXist.

I do not know if I'm not mistake somewhere, but it seems to me that 
the macro \doifnotmodeelse does not work. Can anyone verify this?
There is no command with this name because there is no need for it 
and it won’t be different from \doifmodeelse with the exception that 
the second and third arguments are switched. Below is a short summary 
of the available mode tests.


The \doifmode{}{} command is used when you want to show/enable 
something when the requested mode is enabled.


The \doifnotmode{}{} command is used when you to show/enable 
something when the requested mode is disable or not set.


With the \doifelsemode{}{}{} (you can also use the alternative name 
\doifmodeelse) you can show/enable different things dependent whether 
the requested mode is enabled or disabled.


My bad. I thought that I had checked this when writing the article on 
modes. I'll update the wiki accordingly.


Aditya


___
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
___

[NTG-context] \doifnotmodeelse - undefined control sequence error?

2015-09-15 Thread Jaroslav Hajtmar

Hello ConTeXist.

I do not know if I'm not mistake somewhere, but it seems to me that the 
macro \doifnotmodeelse does not work. Can anyone verify this?



Jaroslav Hajtmar


Here is a simple example:


\enablemode[mymode]
% \disablemode[mymode]

\starttext

\startmode[mymode]
mode 'mymode' is enabled!
\stopmode

\startnotmode[mymode]
mode 'mymode' is disbled!
\stopnotmode


\doifmodeelse{mymode}{mode 'mymode' is enabled!}{mode 'mymode' is disbled!}

% Undefined control sequence error ???
% \doifnotmodeelse{mymode}{mode 'mymode' is disbled!}{mode 'mymode' is 
enabled!}



\stoptext


___
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
___

[NTG-context] Dig out contents of the TeX macro using Lua

2015-07-14 Thread Jaroslav Hajtmar

Hello ConTeXist.
I hope that my crazy questions not much bother.
This time I needed to get to the fair value of the parameter, delivering 
to lua function over the content macros.
Obviously it's my misunderstanding of the functioning of expansion in 
case maker with optional parameters, or you really can not explain the 
functioning of the transmission values. It seems that is passed to a 
sort of reference as to the actual contents of the macro perhaps can not 
even get through Lua. Or did they?

The following minimal example, perhaps explain what going on.

The question ultimately: Is there any alternative how using Lua somehow 
easily evaluate the macro content? For example to determine whether two 
different macros have the same content?


Jaroslav Hajtmar

here is minimal example:

\starttext

This works as expected:

\def\makrowithcontent{}

\edef\testparameter#1{%
\startluacode
local parameter='#1'
if parameter=='' then context('TRUE. ') else context('FALSE. ') end
context('Parameter '..parameter..' has length '..string.len(parameter))
\stopluacode
}%

\type{\makrowithcontent} -- \makrowithcontent

Test is \testparameter{}

Test is \testparameter{} % OK

Test is \testparameter{\makrowithcontent} % OK

But what about with this: ???


% initialize values
\startluacode
A={}
for i=1,50 do A[i]='Record '..tostring(i) end
A[25]=''
\stopluacode


\def\makrowithcontent{}

\def\lastname{\dosingleempty\dolastname}%
\def\dolastname[#1]{\doifsomethingelse{#1}{\ctxlua{context(A[#1])}}{\makrowithcontent}}%


\type{\lastname} - \lastname

\type{\lastname[2]} - \lastname[2]

\type{\lastname[5]} - \lastname[5]

\type{\lastname[25]} - \lastname[25]





\edef\readandprocessparameters#1#2{%
\startluacode
local parameter1='#1'
if parameter1=='' then context('Test '..parameter1..' =  is 
TRUE. ') else context('Test '..parameter1..' =  is FALSE. ') end
context('Parameter 1 = '..parameter1..' has length 
'..string.len(parameter1))

context('\\crlf')
local parameter2='#2'
if parameter2=='' then context('Test '..parameter2..' =  is 
TRUE. ') else context('Test '..parameter2..' =  is FALSE. ') end
context('Parameter 2 = '..parameter2..' has length 
'..string.len(parameter2))

context('\\crlf')
\stopluacode
}%


\readandprocessparameters{}{}

%Test is \readandprocessparameters{\lastname[25]}{\lastname} % Crashed

\readandprocessparameters{\\lastname[25]}{\\lastname}

\stoptext

___
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
___

Re: [NTG-context] Using lua to define a macro with one optional parameter in brackets

2015-07-13 Thread Jaroslav Hajtmar

Thanks Hans.
At this moment, it works fine. For me it is quite essential novelty and 
it is very much handy for me.
It seems that works only in the standalone version because version in 
TeXlive 2014 version it tells an error message (but does not matter on 
it). I want to even ask how you can write a macro with one or more 
parameters?
Now the parameter in square brackets displayed together with the 
contents of the macro. You can do this at all? It would get any minimal 
example?

Thanks again for your support.

Jaroslav Hajtmar


Dne 9. 7. 2015 v 17:24 Hans Hagen napsal(a):

On 7/9/2015 5:05 PM, Jaroslav Hajtmar wrote:

Thanx to Hans and Taco too,

ad Taco) ala Perhaps interfaces.definecommand could be extended with a
way to do global definitions?
Indeed it seems to me. Changes in lua code does not affect the results
in ConTeXt.

ad Hans) interfaces.setmacro(name,value)

Thanx, II tried to use it, but somehow I can not realize what I wanted.
Not available somewhere a minimal example? I tried to scan codes in the
folder with the installation of ConTeXt, but I never encountered a
working example of where you could bounce.
Thanks Jaroslav Hajtmar


\starttext

\startluacode
interfaces.setmacro(foo,bar)
\stopluacode

\foo

\start
\startluacode
interfaces.setmacro(foo,foo,global)
\stopluacode
\stop

\foo

\stoptext

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___ 

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
___

Re: [NTG-context] Using lua to define a macro with one optional parameter in brackets

2015-07-10 Thread Jaroslav Hajtmar

Thanks Hans.
At this moment, it works fine. For me it is quite essential novelty and 
it is very much handy for me.
It seems that works only in the standalone version because version in 
TeXlive 2014 version it tells an error message (but does not matter on 
it). I want to even ask how you can write a macro with one or more 
parameters?
Now the parameter in square brackets displayed together with the 
contents of the macro. You can do this at all? It would get any minimal 
example?

Thanks again for your support.

Jaroslav Hajtmar


Dne 9. 7. 2015 v 17:24 Hans Hagen napsal(a):

On 7/9/2015 5:05 PM, Jaroslav Hajtmar wrote:

Thanx to Hans and Taco too,

ad Taco) ala Perhaps interfaces.definecommand could be extended with a
way to do global definitions?
Indeed it seems to me. Changes in lua code does not affect the results
in ConTeXt.

ad Hans) interfaces.setmacro(name,value)

Thanx, II tried to use it, but somehow I can not realize what I wanted.
Not available somewhere a minimal example? I tried to scan codes in the
folder with the installation of ConTeXt, but I never encountered a
working example of where you could bounce.
Thanks Jaroslav Hajtmar


\starttext

\startluacode
interfaces.setmacro(foo,bar)
\stopluacode

\foo

\start
\startluacode
interfaces.setmacro(foo,foo,global)
\stopluacode
\stop

\foo

\stoptext

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___ 

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
___

Re: [NTG-context] Using lua to define a macro with one optional parameter in brackets

2015-07-09 Thread Jaroslav Hajtmar

Thanx to Hans and Taco too,

ad Taco) ala Perhaps interfaces.definecommand could be extended with a 
way to do global definitions?
Indeed it seems to me. Changes in lua code does not affect the results 
in ConTeXt.


ad Hans) interfaces.setmacro(name,value)

Thanx, II tried to use it, but somehow I can not realize what I wanted. 
Not available somewhere a minimal example? I tried to scan codes in the 
folder with the installation of ConTeXt, but I never encountered a 
working example of where you could bounce.

Thanks Jaroslav Hajtmar



Dne 9. 7. 2015 v 11:07 Hans Hagen napsal(a):

On 7/9/2015 7:22 AM, Jaroslav Hajtmar wrote:

Hi Hans.
Only for explanation of my (maybe) crazy request:
I can not at this level TeX macros to create, because it creates
automatically after opening the CSV file. Although I tried to start
creating something with \ csname \ endcsname etc. but my experiments
with this method were never successful. In addition with TeX probably I
can not work as well as with Lua (for things which in this case I need
ie. at low level). Given that I have a CSV file loaded in global
variables and header information at my disposal, I Lua everything you
need me to do what I need. The problem is that the macros created in Lua
I sometimes do not work as well when I create TeX (during the cycle will
automatically fall short values). I have a particularly bad experience
in this regard with the construction, he sent Taco.

Simplified version of interfaces.definecommand construction does not
in my way of processing the results of what I expected.


interfaces.setmacro(name,value)


Module which at the moment I work (in collaboration with Pablo
Rodriguez) at the moment is very complex and extensive, and already it
slowly begin to lose myself :-), so I try to get any information from
the conference.
Thank you and also to other counselors too at the conference for their
cooperation in solve my problems.

Jaroslav Hajtmar




Dne 8. 7. 2015 v 20:54 Hans Hagen napsal(a):

On 7/8/2015 4:11 PM, Jaroslav Hajtmar wrote:

Thanks Taco very much.

At this point, it really works in simple situations, but in the event
that this solution will incorporate into the existing system, then I
have big problems with expansion (values are not updated in macros). I
need more solutions using something like context.setgvalue, or at 
least

according to the following example. If they could incorporate the
remaining two definitions
ie
\def\simpleA {content when parameter is missing}
\def\complexA[#1]{parameter #1}

into luacode (probably encounter a problem with #), so it might work.
Can not think of anyone, how it could be done differently?
Thanks Jaroslav Hajtmar

Here is minimal example:

\ctxlua{
xlsname='A'
content='content when parameter is missing'
context([[\definecomplexorsimple\]]..xlsname)
%context([[\def\simple]]..xlsname..[[{]]..content..[[}]])
%context([[\def\complex]]..xlsname..'[#1]'..[[{Neco: #1}]])
}

\def\simpleA {content when parameter is missing}
\def\complexA[#1]{parameter #1}


why don't you define these commands at the tex level

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___ 



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
___

Re: [NTG-context] Using lua to define a macro with one optional parameter in brackets

2015-07-08 Thread Jaroslav Hajtmar

Hi Taco.
full deployment is unfortunately not working.

Unfortunately I need to cycle create different macros whose names are 
variable. At this moment I can not deal with this:


   --- context.doxlsname() --- ?


Thanx Jaroslav Hajtmar

here is another minimal example:



\starttext


\def\linepointer{5}

\def\csvcell[#1,#2]{cell #1,#2}


\directlua{
xlsname='A'
interfaces.definecommand ('do'..xlsname, {
arguments = { { option, string }  },
macro = function (opt_1)
  if #opt_10 then 
context('\\csvcell['..xlsname..','..opt_1..']') else 
context('\\csvcell['..xlsname..',\\linepointer]') end

end
})
interfaces.definecommand (xlsname, {
macro = function ()
   context.dosingleempty()
   --- context.doxlsname() --- ?
end
})
}


\csvcell['Firstname',\linepointer]


\A

\A[5]




\stoptext



Dne 8. 7. 2015 v 12:07 Taco Hoekwater napsal(a):

\startluacode
interfaces.definecommand ('dolastname', {
 arguments = { { option, string }  },
 macro = function (opt_1)
if #opt_10 then context(opt_1) else context('nothing') end
 end
})
interfaces.definecommand ('lastname', {
 macro = function ()
context.dosingleempty()
context.dolastname()
 end
})
\stopluacode


___
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
___

Re: [NTG-context] Using lua to define a macro with one optional parameter in brackets

2015-07-08 Thread Jaroslav Hajtmar

Thanx Taco for reply.

the minimal example see bellow not crashed, but \A macro is not created.
I don't Know in what could still be a problem. Example I am even more 
minimalize


Thanx Jaroslav




\starttext


\directlua{
xlsname='A'
interfaces.definecommand ('do'..xlsname, {
arguments = { { option, string }  },
macro = function (opt_1)
   if #opt_10 then context(opt_1) else context('nothing') end
end
})
interfaces.definecommand (xlsname, {
macro = function ()
   context.dosingleempty()
 context['do'..xlsname]()
end
})
}

% \A[5]
%
%
% \A



\stoptext


Dne 8. 7. 2015 v 13:28 Taco Hoekwater napsal(a):

On 08 Jul 2015, at 13:04, Jaroslav Hajtmar hajt...@gyza.cz wrote:

Hi Taco.
full deployment is unfortunately not working.

Unfortunately I need to cycle create different macros whose names are variable. 
At this moment I can not deal with this:

   --- context.doxlsname() --- ?

context[‘do’..xlsname]()



Thanx Jaroslav Hajtmar

here is another minimal example:



\starttext


\def\linepointer{5}

\def\csvcell[#1,#2]{cell #1,#2}


\directlua{
xlsname='A'
interfaces.definecommand ('do'..xlsname, {
arguments = { { option, string }  },
macro = function (opt_1)
  if #opt_10 then context('\\csvcell['..xlsname..','..opt_1..']') else 
context('\\csvcell['..xlsname..',\\linepointer]') end
end
})
interfaces.definecommand (xlsname, {
macro = function ()
   context.dosingleempty()
   --- context.doxlsname() --- ?
end
})
}


\csvcell['Firstname',\linepointer]


\A

\A[5]




\stoptext



Dne 8. 7. 2015 v 12:07 Taco Hoekwater napsal(a):

\startluacode
interfaces.definecommand ('dolastname', {
 arguments = { { option, string }  },
 macro = function (opt_1)
if #opt_10 then context(opt_1) else context('nothing') end
 end
})
interfaces.definecommand ('lastname', {
 macro = function ()
context.dosingleempty()
context.dolastname()
 end
})
\stopluacode




___
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
___

[NTG-context] Using lua to define a macro with one optional parameter in brackets

2015-07-08 Thread Jaroslav Hajtmar

Hello ConTeXist.

Within the one very complex problem I need to solve the following case. 
I want using lua code to define a macro with one optional parameter in 
brackets. I tried it using commands context.setgvalue, or find something 
on the wiki
(http://wiki.contextgarden.net/System_Macros/Definitions_and_Assignments), 
but each time I broke a tooth on it.


Can you, please, someone advise  how something can be it done? Suffice 
some reference to solve a similar problem.


Thanks Jaroslav Hajtmar

Here is my minimal example:

\starttext

\def\lastname{\dosingleempty\dolastname}
\def\dolastname[#1]{\iffirstargument #1\else nothing\fi}

\lastname

\lastname[Smith]


% Not working
% \ctxlua{
% context([[\def\firstname{\dosingleempty\dofirstname}]])
% context([[\def\dofirstname[#1]{\iffirstargument #1\else {nothing}\fi}]])
% }
%
% \firstname
%
% \firstname['Peter']

\stoptext




___
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
___

Re: [NTG-context] Using lua to define a macro with one optional parameter in brackets

2015-07-08 Thread Jaroslav Hajtmar

Thanks Taco,
your solution helped me ... Based on initial tests, it seems that it 
works correctly. I'll know more after thorough testing.

Once again, thank you many times.
Sincerely Jaroslav Hajtmar


Dne 8. 7. 2015 v 12:07 Taco Hoekwater napsal(a):

On 08 Jul 2015, at 11:05, Jaroslav Hajtmar hajt...@gyza.cz wrote:

Hello ConTeXist.

Within the one very complex problem I need to solve the following case. I want 
using lua code to define a macro with one optional parameter in brackets.

Simplest solution I know is this:

\startluacode
interfaces.definecommand ('dolastname', {
 arguments = { { option, string }  },
 macro = function (opt_1)
if #opt_10 then context(opt_1) else context('nothing') end
 end
})
interfaces.definecommand ('lastname', {
 macro = function ()
context.dosingleempty()
context.dolastname()
 end
})
\stopluacode

Best wishes,
Taco


___
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
___

Re: [NTG-context] Using lua to define a macro with one optional parameter in brackets

2015-07-08 Thread Jaroslav Hajtmar

Thanks Taco very much.

At this point, it really works in simple situations, but in the event 
that this solution will incorporate into the existing system, then I 
have big problems with expansion (values are not updated in macros). I 
need more solutions using something like context.setgvalue, or at least 
according to the following example. If they could incorporate the 
remaining two definitions

ie
\def\simpleA {content when parameter is missing}
\def\complexA[#1]{parameter #1}

into luacode (probably encounter a problem with #), so it might work. 
Can not think of anyone, how it could be done differently?

Thanks Jaroslav Hajtmar

Here is minimal example:

\ctxlua{
xlsname='A'
content='content when parameter is missing'
context([[\definecomplexorsimple\]]..xlsname)
%context([[\def\simple]]..xlsname..[[{]]..content..[[}]])
%context([[\def\complex]]..xlsname..'[#1]'..[[{Neco: #1}]])
}

\def\simpleA {content when parameter is missing}
\def\complexA[#1]{parameter #1}



\type{\A}: \A

\type{\A[5]}: \A[5]


\stoptext




Dne 8. 7. 2015 v 14:11 Taco Hoekwater napsal(a):

On 08 Jul 2015, at 13:58, Jaroslav Hajtmar hajt...@gyza.cz wrote:

Thanx Taco for reply.

the minimal example see bellow not crashed, but \A macro is not created.
I don't Know in what could still be a problem. Example I am even more minimalize

It works for me after changing \directlua {} to \startluacode … \stopluacode

Best wishes,
Taco






___
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
___

Re: [NTG-context] Using lua to define a macro with one optional parameter in brackets

2015-07-08 Thread Jaroslav Hajtmar

Hi Hans.
Only for explanation of my (maybe) crazy request:
I can not at this level TeX macros to create, because it creates 
automatically after opening the CSV file. Although I tried to start 
creating something with \ csname \ endcsname etc. but my experiments 
with this method were never successful. In addition with TeX probably I 
can not work as well as with Lua (for things which in this case I need 
ie. at low level). Given that I have a CSV file loaded in global 
variables and header information at my disposal, I Lua everything you 
need me to do what I need. The problem is that the macros created in Lua 
I sometimes do not work as well when I create TeX (during the cycle will 
automatically fall short values). I have a particularly bad experience 
in this regard with the construction, he sent Taco.


Simplified version of interfaces.definecommand construction does not 
in my way of processing the results of what I expected.


Module which at the moment I work (in collaboration with Pablo 
Rodriguez) at the moment is very complex and extensive, and already it 
slowly begin to lose myself :-), so I try to get any information from 
the conference.
Thank you and also to other counselors too at the conference for their 
cooperation in solve my problems.


Jaroslav Hajtmar




Dne 8. 7. 2015 v 20:54 Hans Hagen napsal(a):

On 7/8/2015 4:11 PM, Jaroslav Hajtmar wrote:

Thanks Taco very much.

At this point, it really works in simple situations, but in the event
that this solution will incorporate into the existing system, then I
have big problems with expansion (values are not updated in macros). I
need more solutions using something like context.setgvalue, or at least
according to the following example. If they could incorporate the
remaining two definitions
ie
\def\simpleA {content when parameter is missing}
\def\complexA[#1]{parameter #1}

into luacode (probably encounter a problem with #), so it might work.
Can not think of anyone, how it could be done differently?
Thanks Jaroslav Hajtmar

Here is minimal example:

\ctxlua{
xlsname='A'
content='content when parameter is missing'
context([[\definecomplexorsimple\]]..xlsname)
%context([[\def\simple]]..xlsname..[[{]]..content..[[}]])
%context([[\def\complex]]..xlsname..'[#1]'..[[{Neco: #1}]])
}

\def\simpleA {content when parameter is missing}
\def\complexA[#1]{parameter #1}


why don't you define these commands at the tex level

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___ 

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
___

Re: [NTG-context] conTeXt Mkiv: the number of parameters can not be more than 9?

2015-07-04 Thread Jaroslav Hajtmar

Hi Dillon
There is also a purely plaintex solutions for example:


% Here is Peter Olsak solution (see TBN: 
ftp://math.feld.cvut.cz/olsak/tbn/tbn.pdf - czech only)


\def\terminator{*}
\def\usethereadvalues{}
\newcount\tempnum

\def\readparameters{\tempnum=0\let\next=\readonlyone \next}
\def\readonlyone #1, {\advance\tempnum by 1 \def\param{#1}%
%\the\tempnum - \param\par%
\ifx\param\terminator \let\next=\usethereadvalues
\else\expandafter\def \csname param\the\tempnum\endcsname{#1}%
\fi\next}

\def\var#1{\csname #1\endcsname}


\starttext

% Read any number of parameters, terminator is * now
\readparameters 471-44/2007, 474-44/2007, 464-44/2007, 465-44/2007, 
461-44/2007, 472-44/2007, 473-44/2007, 475-44/2007, 469-44/2007, 
455-44/2007, AA, BBB, 124,  *, %


Parameters are now in macros \type{\var{param1}}, \type{\var{param2}}, 
\type{\var{param3}},  \dots :


\blank[big]

\dorecurse{16}{parameter \recurselevel is : \var{param\recurselevel}\crlf}


\blank[big]

% OR

% put parameters into macro:
\def\parameters{A, B, XXL, QWE, 123, Hello, End, TeX, Solution, XSE, 
Flag, Prague, Paris, New York, last value, *, }

% and now read parameters:
\expandafter\readparameters\parameters


\dorecurse{16}{parameter \recurselevel is : \var{param\recurselevel}\crlf}




\stoptext


Jaroslav Hajtmar

Dne 5. 7. 2015 v 3:55 土卜皿 napsal(a):


hi, all

For testing, I have a definition:

|\define[9]\DEFINETEST{#1,#2,#3,#4,#5,#6,#7,#8,#9}|

|context test| can work fine, when I modify the above into:

|\define[10]\DEFINETEST{#1,#2,#3,#4,#5,#6,#7,#8,#9,#10}|

I got a error:

|test.tex: ! Illegal parameter number in definition of\DEFINETEST|

From StackExchange, I got a answer:

Since ConTeXt is based on TeX, the maximum number of 9 parameters is 
inherited


So, in Context mkiv, what should I do for more than 9 parameters?

Thanks!

Best Regards

Dillon



___
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
___

Re: [NTG-context] Problem with rfc4180splitter in last beta?

2015-06-15 Thread Jaroslav Hajtmar
After I read my e-mail the I cut more my source code and I am sending 
now more minimalized version of minimal example


Sorry, Jaroslav Hajtmar


Here is another minimal version:

% csvfile.txt content:
% first,second,third,fourth
% 1,2,3,4
% a,b,c,d
% foo,barbaz,boogie,xyzzy
%



\starttext

\startluacode
 gCSVHeader=true -- works fine when compiled any version of ConTeXt
 --gCSVHeader=false -- crashed, when compiled by last version of 
standalone

 gColNames={}
 gColumnNames={}
 local inpcsvfile='csvfile.txt'
 local currentlyprocessedcsvfile = io.loaddata(inpcsvfile)
 local mycsvsplitter = utilities.parsers.rfc4180splitter{
separator = ',',
quote = '',
}
if gCSVHeader then
 gTableRows, gColumnNames = 
mycsvsplitter(currentlyprocessedcsvfile,true)

 inspect(gTableRows)
 inspect(gColumnNames)
else
  gTableRows = mycsvsplitter(currentlyprocessedcsvfile)
  inspect(gTableRows)
end
 gNumRows=#gTableRows -- Getting number of rows
  gNumCols=#gTableRows[1] -- Getting number of columns

 context.setgvalue(numrows,tostring(gNumRows))
 context.setgvalue(numcols,tostring(gNumCols))
 context.setgvalue(filename,tostring(inpcsvfile))
\stopluacode


File \filename\ has \numrows\ lines and \numcols\ columns.

\stoptext




Dne 15. 6. 2015 v 10:45 Jaroslav Hajtmar napsal(a):

Hi Hans,
I encountered while experimenting with the latest beta version of 
standalone context to a problem when using the splitter. When I 
process without header file then compilation crashed when you compile 
the latest beta version. Conversely, the processing of a header file 
is no problem. ConTEXt while compiling the 2014 TL is fine in both 
cases. I do not know from which beta version was a problem, I 
discovered it by accident until now. Send minimal example. When 
gCSVHeader = true everything is OK when it is gCSVHeader = false and 
compilation fails.



Thanx for any advice
Jaroslav Hajtmar

Here is my minimal version of problematic example:



% csvfile.txt content:
% first,second,third,fourth
% 1,2,3,4
% a,b,c,d
% foo,barbaz,boogie,xyzzy
%



\starttext

\startluacode
 --gCSVHeader=true -- works fine when compiled any version of ConTeXt
 gCSVHeader=false -- crashed, when compiled by last beta version 
of standalone

 gColNames={}
 gColumnNames={}
 local inpcsvfile='csvfile.txt'
 local currentlyprocessedcsvfile = io.loaddata(inpcsvfile)
 local mycsvsplitter = utilities.parsers.rfc4180splitter{
separator = ',',
quote = '',
}
if gCSVHeader then
 gTableRows, gColumnNames = 
mycsvsplitter(currentlyprocessedcsvfile,true)

 inspect(gTableRows)
 inspect(gColumnNames)
 for i=1,#gTableRows[1] do
gColNames[tostring(gColumnNames[i])] = i -- for indexing use
end
else
  gTableRows = mycsvsplitter(currentlyprocessedcsvfile)
  inspect(gTableRows)
  -- ad now set column names for withoutheader situation:
for i=1,#gTableRows[1] do
context(gTableRows[i])
 gColumnNames[i]='c'..(i)
end
end
 gNumRows=#gTableRows -- Getting number of rows
  gNumCols=#gTableRows[1] -- Getting number of columns

 context.setgvalue(numrows,tostring(gNumRows))
 context.setgvalue(numcols,tostring(gNumCols))
 context.setgvalue(filename,tostring(inpcsvfile))
\stopluacode


File \filename\ has \numrows\ lines and \numcols\ columns.

\stoptext
___ 

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
___

Re: [NTG-context] Problem with rfc4180splitter in last beta?

2015-06-15 Thread Jaroslav Hajtmar

Hi Hans.
Once again. It occurred to me to send a minimum Hans's example. When I 
compile with new beta version are the results the same for header and 
noheader versions, while a compilation of TL 2014 Contex proceeds 
differently.



Jaroslav Hajtmar

\starttext

% csvfile.txt content:
% first,second,third,fourth
% 1,2,3,4
% a,b,c,d
% foo,barbaz,boogie,xyzzy
%


\startluacode

local mycsvsplitter = utilities.parsers.rfc4180splitter()
local crap = io.loaddata(csvfile.txt)

local list, names = mycsvsplitter(crap,true)   inspect(list) inspect(names)
-- local list, names = mycsvsplitter(crap)inspect(list) 
inspect(names)


context.starttabulate { |l|r| }
for i=1,#list do
local l = list[i]
context.NC() context(l[1])
context.NC() context(l[3])
context.NC()
context.NR()
end
context.stoptabulate()

\stopluacode

\stoptext







Dne 15. 6. 2015 v 11:00 Jaroslav Hajtmar napsal(a):
After I read my e-mail the I cut more my source code and I am sending 
now more minimalized version of minimal example


Sorry, Jaroslav Hajtmar


Here is another minimal version:

% csvfile.txt content:
% first,second,third,fourth
% 1,2,3,4
% a,b,c,d
% foo,barbaz,boogie,xyzzy
%



\starttext

\startluacode
 gCSVHeader=true -- works fine when compiled any version of ConTeXt
 --gCSVHeader=false -- crashed, when compiled by last version of 
standalone

 gColNames={}
 gColumnNames={}
 local inpcsvfile='csvfile.txt'
 local currentlyprocessedcsvfile = io.loaddata(inpcsvfile)
 local mycsvsplitter = utilities.parsers.rfc4180splitter{
separator = ',',
quote = '',
}
if gCSVHeader then
 gTableRows, gColumnNames = 
mycsvsplitter(currentlyprocessedcsvfile,true)

 inspect(gTableRows)
 inspect(gColumnNames)
else
  gTableRows = mycsvsplitter(currentlyprocessedcsvfile)
  inspect(gTableRows)
end
 gNumRows=#gTableRows -- Getting number of rows
  gNumCols=#gTableRows[1] -- Getting number of columns

 context.setgvalue(numrows,tostring(gNumRows))
 context.setgvalue(numcols,tostring(gNumCols))
 context.setgvalue(filename,tostring(inpcsvfile))
\stopluacode


File \filename\ has \numrows\ lines and \numcols\ columns.

\stoptext




Dne 15. 6. 2015 v 10:45 Jaroslav Hajtmar napsal(a):

Hi Hans,
I encountered while experimenting with the latest beta version of 
standalone context to a problem when using the splitter. When I 
process without header file then compilation crashed when you compile 
the latest beta version. Conversely, the processing of a header file 
is no problem. ConTEXt while compiling the 2014 TL is fine in both 
cases. I do not know from which beta version was a problem, I 
discovered it by accident until now. Send minimal example. When 
gCSVHeader = true everything is OK when it is gCSVHeader = false and 
compilation fails.



Thanx for any advice
Jaroslav Hajtmar

Here is my minimal version of problematic example:



% csvfile.txt content:
% first,second,third,fourth
% 1,2,3,4
% a,b,c,d
% foo,barbaz,boogie,xyzzy
%



\starttext

\startluacode
 --gCSVHeader=true -- works fine when compiled any version of 
ConTeXt
 gCSVHeader=false -- crashed, when compiled by last beta version 
of standalone

 gColNames={}
 gColumnNames={}
 local inpcsvfile='csvfile.txt'
 local currentlyprocessedcsvfile = io.loaddata(inpcsvfile)
 local mycsvsplitter = utilities.parsers.rfc4180splitter{
separator = ',',
quote = '',
}
if gCSVHeader then
 gTableRows, gColumnNames = 
mycsvsplitter(currentlyprocessedcsvfile,true)

 inspect(gTableRows)
 inspect(gColumnNames)
 for i=1,#gTableRows[1] do
gColNames[tostring(gColumnNames[i])] = i -- for indexing use
end
else
  gTableRows = mycsvsplitter(currentlyprocessedcsvfile)
  inspect(gTableRows)
  -- ad now set column names for withoutheader situation:
for i=1,#gTableRows[1] do
context(gTableRows[i])
 gColumnNames[i]='c'..(i)
end
end
 gNumRows=#gTableRows -- Getting number of rows
  gNumCols=#gTableRows[1] -- Getting number of columns

 context.setgvalue(numrows,tostring(gNumRows))
 context.setgvalue(numcols,tostring(gNumCols))
 context.setgvalue(filename,tostring(inpcsvfile))
\stopluacode


File \filename\ has \numrows\ lines and \numcols\ columns.

\stoptext
___ 

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

[NTG-context] Problem with rfc4180splitter in last beta (sticking point was found... maybe)

2015-06-15 Thread Jaroslav Hajtmar

Hello Hans.
I tried to find differences in beta compared to a fully functional 
version of the TL 2014 and I found two changes in the file-utils prs.lua 
compared to a fully functional version of utils-prs.lua in the TL 2014 
version of ConTeXt:


Changes in file utils-prs.lua (beta version) compared to TL 2014 (fully 
functional version):


line no 520 of beta standalone:
specification = specification and 
setmetatableindex(specification,defaultspecification) or 
defaultspecification


while the TL 2014 version line no 478:
specification = specification and 
table.setmetatableindex(specification,defaultspecification) or 
defaultspecification


and next diference:

line no 533 of beta standalone:
local wholeblob   = Ct((newline^(specification.strict and -1 or 1) * 
record)^0)


while the TL 2014 version line no 491:
local wholeblob   = Ct((newline^-1 * record)^0)


When I  change these lines and regenerate ConTeXt format then suddenly 
it works as expected. Of course, you will probably need to make some 
adjustments depending on your idea of a line 533rd.


I hope this information helps a little in search of a problem.


Jaroslav Hajtmar





Dne 15. 6. 2015 v 10:45 Jaroslav Hajtmar napsal(a):

Hi Hans,
I encountered while experimenting with the latest beta version of 
standalone context to a problem when using the splitter. When I 
process without header file then compilation crashed when you compile 
the latest beta version. Conversely, the processing of a header file 
is no problem. ConTEXt while compiling the 2014 TL is fine in both 
cases. I do not know from which beta version was a problem, I 
discovered it by accident until now. Send minimal example. When 
gCSVHeader = true everything is OK when it is gCSVHeader = false and 
compilation fails.



Thanx for any advice
Jaroslav Hajtmar

Here is my minimal version of problematic example:



% csvfile.txt content:
% first,second,third,fourth
% 1,2,3,4
% a,b,c,d
% foo,barbaz,boogie,xyzzy
%



\starttext

\startluacode
 --gCSVHeader=true -- works fine when compiled any version of ConTeXt
 gCSVHeader=false -- crashed, when compiled by last beta version 
of standalone

 gColNames={}
 gColumnNames={}
 local inpcsvfile='csvfile.txt'
 local currentlyprocessedcsvfile = io.loaddata(inpcsvfile)
 local mycsvsplitter = utilities.parsers.rfc4180splitter{
separator = ',',
quote = '',
}
if gCSVHeader then
 gTableRows, gColumnNames = 
mycsvsplitter(currentlyprocessedcsvfile,true)

 inspect(gTableRows)
 inspect(gColumnNames)
 for i=1,#gTableRows[1] do
gColNames[tostring(gColumnNames[i])] = i -- for indexing use
end
else
  gTableRows = mycsvsplitter(currentlyprocessedcsvfile)
  inspect(gTableRows)
  -- ad now set column names for withoutheader situation:
for i=1,#gTableRows[1] do
context(gTableRows[i])
 gColumnNames[i]='c'..(i)
end
end
 gNumRows=#gTableRows -- Getting number of rows
  gNumCols=#gTableRows[1] -- Getting number of columns

 context.setgvalue(numrows,tostring(gNumRows))
 context.setgvalue(numcols,tostring(gNumCols))
 context.setgvalue(filename,tostring(inpcsvfile))
\stopluacode


File \filename\ has \numrows\ lines and \numcols\ columns.

\stoptext
___ 

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
___

Re: [NTG-context] Problem with rfc4180splitter in last beta (sticking point was found... maybe)

2015-06-15 Thread Jaroslav Hajtmar

Thanx Hans very much. It works fine now.

Jaroslav Hajtmar




Dne 15. 6. 2015 v 21:40 Hans Hagen napsal(a):

On 6/15/2015 8:22 PM, Jaroslav Hajtmar wrote:

Hello Hans.
I tried to find differences in beta compared to a fully functional
version of the TL 2014 and I found two changes in the file-utils prs.lua
compared to a fully functional version of utils-prs.lua in the TL 2014
version of ConTeXt:

Changes in file utils-prs.lua (beta version) compared to TL 2014 (fully
functional version):

line no 520 of beta standalone:
specification = specification and
setmetatableindex(specification,defaultspecification) or
defaultspecification

while the TL 2014 version line no 478:
specification = specification and
table.setmetatableindex(specification,defaultspecification) or
defaultspecification


that ons is irrelevant


and next diference:

line no 533 of beta standalone:
local wholeblob   = Ct((newline^(specification.strict and -1 or 1) *
record)^0)

while the TL 2014 version line no 491:
local wholeblob   = Ct((newline^-1 * record)^0)


When I  change these lines and regenerate ConTeXt format then suddenly
it works as expected. Of course, you will probably need to make some
adjustments depending on your idea of a line 533rd.

I hope this information helps a little in search of a problem.


it was on user request that it was changed

the two lines look nearly the same, apart from:

specification.strict and -1 or 1

so, if you pass a specification with strict = true then you get the 
behaviour you want


Hans



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___ 

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
___

[NTG-context] Problem with rfc4180splitter in last beta?

2015-06-15 Thread Jaroslav Hajtmar

Hi Hans,
I encountered while experimenting with the latest beta version of 
standalone context to a problem when using the splitter. When I process 
without header file then compilation crashed when you compile the latest 
beta version. Conversely, the processing of a header file is no problem. 
ConTEXt while compiling the 2014 TL is fine in both cases. I do not know 
from which beta version was a problem, I discovered it by accident until 
now. Send minimal example. When gCSVHeader = true everything is OK when 
it is gCSVHeader = false and compilation fails.



Thanx for any advice
Jaroslav Hajtmar

Here is my minimal version of problematic example:



% csvfile.txt content:
% first,second,third,fourth
% 1,2,3,4
% a,b,c,d
% foo,barbaz,boogie,xyzzy
%



\starttext

\startluacode
 --gCSVHeader=true -- works fine when compiled any version of ConTeXt
 gCSVHeader=false -- crashed, when compiled by last beta version of 
standalone

 gColNames={}
 gColumnNames={}
 local inpcsvfile='csvfile.txt'
 local currentlyprocessedcsvfile = io.loaddata(inpcsvfile)
 local mycsvsplitter = utilities.parsers.rfc4180splitter{
separator = ',',
quote = '',
}
if gCSVHeader then
 gTableRows, gColumnNames = 
mycsvsplitter(currentlyprocessedcsvfile,true)

 inspect(gTableRows)
 inspect(gColumnNames)
 for i=1,#gTableRows[1] do
gColNames[tostring(gColumnNames[i])] = i -- for indexing use
end
else
  gTableRows = mycsvsplitter(currentlyprocessedcsvfile)
  inspect(gTableRows)
  -- ad now set column names for withoutheader situation:
for i=1,#gTableRows[1] do
context(gTableRows[i])
 gColumnNames[i]='c'..(i)
end
end
 gNumRows=#gTableRows -- Getting number of rows
  gNumCols=#gTableRows[1] -- Getting number of columns

 context.setgvalue(numrows,tostring(gNumRows))
 context.setgvalue(numcols,tostring(gNumCols))
 context.setgvalue(filename,tostring(inpcsvfile))
\stopluacode


File \filename\ has \numrows\ lines and \numcols\ columns.

\stoptext
___
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
___

Re: [NTG-context] ConTeXt installation problem with Windows 8.1

2015-04-29 Thread Jaroslav Hajtmar
Thanx Mojca.When I downloaded Your ZIP file, then the installation has been 
completed without any problems and everything works as it should. Thanks again.
Jaroslav Hajtmar



Od: ntg-context ntg-context-boun...@ntg.nl
Komu: mailing list for ConTeXt users ntg-context@ntg.nl
Kopie: 
Datum: Wed, 29 Apr 2015 19:09:58 +0200
Předmet: Re: [NTG-context] ConTeXt installation problem with Windows 8.1


 On Wed, Apr 29, 2015 at 4:28 PM, Jaroslav Hajtmar wrote:
  Thanks to Lukas and Mojca too for the reply.
  The problem may be elsewhere. At my working computer (at work) I have
  Windows 8.1, and there I ConTeXt standalone installed ok and everything
  works as it should. On my own laptop I install Windows 8.1 Enterprise (ie. I
  think the top product) and even ConTeXt not installed because the
  installation procedure did not find DLL. At the moment I do not know what it
  could be. Maybe when I install the drivers (I had trouble installing the
  graphics driver) something screwed up. Perhaps it wanted a broader
  discussion of Windows 8 users, respectively. 8.1 and probably even different
  versions (Home, Professional, Enterprise ???).
 
 Please try again (you need to download
 http://distribution.contextgarden.net/setup/context-setup-mswin.zip
 again). I added the missing dll. If any other file is still missing,
 please say which file exactly.
 
 Mojca
 ___
 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
___

Re: [NTG-context] ConTeXt installation problem with Windows 8.1

2015-04-29 Thread Jaroslav Hajtmar
Thanks to Lukas and Mojca too for the reply. 
The problem may be elsewhere. At my working computer (at work) I have Windows 
8.1, and there I ConTeXt standalone installed ok and everything works as it 
should. On my own laptop I install Windows 8.1 Enterprise (ie. I think the top 
product) and even ConTeXt not installed because the installation procedure did 
not find DLL. At the moment I do not know what it could be. Maybe when I 
install the drivers (I had trouble installing the graphics driver) something 
screwed up. Perhaps it wanted a broader discussion of Windows 8 users, 
respectively. 8.1 and probably even different versions (Home, Professional, 
Enterprise ???).
Thanx
Jaroslav Hajtmar


Od: ntg-context ntg-context-boun...@ntg.nl
Komu: mailing list for ConTeXt users ntg-context@ntg.nl
Kopie: 
Datum: Wed, 29 Apr 2015 11:30:18 +0200
Předmet: Re: [NTG-context] ConTeXt installation problem with Windows 8.1


 On Wed, Apr 29, 2015 at 11:18 AM, Procházka Lukáš Ing. - Pontex s. r. o. 
 wrote:
  On Tue, 28 Apr 2015 18:07:58 +0200, Jaroslav Hajtmar hajt...@gyza.cz
  wrote:
 
  Hello ConTeXist.
  I tried to install standalone ConTeXt (64 bit. Version) into the new
  installation of Windows 8.1 During installation, I encounter a message 
  about
  missing DLL library (at first MSVCR100.DLL, after insert this library next
  error message.). Does anyone have a similar experience? respectively. How 
  do
  I install Windows ConTeXt to 8.1
  Thanks. Jaroslav Hajtmar
 
 
  although the following solution for Ctx installation is ad-hoc, not
  systematic, it should solve your problem:
  add the missing MSVC libraries from MS Redistributable Package:
 
  https://msdn.microsoft.com/en-us/library/8kche8ah(v=vs.100).aspx
 
  The problem appears time-to-time to end users and not to program developers,
  as MS Visual Studio includes/installs the required DLLs (which are part of
  Redist. Pack.) automatically (so it works for developers).
 
  And then, an end user may need to install the missing DLLs manually.
  (When a SW has an installer, it often handles this step automatically.)
 
 If our ConTeXt distribution is missing those files, then *I* need to
 add them to the distribution. This problem usually happens when Akira
 switches to a newer MSVC and unless someone complains, I never know
 that new files have to be added as I never use Windows.
 
 We can discuss the fix off-list.
 
 Mojca
 ___
 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
___

[NTG-context] ConTeXt installation problem with Windows 8.1

2015-04-28 Thread Jaroslav Hajtmar
Hello ConTeXist.
I tried to install standalone ConTeXt (64 bit. Version) into the new 
installation of Windows 8.1 During installation, I encounter a message about 
missing DLL library (at first MSVCR100.DLL, after insert this library next 
error message.). Does anyone have a similar experience? respectively. How do I 
install Windows ConTeXt to 8.1
Thanks. Jaroslav Hajtmar___
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
___

Re: [NTG-context] Hidden chapter header? ... was: Change counter of chapters

2015-04-18 Thread Jaroslav Hajtmar
Thanks Pablo 
for workable solutions. Both solutions are working, as I imagined.
Anyway, fortunately I do not work with Word itself, but for example. 
Colleagues, friends and acquaintances. It is sometimes necessary make something 
 in ConTeXt when Word is not enough on it. So fortunately there is no 
condemnation to me, but to someone else:-).


Greeting Jaroslav Hajtmar

From: ntg-context ntg-context-boun...@ntg.nl
To: mailing list for ConTeXt users ntg-context@ntg.nl
Cc: 
Date: Sat, 18 Apr 2015 09:23:51 +0200
Subject: Re: [NTG-context] Hidden chapter header? ... was: Change counter of 
chapters


 On 04/18/2015 07:22 AM, Jaroslav Hajtmar wrote:
  Hello ConTeXist
  My last Subject contribution maybe  so misleading that it nobody react.
  I'll try therefore to bring different view:
  Exist any possibility of creating some kind of hidden chapters
  (sections, subsections)?  
  The command would increase the counter of chapters (sections,
  subsections). Maybe it seems as rape of ConTeXt, but in certain moments
  this option would help me. 
  In my case it is the integration of practical part of project (worked in
  ConTeXt) into Word project:-(...
  
  For example I need to start writing any text from 53 page and such from
  the 5th chapter (or section). 
  It is possible in a similar way as I set the start page number set also
  the counter of chapters (sections)?
 
 Hi Jaroslav,
 
 adding the following commands before \startext does the work:
 
   \definehead[hiddenchapter][chapter]
   \setuphead[hiddenchapter][placehead=no]
 
 But there is a proper way to set the chapter number:
 
   \setupheadnumber[chapter][56] % +2 or -5 also accepted
 
 By the way, going from ConTeXt to Word you know you are on the road to
 perdition, don’t you? ;-)
 
 I hope it helps,
 
 
 Pablo
 
 
 
  Here is my minimal example:
  
  \starttext
  %\hiddenchapter{Fictive chapter}
  %\hiddenchapter{Fictive chapter}
  %\hiddenchapter{Fictive chapter}
  %\hiddenchapter{Fictive chapter}
  
  \page
  
  \setcounter[userpage][53]
  
  \chapter{Fifth (actually first) nonfictive chapter}
  
  blablabla
  
  \stoptext
 
 
 -- 
 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://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
___

[NTG-context] Hidden chapter header? ... was: Change counter of chapters

2015-04-17 Thread Jaroslav Hajtmar
Hello ConTeXist
My last Subject contribution maybe  so misleading that it nobody react. I'll 
try therefore to bring different view:
Exist any possibility of creating some kind of hidden chapters (sections, 
subsections)?  
The command would increase the counter of chapters (sections, subsections). 
Maybe it seems as rape of ConTeXt, but in certain moments this option would 
help me. 
In my case it is the integration of practical part of project (worked in 
ConTeXt) into Word project:-(...


For example I need to start writing any text from 53 page and such from the 5th 
chapter (or section). 
It is possible in a similar way as I set the start page number set also the 
counter of chapters (sections)?


Thanx for help.


Jaroslav Hajtmar


Here is my minimal example:


\starttext
%\hiddenchapter{Fictive chapter}
%\hiddenchapter{Fictive chapter}
%\hiddenchapter{Fictive chapter}
%\hiddenchapter{Fictive chapter}


\page


\setcounter[userpage][53]


\chapter{Fifth (actually first) nonfictive chapter}


blablabla


\stoptext



___
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
___

[NTG-context] Change counter of chapters (sections, subsections...)

2015-04-16 Thread Jaroslav Hajtmar
Hello ConTeXistI need to start writing any text from 53 page and such from the 
5th chapter (or section). It is possible in a similar way as I set the start 
page number set also the counter of chapters (sections)?

Here is my minimal example:

\starttext
\chapter{Fictive chapter}
\chapter{Fictive chapter}
\chapter{Fictive chapter}
\chapter{Fictive chapter}


\page


\setcounter[userpage][53]


\chapter{Fifth (actually first) nonfictive chapter}


blablabla


\stoptext


Thanx for help.


Jaroslav Hajtmar___
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
___

Re: [NTG-context] setupformulas options (or defineformula) and effort to reduce the font in math formulas

2015-03-12 Thread Jaroslav Hajtmar

Hello Wolfgang.

After some searching and experimenting, here is my functional solution.
I wrote it into the wiki. I have not found there eg. defineformula 
command etc


Jaroslav Hajtmar



\defineformula[MY][
align=left,
strut=no,
 spacebefore=,
 spaceafter=,
]


% so you can modify the settings of defineforumla[MY]
\setupformulae[MY][align=right,strut=yes,spacebefore=medium,spaceafter=big]

% so we can create new start-stopsmallformula
\definestartstop[smallformula]
  [before={\startformula[small]},
   after=\stopformula,
]

% and we can so create new start-stopmysmallformula:
\definestartstop[mysmallformula]
  [before={\startMYformula[small]},
   after=\stopMYformula,
]

% and here is my shortcuts:
\let\bmyformula\startmysmallformula
\let\emyformula\stopmysmallformula



\starttext

\title{Example of use and behavior}

startformula:

\startformula
c^2 = a^2 + b^2
\stopformula

startformula$[$small$]$:

\startformula[small]
c^2 = a^2 + b^2
\stopformula

startformula[8pt]:

\startformula[8pt]
c^2 = a^2 + b^2
\stopformula

startsmallformula:

\startsmallformula
c^2 = a^2 + b^2
\stopsmallformula


startmysmallformula:

\startmysmallformula
c^2 = a^2 + b^2
\stopmysmallformula

startMYformula:

\startMYformula
c^2 = a^2 + b^2
\stopMYformula

startMYformula[5pt]:

\startMYformula[5pt]
c^2 = a^2 + b^2
\stopMYformula


bmyformula:

\bmyformula
c^2 = a^2 + b^2
\emyformula



\stoptext


http://wiki.contextgarden.net/defineformula


Dne 11.3.2015 v 18:18 Jaroslav Hajtmar napsal(a):

Thanx Wolfgang for reply.
I had no idea that it is possible in this way to change the font size. 
I could not figure a way for your solution set alignment formulas to 
right and how work \defineformula and \definestartstop together.


After defining a new MY formula in combination with your solution 
works it fine, as I had imagined.
Is there any possibility of setting of parameters a newly defined 
formulas? Or, it can not be done, and everything must be solved within 
the initial definition?


One more thanx
Jaroslav Hajtmar


\defineformula[MY][
align=right,
strut=yes,
spacebefore=,
spaceafter=,
]

\definestartstop[smallformula]
  [before={\startformula[small]},
   after=\stopformula,
]


% \setupformulas[align=right,strut=yes,spacebefore=,spaceafter=]
% 
\setupformulas[smallformula][align=right,strut=yes,spacebefore=,spaceafter=]

% \setupformulas[small][align=right,strut=yes,spacebefore=,spaceafter=]
% \setupsmallformulas[align=right,strut=yes,spacebefore=,spaceafter=]
% 
\setupsmallformulaformulas[align=right,strut=yes,spacebefore=,spaceafter=]

% \setupformulas[MY][align=right,strut=yes,spacebefore=,spaceafter=]
% 
\setupformulas[MYformula][align=right,strut=yes,spacebefore=,spaceafter=]

% \setupMYformulas[align=right,strut=yes,spacebefore=,spaceafter=]


\starttext

\startformula
c^2 = a^2 + b^2
\stopformula

\startformula[small]
c^2 = a^2 + b^2
\stopformula

\startformula[8pt]
c^2 = a^2 + b^2
\stopformula

\startsmallformula
c^2 = a^2 + b^2
\stopsmallformula

\startMYformula[small]
c^2 = a^2 + b^2
\stopMYformula

\startMYformula[5pt]
c^2 = a^2 + b^2
\stopMYformula


\stoptext



Dne 11.3.2015 v 0:52 Wolfgang Schuster napsal(a):
\startformula has a optional argument which let you change the font, 
e.g. \startformula[9pt].


\definestartstop[smallformula]
   [before={\startformula[small]},
after=\stopformula]

\starttext

\startformula
c^2  = a^2  + b^2
\stopformula

\startformula[small]
c^2  = a^2  + b^2
\stopformula

\startsmallformula
c^2  = a^2  + b^2
\stopsmallformula

\stoptext


___ 

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
___

[NTG-context] How to properly put information into contextwiki

2015-03-12 Thread Jaroslav Hajtmar

Hello list.

I tried in vain to find some information on how to properly load some 
things into http://wiki.contextgarden.net/
I tried to insert there thing I have not found there 
(http://wiki.contextgarden.net/defineformula) but I could not find how 
to classify this page to a hierarchy (in this case into the section 
commands). They are somewhere about some information? Or has the final 
classification in charge of an administrator, etc? Thanks for the link 
to some information. I would like to wiki occasionally contributed 
something, but I've somehow fundamentally not orienting.


Thanks Jaroslav Hajtmar
___
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
___

Re: [NTG-context] setupformulas options (or defineformula) and effort to reduce the font in math formulas

2015-03-11 Thread Jaroslav Hajtmar

Thanx Wolfgang for reply.
I had no idea that it is possible in this way to change the font size. I 
could not figure a way for your solution set alignment formulas to right 
and how work \defineformula and \definestartstop together.


After defining a new MY formula in combination with your solution works 
it fine, as I had imagined.
Is there any possibility of setting of parameters a newly defined 
formulas? Or, it can not be done, and everything must be solved within 
the initial definition?


One more thanx
Jaroslav Hajtmar


\defineformula[MY][
align=right,
strut=yes,
spacebefore=,
spaceafter=,
]

\definestartstop[smallformula]
  [before={\startformula[small]},
   after=\stopformula,
]


% \setupformulas[align=right,strut=yes,spacebefore=,spaceafter=]
% 
\setupformulas[smallformula][align=right,strut=yes,spacebefore=,spaceafter=]

% \setupformulas[small][align=right,strut=yes,spacebefore=,spaceafter=]
% \setupsmallformulas[align=right,strut=yes,spacebefore=,spaceafter=]
% \setupsmallformulaformulas[align=right,strut=yes,spacebefore=,spaceafter=]
% \setupformulas[MY][align=right,strut=yes,spacebefore=,spaceafter=]
% \setupformulas[MYformula][align=right,strut=yes,spacebefore=,spaceafter=]
% \setupMYformulas[align=right,strut=yes,spacebefore=,spaceafter=]


\starttext

\startformula
c^2 = a^2 + b^2
\stopformula

\startformula[small]
c^2 = a^2 + b^2
\stopformula

\startformula[8pt]
c^2 = a^2 + b^2
\stopformula

\startsmallformula
c^2 = a^2 + b^2
\stopsmallformula

\startMYformula[small]
c^2 = a^2 + b^2
\stopMYformula

\startMYformula[5pt]
c^2 = a^2 + b^2
\stopMYformula


\stoptext



Dne 11.3.2015 v 0:52 Wolfgang Schuster napsal(a):

\startformula has a optional argument which let you change the font, e.g. 
\startformula[9pt].

\definestartstop[smallformula]
   [before={\startformula[small]},
after=\stopformula]

\starttext

\startformula
c^2  = a^2  + b^2
\stopformula

\startformula[small]
c^2  = a^2  + b^2
\stopformula

\startsmallformula
c^2  = a^2  + b^2
\stopsmallformula

\stoptext


___
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
___

[NTG-context] setupformulas options (or defineformula) and effort to reduce the font in math formulas

2015-03-10 Thread Jaroslav Hajtmar

Hello List.
I would like some elegant way to diminished font in math formulas...

Is there possibility anything as 
\setupformulas[before={\switchtobodyfont[small]} ]?

I need to align formulas, so are not enough to \mathematics {}

Below is my fallback. You can do something smarter?

Thanx Jaroslav Hajtmar



\defineformula[small][
align=right,
strut=yes,
spacebefore=,
spaceafter=,
% before={\switchtobodyfont[small]}
]

% Here is my fallback solution:
\def\Startsmallformula{\startsmallformula\switchtobodyfont[small] }


\starttext

\startformula
\lim\limits_{x\rightarrow-2^{\mp}}{\arctan\frac{x}{2+x}}=\pm\frac{\pi}{2}
\stopformula

\startformula
f':\;y' = \frac{\sqrt{3}(1+x^2)}{(1-x^2)^2+3x^2}
\stopformula

\startformula
\lim\limits_{x\rightarrow 1^{\mp}}{\frac{x^2+1}{x-1}}=\mp\infty
\stopformula



\Startsmallformula
\lim\limits_{x\rightarrow-2^{\mp}}{\arctan\frac{x}{2+x}}=\pm\frac{\pi}{2}
\stopsmallformula

\Startsmallformula
f':\;y' = \frac{\sqrt{3}(1+x^2)}{(1-x^2)^2+3x^2}
\stopsmallformula

\Startsmallformula
\lim\limits_{x\rightarrow 1^{\mp}}{\frac{x^2+1}{x-1}}=\mp\infty
\stopsmallformula



\blank[big]

\startsmallformula
\startalign
\NC f(x)\NC = \ln (x^2+2x+2)\NR
\NC f(-x)\NC = \ln ((–x)^2 - 2x + 2)\NR
\NC -f(x)\NC = -\ln (x^2+2x+2)\NR
\stopalign
\stopsmallformula

\blank[big]

\Startsmallformula
\startalign
\NC f(x)\NC = \ln (x^2+2x+2)\NR
\NC f(-x)\NC = \ln ((–x)^2 - 2x + 2)\NR
\NC -f(x)\NC = -\ln (x^2+2x+2)\NR
\stopalign
\stopsmallformula

\stoptext



___
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
___

Re: [NTG-context] setupformulas options (or defineformula) and effort to reduce the font in math formulas

2015-03-10 Thread Jaroslav Hajtmar

Thanks Hans for the reply.
I take to type some formulas larger font, so that's why I opted to frame 
their own definition of a formula environment with small print. Switch 
entire mathematical text on small I don't want.

Therefore, I would like to have both:

\startformula

\stopformula

and

\startsmallformula

\stopsmallformula

Thanx
Jaroslav Hajtmar


Dne 10.3.2015 v 23:57 Hans Hagen napsal(a):

On 3/10/2015 11:45 PM, Jaroslav Hajtmar wrote:

Hello List.
I would like some elegant way to diminished font in math formulas...

Is there possibility anything as
\setupformulas[before={\switchtobodyfont[small]} ]?
I need to align formulas, so are not enough to \mathematics {}

Below is my fallback. You can do something smarter?


define a bodyfont (rm,mm,tt) where the math has an rscale of 0.8

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-



___
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
___

Re: [NTG-context] Incompatibility catcodes of characters in ConTeXt and PlainTeX

2015-03-01 Thread Jaroslav Hajtmar

One more thanx Hans for interesting and useful information
Jaroslav Hajtmar

BTW: I did not get an answer to my last mail see Re: [NTG-context] CSV 
scanners built in ConTeXt - feature or bug?
I wrote that now is splitter works properly. I would like to ask if 
you're planning to fix file util-prs.lua in a future release of 
standalone ConTeXt?


As for me, I'd rather vote for as the default option other option, ie 
which does not stop on a blank line ie. not how it's setup now (ie 
personally I'd rather vote  strict=true would mean process all lines of 
CSV file and strict=false mean stop processing on blank line), but I 
will take into account whatever alternative and consequently I would 
take into account this options for my own library.
Alan writes about this behavior as like metapost feature. Personally, I 
think that the CSV file is basically a plain text file and a blank line 
in it has its place. The end of the text file is usually marked by eof 
character, so I guess there's no reason to terminate processing before 
the file really ends.





Dne 1.3.2015 v 11:05 Hans Hagen napsal(a):

On 3/1/2015 7:24 AM, Jaroslav Hajtmar wrote:

Dne 27.2.2015 v 19:04 Hans Hagen napsal(a):

On 2/27/2015 5:53 PM, Jaroslav Hajtmar wrote:

Hello ConTeXist.
Petr Olsak (maintainer of Czech/Slovak support for TeX) helped me with
simple typing of sign charts. He made a PlainTeX macro who is working
too in ConTeXt (see
http://tex.stackexchange.com/questions/230273/typing-of-math-sign-charts). 




Petr Olsak (not ConTeXt even LaTeX user) was modified PlainTeX 
macro to

work in ConTeXt and asked the question:
Does anybody know why ConTeXt sets catcode of  to 12? This means 
that

it is incompatible with plain TeX.


Which is imo no big deal.

I did not write that he would give redoing some work, after discovering
that catcode  is different than in plainTEX.



May I therefore ask , what is the reason that has character  catcode
other than in Knuth PlainTeX?
There are catcodes of other characters incompatible?


Because the context table mechanisms don't use  (and never used it)
so ther ei sno reason to make  special. The _ and ^ are also normal
characters. For now we keep the $ for math (and in math mode the  ^ _
work as expected).

Although we're to some extend plain compatible it's not our aim, just
like we're not amstex, latex, lamstex or anytex compatible.


Ok. Thanks for the explanation. I wrote to Peter that developer context
to have a reason, and certainly it would from an ordinary whim not done.
Even so, I am very satisfied with the degree of compatibility.
Practically all of my old PlainTeX macros in ConTeXt work fine.


\pushcatcodetable
\catcodetable\texcatcodes

your plain code

\popcatcodetable

but it doesn't help when sources are passed as arguments of macros 
under the normal regime




Thanx
Jaroslav


Hans



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___ 



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
___

Re: [NTG-context] Incompatibility catcodes of characters in ConTeXt and PlainTeX

2015-02-28 Thread Jaroslav Hajtmar

Dne 27.2.2015 v 19:04 Hans Hagen napsal(a):

On 2/27/2015 5:53 PM, Jaroslav Hajtmar wrote:

Hello ConTeXist.
Petr Olsak (maintainer of Czech/Slovak support for TeX) helped me with
simple typing of sign charts. He made a PlainTeX macro who is working
too in ConTeXt (see
http://tex.stackexchange.com/questions/230273/typing-of-math-sign-charts). 



Petr Olsak (not ConTeXt even LaTeX user) was modified PlainTeX macro to
work in ConTeXt and asked the question:
Does anybody know why ConTeXt sets catcode of  to 12? This means that
it is incompatible with plain TeX.


Which is imo no big deal.
I did not write that he would give redoing some work, after discovering 
that catcode  is different than in plainTEX.



May I therefore ask , what is the reason that has character  catcode
other than in Knuth PlainTeX?
There are catcodes of other characters incompatible?


Because the context table mechanisms don't use  (and never used it) 
so ther ei sno reason to make  special. The _ and ^ are also normal 
characters. For now we keep the $ for math (and in math mode the  ^ _ 
work as expected).


Although we're to some extend plain compatible it's not our aim, just 
like we're not amstex, latex, lamstex or anytex compatible.


Ok. Thanks for the explanation. I wrote to Peter that developer context 
to have a reason, and certainly it would from an ordinary whim not done.
Even so, I am very satisfied with the degree of compatibility. 
Practically all of my old PlainTeX macros in ConTeXt work fine.

Thanx
Jaroslav


Hans



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___ 

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
___

[NTG-context] Incompatibility catcodes of characters in ConTeXt and PlainTeX

2015-02-27 Thread Jaroslav Hajtmar

Hello ConTeXist.
Petr Olsak (maintainer of Czech/Slovak support for TeX) helped me with 
simple typing of sign charts. He made a PlainTeX macro who is working 
too in ConTeXt (see 
http://tex.stackexchange.com/questions/230273/typing-of-math-sign-charts).


Petr Olsak (not ConTeXt even LaTeX user) was modified PlainTeX macro to 
work in ConTeXt and asked the question:
Does anybody know why ConTeXt sets catcode of  to 12? This means that 
it is incompatible with plain TeX.


May I therefore ask , what is the reason that has character  catcode 
other than in Knuth PlainTeX?

There are catcodes of other characters incompatible?

Thanx Jaroslav Hajtmar


___
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
___

Re: [NTG-context] CSV scanners built in ConTeXt - feature or bug?

2015-02-26 Thread Jaroslav Hajtmar

Hans and Alan,
Thanks for the reply. Now it works properly. I would like to ask if 
you're planning to fix file util-prs.lua in a future release of 
standalone ConTeXt.
As for me, I'd rather vote for as the default option other option, ie 
which does not stop on a blank line ie. not how it's setup now (ie 
personally I'd rather vote  strict=true would mean process all lines of 
CSV file and strict=false mean stop processing on blank line), but I 
will take into account whatever alternative and consequently I would 
take into account this options for my own library.
Alan writes about this behavior as like metapost feature. Personally, I 
think that the CSV file is basically a plain text file and a blank line 
in it has its place. The end of the text file is usually marked by eof 
character, so I guess there's no reason to terminate processing before 
the file really ends.


Jaroslav Hajtmar



Dne 26.2.2015 v 12:20 Alan BRASLAU napsal(a):

On Thu, 26 Feb 2015 10:47:29 +0100
Hans Hagen pra...@wxs.nl wrote:


i'm not sure about the default as the standard might demand quit at
empty line so that needs to be figured out (not by me therefore by
you)

Stop on empty line is a very MetaPost-like feature.

I don't have an opinion as to what should be expected for CSV, but
MP thus allows one to pick-off sets of data by successive reads to one
file.

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://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
___

[NTG-context] CSV scanners built in ConTeXt - feature or bug?

2015-02-25 Thread Jaroslav Hajtmar

Hi ConTeXist
A few days ago Hans pointed me builtin CSV splitter. I tried to test it 
sure will come in handy for my needs. I found that if the CSV file 
contain a blank line, then it stops processing the file (see my minimal 
example). It is clear to me that the incorrectness of file format (eg. 
different number of columns in rows etc.) may cause interruption of 
processing, however, I want to ask whether there is an opportunity to 
process the CSV file with blank lines until the end of CSV file. I 
noticed that when I exporting data from Excel sometimes happens that in 
the export file will appear blank line. Is it interrupt processing a 
feature of a buildin splitter or is it a bug? Can it possibly somehow 
fix or add new functionality?


Thanx
Jaroslav Hajtmar



Here is minimal example:

\starttext

\startluacode
local mycsvsplitter = utilities.parsers.rfc4180splitter{
separator = ,,
quote = '',
}

local crap = io.loaddata(data.txt)

-- with header variant
local tablerows, columnname = mycsvsplitter(crap,true)
inspect(tablerows)
inspect(columnname)

-- without header variant
-- local tablerows = mycsvsplitter(crap)
-- inspect(tablerows)

for i=1,#tablerows do
local l = tablerows[i]
 for j=1,#l do context(l[j].., )
end
context('\\crlf')
end

\stopluacode


\stoptext




% -- here start data.txt file --
first,second,third,fourth
1,2,3,4
a,b,c,d
foo,barbaz,boogie,xyzzy
,,, 
And now,followed by,several,blank lines




After several,empty rows,data continues,here
11,22,33,44
aa,bb,cc,dd
% -- and here stop data.txt file --





___
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
___

Re: [NTG-context] Different versions of Lua and error in the same versions of ConTeXt (Fedora vs Win7)

2015-02-24 Thread Jaroslav Hajtmar

Hi Hans.
One more I ask You about this thing. When I have other separator - for 
example ; then c.txt data file is:


first,second,third,fourth
1;2;3;4
a;b;c;d
foo;barbaz;boogie;xyzzy

I was unable to figure out how to set the separator (and others default 
values too) so as to replace the default value in the library util-prs.lua

Is there anything as utilities.parsers.rfc4180splitter.separator=;???

This library is loaded automatically? Or as a module?

Thanks Jaroslav Hajtmar

Here is minimal example for Your correction:

\starttext

\startluacode

local mycsvsplitter = utilities.parsers.rfc4180splitter()
utilities.parsers.rfc4180splitter.separator=;

local crap = io.loaddata(c.txt)

local list, names = mycsvsplitter(crap,true)   inspect(list) inspect(names)
local list, names = mycsvsplitter(crap)inspect(list) inspect(names)

context.starttabulate { |l|r| }
for i=1,#list do
local l = list[i]
context.NC() context(l[1])
context.NC() context(l[3])
context.NC()
context.NR()
end
context.stoptabulate()

\stopluacode

\stoptext





Dne 23.2.2015 v 9:49 Hans Hagen napsal(a):

On 2/22/2015 9:42 PM, Pablo Rodriguez wrote:

On 02/22/2015 07:44 PM, Hans Hagen wrote:

[...]
for pablo: there are csv scanners built in context


Hans,

I don’t really need this at home, but I’m interested in this.


in addition to the previous mail, t.txt is:

first,second,third,fourth
1,2,3,4
a,b,c,d
foo,barbaz,boogie,xyzzy

the code is in util-prs.lua (where all kind of parsing code lives)

if you want to use that kind of code outside context you can do 
something like this:


lua mtxlibs.lua --selfmerge foo.lua

and then in your script load foo.lua

this makes it possible to use the same set of helpers in context as 
well outside it (alternatively you can just use luatex as lua engine 
and mtxrun as script runner which is what we mostly do); this means 
that the context distribution provides all kind of means to set up 
workflows



I guess you mean m-database.mkiv. But I don’t have a clue on how to
handle it.

I mean, how to ignore the first line and how to make commands from the
so-called cells (A2, B5...; to use them in document combination) reading
an external file.

Many thanks for your help,

Pablo






___
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
___

Re: [NTG-context] Different versions of Lua and error in the same versions of ConTeXt (Fedora vs Win7)

2015-02-23 Thread Jaroslav Hajtmar
Thanks for showing options in last mails. This is for me very 
interesting news, and certainly it will be very useful and inspirative 
for me.


Jaroslav Hajtmar



Dne 23.2.2015 v 9:49 Hans Hagen napsal(a):

in addition to the previous mail, t.txt is:

first,second,third,fourth
1,2,3,4
a,b,c,d
foo,barbaz,boogie,xyzzy

the code is in util-prs.lua (where all kind of parsing code lives)

if you want to use that kind of code outside context you can do 
something like this:


lua mtxlibs.lua --selfmerge foo.lua

and then in your script load foo.lua

this makes it possible to use the same set of helpers in context as 
well outside it (alternatively you can just use luatex as lua engine 
and mtxrun as script runner which is what we mostly do); this means 
that the context distribution provides all kind of means to set up 
workflows 


___
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
___

Re: [NTG-context] Different versions of Lua and error in the same versions of ConTeXt (Fedora vs Win7)

2015-02-22 Thread Jaroslav Hajtmar
Hans, thanks for the reply. You write about the embedded CSV scanner. I 
was looking at contextgarden and on the Internet too, but I did not 
found any information about this.
Can you, please, about built-in scanner CSV say more (link, minimal 
example etc.)? This thing interests me very much...


Thanks
Jaroslav Hajtmar




Dne 22.2.2015 v 19:44 Hans Hagen napsal(a):

On 2/22/2015 7:36 PM, Jaroslav Hajtmar wrote:

Hi ConTeXist...
How can I find out what version of Lua uses ConTeXt TeXlive 2014
respectively what version of Lua uses Standalone ConTeXt?
The point is that Pablo Rodriguez use Fedora 20, which comes with
Lua-5.2.2. Pablo tested last version of my module ScanCSV and his
current version of standalone ConTeXt gained mistake, while I compiled
(with the same current version of Standalone under Win7) the same source
code without error 

Error message from log file is:

t-scancsv-2015-02-19.lua:81: assertion failed!
stack traceback:
 [C]: in function 'assert'
 t-scancsv-2015-02-19.lua:81: in function 'ParseCSVLine'
 t-scancsv-2015-02-19.lua:123: in function 'parsecsvdata'
 t-scancsv-2015-02-19.lua:180: in function 'opencsvfile'
 [\directlua]:1: in main chunk


_VERSION

for pablo: there are csv scanners built in context

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___ 

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
___

[NTG-context] Different versions of Lua and error in the same versions of ConTeXt (Fedora vs Win7)

2015-02-22 Thread Jaroslav Hajtmar

Hi ConTeXist...
How can I find out what version of Lua uses ConTeXt TeXlive 2014 
respectively what version of Lua uses Standalone ConTeXt?
The point is that Pablo Rodriguez use Fedora 20, which comes with 
Lua-5.2.2. Pablo tested last version of my module ScanCSV and his 
current version of standalone ConTeXt gained mistake, while I compiled 
(with the same current version of Standalone under Win7) the same source 
code without error 


Error message from log file is:

t-scancsv-2015-02-19.lua:81: assertion failed!
stack traceback:
[C]: in function 'assert'
t-scancsv-2015-02-19.lua:81: in function 'ParseCSVLine'
t-scancsv-2015-02-19.lua:123: in function 'parsecsvdata'
t-scancsv-2015-02-19.lua:180: in function 'opencsvfile'
[\directlua]:1: in main chunk


Thanx
Jaroslav Hajtmar


___
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
___

Re: [NTG-context] Different versions of Lua and error in the same versions of ConTeXt (Fedora vs Win7)

2015-02-22 Thread Jaroslav Hajtmar

Akira, thanx for reply.
Jaroslav


Dne 23.2.2015 v 1:10 Akira Kakuto napsal(a):
The point is that Pablo Rodriguez use Fedora 20, which comes with 
Lua-5.2.2.


I think TeX Live 2014 uses Lua-5.2.3 on all platforms.
I don't know differences between 5.2.2 and 5.2.3.
Current windows version of standalone ConTeXt also uses 5.2.3.

Best,
Akira

___ 

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
___

Re: [NTG-context] \executesystemcommand dont work?

2015-02-17 Thread Jaroslav Hajtmar

Thanx Ulrike for reply.
I'm sending outputs from Pdflatex and lualatex consoles:
I do not know what I should receive
Jaroslav Hajtmar



PDFLaTeX output console:
Microsoft Windows [Verze 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Všechna práva vyhrazena.

C:\$~1da\ConTeXt\ConTeXt-Tests\my_way\ScanCSV\t-scancsv_ConTeXt_module\2PabloRod
riguez5\dddpdflatex --shell-escape latex
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014/W32TeX) 
(preloaded

 format=pdflatex)
 \write18 enabled.
entering extended mode
(./latex.tex
LaTeX2e 2014/05/01
Babel 3.9k and hyphenation patterns for 79 languages loaded.
(c:/texlive/2014/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(c:/texlive/2014/texmf-dist/tex/latex/base/size10.clo))
No file latex.aux.
(./latex.aux) )
No pages of output.
Transcript written on latex.log.

C:\$~1da\ConTeXt\ConTeXt-Tests\my_way\ScanCSV\t-scancsv_ConTeXt_module\2PabloRod
riguez5\ddd



And LuaLaTeX output console:

C:\$~1da\ConTeXt\ConTeXt-Tests\my_way\ScanCSV\t-scancsv_ConTeXt_module\2PabloRod
riguez5\dddlualatex --shell-escape latex
This is LuaTeX, Version beta-0.79.1 (TeX Live 2014/W32TeX) (rev 4971)
 \write18 enabled.
(./latex.tex
LaTeX2e 2014/05/01
Babel 3.9k and hyphenation patterns for 79 languages loaded.
(c:/texlive/2014/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(c:/texlive/2014/texmf-dist/tex/latex/base/size10.clo)) (./latex.aux)
(./latex.aux))
 262 words of node memory still in use:
   2 hlist, 1 vlist, 1 rule, 2 glue, 39 glue_spec, 2 write nodes
   avail lists: 2:12,3:1,6:3,7:1,9:1
No pages of output.
Transcript written on latex.log.

C:\$~1da\ConTeXt\ConTeXt-Tests\my_way\ScanCSV\t-scancsv_ConTeXt_module\2PabloRod
riguez5\ddd





Dne 17.2.2015 v 11:29 Ulrike Fischer napsal(a):

pdflatex --shell-escape


___
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
___

[NTG-context] \executesystemcommand dont work? (RESOLVED!!!)

2015-02-17 Thread Jaroslav Hajtmar

Dear Akira.
I made adjustments as you advised me and ... believe it or not, all 
started working, including automatic updates of Standalone ConTeXt 
(which I was asking some time ago). I am very, very pleased, and I 
admire you for Your insight and work with the revelation of mistakes in 
setting my path variable. I am very grateful for your help. Likewise, I 
thank all those who have dealt with my problem. I hope that the error 
which was detected by Akira, help perhaps in the future to other users 
who fall into similar problems. Next time I I'll be careful when 
modifying setting of my path. Errors in the my Path was definitely my 
carelessness and sloppy settings.
Once again, many thanks and I appreciate very valuable advice. Finally, 
I again after a long time, everything works as it should ...


Sincerely,
Jaroslav Hajtmar



Dne 17.2.2015 v 14:55 Akira Kakuto napsal(a):

Dear Jaroslav,

See your PATH carefully. For example I find a space between
C:\1da\support\batch;
and
C:\Ruby\bin;C:\Windows\system32
i.e.,
C:\1da\support\batch; C:\Ruby\bin;C:\Windows\system32

There are many such spaces which should be removed.

I think quotations such as
C:\Program Files (x86)\ghostgum\gsview
should be removed like
C:\Program Files (x86)\ghostgum\gsview

Best,
Akira

___ 

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
___

Re: [NTG-context] \executesystemcommand dont work?

2015-02-17 Thread Jaroslav Hajtmar

Thanx Akira for reply.
Thanks to your answers I see that my console output differs from yours. 
At this moment, however, I do not know what happened to my windows 
respectively how to correct the mistake. Does anyone know how to fix it? 
I'm not ConTeXt expert and I'm not Windows expert too.


Thanx Jaroslav Hajtmar


Dne 17.2.2015 v 8:04 Akira Kakuto napsal(a):

Dear Jaroslav,

Here your lines

fonts'fallback modern-designsize rm 12pt' is loaded
test before calling shell command
test after calling shell command
close source 2  3  
C:/$~1da/ConTeXt/ConTeXt-Tests/my_way/ScanCSV/t-scancs...


are like

fonts'fallback modern-designsize rm 12pt' is loaded
OO
close source 2  3  
C:/$~1da/ConTeXt/ConTeXt-Tests/my_way/ScanCSV/t-scancs...



(Windows 7, 32bit and Windows 8.1, 64bit)
(mtx-context | current version: 2015.02.03 23:55)

Thanks,
Akira

___ 

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
___

Re: [NTG-context] \executesystemcommand dont work?

2015-02-17 Thread Jaroslav Hajtmar

Thanx Akira.
I tested path settings, but it seems it is OK (c:\windows\system32 is in 
my PATH)

I am sending full path variable.

PATH=C:\ProgramData\Oracle\Java\javapath;C:\Program 
Files\ImageMagick-6.8.7-Q16;
C:\Program Files (x86)\PC Connectivity 
Solution\;C:\texlive\2014\bin\win32;C:\Pe
rl64\site\bin;C:\Perl64\bin;C:\1da\support\exe;C:\1da\support\batch; 
C:\Ruby\bin
;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem; 
C:\Windows\System32\Wi
ndowsPowerShell\v1.0\;C:\Program Files\Dell\Dell Wireless WLAN 
Card;c:\Program F
iles\WIDCOMM\Bluetooth Software\;c:\Program Files\WIDCOMM\Bluetooth 
Software\sys
wow64;c:\Program Files (x86)\ATI 
Technologies\ATI.ACE\Core-Static;C:\Program Fil
es (x86)\Common Files\Roxio Shared\DLLShared\;c:\Program Files 
(x86)\pstoedit;
C:\Program Files (x86) \gs\gs8.71\bin;C:\Program Files 
(x86)\ghostgum\gsview
;C:\Program Files\Tracker Software\PDF Viewer\;C:\Program Files 
(x86)\Kofax\Im
gCtls\bin; C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe;C:\Program 
Files (
x86) \PDFtk\bin\;C:\Program Files 
(x86)\Inkscape\;c:\ruby\bin;c:\context\bin; C:
\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program 
Files (x86)
\Common Files\Microsoft Shared\Windows 
Live;C:\texlive\support\exe\sw\wscite;C:\
Program Files\ImageMagick-6.6.4-Q16; C:\1da\support\exe; C:\Windows; 
C:\Program
 Files (x86)\gs\gs8.71\bin;C:\Program Files (x86) 
\ghostgum\gsview;C:\Program
 Files (x86)\Windows Live\Shared;C:\Program Files (x86) 
\Inkscape\Inkscape.exe



Thanx for support.
Jaroslav Hajtmar



Dne 17.2.2015 v 13:21 Akira Kakuto napsal(a):

No file latex.aux.
(./latex.aux) )
No pages of output.


OK, as I said previously, c:\windows\system32 does not
exist in your PATH.

In your command prompt
echo 000
will work, but
cmd /c echo 000
will not work.

Please test in your command prompt

set PATH=c:\windows\system32;%PATH%
pdflatex --shell-escape latex

It should work perfectly.

After that, repair the PATH variable,
by reading the manual of OS, if you don't understand.

Thanks,
Akira

___ 

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
___

Re: [NTG-context] \executesystemcommand dont work?

2015-02-16 Thread Jaroslav Hajtmar

Thanx Aditya for reply.

I compile this ConTeXt file:

\starttext
\immediate\write18{context --version}
\stoptext

with last standalone version of ConTeXt (minimals). Below is the console 
output and log file.
I do not know whether this can decipher be from a reading. It seems that 
write18 is enabled. I do not know what could have happened and why it 
does not work. Can be a problem in collision TeXlive vs Standalone 
version (paths problem)? I do not know how to fix it. I tried again to 
install the standalone version, but it did not help. I hope that I have 
somehow smashed up Windows because reinstalling windows because of 
dysfunctional ConTeXt me quite a scare...


Thanx Jaroslav Hajtmar


C:\$~1da\ConTeXt\ConTeXt-Tests\my_way\ScanCSV\t-scancsv_ConTeXt_module\2PabloRod
riguez5\bbbcontext test

mtx-context | warning: no (local) file './test', proceeding
mtx-context | run 1: luatex 
--fmt=C:/context/tex/texmf-cache/luatex-cache/c
ontext/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en 
--jobname=test

 --lua=C:/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb
1556f32e/formats/luatex/cont-en.lui --no-parse-first-line 
--c:currentrun=1 --c:
fulljobname=./test --c:input=./test --c:kindofrun=1 --c:maxnofruns=8 
cont-y

es.mkiv
This is LuaTeX, Version beta-0.79.1 (TeX Live 2014/W32TeX) (rev 5064)
 \write18 enabled.
open source  1  1  
C:/context/tex/texmf-context/tex/context/base/cont-yes

.mkiv

ConTeXt  ver: 2015.02.03 23:55 MKIV beta  fmt: 2015.2.16  int: 
english/english 



system   'cont-new.mkiv' loaded
open source  2  2  
C:/context/tex/texmf-context/tex/context/base/cont-new

.mkiv
close source 2  2  
C:/context/tex/texmf-context/tex/context/base/cont-new

.mkiv
system   files  jobname 'test', input './test', result 'test'
fontslatin modern fonts are not preloaded
languageslanguage 'en' is active
open source  2  3  
C:/$~1da/ConTeXt/ConTeXt-Tests/my_way/ScanCSV/t-scancs

v_ConTeXt_module/2PabloRodriguez5/bbb/test.tex
fontspreloading latin modern fonts (second stage)
fonts'fallback modern-designsize rm 12pt' is loaded
close source 2  3  
C:/$~1da/ConTeXt/ConTeXt-Tests/my_way/ScanCSV/t-scancs

v_ConTeXt_module/2PabloRodriguez5/bbb/test.tex
close source 1  3  
C:/context/tex/texmf-context/tex/context/base/cont-yes

.mkiv

mkiv lua stats   used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats   used cache path: 
C:/context/tex/texmf-cache/luatex-cache/conte

xt/5fe67e0bfe781ce0dde776fb1556f32e
mkiv lua stats   resource resolver: loadtime 0.012 seconds, 0 scans 
with scanti

me 0.000 seconds, 0 shared scans, 8 found files, scanned paths: none
mkiv lua stats   stored bytecode data: 364 modules (0.209 sec), 76 
tables (0.00

5 sec), 440 chunks (0.214 sec)
mkiv lua stats   running in nuts mode: yes
mkiv lua stats   cleaned up reserved nodes: 41 nodes, 439 lists of 438
mkiv lua stats   node memory usage: 2 glue, 2 penalty, 6 attribute, 20 
glue_spe

c, 2 attribute_list, 2 temp
mkiv lua stats   node list callback tasks: 6 unique task lists, 2 
instances (re

)created, 3 calls
mkiv lua stats   used backend: pdf (backend for directly generating pdf 
output)


mkiv lua stats   loaded patterns: en::2, load time: 0.000
mkiv lua stats   jobdata time: 0.003 seconds saving, 0.000 seconds loading
mkiv lua stats   callbacks: 55 direct, 239 indirect, 294 total
mkiv lua stats   result saved in file: test.pdf, compresslevel 3, 
objectcompres

slevel 3
mkiv lua stats   loaded fonts: 2 files: latinmodern-math.otf, 
lmroman12-regular

.otf
mkiv lua stats   fonts load time: 0.239 seconds
mkiv lua stats   used platform: win64, type: windows, binary subtree: 
texmf-win

64
mkiv lua stats   luatex banner: this is luatex, version beta-0.79.1 
(tex live 2

014/w32tex) (rev 5064)
mkiv lua stats   control sequences: 40425 of 65536 + 10
mkiv lua stats   lua properties: engine: lua, used memory: 60 MB (ctx: 
60 MB),

hash type: lua, hash chars: min(64,40), symbol mask: utf (¤ä╬Á¤ç)
mkiv lua stats   runtime: 0.627 seconds

mtx-context | run 2: luatex 
--fmt=C:/context/tex/texmf-cache/luatex-cache/c
ontext/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en 
--jobname=test

 --lua=C:/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb
1556f32e/formats/luatex/cont-en.lui --no-parse-first-line 
--c:currentrun=2 --c:
fulljobname=./test --c:input=./test --c:kindofrun=2 --c:maxnofruns=8 
cont-y

es.mkiv
This is LuaTeX, Version beta-0.79.1 (TeX Live 2014/W32TeX) (rev 5064)
 \write18 enabled.
open source  1  1  
C:/context/tex/texmf-context/tex/context/base/cont-yes

.mkiv

ConTeXt  ver: 2015.02.03 23:55 MKIV beta  fmt: 2015.2.16  int: 
english/english 



system   'cont-new.mkiv' loaded
open source  2  2  
C:/context/tex/texmf-context/tex/context/base/cont-new

.mkiv
close source 2  2  
C

Re: [NTG-context] \executesystemcommand dont work?

2015-02-16 Thread Jaroslav Hajtmar

Thanks to Pablo for testing of functionality.
Does anyone know whether it could be related to the random last 
comprehensive update of Win7? I read that Microsoft corrected with 
problem of  big security hole.


It is strange that a few days ago I find it all worked very well and 
after the last update of Windows 7 it not working.

You can someone please verify this?

Have you Pablo the latest Microsoft Windows 7 update??

Thanx
Jaroslav Hajtmar





Dne 16.2.2015 v 21:20 Pablo Rodriguez napsal(a):

On 02/16/2015 12:41 PM, Jaroslav Hajtmar wrote:

Hi ConTeXist.
After a long time I tried to recompile ConTeXt file that contained the
\executesystemcommand. It seems to me that this command stopped working.
Can anyone confirm or refute this my perception?

Hi Jaroslav,

the sample you sent works fine for me. Both files get compiled.


I call \executesystemcommand to compiling another ConTeXt file from
running ConTeXt. I use Windows 7 and problem is under TeXlive 2014
version and Standalone version too.

I’m using latest beta in Fedora 20.

At work, I use Win7 64 bits and \executesystemcommand works also fine (I
use it every day).

Sorry, but I’m afraid I don’t have a clue why it doesn’t work in your
system.


Pablo


___
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
___

Re: [NTG-context] \executesystemcommand dont work?

2015-02-16 Thread Jaroslav Hajtmar

Hi Aditya.
Thanx for reply. I am sending result from output console from your 
example ie:

\starttext
\writestatus{test}{before calling shell command}
\immediate\write18{echo HELP}
\writestatus{test}{after calling shell command}
\stoptext

Output is below.
Regarding the call ConTeXt, I often calls it directly from the editor 
(PsPad) but when frequently repeated compilations, then I type commands 
directly from terminal (command line of windows)


Thankx for attempt to solve my problem.
Jaroslav Hajtmar


C:\$~1da\ConTeXt\ConTeXt-Tests\my_way\ScanCSV\t-scancsv_ConTeXt_module\2PabloRod
riguez5\bbbcontext test

mtx-context | warning: no (local) file './test', proceeding
mtx-context | run 1: luatex 
--fmt=C:/context/tex/texmf-cache/luatex-cache/c
ontext/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en 
--jobname=test

 --lua=C:/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb
1556f32e/formats/luatex/cont-en.lui --no-parse-first-line 
--c:currentrun=1 --c:
fulljobname=./test --c:input=./test --c:kindofrun=1 --c:maxnofruns=8 
cont-y

es.mkiv
This is LuaTeX, Version beta-0.79.1 (TeX Live 2014/W32TeX) (rev 5064)
 \write18 enabled.
open source  1  1  
C:/context/tex/texmf-context/tex/context/base/cont-yes

.mkiv

ConTeXt  ver: 2015.02.03 23:55 MKIV beta  fmt: 2015.2.16  int: 
english/english 



system   'cont-new.mkiv' loaded
open source  2  2  
C:/context/tex/texmf-context/tex/context/base/cont-new

.mkiv
close source 2  2  
C:/context/tex/texmf-context/tex/context/base/cont-new

.mkiv
system   files  jobname 'test', input './test', result 'test'
fontslatin modern fonts are not preloaded
languageslanguage 'en' is active
open source  2  3  
C:/$~1da/ConTeXt/ConTeXt-Tests/my_way/ScanCSV/t-scancs

v_ConTeXt_module/2PabloRodriguez5/bbb/test.tex
fontspreloading latin modern fonts (second stage)
fonts'fallback modern-designsize rm 12pt' is loaded
test before calling shell command
test after calling shell command
close source 2  3  
C:/$~1da/ConTeXt/ConTeXt-Tests/my_way/ScanCSV/t-scancs

v_ConTeXt_module/2PabloRodriguez5/bbb/test.tex
close source 1  3  
C:/context/tex/texmf-context/tex/context/base/cont-yes

.mkiv

mkiv lua stats   used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats   used cache path: 
C:/context/tex/texmf-cache/luatex-cache/conte

xt/5fe67e0bfe781ce0dde776fb1556f32e
mkiv lua stats   resource resolver: loadtime 0.012 seconds, 0 scans 
with scanti

me 0.000 seconds, 0 shared scans, 8 found files, scanned paths: none
mkiv lua stats   stored bytecode data: 364 modules (0.231 sec), 76 
tables (0.00

6 sec), 440 chunks (0.237 sec)
mkiv lua stats   running in nuts mode: yes
mkiv lua stats   cleaned up reserved nodes: 41 nodes, 439 lists of 438
mkiv lua stats   node memory usage: 2 glue, 2 penalty, 6 attribute, 20 
glue_spe

c, 2 attribute_list, 2 temp
mkiv lua stats   node list callback tasks: 6 unique task lists, 2 
instances (re

)created, 3 calls
mkiv lua stats   used backend: pdf (backend for directly generating pdf 
output)


mkiv lua stats   loaded patterns: en::2, load time: 0.000
mkiv lua stats   jobdata time: 0.004 seconds saving, 0.001 seconds loading
mkiv lua stats   callbacks: 55 direct, 241 indirect, 296 total
mkiv lua stats   randomizer: resumed with value 0.53962828455458
mkiv lua stats   result saved in file: test.pdf, compresslevel 3, 
objectcompres

slevel 3
mkiv lua stats   loaded fonts: 2 files: latinmodern-math.otf, 
lmroman12-regular

.otf
mkiv lua stats   fonts load time: 0.267 seconds
mkiv lua stats   used platform: win64, type: windows, binary subtree: 
texmf-win

64
mkiv lua stats   luatex banner: this is luatex, version beta-0.79.1 
(tex live 2

014/w32tex) (rev 5064)
mkiv lua stats   control sequences: 40426 of 65536 + 10
mkiv lua stats   lua properties: engine: lua, used memory: 59 MB (ctx: 
59 MB),

hash type: lua, hash chars: min(64,40), symbol mask: utf (¤ä╬Á¤ç)
mkiv lua stats   runtime: 0.721 seconds

system  | total runtime: 1.095 seconds
C:\$~1da\ConTeXt\ConTeXt-Tests\my_way\ScanCSV\t-scancsv_ConTeXt_module\2PabloRod
riguez5\bbb



And here is log file:


open source  1  1  
C:/context/tex/texmf-context/tex/context/base/cont-yes.mkiv


ConTeXt  ver: 2015.02.03 23:55 MKIV beta  fmt: 2015.2.16  int: 
english/english 


system   'cont-new.mkiv' loaded
open source  2  2  
C:/context/tex/texmf-context/tex/context/base/cont-new.mkiv
close source 2  2  
C:/context/tex/texmf-context/tex/context/base/cont-new.mkiv

system   files  jobname 'test', input './test', result 'test'
fontslatin modern fonts are not preloaded
languageslanguage 'en' is active
open source  2  3  
C:/$~1da/ConTeXt/ConTeXt-Tests/my_way/ScanCSV/t-scancsv_ConTeXt_module/2PabloRodriguez5/bbb/test.tex

fonts

Re: [NTG-context] \executesystemcommand dont work?

2015-02-16 Thread Jaroslav Hajtmar

Hi Luigi.
Thanx for reply. I am sending result from output console from your 
example ie:

\starttext
\immediate\write18{echo OO}
\stoptext

Output is below.
To be honest, I've never done such a thing and did not examine how many 
times ConTeXt runs. I have always relied on the default settings.


Thankx for attempt to solve my problem.
Jaroslav Hajtmar


C:\$~1da\ConTeXt\ConTeXt-Tests\my_way\ScanCSV\t-scancsv_ConTeXt_module\2PabloRod
riguez5\bbbcontext test

mtx-context | warning: no (local) file './test', proceeding
mtx-context | run 1: luatex 
--fmt=C:/context/tex/texmf-cache/luatex-cache/c
ontext/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en 
--jobname=test

 --lua=C:/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb
1556f32e/formats/luatex/cont-en.lui --no-parse-first-line 
--c:currentrun=1 --c:
fulljobname=./test --c:input=./test --c:kindofrun=1 --c:maxnofruns=8 
cont-y

es.mkiv
This is LuaTeX, Version beta-0.79.1 (TeX Live 2014/W32TeX) (rev 5064)
 \write18 enabled.
open source  1  1  
C:/context/tex/texmf-context/tex/context/base/cont-yes

.mkiv

ConTeXt  ver: 2015.02.03 23:55 MKIV beta  fmt: 2015.2.16  int: 
english/english 



system   'cont-new.mkiv' loaded
open source  2  2  
C:/context/tex/texmf-context/tex/context/base/cont-new

.mkiv
close source 2  2  
C:/context/tex/texmf-context/tex/context/base/cont-new

.mkiv
system   files  jobname 'test', input './test', result 'test'
fontslatin modern fonts are not preloaded
languageslanguage 'en' is active
open source  2  3  
C:/$~1da/ConTeXt/ConTeXt-Tests/my_way/ScanCSV/t-scancs

v_ConTeXt_module/2PabloRodriguez5/bbb/test.tex
fontspreloading latin modern fonts (second stage)
fonts'fallback modern-designsize rm 12pt' is loaded
close source 2  3  
C:/$~1da/ConTeXt/ConTeXt-Tests/my_way/ScanCSV/t-scancs

v_ConTeXt_module/2PabloRodriguez5/bbb/test.tex
close source 1  3  
C:/context/tex/texmf-context/tex/context/base/cont-yes

.mkiv

mkiv lua stats   used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats   used cache path: 
C:/context/tex/texmf-cache/luatex-cache/conte

xt/5fe67e0bfe781ce0dde776fb1556f32e
mkiv lua stats   resource resolver: loadtime 0.011 seconds, 0 scans 
with scanti

me 0.000 seconds, 0 shared scans, 8 found files, scanned paths: none
mkiv lua stats   stored bytecode data: 364 modules (0.224 sec), 76 
tables (0.00

6 sec), 440 chunks (0.230 sec)
mkiv lua stats   running in nuts mode: yes
mkiv lua stats   cleaned up reserved nodes: 41 nodes, 439 lists of 438
mkiv lua stats   node memory usage: 2 glue, 2 penalty, 6 attribute, 20 
glue_spe

c, 2 attribute_list, 2 temp
mkiv lua stats   node list callback tasks: 6 unique task lists, 2 
instances (re

)created, 3 calls
mkiv lua stats   used backend: pdf (backend for directly generating pdf 
output)


mkiv lua stats   loaded patterns: en::2, load time: 0.000
mkiv lua stats   jobdata time: 0.003 seconds saving, 0.001 seconds loading
mkiv lua stats   callbacks: 55 direct, 239 indirect, 294 total
mkiv lua stats   randomizer: resumed with value 0.53962828455458
mkiv lua stats   result saved in file: test.pdf, compresslevel 3, 
objectcompres

slevel 3
mkiv lua stats   loaded fonts: 2 files: latinmodern-math.otf, 
lmroman12-regular

.otf
mkiv lua stats   fonts load time: 0.241 seconds
mkiv lua stats   used platform: win64, type: windows, binary subtree: 
texmf-win

64
mkiv lua stats   luatex banner: this is luatex, version beta-0.79.1 
(tex live 2

014/w32tex) (rev 5064)
mkiv lua stats   control sequences: 40426 of 65536 + 10
mkiv lua stats   lua properties: engine: lua, used memory: 56 MB (ctx: 
56 MB),

hash type: lua, hash chars: min(64,40), symbol mask: utf (¤ä╬Á¤ç)
mkiv lua stats   runtime: 0.643 seconds

system  | total runtime: 1.002 seconds
C:\$~1da\ConTeXt\ConTeXt-Tests\my_way\ScanCSV\t-scancsv_ConTeXt_module\2PabloRod
riguez5\bbb


and here is log file:

open source  1  1  
C:/context/tex/texmf-context/tex/context/base/cont-yes.mkiv


ConTeXt  ver: 2015.02.03 23:55 MKIV beta  fmt: 2015.2.16  int: 
english/english 


system   'cont-new.mkiv' loaded
open source  2  2  
C:/context/tex/texmf-context/tex/context/base/cont-new.mkiv
close source 2  2  
C:/context/tex/texmf-context/tex/context/base/cont-new.mkiv

system   files  jobname 'test', input './test', result 'test'
fontslatin modern fonts are not preloaded
languageslanguage 'en' is active
open source  2  3  
C:/$~1da/ConTeXt/ConTeXt-Tests/my_way/ScanCSV/t-scancsv_ConTeXt_module/2PabloRodriguez5/bbb/test.tex

fontspreloading latin modern fonts (second stage)
fonts'fallback modern-designsize rm 12pt' is loaded
close source 2  3  
C:/$~1da/ConTeXt/ConTeXt-Tests/my_way/ScanCSV/t-scancsv_ConTeXt_module

[NTG-context] \executesystemcommand dont work?

2015-02-16 Thread Jaroslav Hajtmar

Hi ConTeXist.
After a long time I tried to recompile ConTeXt file that contained the 
\executesystemcommand. It seems to me that this command stopped working.

Can anyone confirm or refute this my perception?
I call \executesystemcommand to compiling another ConTeXt file from 
running ConTeXt. I use Windows 7 and problem is under TeXlive 2014 
version and Standalone version too.


Thanx Jaroslav Hajtmar


Here is my minimal example:
When I compile maintestfile.tex, then I expect, that 
compilebyexecutesystemcommand.pdf is created during compilation of 
maintestfile.tex file.


I have two files.

First is test.tex name:

\starttext
\input tufte
\stoptext


And second is file maintestfile.tex:

\starttext
\executesystemcommand{context --result=compilebyexecutesystemcommand.pdf 
test.tex}

\input knuth
\stoptext





___
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
___

Re: [NTG-context] expand date from CSV file

2014-12-19 Thread Jaroslav Hajtmar

;-)
Thanx Peter. I'm too not thought about solutions :-).
I was so focused to mined data from a CSV file, and I've not think much 
about the appropriate algorithm.

I love attentive and thoughtful people (although often I'm not alone such)
Maybe I corrected in a subsequent e-mail properly.
One more thanx.

Jaroslav Hajtmar


Dne 18.12.2014 v 13:37 Peter Münster napsal(a):

On Thu, Dec 18 2014, Jaroslav Hajtmar wrote:


 if (year2000) then year=year+2000 end;

Hi,

What about Test;11/11/1999 ... ;-)



___
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
___

Re: [NTG-context] expand date from CSV file

2014-12-18 Thread Jaroslav Hajtmar

Hi Pablo

Here is a quick solution. However, it not treat the incorrect input 
data, ie it requires, however, correct input, otherwise it will collapse ...


Jaroslav Hajtmar



\usemodule[scancsv]

\def\ddmm#1#2#3{% #1 - date, #2 - old separator, #3 - new separator
\startlua
parsedate=thirddata.scancsv.ParseCSVLine('#1','#2');
day=tonumber(parsedate[1]);
month=tonumber(parsedate[2]);
year=tonumber(parsedate[3]);
if (year2000) then year=year+2000 end;
tex.print(day..'#3'..month..'#3'..year);
\stoplua
}

\unexpanded\def\lineaction{
\Name\ arrived on \ddmm{\Date}{/}{.} \\
}


% Name;Date
% ME;11/10/14
% You;05/02/14
% He;15/02/2014
% She;03/03/12
% It;03/03/14

\setheader
 \setsep{;}
 \setfiletoscan{mail.csv}

\starttext
   \filelineaction
\stoptext





Dne 17.12.2014 22:20, Pablo Rodriguez napsal(a):

Dear list,

I have the following sample:

 \usemodule[scancsv]

 \unexpanded\def\lineaction{
 \Name\ arrived on \Date\\
 }

 \setheader
 \setsep{;}
 \setfiletoscan{mail.csv}

 \starttext
 \filelineaction
 \stoptext

that reads data from mail.csv:

 Name;Date
 ME;11/10/14
 You;05/02/14
 He;15/02/2014
 She;03/03/12
 It;03/03/14

My question is simple (and not related to CSV data import): how can I
define a command (ConTeXt or Lua) that changes date format from DD/MM/YY
to DD/MM/ when required?

Many thanks for your help,


Pablo


___
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
___

Re: [NTG-context] expand date from CSV file

2014-12-18 Thread Jaroslav Hajtmar

Hi Pablo,
I am sending still slightly modified version (use local variables and 
better typographic output).
It use of much variables, but at least it is clear how it works. For 
solution occurred me to use parsing function that I have been defined in 
the library, so that it can be successfully used.


Sincerely
Jaroslav Hajtmar



\usemodule[scancsv]

\def\ddmm#1#2#3{% #1 - date, #2 - old separator, #3 - new separator
\startlua
local parsedate=thirddata.scancsv.ParseCSVLine('#1','#2');
local day=tonumber(parsedate[1]);
local month=tonumber(parsedate[2]);
local year=tonumber(parsedate[3]);
if (year2000) then year=year+2000 end;
tex.print(day..'#3'..month..'#3'..year);
\stoplua
}

\unexpanded\def\lineaction{
\Name\ arrived on \ddmm{\Date}{/}{.\\,} \\
}


% Name;Date
% ME;11/10/14
% You;05/02/14
% He;15/02/2014
% She;03/03/12
% It;03/03/14

\setheader
 \setsep{;}
 \setfiletoscan{mail.csv}

\starttext
   \filelineaction
\stoptext




Dne 18.12.2014 9:39, Jaroslav Hajtmar napsal(a):

Hi Pablo

Here is a quick solution. However, it not treat the incorrect input 
data, ie it requires, however, correct input, otherwise it will 
collapse ...


Jaroslav Hajtmar



\usemodule[scancsv]

\def\ddmm#1#2#3{% #1 - date, #2 - old separator, #3 - new separator
\startlua
parsedate=thirddata.scancsv.ParseCSVLine('#1','#2');
day=tonumber(parsedate[1]);
month=tonumber(parsedate[2]);
year=tonumber(parsedate[3]);
if (year2000) then year=year+2000 end;
tex.print(day..'#3'..month..'#3'..year);
\stoplua
}

\unexpanded\def\lineaction{
\Name\ arrived on \ddmm{\Date}{/}{.} \\
}


% Name;Date
% ME;11/10/14
% You;05/02/14
% He;15/02/2014
% She;03/03/12
% It;03/03/14

\setheader
 \setsep{;}
 \setfiletoscan{mail.csv}

\starttext
   \filelineaction
\stoptext





Dne 17.12.2014 22:20, Pablo Rodriguez napsal(a):

Dear list,

I have the following sample:

 \usemodule[scancsv]

 \unexpanded\def\lineaction{
 \Name\ arrived on \Date\\
 }

 \setheader
 \setsep{;}
 \setfiletoscan{mail.csv}

 \starttext
 \filelineaction
 \stoptext

that reads data from mail.csv:

 Name;Date
 ME;11/10/14
 You;05/02/14
 He;15/02/2014
 She;03/03/12
 It;03/03/14

My question is simple (and not related to CSV data import): how can I
define a command (ConTeXt or Lua) that changes date format from DD/MM/YY
to DD/MM/ when required?

Many thanks for your help,


Pablo


___ 

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
___

Re: [NTG-context] expand date from CSV file

2014-12-18 Thread Jaroslav Hajtmar

Hi Pablo.
Peter pointed out an error in my solution. Thanks Peter! His message but 
pointed out that in fact is not the task as simple as it seems at first 
glance. In fact, a lot depends on what target group for those you solve 
a problem resp. whether e.g. date of birth of persons. What does it mean 
03/01/00? It means 1/3/1900? Or does it mean 01/03/2000? Particular job 
you have to deal specifically separately. It occurred to me yet 
following solution that respects the current year as the year when he 
could anyone born. E.g. 19/12/14 means a newborn soul (ie. In fact, 
12/19/2014), while 01/02/15 mean old man ie. in fact 01/02/1915. For the 
specific case you have to modify or create the solution separately.


Greetings
Jaroslav Hajtmar

Here is new minimal example:

\usemodule[scancsv]

\def\ddmm#1#2#3{% #1 - date, #2 - old separator, #3 - new separator
\startlua
local parsedate=thirddata.scancsv.ParseCSVLine('#1','#2');
local day=tonumber(parsedate[1]);
local month=tonumber(parsedate[2]);
local year=tonumber(parsedate[3]);
if (year100) then % when is only two digits year format then
if year=14 then % it is very young person
year=year+2000
else % this person has more than one hundred years
year=year+1900;
end;
end;
tex.print(day..'#3'..month..'#3'..year);
\stoplua
}

\unexpanded\def\lineaction{
\Name\ born \Date\quad  (\ddmm{\Date}{/}{.\\,}) \\
}

% Content of CSV file:
% Name;Date
% ME;11/10/14
% You;05/02/14
% He;15/02/2014
% She;03/03/12
% It;03/03/14
% A;11/11/1999
% B;01/2/1964
% C;02/3/23
% D;03/4/64
% E;04/5/00
% F;05/6/01
% G;05/7/15
% H;05/7/1915
% Test0;1/2/00
% Test1;1/2/01
% Test2;1/2/02
% Test3;1/2/03
% Test4;1/2/04
% Test5;1/2/05
% Test6;1/2/06
% Test7;1/2/07
% Test8;1/2/08
% Test9;1/2/09
% Test10;1/2/10
% Test11;1/2/11
% Test12;1/2/12
% Test13;1/2/13
% Test14;1/2/14
% Test15;1/2/15
% Test16;1/2/16
% Test17;1/2/17
% Test18;1/2/18
% Test19;1/2/19
% Test20;1/2/20

\setheader
 \setsep{;}
 \setfiletoscan{mail.csv}

\starttext
   \filelineaction
\stoptext



Dne 18.12.2014 19:07, Pablo Rodriguez napsal(a):

On 12/18/2014 01:24 PM, Jaroslav Hajtmar wrote:

Hi Pablo,
I am sending still slightly modified version (use local variables and
better typographic output).
It use of much variables, but at least it is clear how it works. For
solution occurred me to use parsing function that I have been defined in
the library, so that it can be successfully used.

Many thanks for your reply, Jaroslav.

This is exactly what I need.

Many thanks for your help,

Pablo



\usemodule[scancsv]

\def\ddmm#1#2#3{% #1 - date, #2 - old separator, #3 - new separator
\startlua
  local parsedate=thirddata.scancsv.ParseCSVLine('#1','#2');
  local day=tonumber(parsedate[1]);
  local month=tonumber(parsedate[2]);
  local year=tonumber(parsedate[3]);
  if (year2000) then year=year+2000 end;
  tex.print(day..'#3'..month..'#3'..year);
\stoplua
}

\unexpanded\def\lineaction{
  \Name\ arrived on \ddmm{\Date}{/}{.\\,} \\
}


% Name;Date
% ME;11/10/14
% You;05/02/14
% He;15/02/2014
% She;03/03/12
% It;03/03/14

\setheader
   \setsep{;}
   \setfiletoscan{mail.csv}

\starttext
 \filelineaction
\stoptext




Dne 18.12.2014 9:39, Jaroslav Hajtmar napsal(a):

Hi Pablo

Here is a quick solution. However, it not treat the incorrect input
data, ie it requires, however, correct input, otherwise it will
collapse ...

Jaroslav Hajtmar



\usemodule[scancsv]

\def\ddmm#1#2#3{% #1 - date, #2 - old separator, #3 - new separator
\startlua
 parsedate=thirddata.scancsv.ParseCSVLine('#1','#2');
 day=tonumber(parsedate[1]);
 month=tonumber(parsedate[2]);
 year=tonumber(parsedate[3]);
 if (year2000) then year=year+2000 end;
 tex.print(day..'#3'..month..'#3'..year);
\stoplua
}

\unexpanded\def\lineaction{
 \Name\ arrived on \ddmm{\Date}{/}{.} \\
}


% Name;Date
% ME;11/10/14
% You;05/02/14
% He;15/02/2014
% She;03/03/12
% It;03/03/14

\setheader
  \setsep{;}
  \setfiletoscan{mail.csv}

\starttext
\filelineaction
\stoptext





Dne 17.12.2014 22:20, Pablo Rodriguez napsal(a):

Dear list,

I have the following sample:

  \usemodule[scancsv]

  \unexpanded\def\lineaction{
  \Name\ arrived on \Date\\
  }

  \setheader
  \setsep{;}
  \setfiletoscan{mail.csv}

  \starttext
  \filelineaction
  \stoptext

that reads data from mail.csv:

  Name;Date
  ME;11/10/14
  You;05/02/14
  He;15/02/2014
  She;03/03/12
  It;03/03/14

My question is simple (and not related to CSV data import): how can I
define a command (ConTeXt or Lua) that changes date format from DD/MM/YY
to DD/MM/ when required?

Many thanks for your help,


Pablo




___
If your question is of interest to others

Re: [NTG-context] issue with t-scancsv.lua

2014-12-08 Thread Jaroslav Hajtmar

Hello Pablo.
What do you think of this solution:

\usemodule[scancsv]

\setuppapersize[C6, landscape]
\setuppagenumbering[location=]

\unexpanded\def\lineaction{
\edef\lcA{\lowercase{\cA}}
\edef\ucB{\uppercase{\cB}}
cA: \cA -- lowercase cA: \lcA\crlf
cB: \cB -- upercase cB: \ucB\crlf
cC: \cC -- cD: \cD\crlf

\lowercase{}\crlf
\uppercase{}\crlf
\page
}

\setsep{;}
\setfiletoscan{mailmergedatatable.csv}

\starttext
\filelineaction
\stoptext


I greet you

Jaroslav Hajtmar


Dne 8.12.2014 13:38, Pablo Rodriguez napsal(a):

Hello Jaroslav,

I have discovered that it is impossible to change letter cases with
fields imported with t-scancsv.lua.

Here you have a sample:

\usemodule[scancsv]

\setuppapersize[C6, landscape]
\setuppagenumbering[location=]

\unexpanded\def\lineaction{
\lowercase{\cA}\crlf
\uppercase{\cB}\crlf
\cC--\cD\crlf

\lowercase{}\crlf
\uppercase{}\crlf
\page
}

\setsep{;}
\setfiletoscan{mailmergedatatable.csv}

\starttext
 \filelineaction
\stoptext

The contents of mailmergedatatable.csv would be:

name;address;postcode;city;
ME;STREET;;HERE;
You;Square;;There;

Would it be a way to avoid this?

Many thanks for your help,


Pablo


___
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
___

Re: [NTG-context] issue with t-scancsv.lua

2014-12-08 Thread Jaroslav Hajtmar

Hi Pablo.
I am glad that my library for you to use ...
I noticed that you have in your CSV file header with column names (ie. 
head of CSV document). I do not know if you noticed the option put this 
information into scancsv.lua library. This is done via the command 
\setheader. In this case library does not consider the first line of the 
CSV file as a data line. From the header of CSV file are now macros 
(from header names) contain later data from rows of the CSV file 
(changing in cycle). In addition, you can also use internal hooks. CSV 
file can even contain macros (must be defined before processing the CSV 
file).


I greet you.
Jaroslav Hajtmar

Example of use hooks etc. eg. Here:

\usemodule[scancsv]

\setuppapersize[C6, landscape]
\setuppagenumbering[location=]

% Structure of CSV file - you can use macros in CSV table too
% name;address;postcode;city;linecolor
% ME;STREET;;HERE;\green;
% You;Square;;There;\red;
% we;another Square;111;anyplace;\blue;


% Library is making \name, \address, \postcode, \city and \linecolor macros
% when you using \setheader command.

% Your example:
\unexpanded\def\lineaction{
\edef\lowercasename{\lowercase{\name}}
\edef\uppercaseaddress{\uppercase{\address}}
name: {\linecolor\name}\ -- lowercase name: \lowercasename\crlf
address: \address\ -- upercase address: \uppercaseaddress\crlf
\postcode\ \city\crlf

\page
}


% My example with hooks:
\unexpanded\def\tablelineaction{%
\edef\ehname{\hname}%
\edef\ehaddress{\haddress}%
\edef\ehpostcode{\hpostcode}%
\edef\ehcity{\hcity}%
\ehname \ehaddress \ehpostcode \ehcity %
}

% My simple example with hooks:
\def\simpletablelineaction{%
\bTD{\linecolor\numline}\eTD\hname\haddress\hpostcode\hcity%
}


\setsep{;} % set separator
\setheader % set information about header
\setfiletoscan{mailmergedatatable.csv}

\starttext
% process all file

Here is begin of processing...

\filelineaction

And here is end

\page

And now we can use internal hooks:

\def\bch{\bTD } % begin column hook
\def\ech{\eTD} % end column hook
\def\blinehook{\bTR } % begin line hook
\def\elinehook{\eTR} % end line hook
\def\bfilehook{\bTABLE } % begin CSV file hook
\def\efilehook{\eTABLE} % end CSV file hook

Here is begin of processing...

%process all file too (endless cycle)
\doloopif{1}{==}{1}{\tablelineaction}

And here is end

\page

Printing only specific data:

\doloopif{\name}{eq}{You}{\tablelineaction}

\page

Simpletablelineaction:

\doloopif{1}{==}{1}{\simpletablelineaction}

\page

Another using of hooks:

\def\bch{\bgroup\linecolor\bf } % begin column hook
\def\ech{\egroup,\ } % end column hook
\def\blinehook{Here is new \numline. line of CSV file:\crlf } % begin 
line hook

\def\elinehook{\hairline\par} % end line hook
\def\bfilehook{Here is all CSV file:\blank[2*big] } % begin CSV file hook
\def\efilehook{\par Here is end of file processing\par} % end CSV file hook

\doloopif{1}{==}{1}{\tablelineaction}



\stoptext





Dne 8.12.2014 17:21, Pablo Rodriguez napsal(a):

Hi Jaroslav,

many thanks for your reply.

It works fine here. Let’s see what I can do tomorrow with the real
documents :-)

Many thanks for your help again,


Pablo


On 12/08/2014 01:56 PM, Jaroslav Hajtmar wrote:

Hello Pablo.
What do you think of this solution:

\usemodule[scancsv]

\setuppapersize[C6, landscape]
\setuppagenumbering[location=]

\unexpanded\def\lineaction{
\edef\lcA{\lowercase{\cA}}
\edef\ucB{\uppercase{\cB}}
cA: \cA -- lowercase cA: \lcA\crlf
cB: \cB -- upercase cB: \ucB\crlf
cC: \cC -- cD: \cD\crlf

\lowercase{}\crlf
\uppercase{}\crlf
\page
}

\setsep{;}
\setfiletoscan{mailmergedatatable.csv}

\starttext
  \filelineaction
\stoptext


I greet you

Jaroslav Hajtmar


___
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
___

[NTG-context] Moving hairline in itemize environment

2014-11-21 Thread Jaroslav Hajtmar

Hello ConTeXist.
Is there possibility move hairline in itemize environment to the leftto 
start from the beginning of the line independently indentation environment?


Thanx Jaroslav Hajtmar

Here is minimal example:

\starttext

\startitemize[n]
\item \input ward
\hairline %this line move to the left to start from the very 
beginning of the line

\item \input ward
\hairline %this line move to the left to start from the very 
beginning of the line

\item \input ward
\hairline%this line move to the left to start from the very 
beginning of the line


\stopitemize
\stoptext



___
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
___

Re: [NTG-context] mail merge in mkiv?

2014-11-09 Thread Jaroslav Hajtmar

Hello Pablo.
The module I created about before 4 years ago, when I wanted to learn to 
program in Lua. Therefore, I think that my module is too rudimentary and 
not quite optimized. Unfortunately, since I do not now use much Lua, so 
I dare not reasonably somehow finish. Before inclusion in third party 
modules that would probably have to take some experienced Lua expert and 
redo the whole module. For my needs it is enough. I use this module very 
often for my practise (I am teacher). Perhaps it helped a little.

Greetings Jaroslav Hajtmar


Dne 8.11.2014 11:09, Pablo Rodriguez napsal(a):

On 11/07/2014 12:44 PM, Jaroslav Hajtmar wrote:

Hello Pablo.

Here is the solution of your minimal example:
http://public.hajtmar.com/?cesta=JRsVFQdsJhwoWyAdFwQROwZWBFkwERgeFzAEJjMbLSYcKAAcHxYUAS8XVkIkIhAVHyYsFgsZEzYXAw
  
Examples of more complex and comprehensive application of my

t-scancsv.lua mudule are available at:
http://public.hajtmar.com/?cesta=JRsVFQdsJhwoWyAdFwQROwZWBFkwERgeFzAEJjMbLSYcKAAcHxYUAS8X
  
I zip the entire folder and you can download it at:

http://public.hajtmar.com/files/TeX/context/t-scancsv_ConTeXt_module/t-scancsv_ConTeXt_module.zip

Perhaps those that serve well.

Many thanks for your reply, Jaroslav.

Since this feature may be useful to other users, how about including it
as a third-party module in the ConTeXt Suite?

Many thanks for your help again,


Pablo


___
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
___

Re: [NTG-context] mail merge in mkiv?

2014-11-09 Thread Jaroslav Hajtmar

Hello Pablo.
Here is example of add days in Lua:

\startluacode
x=5 -- add five days
tex.print ('Actual date is :'..os.date('%d.%m.%Y')..'\\crlf')
tex.print ( 'And x days added date is :'.. os.date('%d.%m.%Y',os.time()+ 
x * 24 * 3600))

\stopluacode


Jaroslav Hajtmar



Dne 9.11.2014 22:49, Pablo Rodriguez napsal(a):

On 11/09/2014 03:59 PM, Jaroslav Hajtmar wrote:

Hello Pablo.
The module I created about before 4 years ago, when I wanted to learn to
program in Lua. Therefore, I think that my module is too rudimentary and
not quite optimized. Unfortunately, since I do not now use much Lua, so
I dare not reasonably somehow finish. Before inclusion in third party
modules that would probably have to take some experienced Lua expert and
redo the whole module. For my needs it is enough. I use this module very
often for my practise (I am teacher). Perhaps it helped a little.
Greetings Jaroslav Hajtmar

Many thanks for the module, Jaroslav.

BTW, wouldn’t you know how can I set a \date using Lua that adds x
working days to the current date?

Many thanks for your help,


Pablo


___
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
___

  1   2   3   4   >