ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [MkIV] How to get the local size of a column
@ 2015-05-18 18:00 Pierre-François Bonnefoi
  2015-05-19 10:16 ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Pierre-François Bonnefoi @ 2015-05-18 18:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hello,

Is it possible to get the current width of a column from a paragraph into Lua ?


Pierre-François.

 
-- 
Bonnefoi Pierre-Francois                |    E-mail : bonnefoi@unilim.fr http://libpfb.so/
Universite de Limoges, Laboratoire XLIM |       Tel : 06 28 18 03 38
123 av Albert Thomas                    |  Mrs. Peel, we're needed...
87060 Limoges CEDEX - FRANCE            |                 The Avengers.


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

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

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

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

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

* Re: [MkIV] How to get the local size of a column
  2015-05-18 18:00 [MkIV] How to get the local size of a column Pierre-François Bonnefoi
@ 2015-05-19 10:16 ` Hans Hagen
  2015-05-19 10:31   ` Pierre-François Bonnefoi
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2015-05-19 10:16 UTC (permalink / raw)
  To: ntg-context

On 5/18/2015 8:00 PM, Pierre-François Bonnefoi wrote:
> Hello,
>
> Is it possible to get the current width of a column from a paragraph
> into Lua ?

it all depends on where and how you access that but normally the width 
of a hlist will do

> Pierre-François.
>
> --
> Bonnefoi Pierre-Francois                |    E-mail : bonnefoi@unilim.fr
> <mailto:bonnefoi@unilim.fr> http://libpfb.so/
> Universite de Limoges, Laboratoire XLIM |       Tel : 06 28 18 03 38
> 123 av Albert Thomas                    |  Mrs. Peel, we're needed...
> 87060 Limoges CEDEX - FRANCE            |                 The Avengers.
>
>
>
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
>


-- 

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

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

* Re: [MkIV] How to get the local size of a column
  2015-05-19 10:16 ` Hans Hagen
@ 2015-05-19 10:31   ` Pierre-François Bonnefoi
  2015-05-19 11:04     ` Wolfgang Schuster
  2015-05-19 12:19     ` Pierre-François Bonnefoi
  0 siblings, 2 replies; 7+ messages in thread
From: Pierre-François Bonnefoi @ 2015-05-19 10:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hello Hans,

I try to get the equivalent of \the\hsize in Lua, in order to render some verbatim text to the current width of the column.

Thank you for your help,
Pierre-François.

> On 19 May 2015, at 12:16, Hans Hagen <pragma@wxs.nl> wrote:
> 
> On 5/18/2015 8:00 PM, Pierre-François Bonnefoi wrote:
>> Hello,
>> 
>> Is it possible to get the current width of a column from a paragraph
>> into Lua ?
> 
> it all depends on where and how you access that but normally the width of a hlist will do
> 
>> Pierre-François.
>> 
>> --
>> Bonnefoi Pierre-Francois                |    E-mail : bonnefoi@unilim.fr
>> <mailto:bonnefoi@unilim.fr> http://libpfb.so/
>> Universite de Limoges, Laboratoire XLIM |       Tel : 06 28 18 03 38
>> 123 av Albert Thomas                    |  Mrs. Peel, we're needed...
>> 87060 Limoges CEDEX - FRANCE            |                 The Avengers.
>> 
>> 
>> 
>> ___________________________________________________________________________________
>> 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
>> ___________________________________________________________________________________
>> 
> 
> 
> -- 
> 
> -----------------------------------------------------------------
>                                          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
> ___________________________________________________________________________________

-- 
Bonnefoi Pierre-Francois                |    E-mail : bonnefoi@unilim.fr http://libpfb.so/
Universite de Limoges, Laboratoire XLIM |       Tel : 06 28 18 03 38
123 av Albert Thomas                    |  Mrs. Peel, we're needed...
87060 Limoges CEDEX - FRANCE            |                 The Avengers.


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

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

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

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

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

* Re: [MkIV] How to get the local size of a column
  2015-05-19 10:31   ` Pierre-François Bonnefoi
@ 2015-05-19 11:04     ` Wolfgang Schuster
  2015-05-19 12:25       ` Pierre-François Bonnefoi
  2015-05-19 12:19     ` Pierre-François Bonnefoi
  1 sibling, 1 reply; 7+ messages in thread
