ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Command \NN in table?
@ 2008-03-17  4:27 Morgan Brassel
  2008-03-22 13:38 ` Morgan Brassel
  0 siblings, 1 reply; 8+ messages in thread
From: Morgan Brassel @ 2008-03-17  4:27 UTC (permalink / raw)
  To: ntg-context


Hi,
I'm currently trying to typeset tables of digits. I read in This Way #3 
that the tabulate environment has digits support with \NN. Would it be 
possible to had the same feature in the table environment?

By the way, I'd like to congratulate Hans for the \digits command: it 
really saved me so much time! It don't need to retype numbers from 
my numerical outputs anymore. And I can switch very easily from english to 
french number format. It's great!

Best wishes,
Morgan
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Command \NN in table?
  2008-03-17  4:27 Command \NN in table? Morgan Brassel
@ 2008-03-22 13:38 ` Morgan Brassel
  2008-03-22 14:12   ` Aditya Mahajan
  0 siblings, 1 reply; 8+ messages in thread
From: Morgan Brassel @ 2008-03-22 13:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi everyone,

Sorry to bother you again with that question, but I didn't get any answers 
last time, and I think this would make a useful new feature in ConTeXt: is 
there a particular reason why the \NN command is defined in 'tabulate' and 
not in 'table'? Would it be hard to add it in 'table'?

Best wishes,
Morgan

On Mon, 17 Mar 2008, Morgan Brassel wrote:

>
> Hi,
> I'm currently trying to typeset tables of digits. I read in This Way #3
> that the tabulate environment has digits support with \NN. Would it be
> possible to had the same feature in the table environment?
>
> By the way, I'd like to congratulate Hans for the \digits command: it
> really saved me so much time! It don't need to retype numbers from
> my numerical outputs anymore. And I can switch very easily from english to
> french number format. It's great!
>
> Best wishes,
> Morgan
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Command \NN in table?
  2008-03-22 13:38 ` Morgan Brassel
@ 2008-03-22 14:12   ` Aditya Mahajan
  2008-03-22 15:02     ` Morgan Brassel
  0 siblings, 1 reply; 8+ messages in thread
From: Aditya Mahajan @ 2008-03-22 14:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, 22 Mar 2008, Morgan Brassel wrote:

> Hi everyone,
>
> Sorry to bother you again with that question, but I didn't get any answers
> last time, and I think this would make a useful new feature in ConTeXt:

What exactly are you trying to achieve? I do not completely know all the 
features of digits. But table has a numerical columns n and q, see 
http://www.tug.org/TUGboat/Articles/tb29-1/tb91mahajan.pdf. There are also 
\HC (hook column) which can do certain things. Can you give an example of 
a table (placing \digit commands by hand)?

> is
> there a particular reason why the \NN command is defined in 'tabulate' and
> not in 'table'?

'table' is just a wrapper around TaBlE macros, and due to the syntax sugar 
of ConTeXt, some of the features of the original TaBlE macros are lost. 
(Though I do not know if \digits thing is possible with the original TaBlE 
macros or not)

> Would it be hard to add it in 'table'?

