Re: [NTG-context] Multiplication table (with lines) in ConTeXt?

2011-05-04 Thread Wolfgang Schuster

Am 04.05.2011 um 06:45 schrieb Aditya Mahajan:

 \startsetups table:frame
 \setupTABLE[each][each][frame=off, align=middle]
 \setupTABLE[row][first][bottomframe=on]
 \setupTABLE[column][first][rightframe=on]
 \stopsetups
 
 \startTABLE[setups=table:frame]
 \NC $\times$ \NC 1 \NC 2 \NC ... \NC \NR
 
 \stopTABLE

and for the lazy people:

\starttext

\startsetups table:multiplication
  \setupTABLE[each][each][frame=off,align=middle,width=2em,height=2em]
  \setupTABLE[row][first][bottomframe=on]
  \setupTABLE[column][first][rightframe=on]
\stopsetups

\startluacode
context.bTABLE{setups=table:multiplication}
for i=0,6 do
context.bTR()
for j=0,6 do
context.bTD()
if i==0 and j==0 then
context(×)
elseif i==0 or j==0 then
context(i+j)
else
context(i*j)
end
context.eTD()
end
context.eTR()
end
context.eTABLE()
\stopluacode

\stoptext

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Multiplication table (with lines) in ConTeXt?

2011-05-04 Thread Alasdair McAndrew
 It looks like it should work, but when I try it I get a very squashed
table, with lines between all rows and columns...  FWIW, I'm using MKII:

ConTeXt  ver: 2011.02.25 22:03 MKII  fmt: 2011.3.14  int: english/english

-Alasdair

On Wed, May 4, 2011 at 5:05 PM, Wolfgang Schuster 
schuster.wolfg...@googlemail.com wrote:


 Am 04.05.2011 um 06:45 schrieb Aditya Mahajan:

  \startsetups table:frame
  \setupTABLE[each][each][frame=off, align=middle]
  \setupTABLE[row][first][bottomframe=on]
  \setupTABLE[column][first][rightframe=on]
  \stopsetups
 
  \startTABLE[setups=table:frame]
  \NC $\times$ \NC 1 \NC 2 \NC ... \NC \NR
  
  \stopTABLE

 and for the lazy people:

 \starttext

 \startsetups table:multiplication
  \setupTABLE[each][each][frame=off,align=middle,width=2em,height=2em]
   \setupTABLE[row][first][bottomframe=on]
  \setupTABLE[column][first][rightframe=on]
 \stopsetups

 \startluacode
 context.bTABLE{setups=table:multiplication}
 for i=0,6 do
context.bTR()
for j=0,6 do
context.bTD()
if i==0 and j==0 then
context(×)
elseif i==0 or j==0 then
context(i+j)
else
context(i*j)
end
context.eTD()
end
context.eTR()
 end
 context.eTABLE()
 \stopluacode

 \stoptext

 Wolfgang


 ___
 If your question is of interest to others as well, please add an entry to
 the Wiki!

 maillist : ntg-context@ntg.nl /
 http://www.ntg.nl/mailman/listinfo/ntg-context
 webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net

 ___




-- 
Blog: http://amca01.wordpress.com
Web:  http://bit.ly/Alasdair
Facebook: http://www.facebook.com/alasdair.mcandrew
___
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] Multiplication table (with lines) in ConTeXt?

2011-05-04 Thread Paul Menzel
Am Mittwoch, den 04.05.2011, 20:10 +1000 schrieb Alasdair McAndrew:
 It looks like it should work, but when I try it I get a very squashed
 table, with lines between all rows and columns...  FWIW, I'm using MKII:
 
 ConTeXt  ver: 2011.02.25 22:03 MKII  fmt: 2011.3.14  int: english/english

It works perfectly using MK IV.

ConTeXt  ver: 2011.04.30 17:02 MKIV  fmt: 2011.5.1  int: english/english


Thanks,

Paul


PS: Please do not top post or at least remove the unneeded full quote.


signature.asc
Description: This is a digitally signed message part
___
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] Multiplication table (with lines) in ConTeXt?

