Re: [NTG-context] boldstyle for numbers in defineenumeration

2009-03-06 Thread Hans Hagen

Aditya Mahajan wrote:

On Thu, 5 Mar 2009, Wolfgang Schuster wrote:



Am 05.03.2009 um 20:19 schrieb Aditya Mahajan:


On Thu, 5 Mar 2009, Wolfgang Schuster wrote:



Am 05.03.2009 um 19:48 schrieb Aditya Mahajan:


The textcolor does not work. I have to put in in text field.
The example that works is:
Hans: does it make sense to add text(style|color|command) and 
number(style|color|command) keys to enumerations? I could patch 
core-des.tex with these keys.


Hi Aditya, if you do this, can you also integrate the headalign key 
which is mentioned in core-des?


What should headalign do?



It should control the alignment of the headtext.

\setuplayout
[backspace=5cm,
 leftmargin=4cm,
 width=12cm]

\definedescription
[description]
[location=margin,
 width=\leftmarginwidth]

\showframe

\starttext

\description{text} bla bla bla

\description{longer text} bla bla bla

%\setupdescriptions[description][headalign=flushright]
\setupdescriptions[description][text=\hfill]

\description{text} bla bla bla

\description{longer text} bla bla bla

\stoptext


Thanks. I first guess was

\defineframed
  [framehead]
  [location=low,width=\leftmarginwidth,align=flushright,frame=off]

\setupdescriptions[description][text=,location=command,headcommand=\framehead] 



but this does not work. You can also use, but it will be nice to have a 
headalign key.


\setupdescriptions[description][command=\framehead]

\description{text} bla bla bla

\description{longer text} bla bla bla

My only trouble with core-des is that it is ugly. It is an old module, 
and lot of features have been added in an ad-hoc manner with time. I 
hope that at some stage it will be rewritten in the new strc-* style.


sure, it's already different in strc but such 'upgrades' are rather 
gradual since we want to keep compatibilitiy


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to increase weight of a font?

2009-03-06 Thread Hans Hagen

Wei-Wei Guo wrote:

Hi Hans,

Do you mean

  \definefontsynonym[ZhSerif][name:SimSun][properties=???]

Could you tell me how to do?



\starttext

\startproperty[both]
\input tufte
\stopproperty

\stoptext



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] [Fwd: Re: math preview in emacs]

2009-03-06 Thread luigi scarso
On Thu, Mar 5, 2009 at 10:24 PM, Mohamed Bana
mbana.li...@googlemail.com wrote:
 has anyone else looked at providing math preview with ConTeXt?
my long-long-long...long term project
http://www.texmacs.org/

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


[NTG-context] the other blog (chemical stuff)

2009-03-06 Thread Hans Hagen

Hi aditya,

some comments on the other bog item ... (others may wikify it)

you can do a quick and dirty solution as well (tested in mkiv):

\def\MoleculeC#1{$\enablesupersub\tf#1$}

now, concerning the lua solution, it looks pretty clean and ok, but 
there is some room for improvement ... the following version supports 
nested braces and numbers (we can let this evolve in a proper chemical

subsystem if needed since eventually i will replace ppchtex anyway)


\startluacode
local molecule = { }

local format, sprint = string.format, tex.sprint

function commands.justtext(one)
sprint(tex.ctxcatcodes,one)
end

function commands.low(str)
sprint(tex.ctxcatcodes,format(\\low{%s},str))
end

function commands.high(str)
sprint(tex.ctxcatcodes,format(\\high{%s},str))
end

function commands.lowhigh(one,two)
sprint(tex.ctxcatcodes,format(\\lohi{%s}{%s},one,two))
end

function commands.highlow(one,two)
sprint(tex.ctxcatcodes,format(\\hilo{%s}{%s},one,two))
end

local lowercase   = lpeg.R(az)
local uppercase   = lpeg.R(AZ)

local plus= lpeg.P(+)
local minus   = lpeg.P(-)
local digit   = lpeg.R(09)
local sign= plus + minus
local cardinal= digit^1
local integer = sign^0 * cardinal

