Re: [NTG-context] Wrong spacing in \unit

2012-09-17 Thread Marco Patzer
2012-09-13 Marco Patzer home...@lavabit.com:

 when \unit is used just with a unit, without a number, the spacing
 at the left is wrong.

Still the same in 2012.09.16 23:18, it doesn't seem that hard to
fix. Maybe just an if-statement to check if the number is provided
and add a space in that case.

So I checked the sources and saw that it might be a feature to
support the syntax with the number not included in the \unit call
(is anyone actually using this syntax?):

3 \unit{micro mol per second}
  \unit{3 micro mol per second}

I guess it's hard to check whether there is a number provided before
the \unit command from inside \unit.

Any ideas? It renders it much less useful if it only works with a
unit *and* a number.


Marco

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


[NTG-context] Problem with \useMPlibrary[txt]

2012-09-17 Thread pol stra
Dear all,

There is a problem with \useMPlibrary[txt] at compilation time (ConTeXt  ver: 
2012.09.11 20:36 MKIV):

metapost loaded: library 'txt' 
(/opt/context-minimals/texmf-context/tex/context/base/meta-imp-txt.mkiv
! Undefined control sequence.

system   tex  error on line 149 in file 
/opt/context-minimals/texmf-context/tex/context/base/meta-imp-txt.mkiv: 
Undefined control sequence ...

139\ht\scratchbox\parheight
140\dp\scratchbox\zeropoint
141\box\scratchbox
142\getshapecharacteristics
143\egroup}
144 
145 \def\setupshapetexts%
146   {\dodoubleempty\getparameters[\??sh]}
147 
148 \setupshapetexts%
149 [\c!bodyfont=]
150 
151 %%% rotfont nog definieren
152 
153 \doifundefined{RotFont}{\definefont[RotFont][RegularBold]}
154 
155 \def\processfollowingtoken#1% strut toegevoegd
156   {\appendtoks#1\to\MPtoks
157\setbox\MPbox=\hbox{\RotFont\setstrut\strut\the\MPtoks}%
158\startMPdrawing
159  n := n + 1 ; len[n] := \the\wd\MPbox ;

argument \??sh 
 
\setsomevalue #1#2-\expandafter \def \csname #1
#2\endcsname 
\syst_helpers_get_parameters_assign_indeed ...{#2}
  {#3}
\syst_helpers_process_comma_item ...mpty \_e_o_p_ 
  \doubleexpandafter \syst_h...
\syst_helpers_get_parameters ...ss_comma_item #1,]
  ,\_e_o_p_ 
l.149   [\c!bodyfont=]


The fact is I don’t realy know what it is for, I took it from the wiki 
(http://wiki.contextgarden.net/User-Defined_Enumerations).
Maybe it is not compatible with Mkiv?

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

[NTG-context] Formulas include chapter number

2012-09-17 Thread Marco Patzer
Hi,

the last beta includes the chapter number in formulas, former betas
didn't. Example:

\starttext
\startchapter [title=Foo]
  \startplaceformula
\startformula
  E=mc^2
\stopformula
  \stopplaceformula
\stopchapter
\stoptext

∙ Is this intended?
∙ How to remove the chapter number from the formula?


Marco

___
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] Formulas include chapter number

2012-09-17 Thread Sietse Brouwer
Hi Marco,

It's a bug, I think.
The keys that control this are way and prefixsegments:
\setupformulas[way=bychapter, prefixsegments=chapter]

way=bychapter means 'resume numbering at each chapter'
prefixsegments=chapter means 'precede each formula number with the
chapter number': chapter.formula

Right now, as soon as I set 'prefixsegments' to 'section' or 'chapter'
or a number, the prefix segments disappear. Ditto when I set 'way' to
anything. This suggests that it is a bug. Is it indeed, Hans? I've
attached a test file for you.

You can use \setupformulas[prefixsegments=] to solve your problem if
you never want prefixes; that also specifies the correct behaviour
once the bug is fixed.

Cheers,
Sietse


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

Re: [NTG-context] Formulas include chapter number

2012-09-17 Thread Marco Patzer
2012-09-17 Sietse Brouwer sbbrou...@gmail.com:

Hi Sietse,

 It's a bug, I think.
 The keys that control this are way and prefixsegments:
 \setupformulas[way=bychapter, prefixsegments=chapter]
 
 way=bychapter means 'resume numbering at each chapter'
 prefixsegments=chapter means 'precede each formula number with the
 chapter number': chapter.formula
 
 Right now, as soon as I set 'prefixsegments' to 'section' or 'chapter'
 or a number, the prefix segments disappear. Ditto when I set 'way' to
 anything. This suggests that it is a bug. Is it indeed, Hans? I've
 attached a test file for you.
 
 You can use \setupformulas[prefixsegments=] to solve your problem if

Thanks, that fixed it.


Marco

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


[NTG-context] international documents

2012-09-17 Thread Pavel Dohnal
Hello,
I am creating script which generates context source from database
data. Then converts context to pdf and sends it to user. Problem is
that users enter international texts into database and some characters
are not present in final pdf.
Here is my minimal example:

%interface=en translate-file=utf-8
\enableregime[utf]
\starttext
This is in Japan: 日本, 神奈川県藤沢市藤沢75
\stoptext

Now I run:
context file.tex
But japaneese character are missing in final pdf. You can see in
attached file. Is there a way how to create documents which can be
writen in any international language?
Thanks for your help
  Pavel Dohnal


c.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] international documents

2012-09-17 Thread Marco Patzer
2012-09-17 Pavel Dohnal pavel.doh...@twobits.cz:

Hi Pavel

 Problem is that users enter international texts into database and
 some characters are not present in final pdf.
 Here is my minimal example:
 
 %interface=en translate-file=utf-8
 \enableregime[utf]

ConTeXt MkIV uses UTF-8 by default.

 \starttext
 This is in Japan: 日本, 神奈川県藤沢市藤沢75
 \stoptext
 
 Now I run:
 context file.tex
 But japaneese character are missing in final pdf. You can see in
 attached file. Is there a way how to create documents which can be
 writen in any international language?

The font Latin Modern does not contain the Japanese characters. Use
a font that covers the range you need.


Marco

___
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] international documents

2012-09-17 Thread S Barmeier
On 09/17/2012 07:11 PM, Pavel Dohnal wrote:
 Hello,
 I am creating script which generates context source from database
 data. Then converts context to pdf and sends it to user. Problem is
 that users enter international texts into database and some characters
 are not present in final pdf.
 Here is my minimal example:
 
 %interface=en translate-file=utf-8
 \enableregime[utf]
 \starttext
 This is in Japan: 日本, 神奈川県藤沢市藤沢75
 \stoptext
 
 Now I run:
 context file.tex
 But japaneese character are missing in final pdf. You can see in
 attached file. Is there a way how to create documents which can be
 writen in any international language?

You need to load a font which contains Japanese characters. In order to
create documents, which can be written in any international language,
you need to make a typescript, which loads fonts for all languages (if
that is really what you want).

You can specify what Unicode range should be typeset in what font...

Here is a typescript I used for a Japanese document, which also
contained Korean Hangul, Vietnamese and the International Phonetic
Alphabet. You can use it as a reference.

-- type-mytypescript.mkiv --

\definefontfeature[jpdefault][mode=node,script=latn,lang=jan,protrusion=pure,expansion=quality]
\definefontfeature[hz][default][protrusion=pure,mode=node,script=latn]

\def\mydefaultfeatures{kern=yes;liga=yes;tlig=yes;trep=yes}

% Vietnamese0x1EA0-0x1EF9
% Phonetic Ext  0x1D00-0x1D7F
% Korean Hangul 0xAC00-0xD7A3

\definefontfallback[serifwhatever]  
[GenR102.ttf:\mydefaultfeatures]
[0x-0x0400,0x1EA0-0x1EF9,0x1D00-0x1D7F] [force=yes]
\definefontfallback[serifwhatever]  
[UnBatang.ttf:\mydefaultfeatures][0xAC00-0xD7A3][force=yes]
\definefontfallback[serifwhatever]  
[AdobeSongStd-Light.otf:\mydefaultfeatures][0x35C2,0x5987,0x7535,0x4E50,0x98CE,0x957F,0x9A6C][force=yes]
\definefontfallback[serifboldwhatever]  
[GenBasB.ttf:\mydefaultfeatures][0x-0x0400] [force=yes]
\definefontfallback[serifitalicwhatever]
[GenI102.ttf:\mydefaultfeatures][0x-0x0400] [force=yes]
\definefontfallback[serifbolditalicwhatever]
[GenBasBI.ttf:\mydefaultfeatures][0x-0x0400][force=yes]
\definefontfallback[sanswhatever]   
[Andika-R.ttf:\mydefaultfeatures]   [0x-0x0400] [force=yes]

\starttypescript[serif][IPAexMincho]
\definefontsynonym [ipaexmincho] [ipaexm.ttf]
[features=jpdefault,fallbacks=serifwhatever]
\definefontsynonym [ipaexminchobold] [ipaexm.ttf]
[features=krdefault,fallbacks=serifboldwhatever]
\definefontsynonym [ipaexminchoitalic]   [ipaexm.ttf]
[features=krslanted,fallbacks=serifitalicwhatever]
\definefontsynonym [ipaexminchobolditalic] [ipaexm.ttf]
[features=krslanted,fallbacks=serifbolditalicwhatever]
\stoptypescript
\starttypescript [serif][IPAexMincho][name]
\definefontsynonym[Serif][ipaexmincho]
\definefontsynonym[SerifBold][ipaexminchobold]
\definefontsynonym[SerifItalic]  [ipaexminchoitalic]
\definefontsynonym[SerifBoldItalic]  [ipaexminchobolditalic]
\stoptypescript
\starttypescript[sans][IPAexGothic]
\definefontsynonym[ipaexgothic]  [ipaexg.ttf]
[features=jpdefault,fallbacks=sanswhatever]
\stoptypescript
\starttypescript[sans][IPAexGothic][name]
\definefontsynonym[Sans] [ipaexgothic]
\stoptypescript
\starttypescript[mono][KanjiStrokeOrders]
\definefontsynonym[kanjistrokeorders][KanjiStrokeOrders_v2.016.ttf]
[features=jpdefault]
\stoptypescript
\starttypescript[mono][KanjiStrokeOrders][name]
\definefontsynonym[Mono] [kanjistrokeorders]
\stoptypescript
\starttypescript[MyIPAex]
\definetypeface[Myface] [rm][serif] [IPAexMincho]   
[default]
[features=punctuation]
\definetypeface[Myface] [ss][sans]  [IPAexGothic]   
[default]
\definetypeface[Myface] [tt][mono]  [KanjiStrokeOrders] [default]
[rscale=0.9]
\stoptypescript

-- END type-mytypescript.mkiv --

-- file.tex --

\usetypescriptfile[mytypescript]
\usetypescript[MyIPAex]
\definebodyfontenvironment[12pt]
\setupbodyfont[Myface,rm,12pt]
\starttext

Place your text here.

\stoptext

-- END file.tex --

Good luck.
Severin
___
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
___

[NTG-context] Ctx: list of commands

2012-09-17 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello,

1) is there a Ctx command/switch which would generate list of all current 
ConTeXt commands? E.g.