I believe so. The TaBlE code is *very* old, written at a time when TeX was 
limited in terms of features and memory. Tabluate are more recenlt 
relatively, and written from scratch by Hans. Actually, if you request for 
features of table that are missing in tabulate, that might be easier to 
implement.

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

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Command \NN in table?
  2008-03-22 14:12   ` Aditya Mahajan
@ 2008-03-22 15:02     ` Morgan Brassel
  2008-03-23  3:45       ` Aditya Mahajan
  0 siblings, 1 reply; 8+ messages in thread
From: Morgan Brassel @ 2008-03-22 15:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> What exactly are you trying to achieve? I do not completely know all the
> features of digits. But table has a numerical columns n and q, see
> http://www.tug.org/TUGboat/Articles/tb29-1/tb91mahajan.pdf. There are also
> \HC (hook column) which can do certain things. Can you give an example of
> a table (placing \digit commands by hand)?

Thank you for your quick answer, Aditya.
In fact, I saw this example at the end of Hans's This Way #3:

\starttext
\starttabulate[|r|]
\NN 1.@@  \NR
\NN 1.1@  \NR
\NN 1.11  \NR
\NN 11.11 \NR
\stoptabulate
\stoptext

and I would like to get the same result replacing tabulate by table...
What I like about \digits (and \NN) is that you can change the number 
format (english Vs french for example) without rewriting anything.

>
>> is
>> there a particular reason why the \NN command is defined in 'tabulate' and
>> not in 'table'?
>
> 'table' is just a wrapper around TaBlE macros, and due to the syntax sugar
> of ConTeXt, some of the features of the original TaBlE macros are lost.
> (Though I do not know if \digits thing is possible with the original TaBlE
> macros or not)
>
>> Would it be hard to add it in 'table'?
>
> I believe so. The TaBlE code is *very* old, written at a time when TeX was
> limited in terms of features and memory. Tabluate are more recenlt
> relatively, and written from scratch by Hans. Actually, if you request for
> features of table that are missing in tabulate, that might be easier to
> implement.
>
> Aditya

I see. So maybe I should switch from table to tabulate for now, as I don't 
need vertical lines... I'll try that as a first solution.

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

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Command \NN in table?
  2008-03-22 15:02     ` Morgan Brassel
@ 2008-03-23  3:45       ` Aditya Mahajan
  2008-03-23 15:41         ` Morgan Brassel
  0 siblings, 1 reply; 8+ messages in thread
From: Aditya Mahajan @ 2008-03-23  3:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, 22 Mar 2008, Morgan Brassel wrote:

>
>> What exactly are you trying to achieve? I do not completely know all the
>> features of digits. But table has a numerical columns n and q, see
>> http://www.tug.org/TUGboat/Articles/tb29-1/tb91mahajan.pdf. There are also
>> \HC (hook column) which can do certain things. Can you give an example of
>> a table (placing \digit commands by hand)?
>
> Thank you for your quick answer, Aditya.
> In fact, I saw this example at the end of Hans's This Way #3:
>
> \starttext
> \starttabulate[|r|]
> \NN 1.@@  \NR
> \NN 1.1@  \NR
> \NN 1.11  \NR
> \NN 11.11 \NR
> \stoptabulate
> \stoptext
>
> and I would like to get the same result replacing tabulate by table...
> What I like about \digits (and \NN) is that you can change the number
> format (english Vs french for example) without rewriting anything.

Does this do what you want?

%\TracingFormats=1
\starttable[|b{\digits}r|]
\NC 1.@@   \NC \AR
\NC 1.1@   \NC \AR
\NC 1.11   \NC \AR
\NC 11.11  \NC \AR
\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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Command \NN in table?
  2008-03-23  3:45       ` Aditya Mahajan
@ 2008-03-23 15:41         ` Morgan Brassel
  2008-03-23 23:44           ` Aditya Mahajan
  0 siblings, 1 reply; 8+ messages in thread
From: Morgan Brassel @ 2008-03-23 15:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Does this do what you want?
>
> %\TracingFormats=1
> \starttable[|b{\digits}r|]
> \NC 1.@@   \NC \AR
> \NC 1.1@   \NC \AR
> \NC 1.11   \NC \AR
> \NC 11.11  \NC \AR
> \stoptable
>
> Aditya

Hi Aditya,

Thank you for this solution. I saw it on the wiki before I sent my first 
e-mail: it is actually less powerful than a \NN command, as it applies to 
the whole column, whereas \NN can apply to a single cell. (See the example 
below)

My current solution is to define a new command
\define\NN{\NC\digits}

It (apparently) does not clash with the \NN command in tabulate, but it 
seems like a dangerous hack. What is your opinion?

Thanks for your time!
Morgan


\setdigitmode 2
\define\NN{\NC\digits}
\starttext

\starttabulate[|r|]
\NN 1.@@  \AR
\NN 1.11  \AR
\NC hello \AR
\stoptabulate

\starttable[|r|]
\NN 1.@@  \AR
\NN 1.11  \AR
\NC hello \AR
\stoptable

\starttable[|b{\digits}r|]
\NC 1.@@  \AR
\NC 1.11  \AR
\NC hello \AR
\stoptable

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

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Command \NN in table?
  2008-03-23 15:41         ` Morgan Brassel