local leftbrace   = lpeg.P({)
local rightbrace  = lpeg.P(})
local nobrace = 1 - (leftbrace + rightbrace)
local nested  = lpeg.P { leftbrace * (nobrace + lpeg.V(1))^0 * 
rightbrace }

local any = lpeg.P(1)

local subscript   = lpeg.P(_)
local superscript = lpeg.P(^)

local content = lpeg.C(nested + integer + any)

-- could be made more efficient

local lowhigh  = subscript   * content * superscript * content / 
commands.lowhigh
local highlow  = superscript * content * subscript   * content / 
commands.highlow
local low  = subscript   * content / 
commands.low
local high = superscript * content / 
commands.high
local justtext = lpeg.C((1 - somescript)^1)/ 
commands.justtext


local parser = (sometext + lowhigh + highlow + low + high)^0

function commands.molecule(string)
parser:match(string)
end
\stopluacode


\def\molecule#1{\ctxlua{commands.molecule(#1)}}

\molecule{H_2SO_4^-2}
\molecule{H_2SO_4^{-2}}
\molecule{H_2SO_4^{-2{x}}}

Hans




-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] paragraph question

2009-03-06 Thread Alan Stone
Another idea...

How do you make this line counter work ?

\newcount\parnumber
\newcount\linenumber
\def\myCounters{%
   \EveryPar{%
  \advance\parnumber by 1
  (P\the\parnumber)
  \EveryLine{%
% (L\the\prevgraf)}}
  \advance\linenumber by 1
  (L\the\linenumber)}
  \linenumber=0\relax}
   \parnumber=0\relax}

\setuphead[chapter][page=,after={\myCounters}]

\starttext

\chapter{Chapter 0}

Only one line.

\dorecurse{2}{\chapter{Chapter #1}\input knuth}

\stoptext


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


Re: [NTG-context] How to increase weight of a font?

2009-03-06 Thread Wei-Wei Guo

It works, but is what I want. Sorry, I didn't describe my problem clear enough.
I want to set weighted font for chapter title. How do this?

Thanks,

Wei-Wei Guo


Hans Hagen 写道:

Wei-Wei Guo wrote:

Hi Hans,

Do you mean

  \definefontsynonym[ZhSerif][name:SimSun][properties=???]

Could you tell me how to do?



\starttext

\startproperty[both]
\input tufte
\stopproperty

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


Re: [NTG-context] \dorecurse and \recurselevel in Natural Tables

2009-03-06 Thread Wolfgang Schuster


Am 06.03.2009 um 07:41 schrieb luigi scarso:



My summary of this thread:
http://randomdeterminism.wordpress.com/2009/03/05/tex-programming-the-past-the-present-and-the-future/

It's exactly what I think .

Thank you very much.


Nice article, it fits perfectly in the programming section of the wiki.

Thank your for the summary.

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


Re: [NTG-context] How to increase weight of a font?

2009-03-06 Thread Yue Wang
the embolden feature provided by xetex and dvipdfmx?

On Fri, Mar 6, 2009 at 6:31 PM, Wei-Wei Guo wwgu...@gmail.com wrote:
 It works, but is what I want. Sorry, I didn't describe my problem clear
 enough.
 I want to set weighted font for chapter title. How do this?

 Thanks,

 Wei-Wei Guo


 Hans Hagen 写道:

 Wei-Wei Guo wrote:

 Hi Hans,

 Do you mean

  \definefontsynonym[ZhSerif][name:SimSun][properties=???]

 Could you tell me how to do?


 \starttext

 \startproperty[both]
 \input tufte
 \stopproperty

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


Re: [NTG-context] How to increase weight of a font?

2009-03-06 Thread Yanrui Li
2009/3/6 Wei-Wei Guo wwgu...@gmail.com:
 It works, but is what I want. Sorry, I didn't describe my problem clear
 enough.
 I want to set weighted font for chapter title. How do this?



\setuphead
  [chapter]
  [before={\startproperty[both]}, after={\stopproperty}]

-- 
Best wishes,
Li Yanrui

* Gentoo Linux (~x86)
* LuaTeX (snapshot-0.35.0-2009022702)
* ConTeXt Minimals Beta (2009.03.02 23:26)
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] \dorecurse and \recurselevel in Natural Tables

2009-03-06 Thread Willi Egger

Hi Aditya,

Happy luaTeXing. Great summary.

Willi

On Mar 6, 2009, at 4:05 AM, Aditya Mahajan wrote:


On Thu, 5 Mar 2009, luigi scarso wrote:


On Thu, Mar 5, 2009 at 12:09 PM, Wolfgang Schuster
schuster.wolfg...@googlemail.com wrote:


Am 05.03.2009 um 01:17 schrieb luigi scarso:


\starttext
%%% TeX version
\bTABLE
\dorecurse{5}
{\bTR\expandafter \bTD \recurselevel. \eTD\expandafter
   \bTD \recurselevel  \eTD\eTR}
\eTABLE

\dorecurse{2}
{\recurselevel. \recurselevel\crlf}


And you think it's a good idea to use \expandafter in your document?

TeX  version, not context ... :)
btw
\expandafer is not so bad, if used moderatly .



