Re: [NTG-context] ConTeXt on the Mac (TexShop). Problem of a newbie

2013-01-09 Thread Hans Hagen

On 1/7/2013 4:07 PM, Meigen, Thomas wrote:

 1 \usemodule[s-pre-05]

2 \starttext
3 \TitlePage{A simple presentation}
4 \Topics{Today's talk}
5 \Topic{First item}
6 \Topic{Second item}
7 \stoptext

argument ... internal(\currentlistentryinternal


look like a bug in recently updated list code so your installation si ok

-
  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] Node for startbuffer.

2013-01-09 Thread Andre Caldas
Hello!

Given some

\startbuffer
  Blah, blah, blah...
\stopbuffer

I'd like to get a node tree corresponding to how the buffer would be
processed at a given point. Using luatex, I'd like to identify certain
sub-nodes and change their attributes (to be specific: transparency).

Any hint on how to do it?

Also, are there any good examples on how to use nodes?


André Caldas.
___
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] How to use module simpleslides' SideToc

2013-01-09 Thread Sietse Brouwer
Hello PengCZ,

This is not exactly what you want, because it took me very long to
remember to look at SideToc.pdf. But it is close, and I have tried to
put in a lot of comments. Hopefully you can solve it from here?

Cheers, and good luck,
Sietse

% * We use \Topic to set the current topic, and to
%   record it in the topic list

% * \setuptexttexts places the topic list in the left margin
%   on every page
%   http://wiki.contextgarden.net/Command/setuptexttexts
%   (needs improving)

% * \setupbackgrounds sets the backgrond color of the left
%   margin on every page: this highlights the TOC area
%   http://wiki.contextgarden.net/Command/setupbackgrounds

% * the entry typesetting command (called \FancyTopic) typesets
%   entries inside a \framed block as wide as the margin is.
%   This allows highlighting the background of the current topic,
%   and also allows linebreaks etc.
%   http://wiki.contextgarden.net/Command/framed

\setuppapersize[A6,landscape][A6,landscape]
\setuplayout [leftmargin=5cm,
  backspace=6cm,
  width=6cm,
  ]
% Color for the margin (topic list area)
\definecolor[colMyTopics][r=1,g=0.7,b=0.7] % pink

% Color for the current topic (in the topic list)
% I like white, because it attaches the current topic to the
%   main area; but perhaps you prefer pale yellow?
% \definecolor[colCurrentTopic][r=1,g=1,b=0.7] % pale yellow
\definecolor[colCurrentTopic][r=1,g=1,b=1] % white