context --list-of-commands  Cmds.txt


to produce

 Cmds.txt
\startCAP
\stopCAP
\startCap
\stopCap
...
\writetoregister



2) The directory c:\Ctx-Beta\tex\texmf-context\context\data\textpad is empty 
(by default?).

Its content:

  - is filled when context.exe is launched with a command/switch (if so, which 
command?), or

  - is filled when a newer version of ConTeXt is downloaded (if so, which extras - like 
first-setup.bat --extras=all --modules=all - should be specified to fill the directory)?

TIA.

Best regards,

Lukas


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


Re: [NTG-context] Ctx: list of commands

2012-09-17 Thread Marco Patzer
2012-09-17 Procházka Lukáš Ing. - Pontex s. r. o. l...@pontex.cz:

Hi Lukáš

 1) is there a Ctx command/switch which would generate list of all
 current ConTeXt commands? E.g.

Not that I'm aware of. Wolfgang started to maintain a list of
ConTeXt commands, but I'm not sure if he's still on it:

https://bitbucket.org/wolfs/commands

During the last few months the wiki got plenty of new commands added
that you could use. But I don't think there's an interface to
retrieve information from the wiki in an automated fashion.


Marco

___
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] Ctx: list of commands

2012-09-17 Thread Sietse Brouwer
 During the last few months the wiki got plenty of new commands added
 that you could use.