\expanded is the tool for users to get this result without knowledge
about TeX internals and expansion, this is from core-ntb:

% permits \expanded{\bTD ... \eTD}

\unexpanded\def\eTR{}
\unexpanded\def\eTD{}
\unexpanded\def\eTH{}
\unexpanded\def\eTN{}
yes, of course one need to know about \expandafter... so is not so  
different .

But it's context style.




%%% luatex version
\startluacode
  tprint = function(s) tex.sprint(tex.ctxcatcodes,s) end
  tprint('\\bTABLE')
  for j = 1,5 do
  tprint('\\bTR')
  tprint('\\bTD' .. j .. '.' .. '\\eTD' .. '\\bTD' .. j .. '\ 
\eTD')

  tprint('\\eTR')
  end
  tprint('\\eTABLE')
\stopluacode
\stoptext


Nice solution and real alternative for package writers to avoid  
\expandafter
and \expanded but nothing for a normal user, I should keep this  
in my mind.

Are you sure ?
What is a normal user ?
As soon as you use \dorecurse , you become a programmer .

And sooner or later, everyone become a programmer, because it's
impossible to write a format that satisfied
all your needs .


My summary of this thread:
http://randomdeterminism.wordpress.com/2009/03/05/tex-programming- 
the-past-the-present-and-the-future/


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


Re: [NTG-context] boldstyle for numbers in defineenumeration

2009-03-06 Thread Xan

En/na Aditya Mahajan ha escrit:



My only trouble with core-des is that it is ugly. It is an old module, 
and lot of features have been added in an ad-hoc manner with time. I 
hope that at some stage it will be rewritten in the new strc-* style.


Aditya

Good news if you implement this functionality and better if it serves to 
debug code... I'm happy this question serves for (all of) you revise the 
code ,-)


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


Re: [NTG-context] \dorecurse and \recurselevel in Natural Tables

2009-03-06 Thread Curious Learn
Aditya Mahajan adityam at umich.edu writes:

 My summary of this thread:

http://randomdeterminism.wordpress.com/2009/03/05/tex-programming-the-past-the-present-and-the-future/
 
 Aditya

I like the Luatex code of Luigi. Though it is longer than what Wolfgang
suggested (and in this case, I am using Wolfgang's solution now that I know
about it), the luatex code seems to be the kind of programming that I am more
comfortable with. In fact, in Latex when I was trying to achieve this, I used
the python.sty package to code this in Python.

To be able to do this using Lua (Luatex), do I need to learn the Lua programming
language. Do I pick up any beginners book on Lua? Any recommendations based on
experience of those who use Luatex here.

For example, one of the lines in the code is 

 tprint = function(s) tex.sprint(tex.ctxcatcodes,s) end 

Is this Lua or LuaTex?

Thanks. 

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


Re: [NTG-context] \dorecurse and \recurselevel in Natural Tables

2009-03-06 Thread Arthur Reutenauer
   Do I pick up any beginners book on Lua?

  There really is only one beginners book on Lua :-)  _Programming in
