From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: xml and lua again
Date: Thu, 27 Oct 2011 11:53:23 +0200 [thread overview]
Message-ID: <C90E8839-5CAF-4867-A6F6-BC8878538719@googlemail.com> (raw)
In-Reply-To: <4EA9231F.6080001@uni-bonn.de>
Am 27.10.2011 um 11:23 schrieb Thomas A. Schmitz:
> On 10/25/2011 12:27 PM, Thomas A. Schmitz wrote:
>> Wolfgang, Hans,
>>
>> thanks a lot, this works now. Will now try and move the code to a
>> ctxluafile and see if I can make it work again. If not, I'll be back; no
>> good deed goes unpunished...
>>
>> Thomas
>
> OK, I'm slowly making progress processing xml in lua. One naive question now: how can I have access to and manipulate the textwidth dimension? In other words, given
>
> 0.4\textwidth
>
> what would be the equivalent in lua code? I tried
>
> 0.4 * tex.dimen.textwidth
>
> or
>
> 0.4 * tex.dimen["textwidth"]
>
> but couldn't make that work. Also tried grepping the tex/context/base/*.lua files for width, but couldn't find anything immediately obvious.
With “tex.dimen[…]” you get the value in scaled points but util-dim.lua provides some functions to convert the value in points, centimeter etc.
\starttext
\startluacode
context.blackrule{ width = number.topoints(tex.dimen["textwidth"]/2) }
\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
___________________________________________________________________________________
next prev parent reply other threads:[~2011-10-27 9:53 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-22 16:46 Thomas A. Schmitz
2011-10-23 14:04 ` Peter Rolf
2011-10-23 14:37 ` Thomas A. Schmitz
2011-10-23 15:25 ` Peter Rolf
2011-10-23 18:15 ` Peter Rolf
2011-10-24 10:17 ` Hans Hagen
2011-10-24 12:18 ` Thomas A. Schmitz
2011-10-24 12:26 ` Hans Hagen
2011-10-24 17:00 ` Thomas A. Schmitz
2011-10-24 18:48 ` Hans Hagen
2011-10-25 9:43 ` Thomas A. Schmitz
2011-10-25 10:10 ` Wolfgang Schuster
2011-10-25 10:17 ` Hans Hagen
2011-10-25 10:27 ` Thomas A. Schmitz
2011-10-27 9:23 ` Thomas A. Schmitz
2011-10-27 9:53 ` Wolfgang Schuster [this message]
2011-10-27 10:32 ` Thomas A. Schmitz
2011-10-27 11:05 ` Hans Hagen
2011-10-28 6:23 ` Thomas A. Schmitz
2011-10-28 6:37 ` luigi scarso
2011-10-28 6:43 ` luigi scarso
2011-10-28 6:44 ` Patrick Gundlach
2011-10-28 6:55 ` Thomas A. Schmitz
2011-10-28 8:35 ` Wolfgang Schuster
2011-10-28 8:59 ` Hans Hagen
2011-10-28 8:56 ` Hans Hagen
2011-10-28 10:48 ` Thomas A. Schmitz
2011-10-28 11:23 ` luigi scarso
2011-10-28 11:42 ` Hans Hagen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=C90E8839-5CAF-4867-A6F6-BC8878538719@googlemail.com \
--to=schuster.wolfgang@googlemail.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).