The wiki's list of commands is nowhere near complete, alas. There are
a few (not many) commands *documented* on there that are not
documented elsewhere, but if it's *existence* of commands you want to
know about, the wiki is not a good source, so don't bother.

 But I don't think there's an interface to
 retrieve information from the wiki in an automated fashion.

The API is, in fact, enabled:
http://wiki.contextgarden.net/api.php
But that is more for automated editing than automated retrieval: there
are simply not enough microformats/templates in use to make automated
processing worthwhile.

As for what I myself do when I want to know about the existence or
implementation of commands: I grep the source. This is NOT the same as
producing a list of all commands, of course; just something that is
also very useful, and may often solve the problem.

I've defined a command 'crep' that will automatically search the
source files in the main ConTeXt directory, so if I need something
figure- or footnote-related I'll type
crep '\\def.*figure'
or
crep 'footnote', for example
That will usually at least give me an idea on which file I should look
at. Once inside the file, there are often documenation comments that
start with %D. It's not ideal. But it helps.

## start crep command in my .bashrc and .zshrc
function condir {
cd /opt/context/tex/texmf-context/tex/context/base/
}

# Easy grepping of ConTeXt functions
function crep { condir; grep -R $* * }
## end crep command

Cheers,
Sietse
___
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] Ctx: list of commands

