Re: [NTG-context] number of lines ?

2009-01-22 Thread Wolfgang Schuster
On Thu, Jan 22, 2009 at 12:02 PM, Alan Stone
software.list.1e...@gmail.com wrote:
 Hi,

 Is there a command which returns the number of lines for a given portion of
 text ?

\starttext

\setbox\scratchbox\vbox{\input knuth\par}

\getnoflines\htdp\scratchbox

Your text has \noflines\ lines.

\stoptext

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] number of lines ?

2009-01-22 Thread Alan Stone
On Thu, Jan 22, 2009 at 12:22 PM, Wolfgang Schuster 
schuster.wolfg...@googlemail.com wrote:

 On Thu, Jan 22, 2009 at 12:02 PM, Alan Stone
 software.list.1e...@gmail.com wrote:
  Hi,
 
  Is there a command which returns the number of lines for a given portion
 of
  text ?

 \starttext

 \setbox\scratchbox\vbox{\input knuth\par}

 \getnoflines\htdp\scratchbox


\getnoflines{\htdp\scratchbox}  % this works


 Your text has \noflines\ lines.


or: Your text has \noflines lines.


 \stoptext


\scratchingmyhair...  ;O)

! Missing number, treated as zero.
to be read again
   l
l.7 Your text has \noflines\ l
  ines.

Alan

-- 
Best,
Alan

* TeX engine = LuaTeX
*ConTeXt  minimals ver: 2009.01.18 14:39 MKIV  fmt: 2009.1.22  int:
english/english
* Ubuntu 8.04 Hardy Heron, Windows XP SP3 Home
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] number of lines ?

2009-01-22 Thread Otared Kavian


On 22 janv. 09, at 15:39, Alan Stone wrote:

On Thu, Jan 22, 2009 at 12:22 PM, Wolfgang Schuster schuster.wolfg...@googlemail.com 
 wrote:

On Thu, Jan 22, 2009 at 12:02 PM, Alan Stone
software.list.1e...@gmail.com wrote:
 Hi,

 Is there a command which returns the number of lines for a given  
portion of

 text ?

\starttext

\setbox\scratchbox\vbox{\input knuth\par}

\getnoflines\htdp\scratchbox

\getnoflines{\htdp\scratchbox}  % this works


Your text has \noflines\ lines.

or: Your text has \noflines lines.


Try: Your text has {\the\noflines} lines.


Best regards: OK___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] number of lines ?

2009-01-22 Thread Alan Stone

 Try: Your text has {\the\noflines} lines.


Your text has \the\noflines\ lines.  % works also

Thanks.

-- 
Best,
Alan

* TeX engine = LuaTeX
* ConTeXt  minimals ver: 2009.01.18 14:39 MKIV  fmt: 2009.1.22  int:
english/english
* Ubuntu 8.04 Hardy Heron, Windows XP SP3 Home
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] number of lines ?

2009-01-22 Thread Alan Stone
On Thu, Jan 22, 2009 at 3:54 PM, Alan Stone
software.list.1e...@gmail.comwrote:

 Try: Your text has {\the\noflines} lines.


 Your text has \the\noflines\ lines.  % works also

 Thanks.


How do you substract/add a number from/to \noflines ?

I tried

\thinrules[n=\advance\the\noflines by -2]
\thinrules[n=\advance\noflines by -2]
\thinrules[n={\advance\the\noflines by -2}]
\thinrules[n={\advance\noflines by -2}]

neither works.

-- 
Best,
Alan

* TeX engine = LuaTeX
* ConTeXt  minimals ver: 2009.01.18 14:39 MKIV  fmt: 2009.1.22  int:
english/english
* Ubuntu 8.04 Hardy Heron, Windows XP SP3 Home
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] number of lines ?

2009-01-22 Thread Wolfgang Schuster


Am 22.01.2009 um 17:20 schrieb Alan Stone:

On Thu, Jan 22, 2009 at 3:54 PM, Alan Stone software.list.1e...@gmail.com 
 wrote:

Try: Your text has {\the\noflines} lines.

Your text has \the\noflines\ lines.  % works also

Thanks.

How do you substract/add a number from/to \noflines ?

I tried

\thinrules[n=\advance\the\noflines by -2]
\thinrules[n=\advance\noflines by -2]
\thinrules[n={\advance\the\noflines by -2}]
\thinrules[n={\advance\noflines by -2}]


\thinrules[n=\number\numexpr\noflines-2\relax]

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] number of lines ?

2009-01-22 Thread Alan Stone
How do you make the attached example work (see comments at the beginning of
the file) ?

{Thus, I came to the conclusion that the designer of a new system mus\ETC.
! Paragraph ended before \makelines was complete.
to be read again
   \par
l.22

?

Alan

On Thu, Jan 22, 2009 at 3:46 PM, Otared Kavian ota...@gmail.com wrote:


 On 22 janv. 09, at 15:39, Alan Stone wrote:

 On Thu, Jan 22, 2009 at 12:22 PM, Wolfgang Schuster 
 schuster.wolfg...@googlemail.com wrote:

 On Thu, Jan 22, 2009 at 12:02 PM, Alan Stone
 software.list.1e...@gmail.com wrote:
  Hi,
 
  Is there a command which returns the number of lines for a given portion
 of
  text ?

 \starttext

 \setbox\scratchbox\vbox{\input knuth\par}

 \getnoflines\htdp\scratchbox


 \getnoflines{\htdp\scratchbox}  % this works




 Your text has \noflines\ lines.


 or: Your text has \noflines lines.


 Try: Your text has {\the\noflines} lines.


 Best regards: OK



makelines.tex
Description: TeX 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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] number of lines ?

2009-01-22 Thread Wolfgang Schuster


Am 22.01.2009 um 19:35 schrieb Alan Stone:

How do you make the attached example work (see comments at the  
beginning of the file) ?


\long\def\makelines#1{%
  ...}

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] number of lines ?

2009-01-22 Thread Alan Stone
Thanks a lot Wolfgang the Wise Wizard of TeX.  :O)

Alan

On Thu, Jan 22, 2009 at 7:53 PM, Wolfgang Schuster 
schuster.wolfg...@googlemail.com wrote:


 Am 22.01.2009 um 19:35 schrieb Alan Stone:

  How do you make the attached example work (see comments at the beginning
 of the file) ?


 \long\def\makelines#1{%
  ...}


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

 ___




-- 
Best,
Alan

* TeX engine = LuaTeX
* ConTeXt  minimals ver: 2009.01.18 14:39 MKIV  fmt: 2009.1.22  int:
english/english
* Ubuntu 8.04 Hardy Heron, Windows XP SP3 Home
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] number of lines ?

2009-01-22 Thread Alan Stone
On Thu, Jan 22, 2009 at 5:54 PM, Wolfgang Schuster 
schuster.wolfg...@googlemail.com wrote:


 Am 22.01.2009 um 17:20 schrieb Alan Stone:

  On Thu, Jan 22, 2009 at 3:54 PM, Alan Stone 
 software.list.1e...@gmail.com wrote:
 Try: Your text has {\the\noflines} lines.

 Your text has \the\noflines\ lines.  % works also

 Thanks.

 How do you substract/add a number from/to \noflines ?

 I tried

 \thinrules[n=\advance\the\noflines by -2]
 \thinrules[n=\advance\noflines by -2]
 \thinrules[n={\advance\the\noflines by -2}]
 \thinrules[n={\advance\noflines by -2}]


 \thinrules[n=\number\numexpr\noflines-2\relax]


And how do you make a division of \number\numexpr\noflines-2, for ex. by 2 ?

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] number of lines ?

2009-01-22 Thread Wolfgang Schuster


Am 22.01.2009 um 22:23 schrieb Alan Stone:

And how do you make a division of \number\numexpr\noflines-2, for  
ex. by 2 ?


\numexpr\noflines/2\relax

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___