% When \placelist[MyTopics] is called, it calls this \FancyEntry
% function to typeset each individual entry.
% #1: entry (i.e. topic name) to typeset
% \MyMark: section (i.e. topic name) we are currently in (set by
% \Topic).
\define[3]\FancyEntry {
\ifnum\structurelistrealpagenumber=\realpageno\relax SAME \else
OTHER \fi PAGE
\blank[medium]
\doifelse \rawstructurelistfirst \MyMark
  {\framed[frame=off,
   align=normal,
   width=5cm, % same as leftmargin in \setuplayout
   background=color,
   backgroundcolor=colCurrentTopic]{%
--- current mark's entry \par
\color[red]{--- arg (entry): #1}\par
\color[red]{--- mark: \MyMark}
  }}
  {\framed[frame=off, align=normal]{%
--- other entry \par
\color[blue]{--- arg (entry): #1}\par
\color[blue]{--- mark: \MyMark}
  }}
\blank[medium]
}

% Show the margin areas, headers, footers, etc.
\showframe

% Color the margin area. \setupbackgrounds must be called after
% \showframe, or \showframe will 'overwrite' \setupbackgrounds.
\setupbackgrounds[text][leftmargin][
background=color,
backgroundcolor=colMyTopics]
\definelist[MyTopics][criterium=all]

\def\MyMark{}

% \Topic takes one optional argument: #1, the topic name.
\def\Topic%
  {\dosingleargument\doTopic}

\def\doTopic[#1]{%
  % let it be known that we are in section #1 (used by \FancyTopic)
  \def\MyMark{#1}%
  % let topic #1 appear in the TOC (well, the MyTopics list)
  \writetolist[MyTopics]{#1}{}%
}

\setuplist[MyTopics]
  [pagenumber=no,
   alternative=command,
   command=\FancyEntry]

% On every page, place the TOC in the margin, plzkthx
\setuptexttexts[margin][\vbox{\placelist[MyTopics]}][]

\starttext

\Topic[First]
First Topic

\page

\Topic[Second]
Second Topic

\page

\Topic[Third]
Third Topic

\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] Node for startbuffer.

2013-01-09 Thread Hans Hagen

On 1/9/2013 2:54 PM, Andre Caldas wrote:

Hello!

Given some

\startbuffer
   Blah, blah, blah...
\stopbuffer

I'd like to get a node tree corresponding to how the buffer would be
processed at a given point. Using luatex, I'd like to identify certain
sub-nodes and change their attributes (to be specific: transparency).

Any hint on how to do it?


here's an example (I'll add it to the cld manual):

\starttext

\definecolor[mytransparency][a=1,t=.5]

\startluacode
local enabled = false
local count   = 0

function userdata.processmystuff(head)
if enabled then
count = count + 1
for n in node.traverse(head) do
logs.report(node,run %s: %s,count,n)
if count % 2 == 0 then
nodes.tracers.transparencies.set(n,mytransparency)
end
end
return head, true
end
return head, false
end

function userdata.enablemystuff()
enabled = true
end

function userdata.disablemystuff()
enabled = false
end

nodes.tasks.appendaction(processors, normalizers, 
userdata.processmystuff)

\stopluacode

\startbuffer
whatever \hbox{you} want
\stopbuffer

\ctxlua{userdata.enablemystuff()}
\par \getbuffer \par
\ctxlua{userdata.disablemystuff()}

\stoptext


Also, are there any good examples on how to use nodes?


all over context ...

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] Node for startbuffer.

2013-01-09 Thread Andre Caldas
 here's an example (I'll add it to the cld manual):

Wow!!! Thank you for your time, Hans!

I will study your sample... :-)


Cheers,
André Caldas.
___
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] ConTeXt on the Mac (TexShop). Problem of a newbie

2013-01-09 Thread Sietse Brouwer
Hello Thomas,

Just to widen your options a bit: I have greatly enjoyed using the
\complexslides module by Aditya (and co?). I've attached an example
document, which shows inter alia how easy it is to override a design
component. (The fontscheme, in this case.)

Cheers,

Sietse


presentation-hand.pdf
Description: Adobe PDF document


complexslides-fontscheme-sietse.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] Node for startbuffer.

2013-01-09 Thread Andre Caldas
Another question...

 function userdata.processmystuff(head)

Shall I use this?
userdata = userdata or {}


 \startbuffer
 whatever \hbox{you} want
 \stopbuffer

How do I identify a specific node? Like...

\startbuffer
  Will this be
  \boxtobechanged{transparent?}
\stopbuffer


André Caldas.
___
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] Luajittex 0.72.0 announcement

2013-01-09 Thread Mojca Miklavec
On Tue, Dec 25, 2012 at 2:27 PM, luigi scarso wrote:
 Hi,
 there is a new project on supelec: Luajittex.

 Briefly, it's like luatex with Lua replaced by LuaJIT.
 See
 http://foundry.supelec.fr/gf/project/luajittex/
 for the source code.

 Please note that LuaJIT is based on lua 5.1, while luatex is now
 based on lua 5.2 --- this means that binaries modules must be kept separate.
 The tag 0.72.0 means that luajittex is in sinc with the tag 0.72.0 of luatex;
 I'm working to keep in sinc with the last tag.
 I've compiled the source for Linux 64bit (Ubuntu 12.10)  Linux 32bit
 (Opensuse 12.1) and crosscompiled for Mingw32bit and they seem to work
 but of course any feedback is appreciate.



 The new engine is available with context (mkiv) with
 --engine=luajittex