2011-05-04 Thread Paul Menzel
Am Mittwoch, den 04.05.2011, 09:05 +0200 schrieb Wolfgang Schuster:
 Am 04.05.2011 um 06:45 schrieb Aditya Mahajan:
 
  \startsetups table:frame
  \setupTABLE[each][each][frame=off, align=middle]
  \setupTABLE[row][first][bottomframe=on]
  \setupTABLE[column][first][rightframe=on]
  \stopsetups
  
  \startTABLE[setups=table:frame]
  \NC $\times$ \NC 1 \NC 2 \NC ... \NC \NR
  
  \stopTABLE
 
 and for the lazy people:
 
 \starttext
 
 \startsetups table:multiplication
   \setupTABLE[each][each][frame=off,align=middle,width=2em,height=2em]
   \setupTABLE[row][first][bottomframe=on]
   \setupTABLE[column][first][rightframe=on]
 \stopsetups
 
 \startluacode
 context.bTABLE{setups=table:multiplication}
 for i=0,6 do
   context.bTR()
   for j=0,6 do
   context.bTD()
   if i==0 and j==0 then
   context(×)
   elseif i==0 or j==0 then
   context(i+j)
   else
   context(i*j)

Alasdair takes modula 7 if I understood correctly. So it can be

if i*j  7 then
context(i*j)
else
context((i*j) % 7)
end

(Nice symmetry in the resulting table.)

   end
   context.eTD()
   end
   context.eTR()
 end
 context.eTABLE()
 \stopluacode
 
 \stoptext

Thank you Wolfang, I just wanted to reply and recommend using Lua. As
always you were too fast. ;-)


Thanks,

Paul


signature.asc
Description: This is a digitally signed message part
___
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] Multiplication table (with lines) in ConTeXt?

2011-05-04 Thread Alasdair McAndrew
I gave the mod 7 table as an example; what I in fact want to display is the
Cayley table for the dihedral group D_4.

By the way - how do I upgrade to Mk IV?  I just downloaded the installer for
ConTeXt Minimals and let it do its thing.

This is getting very complicated...

-Alasdair

On Wed, May 4, 2011 at 8:43 PM, Paul Menzel 
paulepan...@users.sourceforge.net wrote:

 Am Mittwoch, den 04.05.2011, 09:05 +0200 schrieb Wolfgang Schuster:
  Am 04.05.2011 um 06:45 schrieb Aditya Mahajan:
 
   \startsetups table:frame
   \setupTABLE[each][each][frame=off, align=middle]
   \setupTABLE[row][first][bottomframe=on]
   \setupTABLE[column][first][rightframe=on]
   \stopsetups
  
   \startTABLE[setups=table:frame]
   \NC $\times$ \NC 1 \NC 2 \NC ... \NC \NR
   
   \stopTABLE
 
  and for the lazy people:
 
  \starttext
 
  \startsetups table:multiplication
\setupTABLE[each][each][frame=off,align=middle,width=2em,height=2em]
\setupTABLE[row][first][bottomframe=on]
\setupTABLE[column][first][rightframe=on]
  \stopsetups
 
  \startluacode
  context.bTABLE{setups=table:multiplication}
  for i=0,6 do
context.bTR()
for j=0,6 do
context.bTD()
if i==0 and j==0 then
context(×)
elseif i==0 or j==0 then
context(i+j)
else
context(i*j)

 Alasdair takes modula 7 if I understood correctly. So it can be

 if i*j  7 then
context(i*j)
 else
context((i*j) % 7)
 end

 (Nice symmetry in the resulting table.)

end
context.eTD()
end
context.eTR()
  end
  context.eTABLE()
  \stopluacode
 
  \stoptext

 Thank you Wolfang, I just wanted to reply and recommend using Lua. As
 always you were too fast. ;-)


 Thanks,

 Paul


 ___
 If your question is of interest to others as well, please add an entry to
 the Wiki!

 maillist : ntg-context@ntg.nl /
 http://www.ntg.nl/mailman/listinfo/ntg-context
 webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net

 ___

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Multiplication table (with lines) in ConTeXt?

2011-05-04 Thread Wolfgang Schuster

Am 04.05.2011 um 12:10 schrieb Alasdair McAndrew:

  It looks like it should work, but when I try it I get a very squashed table, 
 with lines between all rows and columns...  FWIW, I'm using MKII: 

To separate the content and style of a table Hans added a “setups” key to 
\bTABLE/\startTABLE in MkIV but as you use MkII this setting has no effect. You 
can apply the style to the table with the \setups command:

% engine=pdftex

