Re: [NTG-context] \typefile from n-th line

2010-10-15 Thread luigi scarso
2010/10/15 Procházka Lukáš Ing. - Pontex s. r. o. l...@pontex.cz:
 Hello,

 I'd need to \typefile a file from n-th line (= ignoring first n-1 lines).

 Is there such an option for \typefile macro?
 (http://wiki.contextgarden.net/Reference/en/typefile is silent.)

 I tried:

 \typefile[default][lines={10}]{a_file.txt} % Start at line 10

 \typefile[default][lines={10,+1}]{a_file.txt} % Start at line 10, step = 1

 \typefile[default][start=10]{a_file.txt} % Start at line 10

 \typefile[default][from=10]{a_file.txt} % Start at line 10

 No success.

 (The last Ctx minimals, WinXP.)

 Lukas
Not an answer, but quick recipe:
With mkiv is trivial ; use lua to skip the first n-1 lines.
With  mkii just use luatex as lua interpreter to call with
\executesystemcommand  and then see previous point.


-- 
luigi
___
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] \typefile from n-th line

2010-10-15 Thread Henning Hraban Ramm


Am 2010-10-15 um 09:16 schrieb Procházka Lukáš Ing. - Pontex s. r. o.:

I'd need to \typefile a file from n-th line (= ignoring first n-1  
lines).



\typefile[default][start=10]{a_file.txt} % Start at line 10



According to older ML messages and the source, \typefile[start=10]  
should work. Maybe it need stop also?

Otherwise it's undocumented.

see
http://source.contextgarden.net/tex/context/base/buff-ver.mkii?search=typefile 
 (MkII)
http://source.contextgarden.net/tex/context/base/buff-ver.mkiv?search=typefile 
 (MkIV)



Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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] \typefile from n-th line

2010-10-15 Thread Peter Münster
On Fri, Oct 15 2010, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
 
 I'd need to \typefile a file from n-th line (= ignoring first n-1 lines).

\starttext% 1
\typefile[range=3]{test.tex}  % 2
bla   % 3
bla   % 4
bla   % 5
bla   % 6
\stoptext % 7

See also: http://tracker.luatex.org/view.php?id=475

Cheers, Peter

-- 
Contact information: http://pmrb.free.fr/contact/


___
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] \typefile from n-th line

2010-10-15 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello, it doesn't seem to work.

Let's have t-TypeF2.mkiv with the following content:

---
\setuptyping[default][bodyfont=small,style={\ttx\setupinterlinespace}] % 1
% 2
\starttext % 3
  \typefile[default][start=4]{t-TypeF2.mkiv} % = This file; 4
  \typefile[default][start=4,stop=99]{t-TypeF2.mkiv} % = This file; 5
  \typefile[default][lines={4,+1}]{t-TypeF2.mkiv} % = This file; 6
\stoptext % 7
---

If you see the result, all lines are printed in all cases.

Moreover, 4 and 99 are also printed in the front and at the end of the 
typed file in the second case.

2Luigi:


Not an answer, but quick recipe:
With mkiv is trivial ; use lua to skip the first n-1 lines.
With  mkii just use luatex as lua interpreter to call with
\executesystemcommand  and then see previous point.


I had also such idea, but I believed to be simply solvable even with the 
existing \typefile command - supposing there is start/stop line option (or it 
couldn't be so complicated to provide them). So I supposed the valid syntax is 
unknown for me.

Lukas


On Fri, 15 Oct 2010 10:00:10 +0200, Henning Hraban Ramm hra...@fiee.net wrote:


\typefile[default][start=10]{a_file.txt} % Start at line 10



According to older ML messages and the source, \typefile[start=10]
should work. Maybe it need stop also?
Otherwise it's undocumented.

see
http://source.contextgarden.net/tex/context/base/buff-ver.mkii?search=typefile
  (MkII)
http://source.contextgarden.net/tex/context/base/buff-ver.mkiv?search=typefile
  (MkIV)


--
Ing. Lukáš Procházka [mailto:l...@pontex.cz]
Pontex s. r. o.  [mailto:pon...@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

t-TypeF2.mkiv
Description: Binary data


t-TypeF2.pdf
Description: Adobe PDF document
___
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] \typefile from n-th line

2010-10-15 Thread Procházka Lukáš Ing . - Pontex s . r . o .

... Yes, thanks, that's it:

\typefile[default][range={3,5}]{t-TypeF2.mkiv} % If also the upper limit is to 
be specified

Regards,

Lukas


On Fri, 15 Oct 2010 10:09:13 +0200, Peter Münster pmli...@free.fr wrote:


On Fri, Oct 15 2010, Procházka Lukáš Ing. - Pontex s. r. o. wrote:


I'd need to \typefile a file from n-th line (= ignoring first n-1 lines).


\starttext% 1
\typefile[range=3]{test.tex}  % 2
bla   % 3
bla   % 4
bla   % 5
bla   % 6
\stoptext % 7

See also: http://tracker.luatex.org/view.php?id=475

Cheers, Peter




--
Ing. Lukáš Procházka [mailto:l...@pontex.cz]
Pontex s. r. o.  [mailto:pon...@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

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