From: Wolfgang Schuster @ 2015-05-19 11:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 19.05.2015 um 12:31 schrieb Pierre-François Bonnefoi <bonnefoi@unilim.fr>:
> 
> Hello Hans,
> 
> I try to get the equivalent of \the\hsize in Lua, in order to render some verbatim text to the current width of the column.

Both dimensions are in scaled points.

\starttext

\cldcontext{tex.hsize}

\cldcontext{tex.dimen["textwidth"]}

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

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

* Re: [MkIV] How to get the local size of a column
  2015-05-19 10:31   ` Pierre-François Bonnefoi
  2015-05-19 11:04     ` Wolfgang Schuster
@ 2015-05-19 12:19     ` Pierre-François Bonnefoi
  1 sibling, 0 replies; 7+ messages in thread
From: Pierre-François Bonnefoi @ 2015-05-19 12:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

I've found a workaround by passing the value as an argument to the lua code :

\def\stopzonetexte
  {\ctxlua{userdata.traiterbuffer(buffers.getcontent('zonetexte'),[==[\the\hsize]==])}

Now, I try to figure how to get em size in points.



> On 19 May 2015, at 12:31, Pierre-François Bonnefoi <bonnefoi@unilim.fr> wrote:
> 
> Hello Hans,
> 
> I try to get the equivalent of \the\hsize in Lua, in order to render some verbatim text to the current width of the column.
> 
> Thank you for your help,
> Pierre-François.
> 
>> On 19 May 2015, at 12:16, Hans Hagen <pragma@wxs.nl <mailto:pragma@wxs.nl>> wrote:
>> 
>> On 5/18/2015 8:00 PM, Pierre-François Bonnefoi wrote:
>>> Hello,
>>> 
>>> Is it possible to get the current width of a column from a paragraph
>>> into Lua ?
>> 
>> it all depends on where and how you access that but normally the width of a hlist will do
>> 
>>> 

-- 
Bonnefoi Pierre-Francois                |    E-mail : bonnefoi@unilim.fr http://libpfb.so/
Universite de Limoges, Laboratoire XLIM |       Tel : 06 28 18 03 38
123 av Albert Thomas                    |  Mrs. Peel, we're needed...
87060 Limoges CEDEX - FRANCE            |                 The Avengers.


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

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

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

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

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

* Re: [MkIV] How to get the local size of a column
  2015-05-19 11:04     ` Wolfgang Schuster
@ 2015-05-19 12:25       ` Pierre-François Bonnefoi
  2015-05-19 21:23         ` Wolfgang Schuster
  0 siblings, 1 reply; 7+ messages in thread
From: Pierre-François Bonnefoi @ 2015-05-19 12:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Thank you !

tex.hzize / 2^16 gives me the expected value !

This is a lot to learn  :)

> On 19 May 2015, at 13:04, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:
> 
> contex

-- 
Bonnefoi Pierre-Francois                |    E-mail : bonnefoi@unilim.fr http://libpfb.so/
Universite de Limoges, Laboratoire XLIM |       Tel : 06 28 18 03 38
123 av Albert Thomas                    |  Mrs. Peel, we're needed...
87060 Limoges CEDEX - FRANCE            |                 The Avengers.


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

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

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

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

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

* Re: [MkIV] How to get the local size of a column
  2015-05-19 12:25       ` Pierre-François Bonnefoi
@ 2015-05-19 21:23         ` Wolfgang Schuster
  0 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Schuster @ 2015-05-19 21:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 19.05.2015 um 14:25 schrieb Pierre-François Bonnefoi <bonnefoi@unilim.fr>:
> 
> Thank you !
> 
> tex.hzize / 2^16 gives me the expected value !
> 
> This is a lot to learn  :)

Take a look into util-dim.la and search for the number.todimen function which can be used to convert scaled points into points.

\starttext

\startluacode

context(tex.hsize)
context.par()
context(number.topoints(tex.hsize))
context.par()
context(number.topoints(tex.hsize,"%0.5f"))

\stopluacode

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

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

end of thread, other threads:[~2015-05-19 21:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-18 18:00 [MkIV] How to get the local size of a column Pierre-François Bonnefoi
2015-05-19 10:16 ` Hans Hagen
2015-05-19 10:31   ` Pierre-François Bonnefoi
2015-05-19 11:04     ` Wolfgang Schuster
2015-05-19 12:25       ` Pierre-François Bonnefoi
2015-05-19 21:23         ` Wolfgang Schuster
2015-05-19 12:19     ` Pierre-François Bonnefoi

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