2012-09-17 Thread Procházka Lukáš Ing . - Pontex s . r . o .

... Maybe I found something useful (initially I could not remember where and 
what to look for, but - )

c:\ConTeXt\tex\texmf-context\scripts\context\lua\mtx-interface.lua

There is:


...
local helpinfo = [[
...
--textpad generate textpad interface files
--textcreate text files for commands and environments
...
]]


So I'll check it.

I'd like to renew my TextPad syntax highlighting file for ConTeXt; or better to 
try to renew it as there were some Ctx commands missing in the (last) 
Ctx-generated syntax file and I had to add commands manually in it.

So if the list of commands is more complete or really complete, I'd like to 
use it.

Best regards,

Lukas


On Mon, 17 Sep 2012 16:20:44 +0200, Sietse Brouwer sbbrou...@gmail.com wrote:


During the last few months the wiki got plenty of new commands added
that you could use.


The wiki's list of commands is nowhere near complete, alas. There are
a few (not many) commands *documented* on there that are not
documented elsewhere, but if it's *existence* of commands you want to
know about, the wiki is not a good source, so don't bother.


But I don't think there's an interface to
retrieve information from the wiki in an automated fashion.


The API is, in fact, enabled:
http://wiki.contextgarden.net/api.php
But that is more for automated editing than automated retrieval: there
are simply not enough microformats/templates in use to make automated
processing worthwhile.

As for what I myself do when I want to know about the existence or
implementation of commands: I grep the source. This is NOT the same as
producing a list of all commands, of course; just something that is
also very useful, and may often solve the problem.

I've defined a command 'crep' that will automatically search the
source files in the main ConTeXt directory, so if I need something
figure- or footnote-related I'll type
crep '\\def.*figure'
or
crep 'footnote', for example
That will usually at least give me an idea on which file I should look
at. Once inside the file, there are often documenation comments that
start with %D. It's not ideal. But it helps.

## start crep command in my .bashrc and .zshrc
function condir {
cd /opt/context/tex/texmf-context/tex/context/base/
}

# Easy grepping of ConTeXt functions
function crep { condir; grep -R $* * }
## end crep command

Cheers,
Sietse
___
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
___




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


