ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* table: vertical distance
@ 2010-04-17  9:35 Wolfgang Werners-Lucchini
  2010-04-17 13:02 ` Wolfgang Schuster
  2010-04-17 14:59 ` Wolfgang Schuster
  0 siblings, 2 replies; 5+ messages in thread
From: Wolfgang Werners-Lucchini @ 2010-04-17  9:35 UTC (permalink / raw)
  To: ntg-context

Hallo,

I have to typeset a division and have two diverent solutions but they 
both have problems.

%---------------------------------------------------------------------
\starttext
{\setuptables[rulethickness=0.05em,distance=small]
\starttable[s0|r|r|r|r|r|r|r|r|r|r|r|r|r|r|r|r|]
\NC\NC 1\NC 1\NC 0\NC 0\NC 1\NC 1\NC :\NC 1\NC 1\NC = \NC 1\NC 0\NC 0 
\NC 0 \NC 1\NC\AR
\NC\NC 1\NC 1\NC \NC \NC \NC \NC \NC \NC \NC \NC \NC \NC  \NC   \NC  
\NC\AR
\DC \DL[2]                         \DC \DC \DC \DC \DC \DC \DC \DC 
\DC \DC \DC \DC \DC                \DR
\NC\NC \NC 0\NC 0\NC \NC \NC \NC   \NC   \NC  \NC  \NC   \NC  \NC  
\NC   \NC  \NC\AR
\NC\NC \NC 0\NC 0\NC \NC \NC \NC   \NC   \NC  \NC  \NC   \NC  \NC  
\NC   \NC  \NC\AR
\DC\DC \DL[2]                        \DC \DC \DC \DC \DC \DC \DC \DC 
\DC \DC \DC \DC                \DR
\NC\NC \NC \NC 0\NC 0\NC \NC \NC   \NC   \NC  \NC  \NC   \NC  \NC  
\NC   \NC  \NC\AR
\NC\NC \NC \NC 0\NC 0\NC \NC \NC   \NC   \NC  \NC  \NC   \NC  \NC  
\NC   \NC  \NC\AR
\DC\DC\DC \DL[2]                         \DC \DC \DC \DC \DC \DC \DC 
\DC \DC \DC \DC                \DR
\NC\NC \NC \NC \NC 0\NC 1\NC \NC   \NC   \NC  \NC  \NC   \NC  \NC  
\NC   \NC  \NC\AR
\NC\NC \NC \NC \NC 0\NC 0\NC \NC   \NC   \NC  \NC  \NC   \NC  \NC  
\NC   \NC  \NC\AR
\DC\DC\DC\DC \DL[2]                         \DC \DC \DC \DC \DC \DC 
\DC \DC \DC \DC                \DR
\NC\NC \NC \NC \NC \NC 1\NC 1\NC   \NC   \NC  \NC  \NC   \NC  \NC  
\NC   \NC  \NC\AR
\NC\NC \NC \NC \NC \NC 1\NC 1\NC   \NC   \NC  \NC  \NC   \NC  \NC  
\NC   \NC  \NC\AR
\DC\DC\DC\DC \DC \DL[2]\DC \DC \DC \DC \DC \DC \DC \DC \DC            
    \DR
\NC\NC\NC\NC\NC\NC\NC 0\NC\NC\NC\NC\NC\NC\NC\NC\NC\NC\AR
\stoptable}

\setuplines[style=type]
\startlines
110011:11=10001
11
--
~00
~00
~--
~~00
~~00
~~--
~~~01
~~~00
~~~--
~~~~11
~~~~11
~~~~--
~~~~~0
\stoplines
\stoptext
%---------------------------------------------------------------------

In both examples there is a far to big distance between the lines and 
the upper digits. But the interline distance as a whole could be 
smaller. The simulation of a line with '--' in the second example is 
unsatisfying. Are there some improvments? Or, is there an idea for a 
better approach?


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
___________________________________________________________________________________


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

* Re: table: vertical distance
  2010-04-17  9:35 table: vertical distance Wolfgang Werners-Lucchini
@ 2010-04-17 13:02 ` Wolfgang Schuster
  2010-04-17 14:59 ` Wolfgang Schuster
  1 sibling, 0 replies; 5+ messages in thread
