Re: [NTG-context] solutions and problems

2014-02-22 Thread Xan
No, it does not work.

I have this:

% Questions
\defineenumeration
  [exercici]
  
[alternative=serried,text={\startcolor[darkblue]Exercici\stopcolor},stopper={.\space},left={\bgroup},right={\egroup},width=fit,headstyle=\ss,distance=0.25em,width=fit,before={\incrementcounter[resposta]}]

% Answers
\defineenumeration[resposta][headstyle=\ss,text={Solucions de l'exercici 
\getnumber[exercici]},width=fit,alternative=serried,before={\decrementcounter[resposta]},number=no]

\defineblock[resposta]
\hideblocks[resposta]


% Exercises

\startexercici Bla...
\beginresposta
\resposta (Solucions: \startitemize[a,text] \item D, \item I, \item D, \item No 
té relació, \item D, \item D, \item No té relació, \item No té relació, \item 
D.\stopitemize) \par
\endresposta
\stopexercici

\startexercici Bla 2
\stopexercici

\startexercici Bla 3
\beginresposta
\resposta (Solucions: \startitemize[a,text] \item D, \item I, \item D, \item No 
té relació, \item D, \item D, \item No té relació, \item No té relació, \item 
D.\stopitemize) \par
\endresposta
\stopexercici

\subject{Answers}

\selectblocks[resposta][criterium=section]


I get \getnumber[exercici] as the last, not the counter of 'exercici' in which 
I have the answer. How can I do thaT?

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


Re: [NTG-context] solutions and problems

2014-02-23 Thread Xan
 Am 22.02.2014 um 18:45 schrieb Xan dxpublica at telefonica.net:
 
  No, it does not work.
  
  I have this:
  
  % Questions
  \defineenumeration
   [exercici]
   
  [alternative=serried,text={\startcolor[darkblue]Exercici\stopcolor},stopper={.\space},left={\bgroup},right={\egroup},width=fit,headstyle=\ss,distance=0.25em,width=fit,before={\incrementcounter[resposta]}]
  
  % Answers
  \defineenumeration[resposta][headstyle=\ss,text={Solucions de l'exercici 
  \getnumber[exercici]},width=fit,alternative=serried,before={\decrementcounter[resposta]},number=no]
  
  \defineblock[resposta]
  \hideblocks[resposta]
  
  
  % Exercises
  
  \startexercici Bla...
  \beginresposta
  \resposta (Solucions: \startitemize[a,text] \item D, \item I, \item D, 
  \item No té relació, \item D, \item D, \item No té relació, \item No té 
  relació, \item D.\stopitemize) \par
  \endresposta
  \stopexercici
  
  \startexercici Bla 2
  \stopexercici
  
  \startexercici Bla 3
  \beginresposta
  \resposta (Solucions: \startitemize[a,text] \item D, \item I, \item D, 
  \item No té relació, \item D, \item D, \item No té relació, \item No té 
  relació, \item D.\stopitemize) \par
  \endresposta
  \stopexercici
  
  \subject{Answers}
  
  \selectblocks[resposta][criterium=section]
  
  
  I get \getnumber[exercici] as the last, not the counter of 'exercici' in 
  which I have the answer. How can I do thaT?
 
 Make a complete minimal example.
 
 Wolfgang


Simply put starttext and stoptext. Here it's:

% Questions
\defineenumeration
  [exercici]
  
[alternative=serried,text={\startcolor[darkblue]Exercici\stopcolor},stopper={.\space},left={\bgroup},right={\egroup},width=fit,headstyle=\ss,distance=0.25em,width=fit,before={\incrementcounter[resposta]}]

% Answers
\defineenumeration[resposta][headstyle=\ss,text={Solucions de l'exercici 
\getnumber[exercici]},width=fit,alternative=serried,before={\decrementcounter[resposta]},number=no]

\defineblock[resposta]
\hideblocks[resposta]


% Exercises

\starttext
\startexercici Bla...
\beginresposta
\resposta (Solucions: \startitemize[a,text] \item D, \item I, \item D, \item No 
té relació, \item D, \item D, \item No té relació, \item No té relació, \item 
D.\stopitemize) \par
\endresposta
\stopexercici

\startexercici Bla 2
\stopexercici

\startexercici Bla 3
\beginresposta
\resposta (Solucions: \startitemize[a,text] \item D, \item I, \item D, \item No 
té relació, \item D, \item D, \item No té relació, \item No té relació, \item 
D.\stopitemize) \par
\endresposta
\stopexercici

\subject{Answers}

\selectblocks[resposta][criterium=section]
\stoptext


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


Re: [NTG-context] solutions and problems

2014-02-23 Thread Xan
  Can you help me?
 
 Your counter settings are useless because context stores only the environment 
 plus content for the answers, nothing is done with them at this point. When 
 you flush the answer blocks context sees them for the first time and the 
 counter for the questions is 3 at this point and this is why you get always 
 the same value.

Is there any way of first evaluate \getnumber[exercici] and then store the 
content, and not inversely (as context does now)?

 
 \defineenumeration[exercici][text=Exercici]
 \defineenumeration[resposta][text=Solucions]
 
 \defineblock[resposta]
 \hideblocks[resposta]
 
 \starttext
 
 \startexercici Question 1
 \beginresposta
 \resposta Answer 1 \par
 \endresposta
 \stopexercici
 
 \startexercici Question 2
 \beginresposta
 \incrementcounter[resposta]
 \endresposta
 \stopexercici
 
 \startexercici Question 3
 \beginresposta
 \resposta Answer 3 \par
 \endresposta
 \stopexercici
 
 \subject{Answers}
 
 \selectblocks[resposta]
 
 \stoptext
 
 Wolfgang

Increment counter *every* time is possible option, but in fact very annoying: 
if I have 100 exercises (now I have more than this) and I have only 20 
exercises, then I have to put \incrementcounter in 80 exercises. It's a 
tedious thing.

Is there any more relaxing thing: assuming that I have 'resposta' nested in 
'exercici' like

\startexercici
\beginresposta
\resposta Answer X
\endresposta
\stopexercici

?


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


Re: [NTG-context] OT: Reflections on usability ConTeXt for typesetting of mathematics

2014-02-26 Thread Xan
 Hello ConTeXist.
 
 0. Do you think that this is only a problem for beginners of ConText or 
 it is a general problem of ConTeXt?
 1. How many of ConTeXt users use this tool for typesetting of 
 non-elementary mathematics?
 2. Are you satisfied with the results, which produces ConTeXt (thinking 
 in the field of mathematics rate)?