[NTG-context] Exploring the Lua innards of ConTeXt: showtable

2012-09-17 Thread Sietse Brouwer
Hi all,

ConTeXt mkiv stores all sorts of things in Lua tables, but 'what goes
where' does not tend to be documented. So here is a function to print
out a table's contents to get something like the following excerpt.

The excerpt is from the output of
`userdata.showtable(structures.lists)` in a document with three
\placefigures and one \placeformula. Note the reference in
T.cached.1.references.reference, and the caption in
T.cached.1.titledata.title (T stands for the table yone passed to
showtables); and note how the tables of figures 2 and 3 are not
printed, because they follow the same pattern as table 1. (You can
tell showtable to print everything, natch.)

T.addto   : function: 0xa4c8818
T.analyze : function: 0xb1c27b0
T.cached  : table: 0xb1c2240
T.cached.1 : table: 0xc3f7b18
T.cached.1.metadata   : table: 0xc3f7d58
T.cached.1.metadata.kind : float
T.cached.1.metadata.name : figure
T.cached.1.prefixdata : table: 0xc3f7c68
T.cached.1.prefixdata.connector : .
T.cached.1.prefixdata.prefix: no
T.cached.1.references : table: 0xc3f7ba8
T.cached.1.references.reference : ref:asdf
T.cached.1.titledata  : table: 0xc3f7b40
T.cached.1.titledata.title : caption 1
T.cached.2 : table: 0xc467bb8 (like T.cached.1)
T.cached.3 : table: 0xc4731a8 (like T.cached.1)
T.cached.4 : table: 0xc47c988
T.cached.4.metadata   : table: 0xc47d628
T.cached.4.metadata.kind : formula
T.cached.4.metadata.name : formula

(You can't see it in this e-mail, but the colons of entries in the
same subtable nicely line up with each other.)

Usage: put showtable.lua in your working directory and run the following code:

\starttext
% \placefigure[][ref:asdf]{caption 1}{picture 1}
\startluacode
require('showtable')
userdata.showtable(structures.lists)
\stopluacode
\stoptext

Extra options can be passed as part of an options table. (This allows
overriding one option without respecifying the others.)
userdata.showtable(
structures.lists,
{ everything=true, -- descend even into similar-looking siblings
tablename='S.L' }
)

Output is printed to the terminal, alas, because I couldn't discover
how to print to the log. Anybody know anything about this?

Hopefully this may be useful to someone, next time they they're
hunting for something in the bowels of ConTeXt. Interesting tables to
look at:
* userdata.showtable(commands) contains a great miscellanea of helper commands
* userdata.showtable(context) also contains a great miscellanea of commands
* userdata.showtable(tex) seems to show lua access functions to some
plain tex stuff
* userdata.showtable(lxml) gives a list of lxml-related functions

Cheers,
Sietse


showtable.lua
Description: Binary data
___
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] Exploring the Lua innards of ConTeXt: showtable

2012-09-17 Thread Hans Hagen

On 17-9-2012 17:47, Sietse Brouwer wrote:

Hi all,

ConTeXt mkiv stores all sorts of things in Lua tables, but 'what goes
where' does not tend to be documented. So here is a function to print
out a table's contents to get something like the following excerpt.


Keep in mind that many datatables are not frozen in stone i.e. their 
structure might change at some point (I still need to finish cleaning up 
some structure related code, after that most will stay as it is).


In case you don't this one:

context s-inf-03.mkiv

It reports some info about what sits in a table (d means data).


The excerpt is from the output of
`userdata.showtable(structures.lists)` in a document with three
\placefigures and one \placeformula. Note the reference in
T.cached.1.references.reference, and the caption in
T.cached.1.titledata.title (T stands for the table yone passed to
showtables); and note how the tables of figures 2 and 3 are not
printed, because they follow the same pattern as table 1. (You can
tell showtable to print everything, natch.)

