Re: [NTG-context] MTXrun | error, no format found with name: cont-en, aborting

2010-08-01 Thread Vedran Miletić
2010/8/1 Paul Dostert :
> Worked... although I need to know why :-)
>
> What didn't work when I just installed the minimals, and what did
> luatools --generate and context --make do?
>
> Thank you!
>

http://wiki.contextgarden.net/Running_Mark_IV

Regards,

-- 
Vedran Miletić
___
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] CSV parser do not processed macro.

2010-08-01 Thread Arthur Reutenauer
> to solve my problem I need to find why my function ParseCSVdata  
> incorrectly parses strings stored in a macro.

  You can work around the problem by defining a Lua function that calls
the macro:

\def\parse#1{\directlua{pars("#1")}}

  You can then either call it directly:

\parse{\printaction}

or from Lua with tex.print:

\startluacode
tex.print("\\parse{\\printaction}")
\stopluacode

and the macros are expanded in the order you want.

  It's admittedly a bit silly, but it works.

  As a side note, the infinitive of the verb related to “parser” is “to
parse” in English, with an ‘e’ at the end.

Arthur
___
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] new current

2010-08-01 Thread taco

Patrick Gundlach wrote:

   * Experimental support for keeping links in included pdfs
\externalfigure[file.pdf][page=1,interaction=yes]



Is this done with the new luatex epdf library?


Yes.

Best wishes,
Taco
___
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] new current

2010-08-01 Thread Patrick Gundlach
>* Experimental support for keeping links in included pdfs
> \externalfigure[file.pdf][page=1,interaction=yes]


Is this done with the new luatex epdf library?

Patrick

___
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] new current

2010-08-01 Thread Taco Hoekwater

On 07/30/2010 10:45 AM, Hans Hagen wrote:

Hi,

I uploaded a current release that matches luatex 0.61 beta (released a
few days ago). The release notes will follow.


A more precise list of new (mkiv) features:

*  Tagged pdf generation.
* Experimental support for keeping links in included pdfs 
\externalfigure[file.pdf][page=1,interaction=yes]
* Hyphenation support is now processed with the help of lang-xx.lua 
files
* texmfcnf.lua (see the example contextcnf.lua) now completely 
replaces texmf.cnf (and has an internal structure)
* mtxrun has taken over the role of luatools (which is now a stub 
for mtxrun --script base and will eventually go away)
* TEXMFCACHE can now consist of multiple paths (one writable 
followed by any number of read-only paths)
* Support for the biolinum, stix, and xits fonts added, as well 
updated typescripts for iwona.


[edit]

Detailed release notes are here:

  http://wiki.contextgarden.net/Context_2010.07.30

Best wishes,
Taco
___
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] Expansion of TeX macros inside the Lua function

2010-08-01 Thread Jaroslav Hajtmar

Thanx very much to Hans.
I see that you understood what I meant. I expected something like this 
probably will not do.

I'll try to experiment according to your advice.

You ask why do I need? It is hard for me to explain in English why I 
need it.

Only shortly:
I prepared a series of Lua functions, that accesses data from a CSV file 
in very general level.
In fact I can in Luacycle print in ConTeXt (but in LuaLaTeX or LuaPlain 
too) any reports, forms, mail merge letters, etc.
The user creates a report (using data of row of the CSV table). The user 
can in report use TeX macros, that are automaticaly creating during 
browsing of the CSV file. Macro names are derived from Excel table 
columns (\ cA, \ cB, \ cC, ...) or are created under the header (first 
line) CSV table.


I had it working quite well, but I am trying now output from my 
applications to use as an input to the database module of Mojca Miklavec.
The problem is that output of my application appears in the one macro 
(printmacro \printacion or maybe better \lineaction because it contains 
the row data of the CSV table). Unfortunately, I have a macro in 
unexpanded form (as one token), because it constantly changes according 
to the contents of the current row of CSV table, but Mojca module 
requires several values separated by separators.