Lua_, by Roberto Ierusalimschy, the Lua author.  There are a few other
books, mostly about Lua and games, because Lua has become quite
popular in the gamers' community, but Roberto's book is really excellent
and makes a good tutorial.

 For example, one of the lines in the code is 
 
  tprint = function(s) tex.sprint(tex.ctxcatcodes,s) end 
 
 Is this Lua or LuaTex?

  The question does not really makes sense if you put it that way.  This
line of code is pure Lua, it is completely syntactically correct; but
you can't use as it a standalone Lua script, because it uses functions
that only LuaTeX and ConTeXt define (think of it as the action of
import in Python, except that here it's not available as a stand-alone
library call; it's built into LuaTeX).

  Hence, if you want to become proficient in Lua programming in ConTeXt,
you need to learn:

  * The Lua programming language, with its core libraries (covered in
the aforementioned book).

  * The Lua libraries that LuaTeX adds to Lua, documented in the LuaTeX
manual.

  * The Lua libraries that ConTeXt adds to LuaTeX.

  The above line of code is really a mixture of the three, but in any
case, the ground stone is always Lua.

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


Re: [NTG-context] \dorecurse and \recurselevel in Natural Tables

2009-03-06 Thread luigi scarso
 I like the Luatex code of Luigi. Though it is longer than what Wolfgang
 suggested (and in this case, I am using Wolfgang's solution now that I know
 about it), the luatex code seems to be the kind of programming that I am more
 comfortable with. In fact, in Latex when I was trying to achieve this, I used
 the python.sty package to code this in Python.
The optimal  solution is that one of Wolfgang that uses \expanded .
The others are less than optimal.

 To be able to do this using Lua (Luatex), do I need to learn the Lua 
 programming
 language. Do I pick up any beginners book on Lua? Any recommendations based on
 experience of those who use Luatex here.
Programming in Lua ,
see www.lua.org



 For example, one of the lines in the code is

  tprint = function(s) tex.sprint(tex.ctxcatcodes,s) end

 Is this Lua or LuaTex?
luatex


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


Re: [NTG-context] paragraph question

2009-03-06 Thread Hans Hagen

Alan Stone wrote:

Another idea...

How do you make this line counter work ?

\newcount\parnumber
\newcount\linenumber
\def\myCounters{%
   \EveryPar{%
  \advance\parnumber by 1
  (P\the\parnumber)
  \EveryLine{%
% (L\the\prevgraf)}}
  \advance\linenumber by 1
  (L\the\linenumber)}
  \linenumber=0\relax}
   \parnumber=0\relax}

\setuphead[chapter][page=,after={\myCounters}]

\starttext

\chapter{Chapter 0}

Only one line.

\dorecurse{2}{\chapter{Chapter #1}\input knuth}

\stoptext



\startlinenumbering

\input tufte

\stoplinenumbering

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] paragraph question

2009-03-06 Thread Alan Stone
On Fri, Mar 6, 2009 at 3:05 PM, Hans Hagen pra...@wxs.nl wrote:
[...]
 \startlinenumbering

 \input tufte

 \stoplinenumbering

Ok, my question was a bit ambiguous...

I was not looking to number lines, but to count lines using EveryLine
within EveryPar, aka the paragraph counter \parnumber in the provided
code.

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


[NTG-context] overprint and \currentcolorname in mkiv

2009-03-06 Thread Peter Rolf

Hi Hans,

the subject is re-used from an older mail

http://archive.contextgarden.net/message/20080912.160921.cb5bba9d.en.html

 Currently I try to adapt some mkii code to mkiv. Overprinting should
 only be enabled if
 - a given maximum font size is not exceeded and
 - the current text color is black.

 So I also need \currentcolorname (or something similar) for that test.

 [colo-new.mkiv:]
 \def\currentcolorname{\s!black} % todo

You were so kind to add \doifblackelse in mkiv, but without a working 
\currentcolorname it is pretty useless at the moment. I want to closure 
the (inconvenient) prepress topic and overprinting is the last unsolved 
problem. Any chance that this will be implemented in the near future?


Best wishes,

Peter

--
 Es ist doch ein Trost,
  das Geldgier manchmal blöd macht.

- Kottan in Kottan ermittelt, Folge 9: Die Einteilung -

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


Re: [NTG-context] New LilyPond module

2009-03-06 Thread Henning Hraban Ramm

Am 2009-03-05 um 16:47 schrieb Wei-Wei Guo:

Is it possible to make the temp lily file in the format of PNG  
instead of PDF?

MkIV here cannot insert PDF figure properly recently.



Sorry, I son't think that would make sense.

It MkIV really can't include PDFs, that would be a major bug - nothing  
that could be blamed to or corrected by the LilyPond module.


If you want to get PNGs, you could try to change the call to LilyPond  
or add a call to ImageMagick after pstopdf (to convert PDF to PNG).



Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)