T.addto   : function: 0xa4c8818
T.analyze : function: 0xb1c27b0
T.cached  : table: 0xb1c2240
T.cached.1 : table: 0xc3f7b18
T.cached.1.metadata   : table: 0xc3f7d58
T.cached.1.metadata.kind : float
T.cached.1.metadata.name : figure
T.cached.1.prefixdata : table: 0xc3f7c68
T.cached.1.prefixdata.connector : .
T.cached.1.prefixdata.prefix: no
T.cached.1.references : table: 0xc3f7ba8
T.cached.1.references.reference : ref:asdf
T.cached.1.titledata  : table: 0xc3f7b40
T.cached.1.titledata.title : caption 1
T.cached.2 : table: 0xc467bb8 (like T.cached.1)
T.cached.3 : table: 0xc4731a8 (like T.cached.1)
T.cached.4 : table: 0xc47c988
T.cached.4.metadata   : table: 0xc47d628
T.cached.4.metadata.kind : formula
T.cached.4.metadata.name : formula

(You can't see it in this e-mail, but the colons of entries in the
same subtable nicely line up with each other.)

Usage: put showtable.lua in your working directory and run the following code:

\starttext
% \placefigure[][ref:asdf]{caption 1}{picture 1}
\startluacode
 require('showtable')
 userdata.showtable(structures.lists)
\stopluacode
\stoptext

Extra options can be passed as part of an options table. (This allows
overriding one option without respecifying the others.)
userdata.showtable(
 structures.lists,
 { everything=true, -- descend even into similar-looking siblings
 tablename='S.L' }
)

Output is printed to the terminal, alas, because I couldn't discover
how to print to the log. Anybody know anything about this?


commands.writestatus(mylog,str)

or:

local myreporter = logs.reporter(tables)

myreporter()


Hopefully this may be useful to someone, next time they they're
hunting for something in the bowels of ConTeXt. Interesting tables to
look at:
* userdata.showtable(commands) contains a great miscellanea of helper commands


the commands namespace is used for commands that pipe something to tex 
and/or are calles in a command at the tex end



* userdata.showtable(context) also contains a great miscellanea of commands


this is the print-to-tex namespace


* userdata.showtable(tex) seems to show lua access functions to some
plain tex stuff
* userdata.showtable(lxml) gives a list of lxml-related functions

Cheers,
Sietse



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


[NTG-context] Bug in xits font? No widehat shows up

2012-09-17 Thread Otared Kavian
Dear Khaled, dear Hans,

I noticed that when using xits fonts the command \widehat is ignored (though 
\hat gives the expected result).
Minimal example

%%% begin example
\setupbodyfont[xits,11pt]
\starttext
By definition we set ${\widehat \phi}(\xi) := {\cal F}(\phi)(\xi)$ that is
\startformula
{\hat \phi}(\xi) = \widehat{\phi}(\xi) = {\widehat \phi}(\xi) := {\cal 
F}(\phi)(\xi) := (2\pi)^{-N/2}\int_{{\Bbb R}^N}{\rm e}^{-{\rm i}\xi\cdot 
x}\phi(x) dx.
\stopformula
\stoptext
%%% end example

This bug report concerns mkiv version ConTeXt  ver: 2012.09.16 23:18 MKIV  fmt: 
2012.9.17. However in older versions the same problem exists.
I don't know whether this is a bug in mkiv or in xits fonts.

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


Re: [NTG-context] Ctx: list of commands

2012-09-17 Thread Philipp Gesang
···date: 2012-09-17, Monday···from: Procházka Lukáš Ing. - Pontex s. r. 
o.···

 Hello,
 
 1) is there a Ctx command/switch which would generate list of all current 
 ConTeXt commands? E.g.

Hi Lukáš, if you interpret “current Context commands” as “macros
known to TeX”, you may try dumping the hashtable with these lines:

···
\starttext
  \startluacode
table.print(tex.hashtokens())
  \stopluacode
\stoptext
···

It’s already sorted, too!