From: Wolfgang Schuster @ 2010-04-17 13:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 17.04.10 11:35, schrieb Wolfgang Werners-Lucchini:
> Hallo,
>
> I have to typeset a division and have two diverent solutions but they
> both have problems.
>
> \setuplines[style=type]
> \startlines
> 110011:11=10001
> 11
> ...
> ~~~~~0
> \stoplines
> \stoptext
>    
\setuplines[style=type,space=on]
\startlines
\formula{\tt 110011:11=10001}
11
--
  00
  00
  --
   00
   00
   --
    01
    00
    --
     11
     11
     --
      0
\stoplines

You can also look at the xlop package 
http://ctan.org/tex-archive/macros/generic/xlop/

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
___________________________________________________________________________________


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

* Re: table: vertical distance
  2010-04-17  9:35 table: vertical distance Wolfgang Werners-Lucchini
  2010-04-17 13:02 ` Wolfgang Schuster
@ 2010-04-17 14:59 ` Wolfgang Schuster
  2010-04-17 18:31   ` Wolfgang Schuster
  1 sibling, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2010-04-17 14:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 17.04.10 11:35, schrieb Wolfgang Werners-Lucchini:
> I have to typeset a division …
>
> \setuplines[style=type]
> \startlines
> 110011:11=10001
> 11
> --
> ~00
> ~00
> ~--
> ~~00
> ~~00
> ~~--
> ~~~01
> ~~~00
> ~~~--
> ~~~~11
> ~~~~11
> ~~~~--
> ~~~~~0
> \stoplines
> \stoptext
>    
\define[1]\divisionrule
{\dontleavehmode\blap
{\vskip-\strutht
\blackrule[width=\the\dimexpr.5em*#1\relax,height=2\linewidth]}%
\vskip-\lineheight}

\definelines[division][style=type,space=on]

\starttext

\startdivision
\formula{\tt 110011 ÷ 11 = 10001}
11
\divisionrule{2}
00
00
\divisionrule{2}
00
00
\divisionrule{2}
01
00
\divisionrule{2}
11
11
\divisionrule{2}
0
\stopdivision

\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
___________________________________________________________________________________


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

* Re: table: vertical distance
  2010-04-17 14:59 ` Wolfgang Schuster
@ 2010-04-17 18:31   ` Wolfgang Schuster
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Schuster @ 2010-04-17 18:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 17.04.10 16:59, schrieb Wolfgang Schuster:
> Am 17.04.10 11:35, schrieb Wolfgang Werners-Lucchini:
>> I have to typeset a division …
>>
>> \setuplines[style=type]
>> \startlines
>> ...
>> \stoplines
>> \stoptext
>
> \definelines[division][style=type,space=on]
You don't even need a typewriter font for this:

\definefontfeature[tnum][tnum=yes]

\setupbodyfont[pagella]

\define[1]\divisionrule
   {\dontleavehmode\blap
      {\vskip-\strutht
       \blackrule[width=\the\dimexpr.5em*#1\relax,height=2\linewidth]}%
    \vskip-\lineheight}

\definelines[division][style=\addff{tnum},space=on]

\starttext

\startdivision
\formula{110011 ÷ 11 = 10001}
11
\divisionrule{2}
  00
  00
  \divisionrule{2}
   00
   00
   \divisionrule{2}
    01
    00
    \divisionrule{2}
     11
     11
     \divisionrule{2}
      0
\stopdivision

\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
___________________________________________________________________________________


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

* Re: table: vertical distance
       [not found] <mailman.589.1271519612.4277.ntg-context@ntg.nl>
@ 2010-04-17 20:29 ` Wolfgang Werners-Lucchini
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Werners-Lucchini @ 2010-04-17 20:29 UTC (permalink / raw)
  To: ntg-context

> \define[1]\divisionrule
> {\dontleavehmode\blap
> {\vskip-\strutht
> \blackrule[width=\the\dimexpr.5em*#1\relax,height=2\linewidth]}%
> \vskip-\lineheight}

Ahh! Yes, this helps a lot.
Thank you very much!

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
___________________________________________________________________________________


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

end of thread, other threads:[~2010-04-17 20:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-17  9:35 table: vertical distance Wolfgang Werners-Lucchini
2010-04-17 13:02 ` Wolfgang Schuster
2010-04-17 14:59 ` Wolfgang Schuster
2010-04-17 18:31   ` Wolfgang Schuster
     [not found] <mailman.589.1271519612.4277.ntg-context@ntg.nl>
2010-04-17 20:29 ` Wolfgang Werners-Lucchini

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