I hope at least someone can understand my bad English ... Sorry Taco :-) 
...


Thank you all for your patience with amateurs such as myself. I have 
great admiration for you all and I am privileged to be helping me.


Thanks Jaroslav





Dne 1.8.2010 17:08, Hans Hagen napsal(a):

On 1-8-2010 11:45, Jaroslav Hajtmar wrote:


\ctxlua{pars('\printaction')}

\blank[big]

Example 3)

The third example of my most interesting. Function parameter in 
example is

a TeX macro \backslash printaction which not expanded, respectively
expanded
only when I printing it to TeX. Parameter of function is still string
"\backslash printaction" in which it is futile to look for a comma
separator.
Comma not be found, although the content of macro face that is so. Is
there a
possibility for this case, as in some way to save to Lua variable
content of
macro (of course expanded)?

\ctxlua{pars('\\printaction')}


currently the tex parsing and expansion code is not available in 
luatex (future versions might provide some introspection or expansion 
code, but it's a hairy topic)


Anyhow, given that \printaction is defined you can use the token 
library to see what's in there (you then can sort of reconstruct the 
content).


Another approach is a two-step:

function step_1(str) -- str = \whatever
   tex.print("\ctxlua{step_2('",str,"')}")
end

It all depends on what you want to do. Why do you want to look into 
\whatever?


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] part problems

2010-08-01 Thread Hans Hagen

On 1-8-2010 10:20, Alan BRASLAU wrote:

On Saturday 31 July 2010 11:20:38 Hans Hagen wrote:

On 31-7-2010 1:08, Alan BRASLAU wrote:


Using parts is not as simple as it seems and is still somewhat
problematic, or maybe I, too, am unable to read the source.


parts are just like chapters and sections; the defaults are just set up
differently; don't think of them as something programatically different



Some logical subtleties, though, reflecting the different use either as "part"
or as "volume":


A book (or single volume) may contain several parts, each one containing
several chapters. One may wish to number the chapters subsequently,
independent of the part structure.

This is no problem:
   \definestructureresetset [default] [0,0] [1] % do not reset parts and
chapters
(although the syntax is somewhat obscure here).
also
   \setuphead [part]
  [sectionresetset=default,conversion=Romannumerals,placehead=yes]
and
   \setuphead [chapter,section,subsection] [sectionsegments=2:100]
   \setuppagenumbering [alternative=doublesided,way=bytext,partnumber=no]
(this is what Hans refers to as defaults that are set up differently).

[By the way, the default pagenumbering by part is a very reasonable default,
as is resetting chapter numbering by part, for often "part" is synonymous with
"volume". But not always: sometimes a book is to be broken into parts within a
single volume.]


Now the front matter and the back matter are common to the entire book,
logically part-less (if part is not to be taken as volume).  The front matter
may contain chapter(s) (preface, introduction, definitions) that may be
unnumbered.  The back matter will contain appendices (numbered), an index or
indexes (unnumbered), etc.

For now, I have found no better way then to use funny definitions:
   \definehead [frontchapter] [chapter] % to get around broken bookmarks
   \setuphead  [frontchapter] [incrementnumber=list]
   \definehead [unnumberedchapter] [chapter]
   \setuphead  [unnumberedchapter] [incrementnumber=list]
   \definehead [unnumberedpart] [part]
   \setuphead  [unnumberedpart] [incrementnumber=list,label=no]
   \definecombinedlist [content]
 
[part,unnumberedpart,frontchapter,unnumberedchapter,chapter,section,subsection,subsubsection]
   \setuplist
[part,unnumberedpart,frontchapter,unnumberedchapter,chapter,section,subsection,subsubsection]
 [alternative=c, % number – title – dots – pagenumber
  interaction=all]