Hth, Philipp




 
 
 context --list-of-commands  Cmds.txt
 
 
 to produce
 
  Cmds.txt
 \startCAP
 \stopCAP
 \startCap
 \stopCap
 ...
 \writetoregister
 
 
 
 2) The directory c:\Ctx-Beta\tex\texmf-context\context\data\textpad is 
 empty (by default?).
 
 Its content:
 
   - is filled when context.exe is launched with a command/switch (if so, 
 which command?), or
 
   - is filled when a newer version of ConTeXt is downloaded (if so, which 
 extras - like first-setup.bat --extras=all --modules=all - should be 
 specified to fill the directory)?
 
 TIA.
 
 Best regards,
 
 Lukas
 
 
 -- 
 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
 ___

-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments


pgphCa0Ve1Rby.pgp
Description: PGP signature
___
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] [.tuc] oddity when storing a table

2012-09-17 Thread Philipp Gesang
···date: 2012-09-16, Sunday···from: Hans Hagen···

 On 16-9-2012 19:17, Philipp Gesang wrote:
 Bug?
 
 no, feature. job variables are just key/values and accessible at the
 tex end (you store 'works too' in 'bar')

Ok, I wasn’t aware of this restriction.

 if you want arbitrary data to be stores you need to used datasets,
 as explained in
 
 http://wiki.contextgarden.net/Command/definedataset

Hmm, the wiki only covers the TeX macro interface whilst I am
mainly concerned with passing stuff right from the Lua end.

From my reading of core-dat.lua I gather that there is not really
a way to dump any Lua table (array or hash or mixed) via
datasets. Except directly writing to “tobesaved”.

···
\starttext

\startluacode
  local n, t, d = job.datasets.setdata{
name  = not enough!!!11!1! grr!,
delay = interfaces.variables.no,
data  = a=b,c=d,1=foo,2=bar,nested={second={third=whatever}},
  }

  job.datasets.tobesaved.works_for_me = {
this = { does = { work, for, nested = { tables, !, {{}} } } }
  }

  table.print(job.datasets.getdata(works_for_me, this), this)
\stopluacode

\stoptext
···

I hesitate to wikify the latter, though.

Philipp



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

-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments


pgp8jN9jbGCnC.pgp
Description: PGP signature
___
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
___

[NTG-context] interesting link

2012-09-17 Thread Hans Hagen

Hi,

As Luigi hasn't posted a link in a while ... here is one that looks 
interesting


http://www.nongnu.org/gsl-shell/doc/

(would fit nicely in luatex a library given that tex as system for 
typesetting is used for scientific publishing)


Hans

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


Re: [NTG-context] [.tuc] oddity when storing a table

2012-09-17 Thread Hans Hagen

On 17-9-2012 23:13, Philipp Gesang wrote:

···date: 2012-09-16, Sunday···from: Hans Hagen···


On 16-9-2012 19:17, Philipp Gesang wrote:

Bug?


no, feature. job variables are just key/values and accessible at the
tex end (you store 'works too' in 'bar')


Ok, I wasn’t aware of this restriction.


if you want arbitrary data to be stores you need to used datasets,
as explained in

http://wiki.contextgarden.net/Command/definedataset


Hmm, the wiki only covers the TeX macro interface whilst I am
mainly concerned with passing stuff right from the Lua end.

 From my reading of core-dat.lua I gather that there is not really
a way to dump any Lua table (array or hash or mixed) via
datasets. Except directly writing to “tobesaved”.


And that is indeed somewhat nasty; I'll add a 'convert' key to the 
settings so that you can set raw data at the Lua end.


(I'll send you a Lua file for testing)

Hans


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


Re: [NTG-context] Ctx: list of commands

2012-09-17 Thread Hans Hagen

On 17-9-2012 21:29, Philipp Gesang wrote:

···date: 2012-09-17, Monday···from: Procházka Lukáš Ing. - Pontex s. r. 
o.···


Hello,

1) is there a Ctx command/switch which would generate list of all current 
ConTeXt commands? E.g.


Hi Lukáš, if you interpret “current Context commands” as “macros
known to TeX”, you may try dumping the hashtable with these lines:

···
\starttext
   \startluacode
 table.print(tex.hashtokens())
   \stopluacode
\stoptext
···


or

\enabledirectives[system.dumphash]

\enabledirectives[system.dumpdelta]



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