ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* hdotsfor replacement
@ 2009-08-16 22:58 Michail Vidiassov
  2009-08-17  2:49 ` Aditya Mahajan
  0 siblings, 1 reply; 3+ messages in thread
From: Michail Vidiassov @ 2009-08-16 22:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear All,

is there a replacement of "hdotsfor" from LaTeX to fill
several cells in a matrix row with one long series of dots?

        Sincerely, Michail
___________________________________________________________________________________
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] 3+ messages in thread

* Re: hdotsfor replacement
  2009-08-16 22:58 hdotsfor replacement Michail Vidiassov
@ 2009-08-17  2:49 ` Aditya Mahajan
  2009-08-17 15:56   ` Michail Vidiassov
  0 siblings, 1 reply; 3+ messages in thread
From: Aditya Mahajan @ 2009-08-17  2:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, 17 Aug 2009, Michail Vidiassov wrote:

> Dear All,
>
> is there a replacement of "hdotsfor" from LaTeX to fill
> several cells in a matrix row with one long series of dots?

Not that I know of. Currently, you can manually do this using TeX 
primitives.

\starttext

\startformula
   \startmathmatrix
     \NC a \NC b \NC c \NR
     \NC \spanomit\spanomit{\dotfill} \NR
     \NC e \NC d \NC adlsadjsak \NR
   \stopmathmatrix
   \startmathmatrix
     \NC a \NC b \NC c \NR
     \NC 45 \NC \omit\spanomit{\dotfill} \NR
     \NC e \NC d \NC adlsadjsak \NR
   \stopmathmatrix
\stopformula

\stoptext

Hans, can we have a command to do this? Basically, \hdotsfor does two 
things. Span a specific number of columns and fill them with dots. The 
spacing between the dots should be configurable.

This is how amsmath defines it.

\newcommand{\hdotsfor}[1]{%
   \ifx[#1\@xp\shdots@for\else\hdots@for\@ne{#1}\fi}
\newmuskip\dotsspace@
\def\shdots@for#1]{\hdots@for{#1}}
\def\hdots@for#1#2{\multicolumn{#2}c%
   {\m@th\dotsspace@1.5mu\mkern-#1\dotsspace@
    \xleaders\hbox{$\m@th\mkern#1\dotsspace@.\mkern#1\dotsspace@$}%
            \hfill
    \mkern-#1\dotsspace@}%
    }

I think that in Context, we can have the following.

\definemathmatrix[matrix][dotspaces=...]

and then in a matrix environment, \DC[3] (dot columns 3) expands to the 
correct number of \omit and \spanomits. What do you think?

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] 3+ messages in thread

* Re: hdotsfor replacement
  2009-08-17  2:49 ` Aditya Mahajan
@ 2009-08-17 15:56   ` Michail Vidiassov
  0 siblings, 0 replies; 3+ messages in thread
From: Michail Vidiassov @ 2009-08-17 15:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear Aditya and All,

On Sun, 16 Aug 2009, Aditya Mahajan wrote:

>> is there a replacement of "hdotsfor" from LaTeX to fill
>> several cells in a matrix row with one long series of dots?
>
> Not that I know of. Currently, you can manually do this using TeX primitives.
>
> \startformula
>  \startmathmatrix
>    \NC a \NC b \NC c \NR
>    \NC \spanomit\spanomit{\dotfill} \NR
>    \NC e \NC d \NC adlsadjsak \NR
>  \stopmathmatrix
>  \startmathmatrix
>    \NC a \NC b \NC c \NR
>    \NC 45 \NC \omit\spanomit{\dotfill} \NR
>    \NC e \NC d \NC adlsadjsak \NR
>  \stopmathmatrix
> \stopformula

"\multispan{num}{\dotfill}" may be an alternative for 
\omit\spanomit\spanomit\..., but half of the white space
separating columns has to be added before dots in any case.
How to do get that amount?
In the above examples dots appear to be shifted to the left
from the desired position.
     Sincerely, Michail


___________________________________________________________________________________
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] 3+ messages in thread

end of thread, other threads:[~2009-08-17 15:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-16 22:58 hdotsfor replacement Michail Vidiassov
2009-08-17  2:49 ` Aditya Mahajan
2009-08-17 15:56   ` Michail Vidiassov

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).