ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* number of lines ?
@ 2009-01-22 11:02 Alan Stone
  2009-01-22 11:22 ` Wolfgang Schuster
  0 siblings, 1 reply; 12+ messages in thread
From: Alan Stone @ 2009-01-22 11:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi,

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

-- 
Best,
Alan

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

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: number of lines ?
  2009-01-22 11:02 number of lines ? Alan Stone
@ 2009-01-22 11:22 ` Wolfgang Schuster
  2009-01-22 14:39   ` Alan Stone
  0 siblings, 1 reply; 12+ messages in thread
From: Wolfgang Schuster @ 2009-01-22 11:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, Jan 22, 2009 at 12:02 PM, Alan Stone
<software.list.1es9s@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
___________________________________________________________________________________


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

* Re: number of lines ?
  2009-01-22 11:22 ` Wolfgang Schuster
@ 2009-01-22 14:39   ` Alan Stone
  2009-01-22 14:46     ` Otared Kavian
  0 siblings, 1 reply; 12+ messages in thread
From: Alan Stone @ 2009-01-22 14:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

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

> On Thu, Jan 22, 2009 at 12:02 PM, Alan Stone
> <software.list.1es9s@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

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

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: number of lines ?
  2009-01-22 14:39   ` Alan Stone
@ 2009-01-22 14:46     ` Otared Kavian
  2009-01-22 14:54       ` Alan Stone
  2009-01-22 18:35       ` Alan Stone
  0 siblings, 2 replies; 12+ messages in thread
From: Otared Kavian @ 2009-01-22 14:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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


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

> On Thu, Jan 22, 2009 at 12:22 PM, Wolfgang Schuster <schuster.wolfgang@googlemail.com 
> > wrote:
> On Thu, Jan 22, 2009 at 12:02 PM, Alan Stone
> <software.list.1es9s@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

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

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: number of lines ?
  2009-01-22 14:46     ` Otared Kavian
@ 2009-01-22 14:54       ` Alan Stone
  2009-01-22 16:20         ` Alan Stone
  2009-01-22 18:35       ` Alan Stone
  1 sibling, 1 reply; 12+ messages in thread
From: Alan Stone @ 2009-01-22 14:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

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

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

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: number of lines ?
  2009-01-22 14:54       ` Alan Stone
@ 2009-01-22 16:20         ` Alan Stone
  2009-01-22 16:54           ` Wolfgang Schuster
  0 siblings, 1 reply; 12+ messages in thread
From: Alan Stone @ 2009-01-22 16:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On Thu, Jan 22, 2009 at 3:54 PM, Alan Stone
<software.list.1es9s@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}]

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

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

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: number of lines ?
  2009-01-22 16:20         ` Alan Stone
@ 2009-01-22 16:54           ` Wolfgang Schuster
  2009-01-22 21:23             ` Alan Stone
  0 siblings, 1 reply; 12+ messages in thread
From: Wolfgang Schuster @ 2009-01-22 16:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 22.01.2009 um 17:20 schrieb Alan Stone:

> On Thu, Jan 22, 2009 at 3:54 PM, Alan Stone <software.list.1es9s@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
___________________________________________________________________________________


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

* Re: number of lines ?
  2009-01-22 14:46     ` Otared Kavian
  2009-01-22 14:54       ` Alan Stone
@ 2009-01-22 18:35       ` Alan Stone
  2009-01-22 18:53         ` Wolfgang Schuster
  1 sibling, 1 reply; 12+ messages in thread
From: Alan Stone @ 2009-01-22 18:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

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 <otared@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.wolfgang@googlemail.com> wrote:
>
>> On Thu, Jan 22, 2009 at 12:02 PM, Alan Stone
>> <software.list.1es9s@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
>

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

[-- Attachment #2: makelines.tex --]
[-- Type: application/x-tex, Size: 917 bytes --]

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

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: number of lines ?
  2009-01-22 18:35       ` Alan Stone
@ 2009-01-22 18:53         ` Wolfgang Schuster
  2009-01-22 19:28           ` Alan Stone
  0 siblings, 1 reply; 12+ messages in thread
From: Wolfgang Schuster @ 2009-01-22 18:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


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

* Re: number of lines ?
  2009-01-22 18:53         ` Wolfgang Schuster
@ 2009-01-22 19:28           ` Alan Stone
  0 siblings, 0 replies; 12+ messages in thread
From: Alan Stone @ 2009-01-22 19:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Thanks a lot Wolfgang the "Wise Wizard of TeX".  :O)

Alan

On Thu, Jan 22, 2009 at 7:53 PM, Wolfgang Schuster <
schuster.wolfgang@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

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

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: number of lines ?
  2009-01-22 16:54           ` Wolfgang Schuster
@ 2009-01-22 21:23             ` Alan Stone
  2009-01-22 21:59               ` Wolfgang Schuster
  0 siblings, 1 reply; 12+ messages in thread
From: Alan Stone @ 2009-01-22 21:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On Thu, Jan 22, 2009 at 5:54 PM, Wolfgang Schuster <
schuster.wolfgang@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.1es9s@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
>

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

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: number of lines ?
  2009-01-22 21:23             ` Alan Stone
@ 2009-01-22 21:59               ` Wolfgang Schuster
  0 siblings, 0 replies; 12+ messages in thread
From: Wolfgang Schuster @ 2009-01-22 21:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


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

end of thread, other threads:[~2009-01-22 21:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-22 11:02 number of lines ? Alan Stone
2009-01-22 11:22 ` Wolfgang Schuster
2009-01-22 14:39   ` Alan Stone
2009-01-22 14:46     ` Otared Kavian
2009-01-22 14:54       ` Alan Stone
2009-01-22 16:20         ` Alan Stone
2009-01-22 16:54           ` Wolfgang Schuster
2009-01-22 21:23             ` Alan Stone
2009-01-22 21:59               ` Wolfgang Schuster
2009-01-22 18:35       ` Alan Stone
2009-01-22 18:53         ` Wolfgang Schuster
2009-01-22 19:28           ` Alan Stone

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).