A problem comes up when I want the main body parts to be labeled, as well as
chapters, as in:
   \setuphead [part]
 [sectionresetset=default,conversion=Romannumerals,placehead=yes]
   \setuplabeltext [chapter=Chapter ] % with trailing space; blank by default
   \startsectionblockenvironment[bodypart]
 \setuplist [chapter]  [label=yes]
   \stopsectionblockenvironment


The problem is always that easier setups also lead to more options 
(undocumented) that when explained lead to the previous code.


At some point we can thing of some 'common preset' but I'm not yet sure 
how to implement that.


btw, there is:

\setupstructurehead
  [chapter]
  [appendixlabel=appendix,
   bodypartlabel=chapter]


--

-
  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] Expansion of TeX macros inside the Lua function

2010-08-01 Thread Hans Hagen

On 1-8-2010 11:45, Jaroslav Hajtmar wrote:


\ctxlua{pars('\printaction')}

\blank[big]

Example 3)

The third example of my most interesting. Function parameter in example is
a TeX macro \backslash printaction which not expanded, respectively
expanded
only when I printing it to TeX. Parameter of function is still string
"\backslash printaction" in which it is futile to look for a comma
separator.
Comma not be found, although the content of macro face that is so. Is
there a
possibility for this case, as in some way to save to Lua variable
content of
macro (of course expanded)?

\ctxlua{pars('\\printaction')}


currently the tex parsing and expansion code is not available in luatex 
(future versions might provide some introspection or expansion code, but 
it's a hairy topic)


Anyhow, given that \printaction is defined you can use the token library 
to see what's in there (you then can sort of reconstruct the content).


Another approach is a two-step:

function step_1(str) -- str = \whatever
   tex.print("\ctxlua{step_2('",str,"')}")
end

It all depends on what you want to do. Why do you want to look into 
\whatever?


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] Placing footnotes in right margin en bloc at bottom of page

2010-08-01 Thread Elias Oltmanns
Wolfgang Schuster  wrote:
>  Am 29.07.10 15:33, schrieb Elias Oltmanns:
>> Wolfgang Schuster  wrote:
>
>> [...]
>>> This is easy:
>>>
>>> \setupnote[footnote][location=text]
>>>
>>> \setuptexttexts[margin][][{\framed[frame=off,offset=none,align=low,height=\textheight,width=broad]{\placenotes[footnote]}}]
>>>
>>> %\showframe
>>>
>>> \starttext
>>> text\footnote{one} text\footnote{two} text\footnote{\input tufte\par} text
>>> \stoptext
>> Thanks for the snippet. Unfortunately, the footnotes don't seem to make
>> it onto the page though. Would this be due to using ConTeXt MKII by any
>> chance? If not, I'd rather not change my current texlive installation
>> just now.
>
> You need a different setup for the footnote in Mark 2:
>
> \setupnote[footnote][width=\rightmarginwidth]

Well, it works and I'm impressed with the result. Thank you very much
for your help.

Regards,

Elias

___
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] tex in context

2010-08-01 Thread R. Bastian
On Sun, 01 Aug 2010 14:59:39 +0200
Wolfgang Schuster  scribit:

>   Am 01.08.10 14:00, schrieb R. Bastian:
> > Hello,
> >
> > is there a way to insert plain tex code in context source ?
> Most of the plain TeX commands work in ConTeXt out of the box but
> ConTeXt’s own commands and environments are recommended.
> 
> I converted the font you want to use into type1 format 
> (http://drp.ly/1sFxdF),
> to use it you should use \definefont which scales the font to match the size
> of the normal text:
> 
> \definefont[ttbold][file:cmbtt10]
> \starttext
> \tt text \ttbold text
> \stoptext
> 
> Wolfgang
> 
Many thanks! it works.
-- 
Ren\'e Bastian (charset problems with this mail ?)
www.pythoneon.org
w


___
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] CLD Documents

2010-08-01 Thread Wolfgang Schuster

Am 01.08.10 15:24, schrieb Martin 'golodhrim' Scholz:

Hi Hans,