PGP.sig
Description: Signierter Teil der Nachricht
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] \dorecurse and \recurselevel in Natural Tables

2009-03-06 Thread Wolfgang Schuster


Am 06.03.2009 um 04:05 schrieb Aditya Mahajan:


My summary of this thread:
http://randomdeterminism.wordpress.com/2009/03/05/tex-programming-the-past-the-present-and-the-future/


Nice article but I have a few corrections for you.


Table setup:

To achieve horizontal and vertical centered content in the table cell
you need 'align={middle,lohi}'.


Pure table code:

You forgot the \bTR and \eTR before and after each row.


Expandafter solution:

You don't need as many \expandafter as you did in your example,
one before \bTD in each loop is enough.

\bTABLE
 \bTR
  \bTD $(+)$ \eTD
  \dorecurse{6}
   {\expandafter \bTD \recurselevel \eTD}
  \eTR
\dorecurse{6}
 {\bTR
 \edef\firstrecurselevel{\recurselevel}
 \expandafter\bTD \recurselevel \eTD
  \dorecurse{6}
{\expandafter
 \bTD
  \the\numexpr\firstrecurselevel+\recurselevel\relax
 \eTD}
  \eTR}
\eTABLE


\for loop:

If you really want to show this loop you also the correct
commands to access the counters. #1 did also work but only
because the command is wrapped around \dostepwiserecurse.

\bTABLE
  \bTR
\bTD $(+)$ \eTD
\for \y=1 \to 6 \step 1 \do
  {\bTD \y \eTD}
  \eTR
  \for \x=1 \to 6 \step 1 \do
  {\bTR
 \bTD \x \eTD
\for \y=1 \to 6 \step 1 \do
{\bTD \the\numexpr\x+\y \eTD}
  \eTR}
\eTABLE


Thank you for the article and I'm looking forward for the next.

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


[NTG-context] Howto make a handy script to handle dia exported *.mp files

2009-03-06 Thread Jan-Erik Hägglöf
HI ALL!

According to an earlier post that was very much helpful, I now wish to
know how to write a shell script or similar to automate this exporting
process.

http://archive.contextgarden.net/message/20081124.122842.38fee2f4.en.html 

I discover it is a lot of typing work to get these work as expected in
ConTeXt and specially mkIV.

Here is what i wish:

Just type in the ubuntu terminal

./mp2context figure.mp figure.tex

Inside the file mp2context it replaces all the latex related like
verbatimtex bla bla etex with \startuseMPgraphic{figure} and replaces
textareas

from btex { latex font definitions ..text..} etex 

to \sometxt{..text..}

I saw Aditya mentioned in the earlier post about some regexp but I don't
know what do do with it. 

Finally you just for example in main document do

\startproduct
\component figure

\placefigure[here][fig:myfig]{Here is my picture done in
dia}{\scale[width=\textwidth]{\useMPgraphic{figure}}}

\stoppproduct

Thanks in Advance!

Janneman

using Minimals

current version: 2009.01.18 14:39
This is LuaTeX, Version snapshot-0.35.0-2009022416 (Web2C 7.5.7)
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] New LilyPond module

2009-03-06 Thread Henning Hraban Ramm

Am 2009-03-05 um 16:00 schrieb Lutz Haseloff:

One remaining problem. On my system (Windows XP, luatex 0.35,  
lilypond 2.12.2)

 your module generates two identical eps files with different names,