@ 2008-03-23 23:44           ` Aditya Mahajan
  2008-03-23 23:56             ` Morgan Brassel
  0 siblings, 1 reply; 8+ messages in thread
From: Aditya Mahajan @ 2008-03-23 23:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, 23 Mar 2008, Morgan Brassel wrote:

>
>> Does this do what you want?
>>
>> %\TracingFormats=1
>> \starttable[|b{\digits}r|]
>> \NC 1.@@   \NC \AR
>> \NC 1.1@   \NC \AR
>> \NC 1.11   \NC \AR
>> \NC 11.11  \NC \AR
>> \stoptable
>>
>> Aditya
>
> Hi Aditya,
>
> Thank you for this solution. I saw it on the wiki before I sent my first
> e-mail: it is actually less powerful than a \NN command, as it applies to
> the whole column, whereas \NN can apply to a single cell. (See the example
> below)

The table way is the opposite. You can specify what applies to all the 
columns, and then rule out specific columns using \REF[..].

> My current solution is to define a new command
> \define\NN{\NC\digits}
>
> It (apparently) does not clash with the \NN command in tabulate, but it
> seems like a dangerous hack. What is your opinion?

This is pretty safe w.r.t tabulate. I do not think that any other context 
feature uses \NN command, so this will only clash with user commands.

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

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Command \NN in table?
  2008-03-23 23:44           ` Aditya Mahajan
@ 2008-03-23 23:56             ` Morgan Brassel
  0 siblings, 0 replies; 8+ messages in thread
From: Morgan Brassel @ 2008-03-23 23:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users



On Sun, 23 Mar 2008, Aditya Mahajan wrote:

> On Sun, 23 Mar 2008, Morgan Brassel wrote:
>
>>
>>> Does this do what you want?
>>>
>>> %\TracingFormats=1
>>> \starttable[|b{\digits}r|]
>>> \NC 1.@@   \NC \AR
>>> \NC 1.1@   \NC \AR
>>> \NC 1.11   \NC \AR
>>> \NC 11.11  \NC \AR
>>> \stoptable
>>>
>>> Aditya
>>
>> Hi Aditya,
>>
>> Thank you for this solution. I saw it on the wiki before I sent my first
>> e-mail: it is actually less powerful than a \NN command, as it applies to
>> the whole column, whereas \NN can apply to a single cell. (See the example
>> below)
>
> The table way is the opposite. You can specify what applies to all the
> columns, and then rule out specific columns using \REF[..].
>
>> My current solution is to define a new command
>> \define\NN{\NC\digits}
>>
>> It (apparently) does not clash with the \NN command in tabulate, but it
>> seems like a dangerous hack. What is your opinion?
>
> This is pretty safe w.r.t tabulate. I do not think that any other context
> feature uses \NN command, so this will only clash with user commands.
>
> Aditya

Ok, so I think I'll stick with this solution for now.
Thank you for all your answers, Aditya!

Best wishes,
Morgan
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-03-23 23:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-17  4:27 Command \NN in table? Morgan Brassel
2008-03-22 13:38 ` Morgan Brassel
2008-03-22 14:12   ` Aditya Mahajan
2008-03-22 15:02     ` Morgan Brassel
2008-03-23  3:45       ` Aditya Mahajan
2008-03-23 15:41         ` Morgan Brassel
2008-03-23 23:44           ` Aditya Mahajan
2008-03-23 23:56             ` Morgan Brassel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).