\startsetups table:multiplication
  \setupTABLE[each][each][frame=off,align=middle,width=2em,height=2em]
  \setupTABLE[row][first][bottomframe=on]
  \setupTABLE[column][first][rightframe=on]
\stopsetups

\starttext

\start\setups[table:multiplication]
\startTABLE
\NC $\times$ \NC 0 \NC 1 \NC 2 \NC 3 \NC 4 \NC 5 \NC 6 \NC\NR
\NC0 \NC 0 \NC 0 \NC 0 \NC 0 \NC 0 \NC 0 \NC 0 \NC\NR
\NC1 \NC 0 \NC 1 \NC 2 \NC 3 \NC 4 \NC 5 \NC 6 \NC\NR
\NC2 \NC 0 \NC 2 \NC 4 \NC 6 \NC 1 \NC 3 \NC 5 \NC\NR
\NC3 \NC 0 \NC 3 \NC 6 \NC 2 \NC 5 \NC 1 \NC 4 \NC\NR
\NC4 \NC 0 \NC 4 \NC 1 \NC 5 \NC 2 \NC 6 \NC 3 \NC\NR
\NC5 \NC 0 \NC 5 \NC 3 \NC 1 \NC 6 \NC 4 \NC 2 \NC\NR
\NC6 \NC 0 \NC 6 \NC 5 \NC 4 \NC 3 \NC 2 \NC 1 \NC\NR
\stopTABLE
\stop

\stoptext

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Multiplication table (with lines) in ConTeXt?

2011-05-04 Thread Wolfgang Schuster

Am 04.05.2011 um 12:49 schrieb Alasdair McAndrew:

 I gave the mod 7 table as an example; what I in fact want to display is the 
 Cayley table for the dihedral group D_4.
 
 By the way - how do I upgrade to Mk IV?  I just downloaded the installer for 
 ConTeXt Minimals and let it do its thing.

Compile your document with “context filename” instead of “texexec filename”.

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] Multiplication table (with lines) in ConTeXt?

2011-05-04 Thread Paul Menzel
Dear Alasdair,


please adhere to the posting style the people helping you use [1].
Please use the interleaved style [2].


Am Mittwoch, den 04.05.2011, 20:49 +1000 schrieb Alasdair McAndrew:
 I gave the mod 7 table as an example; what I in fact want to display is the
 Cayley table for the dihedral group D_4.

Interesting. When you have that finished, it would be great if you could
share your TeX file.

 By the way - how do I upgrade to Mk IV?  I just downloaded the installer for
 ConTeXt Minimals and let it do its thing.
 
 This is getting very complicated...

Please open a new thread about that topic. Do not forget to include
useful information like what operating system you use.


Thanks,

Paul


[1] http://en.opensuse.org/openSUSE:Mailing_list_netiquette
[2] 
https://secure.wikimedia.org/wikipedia/en/wiki/Posting_style#Interleaved_style


signature.asc
Description: This is a digitally signed message part
___
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] Multiplication table (with lines) in ConTeXt?

2011-05-03 Thread Alasdair McAndrew
I want to typeset a multiplication table, where there will be a horizontal
line after the first row, and a vertical line after the first column.  In
LaTeX, I can use:

\[
\begin{array}{c|ccc}
  \times0123456\\
  \hline
  \\
  10123456\\
  20246135\\
  30362514\\
  40415263\\
  50531642\\
  60654321
\end{array}
\]

What is the canonical way of including lines in a mathematical array in
ConTeXt?

Thanks,
Alasdair
___
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] Multiplication table (with lines) in ConTeXt?

2011-05-03 Thread Aditya Mahajan

On Wed, 4 May 2011, Alasdair McAndrew wrote:


I want to typeset a multiplication table, where there will be a horizontal
line after the first row, and a vertical line after the first column.  In
LaTeX, I can use:

\[
\begin{array}{c|ccc}
 \times0123456\\
 \hline
 \\
 10123456\\
 20246135\\
 30362514\\
 40415263\\
 50531642\\
 60654321
\end{array}
\]

What is the canonical way of including lines in a mathematical array in
ConTeXt?


\startsetups table:frame
\setupTABLE[each][each][frame=off, align=middle]
\setupTABLE[row][first][bottomframe=on]
\setupTABLE[column][first][rightframe=on]
\stopsetups

\startTABLE[setups=table:frame]
 \NC $\times$ \NC 1 \NC 2 \NC ... \NC \NR
 
\stopTABLE

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
___