In general, yes. But there are some issues with TiKZ 
[http://www.ntg.nl/pipermail/ntg-context/2013/076384.html] and in some ocasions 
with columns (not balanced).

Perhaps we could have a bug triage system for that?

 3. What things do you need to have in ConTeXt study that one could bet 
 mathematics at a reasonable level?
One reason for ConTeXt is the ability of deal with XML and produce several 
outputs.
Separation of content and presentation is also good.

 4. Is ConTeXt able to substitute LaTeX to typesetting of math (e.g. in 
 the future)?

I join one person (I don't remember who) who says there could be more examples 
for learning people. I think an ideal think could be to have an equivalent The 
not so short introduction to LaTeX.

 5. Can you think of any more questions that should be here?
 
The community is good. All posted questions have posted answers. And Hans is 
the boss ;-)
___
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 with TikZ

2014-03-14 Thread Xan
Hi,

I don't know why and how when the page begins with a tikz picture, a piece of 
text is blue?

See that:

%% ConTeXt template for exercises
%% ConTeXt MIV

%% Carregam símbols
\usesymbols[eur]

%% Capçaleres i peus
\setupheadertexts[{\sc\rm Funcions (T2)}]
\setupheadertexts[{\rm \sc CEPA Sud}][{\rm \sc ESPA 4. Quad. 1}]
\setupfootertexts[{\rm \sc Pàgina \pagenumber\space de \lastpage\space - 13 de 
desembre de 2013}]

\usemodule[tikz]

% BUGGY things
\definecolor[headingcolor][c=1,m=0.5431,y=0,k=0.5451]
\setupfooter[text][style={\ss\tfx},color={headingcolor},before={\hrule}]
\setupheader[text][style={\ss},color={headingcolor},after={\hrule}]
% end of buggy things

\starttext

\startitemize[n]

\item \input tufte.tex

\input tufte.tex

\input tufte.tex
\input tufte.tex

\item Cada matí, en Tomeu camina des de ca seva fins a la parada de l'autobús 
més pròxima (vegeu la figura~\in[fig:Tomeu-modificat]).
El gràfic següent mostra aquest recorregut en un dia concret:


\placefigure[here]
[fig:Tomeu-modificat]
{Recorregut del dia 13 de desembre de 2013}
{
\bTABLE[frame=off,align=middle,width=fit]
   \bTR[frame=off]
 \bTD \bgroup \framed[frame=off]{\starttikzpicture[scale=0.6]
\draw[very thin,help lines, color=gray] (-0.1,-0.1) grid (12.2,10);
\draw[-] (-0.2,0) -- (12.2,0);
\draw (6, -1) node[anchor=north] {$\text{Temps transcorregut (segons)}$};
\draw[-] (0,-0.2) -- (0,10.2) node[above] {$\text{Distància a casa 
(metres)}$};

\foreach \x/\xtext in {1/10, 2/20, 3/30, 4/40, 5/50, 6/60, 7/70, 8/80, 9/90, 
10/100, 11/110, 12/120}
{
\draw (\x, -0.1 cm) -- (\x, 0.1 cm);
\draw (\x, 0 cm) node[anchor=north] {\small  $\xtext$};
}

\foreach \x/\xtext in {1/20, 2/40, 3/60, 4/80, 5/100, 6/120, 7/140, 8/160, 
9/180, 10/200}
{
\draw (-0.1 cm, \x) -- (0.1 cm, \x);
\draw (0, \x) node[anchor=east] {\small $\xtext$};
}


\draw[color=blue, ultra thick] (0,0) -- (5,3) -- (7,1) -- (10,9) -- (12.2,9);

\stoptikzpicture} \egroup \eTD
   \eTR
\eTABLE}



\startitemize[a,packed]
\item Quines variables es representen en el gràfic?
\item A quina distància (de ca seva) està la parada del bus?
\item Quina escala s'utilitza per a cada variable?
\item A quin tram del gràfic va més ràpid? A quin tram va més lent?
\item Quina velocitat duu a cada tram?
\item Emparella aquest gràfic amb la història que correspongui:

\startitemize[A]
\item \startframedtext En Tomeu camina lentament. Després d'una estona, se 
n'adona que li han caigut els guants i torna enrera per a agafar-los. En aquest 
punt, veu arribar l'autobús i corre ràpidament fins a la parada. \stopframedtext
\stopitemize

\stopitemize


\item Elegiu una de les opcions següents:

Ramírez

Botella





\stopitemize
\stoptext


Is it a formal bug?

My version is the latest stable: ConTeXt  ver: 2014.01.03 00:40 MKIV current  
fmt: 2014.3.14  int: english/english

I attached the file (pdf)

Thanks,
Xan.


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

[NTG-context] Color of the headers of one enumeration

2014-03-24 Thread Xan
Hi,

I have this
\defineenumeration
  [punt]
  
[alternative=serried,text={\startcolor[darkblue]Punt\stopcolor},stopper={.\space},left={\bgroup},right={\egroup},width=fit,headstyle=\ss,distance=0.25em,width=fit]

So I get Punt 1. bla,... How can I achieve that Punt 1. were in darkblue? 
Now I just have Punt.

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


Re: [NTG-context] Color of the headers of one enumeration

2014-03-25 Thread Xan
 Am 24.03.2014 um 14:39 schrieb Xan dxpublica at telefonica.net:
 
  Hi,
  
  I have this
  \defineenumeration
   [punt]
   
  [alternative=serried,text={\startcolor[darkblue]Punt\stopcolor},stopper={.\space},left={\bgroup},right={\egroup},width=fit,headstyle=\ss,distance=0.25em,width=fit]
  
  So I get Punt 1. bla,... How can I achieve that Punt 1. were in 
  darkblue? Now I just have Punt“.
 
 
 Use the headcolor key:
 
 \defineenumeration
   [punt]
   [alternative=serried,
text={Punt},
stopper={.},
width=fit,
distance=0.25em,
headstyle=\ss,
headcolor=darkblue]
 
 Wolfgang


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

[NTG-context] \starttyping while processing XML causing error

2014-03-27 Thread Xan
Hi,

I have this minimal example:

1) Tasques.context:

\environment ./entorn-xml

\starttext

A
\xmlprocessfile{demo}{./dades.xml}{}
B
\stoptext


2) entorn-xml.tex:

\startxmlsetups xml:demo:base
  \xmlsetsetup{demo}{*}{-}
  \xmlsetsetup{demo}{things|code|}{xml:demo:*}
\stopxmlsetups

\xmlregisterdocumentsetup{demo}{xml:demo:base}