filename-lilypond-1.eps and filename-lilypond-1-1.eps.
The second is converted to pdf and therefore is filename- 
lilypond-1.pdf not included.


It's not the module producing useless additional files, but LilyPond  
itself.

I complained on the LilyPond list, but it seems it won't change.

We must use the EPS backend, that is also used by lilypond-book  
(LaTeX), otherwise we don't get snippets.
I *guess* (didn't check), LilyPond will split a long score into pages,  
i.e. will produce filename-lilypond-1-1.eps, filename-lilypond-1-2.eps  
etc. for a multi page score.


Anyway, we can't do anything about it. I don't want to include delete  
commands in the module (there aren't OS independent delete commands  
anyway).


Perhaps write a batch script to delete the useless files yourself.

I already tried to keep LilyPond's files in a temp directory, but I  
didn't succeed.



Do you want to read my log and have a look at my generated files?



No, it's the same here on MacOS X.


Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)



PGP.sig
Description: Signierter Teil der Nachricht
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to increase weight of a font?

2009-03-06 Thread Wei-Wei Guo

Thanks, it works.

Best wishes,
Wei-Wei Guo

Yanrui Li 写道:

2009/3/6 Wei-Wei Guo wwgu...@gmail.com:

It works, but is what I want. Sorry, I didn't describe my problem clear
enough.
I want to set weighted font for chapter title. How do this?




\setuphead
  [chapter]
  [before={\startproperty[both]}, after={\stopproperty}]


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


Re: [NTG-context] How to increase weight of a font?

2009-03-06 Thread Wei-Wei Guo
I guess you are asking the equal feature provided by xetex, so my answer is 
'yes'.

Does ConTeXt have the 'embolden' feature? If yes, how to use it?


Best wishes,
Wei-Wei Guo


Yue Wang 写道:
 the embolden feature provided by xetex and dvipdfmx?
 
 On Fri, Mar 6, 2009 at 6:31 PM, Wei-Wei Guo wwgu...@gmail.com wrote:
 It works, but is what I want. Sorry, I didn't describe my problem clear
 enough.
 I want to set weighted font for chapter title. How do this?

 Thanks,

 Wei-Wei Guo


 Hans Hagen 写道:
 Wei-Wei Guo wrote:
 Hi Hans,

 Do you mean

  \definefontsynonym[ZhSerif][name:SimSun][properties=???]

 Could you tell me how to do?

 \starttext

 \startproperty[both]
 \input tufte
 \stopproperty

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


Re: [NTG-context] \dorecurse and \recurselevel in Natural Tables

2009-03-06 Thread Curious Learn


Arthur and Luigi, thanks for your responses. Arthur, your response makes it very
clear, what I need to do. I will start with the book you recommend.



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


Re: [NTG-context] \dorecurse and \recurselevel in Natural Tables

2009-03-06 Thread Aditya Mahajan

On Fri, 6 Mar 2009, Wolfgang Schuster wrote:



Am 06.03.2009 um 04:05 schrieb Aditya Mahajan:


My summary of this thread:
http://randomdeterminism.wordpress.com/2009/03/05/tex-programming-the-past-the-present-and-the-future/


Nice article but I have a few corrections for you.


Table setup:

To achieve horizontal and vertical centered content in the table cell
you need 'align={middle,lohi}'.


Hmm... align={middle,middle} also works. I haven't checked the code to see 
why.




Pure table code:

You forgot the \bTR and \eTR before and after each row.


Thanks.



Expandafter solution:

You don't need as many \expandafter as you did in your example,
one before \bTD in each loop is enough.

\bTABLE
\bTR
 \bTD $(+)$ \eTD
 \dorecurse{6}
  {\expandafter \bTD \recurselevel \eTD}
 \eTR
\dorecurse{6}
{\bTR
\edef\firstrecurselevel{\recurselevel}
\expandafter\bTD \recurselevel \eTD
 \dorecurse{6}
   {\expandafter
\bTD
 \the\numexpr\firstrecurselevel+\recurselevel\relax
\eTD}
 \eTR}
\eTABLE


Ah. I was experimenting without the \the\numexpr (replacing both by 
\relax) so that I could see the output. I did not realize that \numexpr 
expands its arguments anyways.