I like the way how one can write ConTeXt-Lua-Documents, works really
good, but I tried to load a module but there seems to be no solution for
this included. Is there a way to include this in a CLD-Document?


context.usemodule({"..."})

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
___


[NTG-context] CLD Documents

2010-08-01 Thread Martin 'golodhrim' Scholz
Hi Hans,

I like the way how one can write ConTeXt-Lua-Documents, works really 
good, but I tried to load a module but there seems to be no solution for 
this included. Is there a way to include this in a CLD-Document?

Thanks
-- 
---
Martin 'golodhrim' Scholz
Auf dem Sattler 4
34516 Ederbringhausen
Phone: +49 6454 799623
mobile: +49 176 63301749
Fax: +49 6454 
e-Mail: scholz@googlemail.com

BOFH Excuse #260:

We're upgrading /dev/null

___
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] tex in context

2010-08-01 Thread Wolfgang Schuster

 Am 01.08.10 14:00, schrieb R. Bastian:

Hello,

is there a way to insert plain tex code in context source ?

Most of the plain TeX commands work in ConTeXt out of the box but
ConTeXt’s own commands and environments are recommended.

I converted the font you want to use into type1 format 
(http://drp.ly/1sFxdF),

to use it you should use \definefont which scales the font to match the size
of the normal text:

\definefont[ttbold][file:cmbtt10]
\starttext
\tt text \ttbold text
\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
___


Re: [NTG-context] MTXrun | error, no format found with name: cont-en, aborting

2010-08-01 Thread Paul Dostert
Worked... although I need to know why :-)

What didn't work when I just installed the minimals, and what did
luatools --generate and context --make do?

Thank you!

2010/8/1 Vedran Miletić :
> 2010/8/1 Paul Dostert :
>> I installed context via:
>>
>> - Download of context-setup-mswin.zip
>> - unzip to c:\context
>> - run of first-setup.bat (with no args, and same happens with 
>> --context=current)
>> - After running, I go to the tex/ directory and run the setuptex.bat
>
> Try doing:
>
> luatools --generate
> context --make
>
> Regards,
>
> --
> Vedran Miletić
> ___
> 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
> ___
>
___
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] tex in context

2010-08-01 Thread R. Bastian
Hello,

is there a way to insert plain tex code in context source ?

example:

\startTEX
\font\ttbold=cmbtt10 at 12pt
 {\ttbold texte monospace en gras} ...
\stopTEX



-- 
René Bastian
www.pythoneon.org


___
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] Passing info from MetaPost to TeX

2010-08-01 Thread Oliver Buerschaper
> ... because adjusting the bounding box fails once the figure grows a bit 
> larger. Just use
> 
> u := 3StrutHeight;
> 
> in the code above and you'll see the effect.

I forgot to say you need to add some text above and below the displayed 
formula... then you'll see some awkward vertical spacing :-(

Oliver
___
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] Passing info from MetaPost to TeX

2010-08-01 Thread Taco Hoekwater

On 08/01/2010 12:16 PM, Oliver Buerschaper wrote:

Hi Taco,


Well, you could create a temporary file from withing the metapost
graphic, then read that file back on the TeX side, and then shift
the image vertically based on the info from that.


Could you give me a hint on how to parse such an auxiliary file in
TeX? I've never done any sort of that programming before...


You don't have to worry about parsing, just write something like
this in the metapost code:

write "\string\def\string\MathAxis{"& decimal (sqrt(3)*u/3) &"}" to 
"info.tex";


Then \input info.

Best wishes,
Taco
___
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] Passing info from MetaPost to TeX

2010-08-01 Thread Oliver Buerschaper
Hi Taco,

> Well, you could create a temporary file from withing the metapost
> graphic, then read that file back on the TeX side, and then shift
> the image vertically based on the info from that.

Could you give me a hint on how to parse such an auxiliary file in TeX? I've 
never done any sort of that programming before...

I'm asking...