I only wanted to say that luajittex is now available in the
distribution for most of the platforms.

(It's missing on Solaris. The build for 32-bit Mac OS X fails on the
builder's machine and on 64-bit it crashes with Can't create the Lua
state., but you are welcome to test everywhere else.)

Mojca
___
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] Node for startbuffer.

2013-01-09 Thread Hans Hagen

On 1/9/2013 9:57 PM, Andre Caldas wrote:

Another question...


function userdata.processmystuff(head)


Shall I use this?
userdata = userdata or {}



\startbuffer
whatever \hbox{you} want
\stopbuffer


How do I identify a specific node? Like...

\startbuffer
   Will this be
   \boxtobechanged{transparent?}
\stopbuffer


Here is a start. I've added the markers code to the beta so that we have 
an abstract way to deal with such matters.


\setupbodyfont[dejavu]

\definemarker[mymarker]

\definecolor[mymarker:1][r=.6]
\definecolor[mymarker:2][g=.6]
\definecolor[mymarker:3][r=.6,g=.6]

\startluacode
local setcolor= nodes.tracers.colors.setlist
local getmarker   = nodes.markers.get
local hlist_code  = nodes.codes.hlist
local traverse_id = node.traverse_id

function userdata.processmystuff(head)
for n in traverse_id(hlist_code,head) do
local m = getmarker(n,mymarker)
if m then
setcolor(n.list,mymarker: .. m)
end
end
return head, true
end

nodes.tasks.appendaction(processors, after, userdata.processmystuff)
nodes.tasks.disableaction(processors, userdata.processmystuff)
\stopluacode

\starttext

\startluacode
nodes.tasks.enableaction(processors, userdata.processmystuff)
\stopluacode

Node lists are processed \hbox \boxmarker{mymarker}{1} {nested from 
\hbox{inside}
out} which is not what you might expect. But, \hbox {coloring} does not 
\hbox
{happen} really nested here, more \hbox {in} \hbox 
\boxmarker{mymarker}{2} {the}

\hbox {order} \hbox {of} \hbox \boxmarker{mymarker}{3} {processing}.

\startluacode
nodes.tasks.disableaction(processors, userdata.processmystuff)
\stopluacode

\stoptext

It's somewhat experimental. Up to you to update the wiki. I've added the 
example to the cld manual.


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
___


[NTG-context] Installing beta.

2013-01-09 Thread Andre Caldas
What is the correct way to install the beta version of context?


André Caldas.
___
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] Installing beta.

2013-01-09 Thread Andreas Mang
Hi André Caldas,

I suppose this helps: http://wiki.contextgarden.net/ConTeXt_Standalone

fetch first-setup.sh, put it to a folder of your liking (e.g. 
/usr/local/contextBETA) and do something like

sh ./first-setup.sh --context=current

(wrt. the system you are using, of course)

Cheers
Andreas

Am Jan 10, 2013 um 2:07 AM schrieb Andre Caldas andre.em.cal...@gmail.com:

 What is the correct way to install the beta version of context?
 
 
 André Caldas.
 ___
 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
___


Re: [NTG-context] Installing beta.

2013-01-09 Thread Mojca Miklavec
On Thu, Jan 10, 2013 at 2:39 AM, Andreas Mang wrote:
 Hi André Caldas,

 I suppose this helps: http://wiki.contextgarden.net/ConTeXt_Standalone

 fetch first-setup.sh, put it to a folder of your liking (e.g. 
 /usr/local/contextBETA) and do something like

 sh ./first-setup.sh --context=current

Actually --context=beta (which is default) will get you the beta version.

Currently the current version might have problems due to LuaTeX 0.74
being incompatible with the older (= current) version of ConTeXt.

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