\for loop:

If you really want to show this loop you also the correct
commands to access the counters. #1 did also work but only
because the command is wrapped around \dostepwiserecurse.

\bTABLE
 \bTR
   \bTD $(+)$ \eTD
   \for \y=1 \to 6 \step 1 \do
 {\bTD \y \eTD}
 \eTR
 \for \x=1 \to 6 \step 1 \do
 {\bTR
\bTD \x \eTD
   \for \y=1 \to 6 \step 1 \do
   {\bTD \the\numexpr\x+\y \eTD}
 \eTR}
\eTABLE


This does not work, for the same reason that the \dorecurse solution does 
not work. You need to exapnad \x and \y in the first row and first column.



Thank you for the article and I'm looking forward for the next.


Thanks for the feedback.

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


Re: [NTG-context] \dorecurse and \recurselevel in Natural Tables

2009-03-06 Thread Aditya Mahajan

On Thu, 5 Mar 2009, Aditya Mahajan wrote:


On Thu, 5 Mar 2009, luigi scarso wrote:


On Thu, Mar 5, 2009 at 12:09 PM, Wolfgang Schuster
schuster.wolfg...@googlemail.com wrote:


Am 05.03.2009 um 01:17 schrieb luigi scarso:


\starttext
%%% TeX version
\bTABLE
\dorecurse{5}
{\bTR\expandafter \bTD \recurselevel. \eTD\expandafter
       \bTD \recurselevel  \eTD\eTR}
\eTABLE

\dorecurse{2}
{\recurselevel. \recurselevel\crlf}


And you think it's a good idea to use \expandafter in your document?

TeX  version, not context ... :)
btw
\expandafer is not so bad, if used moderatly .



\expanded is the tool for users to get this result without knowledge
about TeX internals and expansion, this is from core-ntb:

% permits \expanded{\bTD ... \eTD}

\unexpanded\def\eTR{}
\unexpanded\def\eTD{}
\unexpanded\def\eTH{}
\unexpanded\def\eTN{}
yes, of course one need to know about \expandafter... so is not so 
different .

But it's context style.




%%% luatex version
\startluacode
  tprint = function(s) tex.sprint(tex.ctxcatcodes,s) end
  tprint('\\bTABLE')
  for j = 1,5 do
      tprint('\\bTR')
      tprint('\\bTD' .. j .. '.' .. '\\eTD' .. '\\bTD' .. j .. '\\eTD')
      tprint('\\eTR')
  end
  tprint('\\eTABLE')
\stopluacode
\stoptext


Nice solution and real alternative for package writers to avoid 
\expandafter
and \expanded but nothing for a normal user, I should keep this in my 
mind.

Are you sure ?
What is a normal user ?
As soon as you use \dorecurse , you become a programmer .

And sooner or later, everyone become a programmer, because it's
impossible to write a format that satisfied
all your needs .


My summary of this thread:
http://randomdeterminism.wordpress.com/2009/03/05/tex-programming-the-past-the-present-and-the-future/


For fun: Using metapost

\setupcolors[state=start]
\setupTABLE[each][each][width=2em,height=2em,align={middle,middle}]
\setupTABLE[r][1][background=color,backgroundcolor=gray]
\setupTABLE[c][1][background=color,backgroundcolor=gray]

\let\normalbTABLE\bTABLE
\let\normaleTABLE\eTABLE

\unexpanded\def\bTABLE{\normalbTABLE}
\unexpanded\def\eTABLE{\normaleTABLE}

\unexpanded\def\dobTR{\dodoubleempty\parseTR}
\unexpanded\def\dobTD{\dodoubleempty\parseTD}
\unexpanded\def\dobTH{\dodoubleempty\parseTH}
\unexpanded\def\dobTN{\dodoubleempty\parseTN}

\let\bTR\dobTR
\let\bTD\dobTD
\let\bTH\dobTH
\let\bTN\dobTN

\starttext

\startMPcode
  string table ;
  table = \bTABLE \bTR \bTD $(+)$ \eTD 
for y = 1 upto 6 :
  \bTD   decimal y  \eTD  