> Complicated and a bit ugly, but doable. A nicer solution is to
> adjust the bounging box of the image itself so that it does the
> right thing. This seems to do the trick (but I recall there is
> a way to pass a TeX variable to the figure; and that would be much
> cleaner; but I don't remember how offhand).
> 
> 
> \startuseMPgraphic{diagram2}
>   u := StrutHeight;
>   draw origin--(2u,0)--(u,sqrt(3)*u)--cycle;
>   currentpicture := currentpicture shifted (0,-(sqrt(3)*u/3));
>   setbounds currentpicture to (origin--(2u,0)--(u,sqrt(3)*u)--cycle);
> \stopuseMPgraphic
> 
> \starttext
> 
> \startformula
>  A\raise\Umathaxis\displaystyle\hbox{\useMPgraphic{diagram2}}
>  =B
> \stopformula
> 
> \stoptext


... because adjusting the bounding box fails once the figure grows a bit 
larger. Just use

u := 3StrutHeight;

in the code above and you'll see the effect.

Thanks for your help,
Oliver
___
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] Expansion of TeX macros inside the Lua function

2010-08-01 Thread Jaroslav Hajtmar
I came across an interesting issue (for me), which is probably the 
beginner, but accompanied me for a long time. The problem is probably 
that I do not understand very well the principles of operation LuaTeX 
and while I want to do more complex things.


I think many beginners will love it when someone indicate solutions.

My problem is that I need in my complex application, evaluate parameters 
of Lua functions, which are a TeX macros (respectively their expanded 
contents). I did not discover the possibility of expansion of TeX 
macros, which is a parameter Lua function.


Here are three examples in which I demonstrate the problem.

1. In first example is function parameter a text string.

\ctxlua{pars('a,b,c,d,e')}

Everything works as expected - evaluation of parameter was carried out 
OK - comma separator was found and replaced.


2. In second example is a function parameter a TeX macro \printaction. 
Macro expanded before entering the function. Everything works as 
expected too - comma separator is found and replaced:


\ctxlua{pars('\printaction')}


3. The third example of my most interesting. Function parameter in 
example is a TeX macro \printaction which not expanded, respectively 
expanded only when I printing it to TeX. Parameter of function is string 
"\printaction" in which it is futile to look for a comma separator. 
Comma not be found, although the content of macro face that is so.


\ctxlua{pars('\\printaction')}

Is there a possibility for this case, as in some way to save to Lua 
variable content of macro (of course expanded)?
I note that this example is important for me and I would like there to 
be a Lua function (eg "expandtostring"), which expanded a TeX macro into 
variable until inside function Lua.


I hope the my example (with comments) will be comprehensible and I 
apologize if the solution is too trivial. I searched dozens of examples, 
but I come across something similar.


Thanx very much - Jaroslav

Here is example:


\startluacode

function pars(inppar)
strpar=tostring(inppar) -- here I need a function "expandtostring(inppar)"
gsubstr=string.gsub(strpar, ',', ';')
tex.print("Input parametr (string or macro):  ")
tex.write(inppar)
tex.print("\\par")
tex.print("Content of string (macro): "..strpar) -- There will always be 
expansion

tex.print("\\par")
tex.print("Length string (macro):  "..string.len(inppar).."\\par")
tex.print("Length of content :  "..string.len(strpar).."\\par")
tex.print("Occurrence of the commma separator:  "..gsubstr.."\\par")
end

\stopluacode


\def\printaction{x,y,z}


\starttext

Example 1)

Function parameter in first example is a text string. Everything works as
expected - comma separator is found and replaced:

\ctxlua{pars('a,b,c,d,e')}

\blank[big]

Example 2)

Function parameter in second example is a TeX macro \backslash printaction
which expanded before entering the function. Everything works as 
expected too - comma separator is found

and replaced:

\ctxlua{pars('\printaction')}

\blank[big]

Example 3)

The third example of my most interesting. Function parameter in example is
a TeX macro \backslash printaction which not expanded, respectively 
expanded