\startxmlsetups xml:demo:things
  \xmlflush{#1}
\stopxmlsetups


%TODO: startcode: http://www.ntg.nl/pipermail/ntg-context/2012/064750.html
\startxmlsetups xml:demo:code
  \bigskip
  \startlines\xmlflush{#1}\stoplines
\stopxmlsetups


3) dades.xml:

?xml version='1.0' standalone='yes' encoding=UTF-8?
things
  code
  [root@serviedre ~]# pacman -Syu
:: Synchronizing package databases...
 core 193.0 KiB  50.0K/s 00:04 [##] 100%
 extra2037.1 KiB   166K/s 00:12 
[##] 100%
 community   2.2 MiB   374K/s 00:06 
[##] 100%
 alarm  55.6 KiB   242K/s 00:00 
[##] 100%
 aur64.0 KiB   288K/s 00:00 
[##] 100%
:: Starting full system upgrade...
warning: linux-sun4i: ignoring package upgrade (3.4.79-1 = 3.4.79-2)
warning: linux-sun4i-headers: ignoring package upgrade (3.4.79-1 = 3.4.79-2)
 there is nothing to do
  /code
/things



When I compile tasques.context, all is ok, but when I substitute the 
\startlines \stoplines with \starttyping \stoptyping context never ends.

Is that a bug? 
I just found [this](http://www.ntg.nl/pipermail/ntg-context/2012/064750.html), 
but really no solution. Since 2012 I suppose many things are changed so I ask.

Why doesn't it work?

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


[NTG-context] Problems with XML and table of contents

2014-03-27 Thread Xan
Hi,

I have this:

\definehead [Fitxa] [subsubject]
\setuphead 
[Fitxa][textstyle=sca,align=normal,color=headingcolor,before={},ownnumber=yes,incrementnumber=yes,number=no,strut=no]
\setuplabeltext [Fitxa=Fitxa]
\setuplist[Fitxa] [margin=4em,interaction=text,color=green,textcommand=\WORD]
%\setuplist [Fitxa] [width=2em,criterium=all,interaction=all]

\newcounter\FitxaNumber

\def\fitxa#1%
{\doglobal\increment\FitxaNumber
\Fitxa{\FitxaNumber}{#1}}


\setupcombinedlist[content][list={chapter,section,subsection,Fitxa,tasca},interaction=all,textcolor=black]


and

\startxmlsetups xml:demo:titol
  \fitxa{\xmltext{#1}{/}}
\stopxmlsetups


In the document all is ok, but in the table of contents, I get phantom 
content.

Any clue?

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


[NTG-context] How can I use Aditya filter module within XML?

2014-03-27 Thread Xan
Hi,

Is it possible to use 

paragraph \startmarkdown bla... \stopmarkdown /paragraph

With my code (xmlflush) the start/stopmarkdown is printed without 
interpretation.

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


Re: [NTG-context] \starttyping while processing XML causing error

2014-03-28 Thread Xan
 On 3/27/2014 9:46 AM, Xan wrote:
  \starttext
 
  A
  \xmlprocessfile{demo}{./dades.xml}{}
  B
  \stoptext
 
 \startxmlsetups xml:demo:code
\blank
\start \ttx
  \xmlverbatim{#1}
\stop
\blank
 \stopxmlsetups

First of all, thank you very much, Hans.

But why can't I use

\defineframedtext[framedcode][strut=yes,offset=2mm,width=7cm,align=right]

\definetyping[code][numbering=line,bodyfont=small,before={\startframedcode},after={\stopframedcode}]

\setuplinenumbering[location=intext]
\setuptyping[option=color]


startxmlsetups xml:demo:codi
  \blank
  \startcode\xmlverbatim{#1}\stopcode
  \blank
\stopxmlsetups


How can I achieve this results? (numbering line and color basically)

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


Re: [NTG-context] Problems with XML and table of contents

2014-03-28 Thread Xan
Thanks, many thanks Hans.
The key is expansion=yes. Without, phantom contents in table of contents. 
With, all is ok:

 \definehead [Fitxa] [subsection][ownnumber=yes,expansion=yes]

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


Re: [NTG-context] \starttyping while processing XML causing error

2014-03-28 Thread Xan
I can circumvent it with

\defineframedtext[framedcode][strut=yes,width=local,align=flushleft,frame=off]


\startxmlsetups xml:demo:codi
  \blank
  \startframedcode
  \startlinenumbering\xmlverbatim{#1}\stoplinenumbering
  \stopframedcode
  \blank
\stopxmlsetups

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


Re: [NTG-context] \starttyping while processing XML causing error

2014-03-28 Thread Xan

 
  How can I achieve this results? (numbering line and color basically)
 
 \startlinenumbering
 
 etc
 
How can I disable hyphenize and wrap large lines?

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


Re: [NTG-context] \starttyping while processing XML causing error

2014-03-28 Thread Xan
On Fri, 28 Mar 2014 09:56:12 +0100
Hans Hagen pra...@wxs.nl ha escrit:

 On 3/28/2014 9:13 AM, Xan wrote:
  On 3/27/2014 9:46 AM, Xan wrote:
  \starttext
 
  A
  \xmlprocessfile{demo}{./dades.xml}{}
  B
  \stoptext
 
  \startxmlsetups xml:demo:code
  \blank
  \start \ttx
\xmlverbatim{#1}
  \stop
  \blank
  \stopxmlsetups
 
  First of all, thank you very much, Hans.
 
  But why can't I use
 
  \defineframedtext[framedcode][strut=yes,offset=2mm,width=7cm,align=right]
 
  \definetyping[code][numbering=line,bodyfont=small,before={\startframedcode},after={\stopframedcode}]
 
  \setuplinenumbering[location=intext]
  \setuptyping[option=color]
 
 
  startxmlsetups xml:demo:codi
 \blank
 \startcode\xmlverbatim{#1}\stopcode
 \blank
  \stopxmlsetups
 
 
 different catcode regimes
 
  How can I achieve this results? (numbering line and color basically)
 
 \startlinenumbering
 
 etc

Many thanks.

But  \setuplinenumbering[location=intext,prefix=codi] seems to have no effect in

\startxmlsetups xml:demo:codi
\blank
\startlinenumbering\xmlverbatim{#1}\stoplinenumbering
   \blank
\stopxmlsetups

the numbers seems that always are inmargin.

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


[NTG-context] Defining commands in \start ... \stop

2014-03-30 Thread Xan
Hi,

Concerned with the answers to the [that 
topic](http://www.ntg.nl/pipermail/ntg-context/2014/077099.html), I was 
thinking if I could define a command Exercise with a optional argument (the 
Answer).

\defineblock[question]
\defineblock[answer]

\defineenumeration[question][text={Question}]
\defineenumeration[answer]  [text={Answer}]

\keepblocks[question]
\hideblocks[answer]

Something like
\startexercise My execise ...
\stopexercise

If no more is provide, at the question does \incrementcounter[answer]
If

\startexercise{\startsolution The solution is \stopsolution} My exercise
\stopexercise

then \beginanswer and \startanswer is called.

Is it possible?

I just want to know if it's better to have \startBla...\stopBla command or 
\Bla{} command type?
In the case of the first, how do you define that? I did not find it here 
(http://wiki.contextgarden.net/Commands_with_optional_arguments)

Thanks,
Xan

PS: Please CCme
___
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] Defining commands in \start ... \stop

2014-03-30 Thread Xan
This:

\defineblock[question]
\defineblock[answer]

\defineenumeration[question][text={Question}]
\defineenumeration[answer]  [text={Answer}]

\keepblocks[question]
\hideblocks[answer]


\def\mynewcommand{\dosingleempty\doMyNewCommand}
\def\doMyNewCommand[#1]#2{%
 \iffirstargument
 \beginquestion
   \startquestion #2%
   \stopquestion
 \endquestion
   \beginanswer \startanswer #1%
   \stopanswer \endanswer
 \else
 \beginquestion
   \startquestion #2%
   \stopquestion
 \endquestion
   \incrementcounter[answer]
 \fi
}


\starttext

\chapter{Question}

\beginquestion
\startquestion
Question 1.
\stopquestion
\endquestion

\beginanswer
\startanswer
Answer 1.
\stopanswer
\endanswer

\beginquestion
\startquestion
Question 2.
\stopquestion
\endquestion

\beginanswer
\incrementcounter[answer]
\endanswer

\beginquestion
\startquestion
Question 3.
\stopquestion
\endquestion

\beginanswer
\startanswer
Answer 3.
\stopanswer
\endanswer

\mynewcommand{Question 5}

\mynewcommand[Resposta 6]{Question 6}

\chapter{Answers}

\useblocks[answer]

\stoptext

does not work
___
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] Defining commands in \start ... \stop

2014-03-30 Thread Xan
And so? This has not [mathematical] solution ;-)

Xan.

 The block commands use a buffer to store the content and buffers can’t be 
 used in commands.

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] Aditya filter module: ignore ``` in my case

2014-03-31 Thread Xan
Hi,

I have a problem: why this

\usemodule[filter]
\defineexternalfilter
[markdown]
[filtercommand={pandoc -f markdown+multiline_tables+table_captions -t 
context -o \externalfilteroutputfile\space \externalfilterinputfile}]


\starttext
 \startmarkdown
   Decideix l'esquema de particions que *tendré*
```
| Partició | Espai | Muntatge |
| sda1 | | /var/log % |
PROVA
%=Regime
\enableregime[utf]

%=Choose a language, and associated hyphenation rules.
\mainlanguage[ca]

%= Colors
\setupcolors[state=start]
\definecolor[headingcolor][c=1,m=0.5431,y=0,k=0.5451]
\definecolor[steelblue][h=4682B4]
\definecolor[griscodi][h=F5F5F5]
```


 \stopmarkdown
 \stoptext

does not process the code block (inside ```)?

I just wonder why?

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


Re: [NTG-context] Aditya filter module: ignore ``` in my case

2014-03-31 Thread Xan
Mmm... identation seems the guilty thing ;-)
Decideix  is good (without spaces at beginning)

Xan.

On Mon, 31 Mar 2014 14:17:47 +0200
Xan dxpubl...@telefonica.net ha escrit:

 Hi,
 
 I have a problem: why this
 
 \usemodule[filter]
 \defineexternalfilter
 [markdown]
 [filtercommand={pandoc -f markdown+multiline_tables+table_captions -t 
 context -o \externalfilteroutputfile\space \externalfilterinputfile}]
 
 
 \starttext
  \startmarkdown
Decideix l'esquema de particions que *tendré*
 ```
 | Partició | Espai | Muntatge |
 | sda1 | | /var/log % |
 PROVA
 %=Regime
 \enableregime[utf]
 
 %=Choose a language, and associated hyphenation rules.
 \mainlanguage[ca]
 
 %= Colors
 \setupcolors[state=start]
 \definecolor[headingcolor][c=1,m=0.5431,y=0,k=0.5451]
 \definecolor[steelblue][h=4682B4]
 \definecolor[griscodi][h=F5F5F5]
 ```
 
   
  \stopmarkdown
  \stoptext
 
 does not process the code block (inside ```)?
 
 I just wonder why?
 
 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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Problems with XML and table of contents

2014-04-01 Thread Xan
Finally, I use xsltproc and xml from scratch for this conversion, because 
Aditya module seems to does not work with XML.

The process is XML, XSLT -- ConTeXT file - PDF file

Just for interest of someone...

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


[NTG-context] \installprettytype gets me undefined control sequence

2014-05-09 Thread Xan
Hi,

With the code in http://wiki.contextgarden.net/Verbatim_with_line_breaks, I get

open source  2  3  
/home/xan/NO-SERVIDOR/Serviedre/context3/tasques.context
open source  3  4  
/home/xan/NO-SERVIDOR/Serviedre/context3/plantilles/entorn-minimal.tex
fontstypescripts  unknown library 'cmr'
fontspreloading latin modern fonts (third stage)
fonts'fallback modern-designsize rm 11pt' is loaded
colors   'rgb' color space is supported
colors   'cmyk' color space is supported

tex errorerror on line 76 in file 
/home/xan/NO-SERVIDOR/Serviedre/context3/plantilles/entorn-minimal.tex: ! 
Undefined control sequence

l.76 \installprettytype
 [BREAK][BREAK]

66\divide\BREAKmaxcharcount \wd\scratchbox
67\def\flushrestofverbatimline{\BREAKcharcounter=0 }%
68\BREAKcharcounter=0 }
69 
70 \gdef\setupprettyBREAKtype%
71   {\def\prettyidentifier{BREAK}%
72\BREAKsetcounters
73\BREAKsethandlers
74\BREAKsetspecials}
75 
76   \installprettytype[BREAK][BREAK]
77 
78 
\setuptyping[location=inmargin,option=color,numbering=line,bodyfont=small,option=BREAK,lines=hyphenated]
79 % lines=hyphenated?
80 
81 
%\defineframedtext[framedcode][strut=yes,offset=2mm,width=fit,align=right,framecorner=round]
82 %\definetyping[code][numbering=line,bodyfont=small]
83 %before={\startframedcode},after={\stopframedcode}]
84 %\setuptyping[TEX][escape=yes,numbering=line,method=type]
85 
86 %= Mòduls


? 


I have version 2014.05.08 11:18

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


[NTG-context] \startbackground with footnote

2014-05-22 Thread Xan
Hi,

I have a footnote in \startbackground \stopbackground environment and the 
footnote is not displayed. Can anyone give me any hint?

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


Re: [NTG-context] \startbackground with footnote

2014-05-23 Thread Xan
Thanks Aditya.

What's the difference between startbackground and starttextbackground? I can't 
see the options of textbackground.

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


Re: [NTG-context] \startbackground with footnote

2014-05-23 Thread Xan
Sorry, I mean Wolfgang not 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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] \starttextbackground and \startbackground equivalent options

2014-05-25 Thread Xan
Hi folks,

Just a question:

I have this textbackground environment:

\definestartstop
  [teoria]
  [  before={\startbackground[background=color, backgroundcolor=mteoria, 
frame=on, width=broad, after={\bigskip}, before={\blank[big]\testpage[2]}, 
backgroundcorner=round, backgroundradius=5ex, backgroundoffset=5pt, 
framecorner=round, radius=5ex, frameoffset=5pt]},
  after=\stopbackground
   ]

and I want an equivalent one with starttextbackground.

I try this:

\definetextbackground[provateoria]
[background=color, backgroundcolor=mteoria, location=paragraph, 
frame=on, width=broad, after={\bigskip}, before={\blank[big]\testpage[2]}, 
backgroundcorner=round, backgroundradius=5ex, backgroundoffset=5pt, 
framecorner=round, radius=5ex, frameoffset=5pt
 ]

\definestartstop
  [teoria]
  [  before={\starttextbackground[provateoria]},
  after=\stoptextbackground
   ]


But I get:
  * The corners are not rounded
  * Can I achieve to unbackground footnotes inside \startteoria \stopteoria?


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


[NTG-context] startbackground with footnotes cause problems

2014-05-25 Thread Xan
Hi,

I observe that if startbackground stopbackground has footnotes inside, then 
page breaks are placed before and after footnotes with blank pages...

Anyone does know anything about that?

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


[NTG-context] Split in specific row in natural tables?

2014-05-26 Thread Xan
Hi,

Is there a possibility of split a natural table in specific row? I want to 
split in row third or something like that.

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


[NTG-context] dx=1cm with imposition: how to disable right most dx?

2014-06-01 Thread Xan
Hi,

I have this code:

\definepapersize[carnet][width=8.50cm,height=5.40cm]

\setuppapersize [carnet][A4]

\setuppaper []
\setuplayout[page] [topspace=0.02cm, backspace=0.02cm, 
header=0.02cm,margin=0.02cm,width=middle,footer=0.02cm,height=fit]
\setuplayout[page]
\setuplayout[location=middle,marking=on,nx=2,ny=4,dy=1cm,dx=1cm]


When I run context, the dx distance is added to the right of the rightest 
page of type carnet. So I have an extra right dx distance that it annyoes me 
becase in double printing pages, the side above and the side below don't match.

How can I prevent that?

Thanks in advance,
Xan.

PS: Please CCme.
___
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] dx=1cm with imposition: how to disable right most dx?

2014-06-01 Thread Xan
Oh! thanks. Now I have to try for having the same space on left and on right.

Thanks


On Sun, 01 Jun 2014 13:16:06 +0200
Hans Hagen pra...@wxs.nl ha escrit:

 On 6/1/2014 12:00 PM, Xan wrote:
  Hi,
 
  I have this code:
 
  \definepapersize[carnet][width=8.50cm,height=5.40cm]
 
  \setuppapersize [carnet][A4]
 
  \setuppaper []
  \setuplayout[page] [topspace=0.02cm, backspace=0.02cm, 
  header=0.02cm,margin=0.02cm,width=middle,footer=0.02cm,height=fit]
  \setuplayout[page]
  \setuplayout[location=middle,marking=on,nx=2,ny=4,dy=1cm,dx=1cm]
 
 
  When I run context, the dx distance is added to the right of the 
  rightest page of type carnet. So I have an extra right dx distance that 
  it annyoes me becase in double printing pages, the side above and the side 
  below don't match.
 
  How can I prevent that?
 
 \definepageshift[test][horizontal][8mm]
 \setuppageshift[test]
 
 -
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] \headstylecolor in \setupcaptions ?

2014-07-12 Thread Xan
Hi,

how to set the color of head in setupcaptions? Something like:
\setupcaptions[headstyle={\ss},headstylecolor=red]

thanks
Xan

PS: Please CCme
___
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] \headstylecolor in \setupcaptions ?

2014-07-12 Thread Xan
I found myself: headcolor=red

On Sat, 12 Jul 2014 18:31:55 +0200
Xan dxpubl...@telefonica.net ha escrit:

 Hi,
 
 how to set the color of head in setupcaptions? Something like:
 \setupcaptions[headstyle={\ss},headstylecolor=red]
 
 thanks
 Xan
 
 PS: Please CCme
___
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 the verbosity of XML

2014-07-27 Thread Xan
hi,

I have this context file:

\environment ../../../../plantilles/entorn-simple-estructurals
\environment ../../../../plantilles/entorn-simple-visuals
\environment entorn-simple-xml
...
\xmlprocessfile{demo}{80-activitats.xml}{}

this XML file (80-activitats.xml):

?xml version=1.0 encoding=UTF-8 standalone='yes'?
activitats
  activitat id=1
tipusexercici/tipus
enunciat sintaxi=context![CDATA[
Resol:
\startitemize[a]
\item $6(x+2)-x + 2 - 8x = 7x -2 -(7-2x)+35$
\item $-(x+2)-2(-3-x) +5x -3 = 5(x +2) -6x -16$
\item $-3(x+2) -1 +5(-x -4) = -7(-5x -2) + x -(-x +2) + 51$
\item $5(5x -2) -30 - 20(-3x +2) = 5- (10x -2) + 5x+183$
\item $8(x-3) + 5 -40x = 5 - (8x -5) + 13$
\item $5-3(4x-1) + 6(x-10) +3 = 5 + 2(x+2) -(10x -5)-64$
\item $5(x-2) + 5x -(2-5x) +1 = 3(x-2) + 3$
\item $12-12(2 -3x) +120 = -48(x + 2)+239$
\item $1 - (x-4) -(5-2x) -(-3-4x) = 6(2x-3) -7(-2x+3)$
\stopitemize
]]
/enunciat
solucio
\startitemize[a,text] \item $x = -1$ \item $x = -1$ \item $x = -2$ \item $x = 
3$\stopitemize
/solucio
  /activitat
/activitats

and this environment:

\startxmlsetups xml:demo:base
 \xmlsetsetup{demo}{*}{-}
 \xmlsetsetup{demo}{activitats|tipus|activitat|enunciat|solucio}{xml:demo:*}
\stopxmlsetups

\xmlregisterdocumentsetup{demo}{xml:demo:base}

\startxmlsetups xml:demo:activitats
  \title{Activitats}
  \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:demo:activitat
  \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:demo:enunciat
  \startexercici\xmltext{#1}{/text()}\stopexercici
\stopxmlsetups


But I get the PDF with the verbose text, not processing (I attach them)

What fails?

Thanks in advance,
Xan


80-seleccio.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
___

[NTG-context] snappedmath is now dropped?

2014-07-28 Thread Xan
Hi,

Are you delete the command \snappedmath?

I get that:


! Undefined control sequence.

system   tex  error on line 834 in file 
/home/xan/SYNC/cepasud-raw/classe/ESPA3/planificació/Tema2-Àlgebra/80-juntat.conTeXt:
 Undefined control sequence ...

824 % TODO: acabar les solucions
825 TODO
826 (Solucions: \startitemize[a,text] \item $x = -1$ \item $x = -1$ \item 
$x = -2$ \item $x = 3$\stopitemize)
827 \stopmode
828 \stopexercici
829 
830 \startexercici Resol:
831 
832 \startitemize[a,columns]
833 
834   \item \snappedmath {\displaystyle 3x- (x-2) = 4x + 1}
835 
836 \item \snappedmath {\displaystyle 4\left(x+3\right)-\left(2x-7\right) = 
6x + 18}
837 
838 \item \snappedmath {\displaystyle 5-(3-x) = 2(x+2) -3}
839 
840 \item \snappedmath {\displaystyle 2x-\left(9x+2\right)+4x = 43-x+8-x-13}
841 
842 \item \snappedmath {\displaystyle 2(x-2) -(5-x)=3x+2-6(x+2)}
843 
844 \item \snappedmath {\displaystyle 2x-\left(x-3\right) 
-2\left(5-x\right) = 6-x +8x-1}

recently read \snappedmath 
 
l.834 \item \snappedmath
   {\displaystyle 3x- (x-2) = 4x + 1}
? 


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


[NTG-context] filter module: before print, it puts new line

2014-07-28 Thread Xan
Hi,

I run this code:

\usemodule[filter]

\defineexternalfilter
[python]
[filtercommand={python \externalfilterinputfile\space  
\externalfilteroutputfile},cache=force]


\starttext


Resol les equacions següents i comprova'n la solució
\startitemize[a,columns]
\item $3x + 2 = 35$
\item $11x – 18 = 4$
\item $56x + 33 = -23$
\item $5x + 25 = 125$
\stopitemize

\starttextrule{Solucions}

\startitemize[a,text]
\item \startpython
from sympy.solvers import solve
from sympy import Symbol
from sympy import Eq

x = Symbol('x')
for solucio in solve(Eq(3*x + 2, 35), x):
print(solucio)

\stoppython
\stopitemize
\stoptextrule


\stoptext


with the result of new line after (a). and 11 (the solution of the 
equation).

I attach the pdf.

How can avoid this behaviour?


Thanks,
Xan


j.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] filter module: before print, it puts new line

2014-07-28 Thread Xan
On Mon, 28 Jul 2014 13:29:58 +0200
Xan dxpubl...@telefonica.net ha escrit:

 Hi,
 
 I run this code:
 
 \usemodule[filter]
 
 \defineexternalfilter
 [python]
 [filtercommand={python \externalfilterinputfile\space  
 \externalfilteroutputfile},cache=force]
 
 
 \starttext
 
 
 Resol les equacions següents i comprova'n la solució
 \startitemize[a,columns]
 \item $3x + 2 = 35$
 \item $11x – 18 = 4$
 \item $56x + 33 = -23$
 \item $5x + 25 = 125$
 \stopitemize
 
 \starttextrule{Solucions}
 
 \startitemize[a,text]
 \item \startpython
 from sympy.solvers import solve
 from sympy import Symbol
 from sympy import Eq
 
 x = Symbol('x')
 for solucio in solve(Eq(3*x + 2, 35), x):
   print(solucio)
 
 \stoppython
 \stopitemize
 \stoptextrule
 
 
 \stoptext
 
 
 with the result of new line after (a). and 11 (the solution of the 
 equation).
 
 I attach the pdf.
 
 How can avoid this behaviour?
 
 
 Thanks,
 Xan
 Am 28.07.2014 um 13:29 schrieb Xan dxpublica at telefonica.net:
 
  Hi,
  
  I run this code:
  
  \usemodule[filter]
  
  \defineexternalfilter
 [python]
 [filtercommand={python \externalfilterinputfile\space  
  \externalfilteroutputfile},cache=force]
  
  […]
  
  with the result of new line after (a). and 11 (the solution of the 
  equation).
  
  I attach the pdf.
  
  How can avoid this behavior?
 
 Adding “location=text” to \defineexternalfilter should help (untested).
 
 Wolfgang

It works (tested! ;)

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

[NTG-context] Anyone could help me with this error in filter module?

2014-07-28 Thread Xan
Hi,

Any hint on that [https://github.com/adityam/filter/issues/17], please?

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


Re: [NTG-context] snappedmath is now dropped?

2014-07-30 Thread Xan
 Thanks,
 On 7/28/2014 11:01 AM, Xan wrote:
  Hi,
 
  Are you delete the command \snappedmath?
 
  I get that:
 
 
  ! Undefined control sequence.
 
  system   tex  error on line 834 in file 
  /home/xan/SYNC/cepasud-raw/classe/ESPA3/planificació/Tema2-Àlgebra/80-juntat.conTeXt:
   Undefined control sequence ...
 
 works here  command is available in mkiv ... but, when checking I 
 saw that there is an error:
 
 line 461 of math-ini.mkiv should be
 
 \dp\scratchbox\strutdp

Is the current version patched? I want to upgrade minimals distro, isn't?

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


Re: [NTG-context] Problem with the verbosity of XML

2014-07-30 Thread Xan
 On 7/28/2014 1:13 PM, Xan wrote:
  This is a minimal and isolate example
 
  You can see that {\bf Hola} is not processed.
 
 well, because you want to typeset it as is:
 
 pasHola {\bf a}/pas
 
 why should pas be treated as tex?
 
 \startxmlsetups xml:demo:pas
  \startitem
  \xmlflush{#1}
  \stopitem
 \stopxmlsetups
 
 versus:
 
 \startxmlsetups xml:demo:pas
  \startitem
  \xmlflushcontext{#1}
  \stopitem
 \stopxmlsetups

Mmm... thanks. Very much

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


Re: [NTG-context] Anyone could help me with this error in filter module?

2014-07-30 Thread Xan
 Am 28.07.2014 um 16:15 schrieb Xan dxpublica at telefonica.net:
 
  Hi,
  
  Any hint on that [https://github.com/adityam/filter/issues/17], please?
 
 Don’t use \doifmode{…}{…} etc. with buffers or environments which rely on a 
 buffer because you disable the function to keep end of lines in the input.
 
 What you have to do in this case is to use the \startmode or \startnotmode 
 commands.
 
 Wolfgang


Thanks Wolfgang and Aditya.
This behaviour of doifmode is not documented in the wiki. Can anyone could add 
it

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

[NTG-context] A bug color in tikz

2014-07-30 Thread Xan
Hi,

It's an annoying bug of TikZ with ConTexT: in some circumstances, the content 
after a tikzpicture is coloured. I refered it 
[here](http://www.ntg.nl/pipermail/ntg-context/2014/077374.html), and it's also 
present in the latest version of the minimals. Anyone could check it if he/she 
finds a bug.

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


[NTG-context] Prime and overbar

2014-08-20 Thread Xan
Hi,

$\overbar{OA'} = 3,4$, puts me overbar with two steps: one for $O$ and one for 
$A'$. Is there any way for putting overbar just on top of the expression?

Thanks,
Xan

PS: Please CCme
___
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] Prime and overbar

2014-08-20 Thread Xan
On Wed, 20 Aug 2014 09:38:49 +0200
Xan dxpubl...@telefonica.net ha escrit:

 Hi,
 
 $\overbar{OA'} = 3,4$, puts me overbar with two steps: one for $O$ and one 
 for $A'$. Is there any way for putting overbar just on top of the 
 expression?
 
 Thanks,
 Xan
 
 PS: Please CCme

Yes.




x.pdf
Description: Adobe PDF document
\starttext
\overbar{$A'B'$}
\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
___

[NTG-context] frown in context 2

2014-09-30 Thread Xan
 On Tue, 29 Oct 2013, Xan wrote:
 
  Hi,
 
  I just want to make an arc to a word. I found that 
  [http://tex.stackexchange.com/questions/15468/frown-and-mathop-stackrel-overset]
   but it's LaTeX or XeTeX centric.
 
  Is there any equivalent in ConTeXt?
 
 $\overparent{MMM}$
 
 Aditya

Can the symbol be more close to the MMM? There is so big space between the 
content and the frown symbol

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


[NTG-context] multi-line equations with \left( and \right.

2014-10-07 Thread Xan
Hi,

I try to do that

\startformula
\startalign[left={\left(\,},right={\,\right.}]
\NC x - 2y + 2z \NC = 1 \NR
\NC 2 x + y - z \NC = 2 \NR
\NC 4 x - 3y + 6z \NC = 7 \NR
\stopalign
\stopformula


but it does not work.
Can anyone help me?

Thanks,
Xan

PS: Please CCme
___
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] Possibly bug: misalignment with matrix

2014-10-07 Thread Xan
Hi,

Minimal example:


\definemathmatrix[pmatrix]
[left={\left(\,},right={\,\right)}]


\starttext
Digueu quines de les matrius següents són regulars. Quan ho siguin, trobeu la 
inversa

\startitemize[a,columns,four]
\item \startpmatrix[n=2]
\NC 2 \NC 3 \NR
\NC 6 \NC 7 \NR
\stoppmatrix

\item \startpmatrix[n=3]
\NC 3 \NC 2 \NC 1 \NR
\NC 4 \NC 5 \NC 3 \NR
\NC 5 \NC 0 \NC -2 \NR
\stoppmatrix

\item \startpmatrix[n=3]
\NC 5 \NC 4 \NC 2 \NR
\NC 2 \NC 2 \NC 3 \NR
\NC 7 \NC 6 \NC 5 \NR
\stoppmatrix

\item \startpmatrix[n=4]
\NC a \NC 0 \NC 0 \NC 0 \NR
\NC 0 \NC b \NC 0 \NC 0 \NR
\NC 0 \NC 0 \NC c \NC 0 \NR
\NC 0 \NC 0 \NC 0 \NC d \NR
\stoppmatrix

\stopitemize

\stoptext

produces misalignment in last item (I attach pdf)

Can anyone confirm that?

Thanks,
Xan


matrix.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] multi-line equations with \left( and \right.

2014-10-07 Thread Xan
Mm... I thought I could use mathalign instead.

Thanks,


On Tue, 7 Oct 2014 11:23:13 +0200
Wolfgang Schuster schuster.wolfg...@gmail.com ha escrit:

 
 Am 07.10.2014 um 10:59 schrieb Xan dxpubl...@telefonica.net:
 
  Hi,
  
  I try to do that
  
  \startformula
  \startalign[left={\left(\,},right={\,\right.}]
  \NC x - 2y + 2z \NC = 1 \NR
  \NC 2 x + y - z \NC = 2 \NR
  \NC 4 x - 3y + 6z \NC = 7 \NR
  \stopalign
  \stopformula
  
  but it does not work.
  Can anyone help me?
 
 You have to use the \startmatrix environment.
 
 - http://wiki.contextgarden.net/%5Cstartcases
 - http://dl.contextgarden.net/myway/mathalign.pdf
 
 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] Possibly bug: misalignment with matrix

2014-10-12 Thread Xan
Another bug.

@Hans: At least for user view point it's a bug. 
@Thangalin: thanks. A bigskip will solve me problems, but thanks.


\definemathmatrix[det]
[left={\left\lvert\,},right={\,\right\rvert}]


\starttext
Calculeu els determinants següents:

\startitemize[a,columns]

\item $\startdet[n=4]
\NC 1 \NC 1 \NC 1 \NC 1 \NR
\NC 1 \NC 2 \NC 3 \NC 4 \NR
\NC 1 \NC 3 \NC 6 \NC 10 \NR
\NC 1 \NC 4 \NC 10 \NC 20 \NR
\stopdet$

\item $\startdet[n=4]
\NC 1 \NC -2 \NC 0 \NC 1 \NR
\NC 1 \NC 1 \NC 0 \NC 2 \NR
\NC 0 \NC 3 \NC -2 \NC -1 \NR
\NC 1 \NC 1 \NC 1 \NC 3 \NR
\stopdet$

\item $\startdet[n=5]
\NC 1 \NC 2 \NC 3 \NC 4 \NC 5 \NR
\NC 2 \NC 3 \NC 4 \NC 5 \NC 1 \NR
\NC 3 \NC 4 \NC 5 \NC 1 \NC 2 \NR
\NC 4 \NC 5 \NC 1 \NC 2 \NC 3 \NR
\NC 5 \NC 1 \NC 2 \NC 3 \NC 4 \NR
\stopdet$

\item $\startdet[n=3]
\NC 1 \NC 2 \NC 3 \NR
\NC 1 \NC 4 \NC 9 \NR
\NC 1 \NC 8 \NC 27 \NR
\stopdet$

\stopitemize

Proveu, sense desenvolupar, que els determinants següents són nuls:

\startitemize[a]
\item $\startdet[n=3]
\NC -\sqrt{3} \NC 3 \NR
\NC 5 \NC -\sqrt{3}\cdot 5 \NR
\stopdet$

\item $\startdet[n=3]
\NC 2 \NC 1 \NC 3 \NR
\NC 1 \NC 0 \NC 1 \NR
\NC -3 \NC 2 \NC -1 \NR
\stopdet$

\stopitemize

\stoptext



matrix2.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] Possibly bug: misalignment with matrix

2014-10-12 Thread Xan
and 

\item $\startdet[n=3]
\NC yz \NC \frac{1}{x} \NC x \NR
\NC zx \NC \frac{1}{y} \NC y \NR
\NC xy \NC \frac{1}{z} \NC z \NR
\stopdet$


puts x over 1 in the second row
___
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] Equivalent of os.resultof(...) in LaTeX

2014-11-03 Thread Xan
Hi,

Just short question: what's the equivalent in latex of 
\ctxlua{context(os.resultof(sha256sum \jobname.conTeXt | cut -c  -5))}

?

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

Re: [NTG-context] Equivalent of os.resultof(...) in LaTeX

2014-11-03 Thread Xan
On Mon, 3 Nov 2014 14:31:17 +0100
Xan dxpubl...@telefonica.net ha escrit:

 It does not work: \documentclass{article}
  \begin{document}
  \directlua{
   local handle = io.popen(sha256sum \jobname.tex | cut -c -5,r)
   if handle then
 local result = handle:read(*all) or 
 handle:close()
 tex.print(result)
   end
  }
  \end{document}
 
 Neither this:
 
  \directlua{
   require lualibs-os
   tex.sprint(os.resultof(sha256sum \jobname.tex | cut -c  -5))
  }
 
 
 Blank. Nothing displayed.
___
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] Equivalent of os.resultof(...) in LaTeX

2014-11-06 Thread Xan
 That is not a useful error description ...
 
 Herbert

More clear than this?

 Neither this:
 
  \directlua{
   require lualibs-os
   tex.sprint(os.resultof(sha256sum \jobname.tex | cut -c  -5))
  }
 
 
 Blank. Nothing displayed.
___
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] Equivalent of os.resultof(...) in LaTeX

2014-11-07 Thread Xan
luatex --shell-escape file
will work.

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

[NTG-context] Split numbers in natural tables

2015-08-21 Thread Xan
Hi,

I have a simple script in mako templates which generate this table:


\starttext
\bTABLE[align={lohi,middle}]

 \bTR
   \bTD[width=2.8cm, height=2.8cm] 1 \eTD 
 \eTR

   \bTD[width=2.8cm, height=2.8cm] 2 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 4 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 8 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 16 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 32 \eTD 

 \bTR
   \bTD[width=2.8cm, height=2.8cm] 64 \eTD 
 \eTR

   \bTD[width=2.8cm, height=2.8cm] 128 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 256 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 512 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 1024 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 2048 \eTD 

 \bTR
   \bTD[width=2.8cm, height=2.8cm] 4096 \eTD 
 \eTR

   \bTD[width=2.8cm, height=2.8cm] 8192 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 16384 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 32768 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 65536 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 131072 \eTD 

 \bTR
   \bTD[width=2.8cm, height=2.8cm] 262144 \eTD 
 \eTR

   \bTD[width=2.8cm, height=2.8cm] 524288 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 1048576 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 2097152 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 4194304 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 8388608 \eTD 

 \bTR
   \bTD[width=2.8cm, height=2.8cm] 16777216 \eTD 
 \eTR

   \bTD[width=2.8cm, height=2.8cm] 33554432 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 67108864 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 134217728 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 268435456 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 536870912 \eTD 

 \bTR
   \bTD[width=2.8cm, height=2.8cm] 1073741824 \eTD 
 \eTR

   \bTD[width=2.8cm, height=2.8cm] 2147483648 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 4294967296 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 8589934592 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 17179869184 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 34359738368 \eTD 

 \bTR
   \bTD[width=2.8cm, height=2.8cm] 68719476736 \eTD 
 \eTR

   \bTD[width=2.8cm, height=2.8cm] 137438953472 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 274877906944 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 549755813888 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 1099511627776 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 219902322 \eTD 

 \bTR
   \bTD[width=2.8cm, height=2.8cm] 4398046511104 \eTD 
 \eTR

   \bTD[width=2.8cm, height=2.8cm] 8796093022208 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 17592186044416 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 35184372088832 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 70368744177664 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 140737488355328 \eTD 

 \bTR
   \bTD[width=2.8cm, height=2.8cm] 281474976710656 \eTD 
 \eTR

   \bTD[width=2.8cm, height=2.8cm] 562949953421312 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 1125899906842624 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 2251799813685248 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 4503599627370496 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 9007199254740992 \eTD 

 \bTR
   \bTD[width=2.8cm, height=2.8cm] 18014398509481984 \eTD 
 \eTR

   \bTD[width=2.8cm, height=2.8cm] 36028797018963968 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 72057594037927936 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 144115188075855872 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 288230376151711744 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 576460752303423488 \eTD 

 \bTR
   \bTD[width=2.8cm, height=2.8cm] 1152921504606846976 \eTD 
 \eTR

   \bTD[width=2.8cm, height=2.8cm] 2305843009213693952 \eTD 

   \bTD[width=2.8cm, height=2.8cm] 4611686018427387904 \eTD 


\eTABLE
\stoptext



How can I do for, automatically, split the number in the cells? That is, I want 
the numbers to fit all the cell size, not matter what return carriages it needs.

So some thing like   \bTD[width=2.8cm, height=2.8cm] 4611686018427387904 \eTD  
would be transformed into:

   \bTD[width=2.8cm, height=2.8cm] 4611

686018427

387904 \eTD 

or something similar.


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

Re: [NTG-context] Split numbers in natural tables

2015-08-23 Thread Xan
Thanks.

On Fri, 21 Aug 2015 16:52:11 +0200
Xan xancor...@gmail.com ha escrit:

 Hi,
 
 I have a simple script in mako templates which generate this table:
 
 
 \starttext
 \bTABLE[align={lohi,middle}]
 
  \bTR
\bTD[width=2.8cm, height=2.8cm] 1 \eTD 
  \eTR
 
\bTD[width=2.8cm, height=2.8cm] 2 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 4 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 8 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 16 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 32 \eTD 
 
  \bTR
\bTD[width=2.8cm, height=2.8cm] 64 \eTD 
  \eTR
 
\bTD[width=2.8cm, height=2.8cm] 128 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 256 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 512 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 1024 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 2048 \eTD 
 
  \bTR
\bTD[width=2.8cm, height=2.8cm] 4096 \eTD 
  \eTR
 
\bTD[width=2.8cm, height=2.8cm] 8192 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 16384 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 32768 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 65536 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 131072 \eTD 
 
  \bTR
\bTD[width=2.8cm, height=2.8cm] 262144 \eTD 
  \eTR
 
\bTD[width=2.8cm, height=2.8cm] 524288 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 1048576 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 2097152 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 4194304 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 8388608 \eTD 
 
  \bTR
\bTD[width=2.8cm, height=2.8cm] 16777216 \eTD 
  \eTR
 
\bTD[width=2.8cm, height=2.8cm] 33554432 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 67108864 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 134217728 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 268435456 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 536870912 \eTD 
 
  \bTR
\bTD[width=2.8cm, height=2.8cm] 1073741824 \eTD 
  \eTR
 
\bTD[width=2.8cm, height=2.8cm] 2147483648 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 4294967296 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 8589934592 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 17179869184 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 34359738368 \eTD 
 
  \bTR
\bTD[width=2.8cm, height=2.8cm] 68719476736 \eTD 
  \eTR
 
\bTD[width=2.8cm, height=2.8cm] 137438953472 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 274877906944 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 549755813888 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 1099511627776 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 219902322 \eTD 
 
  \bTR
\bTD[width=2.8cm, height=2.8cm] 4398046511104 \eTD 
  \eTR
 
\bTD[width=2.8cm, height=2.8cm] 8796093022208 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 17592186044416 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 35184372088832 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 70368744177664 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 140737488355328 \eTD 
 
  \bTR
\bTD[width=2.8cm, height=2.8cm] 281474976710656 \eTD 
  \eTR
 
\bTD[width=2.8cm, height=2.8cm] 562949953421312 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 1125899906842624 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 2251799813685248 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 4503599627370496 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 9007199254740992 \eTD 
 
  \bTR
\bTD[width=2.8cm, height=2.8cm] 18014398509481984 \eTD 
  \eTR
 
\bTD[width=2.8cm, height=2.8cm] 36028797018963968 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 72057594037927936 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 144115188075855872 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 288230376151711744 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 576460752303423488 \eTD 
 
  \bTR
\bTD[width=2.8cm, height=2.8cm] 1152921504606846976 \eTD 
  \eTR
 
\bTD[width=2.8cm, height=2.8cm] 2305843009213693952 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 4611686018427387904 \eTD 
 
 
 \eTABLE
 \stoptext
 
 
 
 How can I do for, automatically, split the number in the cells? That is, I 
 want the numbers to fit all the cell size, not matter what return carriages 
 it needs.
 
 So some thing like   \bTD[width=2.8cm, height=2.8cm] 4611686018427387904 \eTD 
  would be transformed into:
 
\bTD[width=2.8cm, height=2.8cm] 4611
 
 686018427
 
 387904 \eTD 
 
 or something similar.
 
 
 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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Process contents of xmlflush in context

2015-08-01 Thread Xan
Hi,

I use MKIV. I want to follow Schmitz tutorial 
[http://www.ntg.nl/maps/42/12.pdf]. My problem is that when my xml contents has 
ConTeXt commands, it are ignored (printing as verbose not interpreted). How can 
I achieve that:

?xml version=1.0 standalone='yes'?
?xml encoding='UTF-8'?
activitats
  activitat id=1 tema=funcions continguts=funció afí, dependència lineal, 
funcions a trossos
presentacio tipus=tradicional sintaxi=context verbs=modelitzacióLa 
fitxa blava i la fitxa vermella es mouen de la manera següent:
  \startitemize
\item la blava recorre
  \stopitemize
/presentacio
  /activitat
/activitats


is interpreted? I want that {\start,\stop}itemize is processed.

My setup is:

\startenvironment processadorxml

\xmlloadonly{rebost}{dades/activitats.xml}{}

\def\Activitat#1%
  {\xmlfilter{rebost}
{/activitats/activitat[@id=='#1']/presentacio/command(xml:choose)}
  }
  
  
\startxmlsetups xml:choose
  \startitem
{\dontleavehmode{\xmlflush{#1}}}
  \stopitem
\stopxmlsetups

\stopenvironment


Thanks a lot,
Xan

PS: Please, CCme.
___
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] Process contents of xmlflush in context

2015-08-02 Thread Xan
Thanks, a lot.

On Sun, 02 Aug 2015 11:56:31 +0200
Hans Hagen pra...@wxs.nl ha escrit:

 \xmlflushcontext
___
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] Refering to parent in XML

2015-08-25 Thread Xan
Hi,

I have this environment:

\startenvironment processadorxml

% Activitat: defineix \Activitat{activitat-id}
\def\Activitat#1%
  {\xmlfilter{rebost}
{/activitats/activitat[@id=='#1']/command(xml:list)}
  }

% Simplement llistam totes les presentacions.  
\startxmlsetups xml:list
 \startactivitat{\xmlatt{#1}{id}}
  \startitemize
\xmlfilter{#1}{/presentacio/command(xml:itemize)}
  \stopitemize
 \stopactivitat
\stopxmlsetups

\startxmlsetups xml:itemize
  \startitem[\xmlatt{#1}{tipus}]
{\ss [\xmlatt{#1}{tipus}]}\space 
{\xmlflushcontext{#1}}
  \stopitem
\stopxmlsetups





% Presentació: defineix \Presentacio{activitat-id}{presentacio-id}
\def\Presentacio#1#2%
  {\xmlfilter{rebost}

{/activitats/activitat[@id=='#1']/presentacio[@tipus=='#2']/command(xml:display)}
  }

% Si la presentació és de tipus tradicional, aleshores és un 'exercici'. 
Altrament és una activitat.
\startxmlsetups xml:display
  \doifelse{\xmlattribute{#1}{.}{tipus}} {tradicional}
  {\startexercici{\xmlatt{#1}{id}}\xmlname{#1}\xmlname{/}
\xmlflushcontext{#1}
  \stopexercici}
  {\startactivitat{\xmlatt{#1}{id}}
\xmlflushcontext{#1}
   \stopactivitat
  }
\stopxmlsetups

\stopenvironment



and this file:

\environment ../plantilles/entorn-simple-estructurals-xml
\environment ../plantilles/entorn-simple-estructurals
\environment ../plantilles/entorn-simple-visuals

\xmlloadonly{rebost}{dades/activitats.xml}{}

\starttext

Activitat: llista totes les presentacions
\Activitat{fitxes}

Presentació específica: només en fa una
\Presentacio{fitxes}{tradicional}
\Presentacio{fitxes}{3-act}

\startexercici B
\stopexercici

\stoptext



My XML file is:
?xml version=1.0 standalone='yes'?
activitats
  activitat id=fitxes
presentacio tipus=tradicionalLa fitxa blava i la fitxa vermella es 
mouen de la manera següent: la blava recorre les caselles d'una en una, mentre 
que la vermella les recorre de dues en dues però, després de cada moviment, 
s'espera un torn (figura~\in[]). Quina de les dues fitxes arribarà primer a la 
meta?
/presentacio
presentacio tipus=3-act Disponible aquí: URL/presentacio
  /activitat
/activitats


The problem is when I change #1 by '..' in:
% Si la presentació és de tipus tradicional, aleshores és un 'exercici'. 
Altrament és una activitat.
\startxmlsetups xml:display
  \doifelse{\xmlattribute{#1}{.}{tipus}} {tradicional}
  {\startexercici{\xmlatt{#1}{id}}\xmlname{#1}\xmlname{/}
\xmlflushcontext{#1}
  \stopexercici}
  {\startactivitat{\xmlatt{#1}{id}}
\xmlflushcontext{#1}
   \stopactivitat
  }
\stopxmlsetups

I get empty string. I supposed that \xmlatt{..}{id} gives me the id of the 
presentacio.

Any hints?

Sorry. I'm just starting experimenting with XML and ConTeXt... ;-)
___
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] Refering to parent in XML

2015-08-27 Thread Xan
 in a setup you can say: \xmlshow{#1} to see what is the (current) node

It does not help me.

I ask you in other way: if I have this

% Presentació: defineix \Presentacio{activitat-id}{presentacio-id}
\def\Presentacio#1#2%
  {\xmlfilter{rebost}

{/activitats/activitat[@id=='#1']/presentacio[@tipus=='#2']/command(xml:display)}
  }

% Si la presentació és de tipus tradicional, aleshores és un 'exercici'. 
Altrament és una activitat.
\startxmlsetups xml:display
  \startitem[\xmlatt{..}{id}]
\xmlflushcontext{#1}
  \stopexercici
\stopxmlsetups

gives me nothing in the label of startitem:
  \startitem[]
contents
  \stopexercici

 when I run \Presentacio{foo}{bar} and it *should* give me

  \startitem[foo]
\xmlflushcontext{#1}
  \stopexercici


It seems like when I descend to activitat/presentacio then I can't go up.
___
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] Migrations: exactly LaTeX margins -- ConTeXt margins

2010-08-30 Thread Xan xan
Hi,

I want to migrate one LaTeX document to ConTeXt document. I only want to
put the _exact_ margins LaTeX use for \documentclass[12pt,a4paper]{article}.


Anyone could say me the exact values I have to put in **layout**?

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


[NTG-context] startenumerate in romans a la LaTeX

2010-08-30 Thread Xan xan
Hi,

I just want to simulate the behaviour of

\usepackage{enumerate}
...

\begin{enumerate}[(i)]
\item
\end{enumerate}

in ConTeXt. That is:
- items in (i), (ii), 
- right indentation of items: in context items start at the same point. In
LaTeX is the item text itself who starts at the same point, not the romans.


I try:
\defineenumeration
  [mylema]
  [text={Lemma}, % Què es mostra
   before={\blank[big]}, % abans de lema, un bigskip
   after={\blank[big]}, % després de lema, un bigskip
   headstyle=bold, % Negreta per la capçaleras
   %between=\blank, % Entre Lemmes una línia en blanc
   titledistance=.5em, % espai entre número i parèntesis.
   textdistance=.5em, % espai entre ) i text
   stopper={.\space}, % Com acaba. Després de parèntesis un '.'
   location=serried,
   width=fit, % que ocupi tot l'espai
   style=italic, % estil del text
   title=yes, % si puc posar o no arguments opcionals
   titlestyle=bf, % estil del títol
   way=bytext, % enumerar en tot el document
   conversion=numbers,indenting=yes] % enumera amb arabic
 %enumera els lemes per seccion
[...]
\startmylema Let $G$ be a group with a finite presentation ${\cal P} =
\langle X \mid R \rangle$. Then for all null-homotopic words $u, v$ in
${\cal P}$,
\setupitems[align=right]
\startitemize[r][left=(,right=),stopper=]
\item $\text{area}(u \cdot w) = \text{area}
(w \cdot u)$
\item $\text{area}(wuw^{-1}) = \text{area}(w)$
\item $\text{area}(u \cdot w) \leq \text{area}(u) + \text{area}(w)$
\item $\text{area}(u) = \text{area}(u^{-1})$
\stopitemize
\stopmylema

but the numbers are left-aligned and they bit the text.

Can anyone help me?

Thanks,
Xan.

PS: I have a new email address. The old has problems with sending emails.
___
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] Fwd: Migrations: exactly LaTeX margins -- ConTeXt margins

2010-08-30 Thread Xan xan
-- Forwarded message --
From: Xan xan xancor...@gmail.com
Date: 2010/8/30
Subject: Re: [NTG-context] Migrations: exactly LaTeX margins -- ConTeXt margins
To: Hans Hagen pra...@wxs.nl


There is a technical explanation in The Not so Short Introduction to
LaTeX [tobi.oetiker.ch/lshort/lshort.pdf]
(page 129)

It's too much for me. I supose there are equivalencies in ConTeXt but
too bit tech for me.

Thanks,
Xan.

2010/8/30 Hans Hagen pra...@wxs.nl

 On 29-8-2010 7:11, Xan xan wrote:

 Hi,

 I want to migrate one LaTeX document to ConTeXt document. I only want to
 put the _exact_ margins LaTeX use for \documentclass[12pt,a4paper]{article}.


 Anyone could say me the exact values I have to put in **layout**?

 You first have to figure out what the exact latex values are. I suppose that 
 they are documented somewhere or can be deduced from the document class 
 (maybe make a list for more popular document classes).

 At some point there can be a module doing things like

 \definelayout[latex-article][...]

 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] startenumerate in romans a la LaTeX

2010-08-30 Thread Xan xan
Hi,

I just want to simulate the behaviour of

\usepackage{enumerate}
...

\begin{enumerate}[(i)]
\item
\end{enumerate}

in ConTeXt. That is:
- items in (i), (ii), 
- right indentation of items: in context items start at the same
point. In LaTeX is the item text itself who starts at the same point,
not the romans.


I try:
\defineenumeration
  [mylema]
  [text={Lemma}, % Què es mostra
   before={\blank[big]}, % abans de lema, un bigskip
   after={\blank[big]}, % després de lema, un bigskip
   headstyle=bold, % Negreta per la capçaleras
   %between=\blank, % Entre Lemmes una línia en blanc
   titledistance=.5em, % espai entre número i parèntesis.
   textdistance=.5em, % espai entre ) i text
   stopper={.\space}, % Com acaba. Després de parèntesis un '.'
   location=serried,
   width=fit, % que ocupi tot l'espai
   style=italic, % estil del text
   title=yes, % si puc posar o no arguments opcionals
   titlestyle=bf, % estil del títol
   way=bytext, % enumerar en tot el document
   conversion=numbers,indenting=yes] % enumera amb arabic
 %enumera els lemes per seccion
[...]
\startmylema Let $G$ be a group with a finite presentation ${\cal P} =
\langle X \mid R \rangle$. Then for all null-homotopic words $u, v$ in
${\cal P}$,
\setupitems[align=right]
\startitemize[r][left=(,right=),stopper=]
\item $\text{area}(u \cdot w) = \text{area}
(w \cdot u)$
\item $\text{area}(wuw^{-1}) = \text{area}(w)$
\item $\text{area}(u \cdot w) \leq \text{area}(u) + \text{area}(w)$
\item $\text{area}(u) = \text{area}(u^{-1})$
\stopitemize
\stopmylema

but the numbers are left-aligned and they bit the text.

Can anyone help me?

Thanks,
Xan.

PS: I have a new email address. The old has problems with sending emails.
___
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
___


<    1   2   3   4