endfor
\eTR  
for x = 1 upto 6 :
  \bTR \bTD   decimal x  \eTD  
  for y = 1 upto 6 :
   \bTD   decimal (x+y)  \eTD  
  endfor
  \eTR 
endfor
\eTABLE ;
  label(textext(table), origin) ;
\stopMPcode

\stoptext

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


Re: [NTG-context] \dorecurse and \recurselevel in Natural Tables

2009-03-06 Thread Wolfgang Schuster


Am 06.03.2009 um 17:33 schrieb Aditya Mahajan:


Table setup:

To achieve horizontal and vertical centered content in the table cell
you need 'align={middle,lohi}'.


Hmm... align={middle,middle} also works. I haven't checked the code  
to see why.


I hadn't known this before but it's feature of framed, good to know.


Expandafter solution:


Ah. I was experimenting without the \the\numexpr (replacing both by  
\relax) so that I could see the output. I did not realize that  
\numexpr expands its arguments anyways.


The first recurselevel was expanded with your \edef and the second
with the \expandafter before \bTD.


\for loop:


This does not work, for the same reason that the \dorecurse solution  
does not work. You need to exapnad \x and \y in the first row and  
first column.


I should next time check the output. Sure, the same rules as \dorecurse
apply to the \for loop.

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


[NTG-context] new beta

2009-03-06 Thread Hans Hagen

Hi,

I uploaded a new beta (mkiv):

-- some optimizations to color literals; i might have introduced 
problems there so keep an eye on color


-- beter definition for virtual lm math (design sizes etc) and a fix for 
undefined sizes


-- taco and i also tracked down some accuracy problems with cirtual 
glyphs in luatex itself; it's not that critical unless you have eyes 
that can zoom in to .05pt so ther eis no real need to upgrade luatex now


-- there are a few more optimizations but don't expect too much speed 
improvements in the future


next comes integration of the new structure stuff (quite some impact) 
and further split of mkii/mkiv code


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] new beta

2009-03-06 Thread Xan

En/na Hans Hagen ha escrit:

Hi,

I uploaded a new beta (mkiv):

-- some optimizations to color literals; i might have introduced 
problems there so keep an eye on color


-- beter definition for virtual lm math (design sizes etc) and a fix 
for undefined sizes


-- taco and i also tracked down some accuracy problems with cirtual 
glyphs in luatex itself; it's not that critical unless you have eyes 
that can zoom in to .05pt so ther eis no real need to upgrade luatex now


-- there are a few more optimizations but don't expect too much speed 
improvements in the future


next comes integration of the new structure stuff (quite some impact) 
and further split of mkii/mkiv code


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___ 


hi,

Sorry for the unknowledge but is there any git/cvs/... repository with 
the code?
For the other hand, do you update the translations I pass you 
[http://www.ntg.nl/pipermail/ntg-context/2009/038413.html]


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


Re: [NTG-context] new beta

2009-03-06 Thread Hans Hagen

Xan wrote:

Sorry for the unknowledge but is there any git/cvs/... repository with 
the code?


no, only 'currents' are checked in by taco into the svn repos; the zips 
are organized in the official tds structure


we might start using git once there are stable interfaces on all 
platforms and once the mkii and mkiv code bases are split


For the other hand, do you update the translations I pass you 
[http://www.ntg.nl/pipermail/ntg-context/2009/038413.html]


i did update some lang files, if not, just send the patch to my private 
mail address


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] new beta

2009-03-06 Thread Xan

En/na Hans Hagen ha escrit:

Xan wrote:

Sorry for the unknowledge but is there any git/cvs/... repository 
with the code?


no, only 'currents' are checked in by taco into the svn repos; the 
zips are organized in the official tds structure


we might start using git once there are stable interfaces on all 
platforms and once the mkii and mkiv code bases are split



Mmm... Okay. When do you think it will be?
For the other hand, do you update the translations I pass you 
[http://www.ntg.nl/pipermail/ntg-context/2009/038413.html]


i did update some lang files, if not, just send the patch to my 
private mail address



Okay.

Thanks a lot,
Xan.
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___