only when I printing it to TeX. Parameter of function is still string
"\backslash printaction" in which it is futile to look for a comma 
separator.
Comma not be found, although the content of macro face that is so. Is 
there a
possibility for this case, as in some way to save to Lua variable 
content of

macro (of course expanded)?

\ctxlua{pars('\\printaction')}



\stoptext





___
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] part problems

2010-08-01 Thread Alan BRASLAU
On Saturday 31 July 2010 11:20:38 Hans Hagen wrote:
> On 31-7-2010 1:08, Alan BRASLAU wrote:
> > 
> > Using parts is not as simple as it seems and is still somewhat
> > problematic, or maybe I, too, am unable to read the source.
> 
> parts are just like chapters and sections; the defaults are just set up
> differently; don't think of them as something programatically different
> 

Some logical subtleties, though, reflecting the different use either as "part" 
or as "volume":


A book (or single volume) may contain several parts, each one containing 
several chapters. One may wish to number the chapters subsequently, 
independent of the part structure.

This is no problem:
  \definestructureresetset [default] [0,0] [1] % do not reset parts and 
chapters
(although the syntax is somewhat obscure here).
also
  \setuphead [part]
 [sectionresetset=default,conversion=Romannumerals,placehead=yes]
and
  \setuphead [chapter,section,subsection] [sectionsegments=2:100]
  \setuppagenumbering [alternative=doublesided,way=bytext,partnumber=no]
(this is what Hans refers to as defaults that are set up differently).

[By the way, the default pagenumbering by part is a very reasonable default, 
as is resetting chapter numbering by part, for often "part" is synonymous with 
"volume". But not always: sometimes a book is to be broken into parts within a 
single volume.]


Now the front matter and the back matter are common to the entire book, 
logically part-less (if part is not to be taken as volume).  The front matter 
may contain chapter(s) (preface, introduction, definitions) that may be 
unnumbered.  The back matter will contain appendices (numbered), an index or 
indexes (unnumbered), etc.

For now, I have found no better way then to use funny definitions:
  \definehead [frontchapter] [chapter] % to get around broken bookmarks
  \setuphead  [frontchapter] [incrementnumber=list]
  \definehead [unnumberedchapter] [chapter]
  \setuphead  [unnumberedchapter] [incrementnumber=list]
  \definehead [unnumberedpart] [part]
  \setuphead  [unnumberedpart] [incrementnumber=list,label=no]
  \definecombinedlist [content]

[part,unnumberedpart,frontchapter,unnumberedchapter,chapter,section,subsection,subsubsection]
  \setuplist 
[part,unnumberedpart,frontchapter,unnumberedchapter,chapter,section,subsection,subsubsection]
[alternative=c, % number – title – dots – pagenumber
 interaction=all]


A problem comes up when I want the main body parts to be labeled, as well as 
chapters, as in:
  \setuphead [part]
[sectionresetset=default,conversion=Romannumerals,placehead=yes]
  \setuplabeltext [chapter=Chapter ] % with trailing space; blank by default
  \startsectionblockenvironment[bodypart]
\setuplist [chapter]  [label=yes]
  \stopsectionblockenvironment


You see, what should be natural (and probably the default) quickly gets to be 
a bit complicated. Furthermore, I have not yet been able to get everything 
that I want working. In the end, I'm sure that the solution will be quite 
easy.

My point is that the use of \part (or, now, \startpart ... \stoppart) is not 
as simple and obvious as it should be.

Alan
___
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] MTXrun | error, no format found with name: cont-en, aborting

2010-08-01 Thread Vedran Miletić
2010/8/1 Paul Dostert :
> I installed context via:
>
> - Download of context-setup-mswin.zip
> - unzip to c:\context
> - run of first-setup.bat (with no args, and same happens with 
> --context=current)
> - After running, I go to the tex/ directory and run the setuptex.bat

Try doing:

luatools --generate
context --make

Regards,

-- 
Vedran Miletić
___
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
___