ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Why I needed \parbox and why does \framed not work here?
@ 2005-03-13  9:08 Gerben Wierda
  2005-03-13 10:57 ` Willi Egger
  2005-03-14 14:27 ` Taco Hoekwater
  0 siblings, 2 replies; 11+ messages in thread
From: Gerben Wierda @ 2005-03-13  9:08 UTC (permalink / raw)


I am trying to convert to ConTeXt and I have a text with a lot of truth 
tables using a \ttable and \xttable command I defined. I ported these 
to ConTeXt but I can't get the \parbox -> \framed to work.

% Example document with truth tables starts here

\usemodule[bib] % defines \newcommand
\newcommand{\operand}[1]{{\sc #1}}
\newcommand{\ttvalue}[1]{{\sc #1}}
\newcommand{\xttable}[7]{\starttable[|c|c|c|]\HL %
#1 \NC #2 \NC #1 \operand{#3} #2 \SR\HL
\ttvalue{false} \NC \ttvalue{false} \NC \ttvalue{#4} \FR %
\ttvalue{false} \NC \ttvalue{true} \NC \ttvalue{#5} \MR %
\ttvalue{true} \NC \ttvalue{false} \NC \ttvalue{#6} \MR %
\ttvalue{true} \NC \ttvalue{true} \NC \ttvalue{#7} \LR\HL %
\stoptable}
\newcommand{\ttable}[5]{\xttable{a}{b}{#1}{#2}{#3}{#4}{#5}}
\starttext
Looks fine:\blank
\midaligned{%
\xttable{Statement X}{Statement Y}{$\Rightarrow$}%
{unknown}{unknown}{invalid (false)}{valid (true)}
}

This doesn't work:\blank
\midaligned{%
\xttable{Some sort of longer statement}{Another sort of longer 
statement}%
{$\Rightarrow$}%
{unknown}{unknown}{invalid (false)}{valid (true)}
}

This doesn't work either:\blank
\midaligned{%
\xttable{\framed[width=2cm,frame=off]{Some sort of longer
statement\par}}{\framed[width=2cm,frame=off]{Another sort of longer
statement\par}}{$\Rightarrow$}%
{unknown}{unknown}{invalid (false)}{valid (true)}
}
\stoptext

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

* Re: Why I needed \parbox and why does \framed not work here?
  2005-03-13  9:08 Why I needed \parbox and why does \framed not work here? Gerben Wierda
@ 2005-03-13 10:57 ` Willi Egger
  2005-03-13 13:42   ` Gerben Wierda
  2005-03-13 14:06   ` Gerben Wierda
  2005-03-14 14:27 ` Taco Hoekwater
  1 sibling, 2 replies; 11+ messages in thread
From: Willi Egger @ 2005-03-13 10:57 UTC (permalink / raw)


Hi Gerben

The problem is, that \starttable[|c|c|c|] is for oneliners only.
Replace the statement with
	\newcommand{\xttable}[7]{\starttable[|p|p|p|]\HL %


Kind regards
Willi
Gerben Wierda wrote:
> I am trying to convert to ConTeXt and I have a text with a lot of truth 
> tables using a \ttable and \xttable command I defined. I ported these to 
> ConTeXt but I can't get the \parbox -> \framed to work.
> 
> % Example document with truth tables starts here
> 
> \usemodule[bib] % defines \newcommand
> \newcommand{\operand}[1]{{\sc #1}}
> \newcommand{\ttvalue}[1]{{\sc #1}}
> \newcommand{\xttable}[7]{\starttable[|c|c|c|]\HL %
> #1 \NC #2 \NC #1 \operand{#3} #2 \SR\HL
> \ttvalue{false} \NC \ttvalue{false} \NC \ttvalue{#4} \FR %
> \ttvalue{false} \NC \ttvalue{true} \NC \ttvalue{#5} \MR %
> \ttvalue{true} \NC \ttvalue{false} \NC \ttvalue{#6} \MR %
> \ttvalue{true} \NC \ttvalue{true} \NC \ttvalue{#7} \LR\HL %
> \stoptable}
> \newcommand{\ttable}[5]{\xttable{a}{b}{#1}{#2}{#3}{#4}{#5}}
> \starttext
> Looks fine:\blank
> \midaligned{%
> \xttable{Statement X}{Statement Y}{$\Rightarrow$}%
> {unknown}{unknown}{invalid (false)}{valid (true)}
> }
> 
> This doesn't work:\blank
> \midaligned{%
> \xttable{Some sort of longer statement}{Another sort of longer statement}%
> {$\Rightarrow$}%
> {unknown}{unknown}{invalid (false)}{valid (true)}
> }
> 
> This doesn't work either:\blank
> \midaligned{%
> \xttable{\framed[width=2cm,frame=off]{Some sort of longer
> statement\par}}{\framed[width=2cm,frame=off]{Another sort of longer
> statement\par}}{$\Rightarrow$}%
> {unknown}{unknown}{invalid (false)}{valid (true)}
> }
> \stoptext
> 
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: Why I needed \parbox and why does \framed not work here?
  2005-03-13 10:57 ` Willi Egger
@ 2005-03-13 13:42   ` Gerben Wierda
  2005-03-13 14:06   ` Gerben Wierda
  1 sibling, 0 replies; 11+ messages in thread
From: Gerben Wierda @ 2005-03-13 13:42 UTC (permalink / raw)


Fine, but how do I influence the width of those p columns? With the old 
way I would put a TeX box as a single line item in a LaTeX tabular 
which had c columns. This worked very well, because I could use 
\parbox{2cm} in my use of the self-defined command. In other words, I 
could influence the width of the output for every table separately.

What happens now is that in one table I get two narrow columns and a 
space and a wider column, but in others one longer statement is not 
wrapped at all and two other columns with longer statements are made 
very narrow. Chaos.

So, I still rather have a solution with c columns and a LaTeX \parbox 
like solution (but then one which works).

G

On Mar 13, 2005, at 11:57, Willi Egger wrote:

> Hi Gerben
>
> The problem is, that \starttable[|c|c|c|] is for oneliners only.
> Replace the statement with
> 	\newcommand{\xttable}[7]{\starttable[|p|p|p|]\HL %
>
>
> Kind regards
> Willi
> Gerben Wierda wrote:
>> I am trying to convert to ConTeXt and I have a text with a lot of 
>> truth tables using a \ttable and \xttable command I defined. I ported 
>> these to ConTeXt but I can't get the \parbox -> \framed to work.
>> % Example document with truth tables starts here
>> \usemodule[bib] % defines \newcommand
>> \newcommand{\operand}[1]{{\sc #1}}
>> \newcommand{\ttvalue}[1]{{\sc #1}}
>> \newcommand{\xttable}[7]{\starttable[|c|c|c|]\HL %
>> #1 \NC #2 \NC #1 \operand{#3} #2 \SR\HL
>> \ttvalue{false} \NC \ttvalue{false} \NC \ttvalue{#4} \FR %
>> \ttvalue{false} \NC \ttvalue{true} \NC \ttvalue{#5} \MR %
>> \ttvalue{true} \NC \ttvalue{false} \NC \ttvalue{#6} \MR %
>> \ttvalue{true} \NC \ttvalue{true} \NC \ttvalue{#7} \LR\HL %
>> \stoptable}
>> \newcommand{\ttable}[5]{\xttable{a}{b}{#1}{#2}{#3}{#4}{#5}}
>> \starttext
>> Looks fine:\blank
>> \midaligned{%
>> \xttable{Statement X}{Statement Y}{$\Rightarrow$}%
>> {unknown}{unknown}{invalid (false)}{valid (true)}
>> }
>> This doesn't work:\blank
>> \midaligned{%
>> \xttable{Some sort of longer statement}{Another sort of longer 
>> statement}%
>> {$\Rightarrow$}%
>> {unknown}{unknown}{invalid (false)}{valid (true)}
>> }
>> This doesn't work either:\blank
>> \midaligned{%
>> \xttable{\framed[width=2cm,frame=off]{Some sort of longer
>> statement\par}}{\framed[width=2cm,frame=off]{Another sort of longer
>> statement\par}}{$\Rightarrow$}%
>> {unknown}{unknown}{invalid (false)}{valid (true)}
>> }
>> \stoptext
>> _______________________________________________
>> ntg-context mailing list
>> ntg-context@ntg.nl
>> http://www.ntg.nl/mailman/listinfo/ntg-context
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>

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

* Re: Why I needed \parbox and why does \framed not work here?
  2005-03-13 10:57 ` Willi Egger
  2005-03-13 13:42   ` Gerben Wierda
@ 2005-03-13 14:06   ` Gerben Wierda
  2005-03-13 15:05     ` Willi Egger
                       ` (3 more replies)
  1 sibling, 4 replies; 11+ messages in thread
From: Gerben Wierda @ 2005-03-13 14:06 UTC (permalink / raw)


Here is the example again, now with p columns. Never mind the 
non-working third example (ConTeXt wraps three elements in the third 
column now but not inside the \framed), but it seems that ConTeXt does 
not wrap the first column at all. As a result, the other two are very 
small.

G

PS. The ConTeXT manual does not have \starttable documentation, not 
does the wiki (how does 'p' work etc).

% Try with 'p' columns

\usemodule[bib] % defines \newcommand
\newcommand{\operand}[1]{{\sc #1}}
\newcommand{\ttvalue}[1]{{\sc #1}}
\newcommand{\xttable}[7]{\starttable[|p|p|p|]\HL %
#1 \NC #2 \NC #1 \operand{#3} #2 \SR\HL
\ttvalue{false} \NC \ttvalue{false} \NC \ttvalue{#4} \FR %
\ttvalue{false} \NC \ttvalue{true} \NC \ttvalue{#5} \MR %
\ttvalue{true} \NC \ttvalue{false} \NC \ttvalue{#6} \MR %
\ttvalue{true} \NC \ttvalue{true} \NC \ttvalue{#7} \LR\HL %
\stoptable}
\newcommand{\ttable}[5]{\xttable{a}{b}{#1}{#2}{#3}{#4}{#5}}
\starttext
Looks fine:\blank
\midaligned{%
\xttable{Statement X}{Statement Y}{$\Rightarrow$}%
{unknown}{unknown}{invalid (false)}{valid (true)}
}

This doesn't work:\blank
\midaligned{%
\xttable{Some sort of longer statement}{Another sort of longer 
statement}%
{$\Rightarrow$}%
{unknown}{unknown}{invalid (false)}{valid (true)}
}

This doesn't work either:\blank
\midaligned{%
\xttable{\framed[width=2cm,frame=off]{Some sort\par of longer
statement\par}}{\framed[width=2cm,frame=off]{Another sort\par of longer
statement\par}}{$\Rightarrow$}%
{unknown}{unknown}{invalid (false)}{valid (true)}
}
\stoptext

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

* Re: Why I needed \parbox and why does \framed not work here?
  2005-03-13 14:06   ` Gerben Wierda
@ 2005-03-13 15:05     ` Willi Egger
  2005-03-13 15:59       ` Gerben Wierda
  2005-03-13 15:12     ` Willi Egger
                       ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Willi Egger @ 2005-03-13 15:05 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 2108 bytes --]

Hi Gerben,

There is no worry about the mentioned chaos. You might be lucky, that 
your definition is giving a result at all.

If you consult the manual or read the article in the MAPS22 on 
tabulating, you will see, that you missed a correct setup of the tabulation.

I attach my version and it works.

KR
Willi

Gerben Wierda wrote:
> Here is the example again, now with p columns. Never mind the 
> non-working third example (ConTeXt wraps three elements in the third 
> column now but not inside the \framed), but it seems that ConTeXt does 
> not wrap the first column at all. As a result, the other two are very 
> small.
> 
> G
> 
> PS. The ConTeXT manual does not have \starttable documentation, not does 
> the wiki (how does 'p' work etc).
> 
> % Try with 'p' columns
> 
> \usemodule[bib] % defines \newcommand
> \newcommand{\operand}[1]{{\sc #1}}
> \newcommand{\ttvalue}[1]{{\sc #1}}
> \newcommand{\xttable}[7]{\starttable[|p|p|p|]\HL %
> #1 \NC #2 \NC #1 \operand{#3} #2 \SR\HL
> \ttvalue{false} \NC \ttvalue{false} \NC \ttvalue{#4} \FR %
> \ttvalue{false} \NC \ttvalue{true} \NC \ttvalue{#5} \MR %
> \ttvalue{true} \NC \ttvalue{false} \NC \ttvalue{#6} \MR %
> \ttvalue{true} \NC \ttvalue{true} \NC \ttvalue{#7} \LR\HL %
> \stoptable}
> \newcommand{\ttable}[5]{\xttable{a}{b}{#1}{#2}{#3}{#4}{#5}}
> \starttext
> Looks fine:\blank
> \midaligned{%
> \xttable{Statement X}{Statement Y}{$\Rightarrow$}%
> {unknown}{unknown}{invalid (false)}{valid (true)}
> }
> 
> This doesn't work:\blank
> \midaligned{%
> \xttable{Some sort of longer statement}{Another sort of longer statement}%
> {$\Rightarrow$}%
> {unknown}{unknown}{invalid (false)}{valid (true)}
> }
> 
> This doesn't work either:\blank
> \midaligned{%
> \xttable{\framed[width=2cm,frame=off]{Some sort\par of longer
> statement\par}}{\framed[width=2cm,frame=off]{Another sort\par of longer
> statement\par}}{$\Rightarrow$}%
> {unknown}{unknown}{invalid (false)}{valid (true)}
> }
> \stoptext
> 
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

[-- Attachment #2: truthtable-Wierda.tex --]
[-- Type: text/plain, Size: 1336 bytes --]

% Truthtables Gerben Wierda
% C0ntext file
% filename: truthtable-Wierda.tex
% Gerben Wierda
% W. Egger
% 13-03-2005

\setupoutput[pdftex]
\setupbodyfont[ss,12pt]

\usemodule[bib] % defines \newcommand
\newcommand{\operand}[1]{{\sc #1}}
\newcommand{\ttvalue}[1]{{\sc #1}}
\newcommand{\xttable}[7]{\starttable[|p(2cm)|p(5cm)|p(3cm)|]
\HL %
\NC #1 \NC #2 \NC #1 \operand{#3} #2 \NC\NR
\HL
\NC \ttvalue{false} \NC \ttvalue{false} \NC \ttvalue{#4} \NC\NR %
\NC \ttvalue{false} \NC \ttvalue{true} \NC \ttvalue{#5} \NC\NR %
\NC \ttvalue{true} \NC \ttvalue{false} \NC \ttvalue{#6} \NC \NR %
\NC \ttvalue{true} \NC \ttvalue{true} \NC \ttvalue{#7} \NC\NR\HL %
\stoptable}
\newcommand{\ttable}[5]{\xttable{a}{b}{#1}{#2}{#3}{#4}{#5}}
\starttext
Looks fine:\blank
\midaligned{%
\xttable{Statement X}{Statement Y}{$\Rightarrow$}%
{unknown}{unknown}{invalid (false)}{valid (true)}
}


 This doesn't work:\blank
\midaligned{%
\xttable{Some sort of longer statement}{Another sort of longer statement}%
{$\Rightarrow$}%
{unknown}{unknown}{invalid (false)}{valid (true)}
}

% This doesn't work either:\blank
% \midaligned{%
% \xttable{\framed[width=2cm,frame=off]{Some sort of longer
% statement\par}}{\framed[width=2cm,frame=off]{Another sort of longer
% statement\par}}{$\Rightarrow$}%
% {unknown}{unknown}{invalid (false)}{valid (true)}
% }
\stoptext

[-- Attachment #3: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: Why I needed \parbox and why does \framed not work here?
  2005-03-13 14:06   ` Gerben Wierda
  2005-03-13 15:05     ` Willi Egger
@ 2005-03-13 15:12     ` Willi Egger
  2005-03-13 16:57     ` Patrick Gundlach
  2005-03-13 20:47     ` mickle
  3 siblings, 0 replies; 11+ messages in thread
From: Willi Egger @ 2005-03-13 15:12 UTC (permalink / raw)


Indeed, there is no \starttable info in the manuals. You might have a 
look into the sources:core-tab.tex.  But what I can see, is, that you do 
not use vertical lines. If all tables are such, then I would suggest to 
use \starttabulate instead.

KR
Willi

Gerben Wierda wrote:
> Here is the example again, now with p columns. Never mind the 
> non-working third example (ConTeXt wraps three elements in the third 
> column now but not inside the \framed), but it seems that ConTeXt does 
> not wrap the first column at all. As a result, the other two are very 
> small.
> 
> G
> 
> PS. The ConTeXT manual does not have \starttable documentation, not does 
> the wiki (how does 'p' work etc).
> 
> % Try with 'p' columns
> 
> \usemodule[bib] % defines \newcommand
> \newcommand{\operand}[1]{{\sc #1}}
> \newcommand{\ttvalue}[1]{{\sc #1}}
> \newcommand{\xttable}[7]{\starttable[|p|p|p|]\HL %
> #1 \NC #2 \NC #1 \operand{#3} #2 \SR\HL
> \ttvalue{false} \NC \ttvalue{false} \NC \ttvalue{#4} \FR %
> \ttvalue{false} \NC \ttvalue{true} \NC \ttvalue{#5} \MR %
> \ttvalue{true} \NC \ttvalue{false} \NC \ttvalue{#6} \MR %
> \ttvalue{true} \NC \ttvalue{true} \NC \ttvalue{#7} \LR\HL %
> \stoptable}
> \newcommand{\ttable}[5]{\xttable{a}{b}{#1}{#2}{#3}{#4}{#5}}
> \starttext
> Looks fine:\blank
> \midaligned{%
> \xttable{Statement X}{Statement Y}{$\Rightarrow$}%
> {unknown}{unknown}{invalid (false)}{valid (true)}
> }
> 
> This doesn't work:\blank
> \midaligned{%
> \xttable{Some sort of longer statement}{Another sort of longer statement}%
> {$\Rightarrow$}%
> {unknown}{unknown}{invalid (false)}{valid (true)}
> }
> 
> This doesn't work either:\blank
> \midaligned{%
> \xttable{\framed[width=2cm,frame=off]{Some sort\par of longer
> statement\par}}{\framed[width=2cm,frame=off]{Another sort\par of longer
> statement\par}}{$\Rightarrow$}%
> {unknown}{unknown}{invalid (false)}{valid (true)}
> }
> \stoptext
> 
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: Why I needed \parbox and why does \framed not work here?
  2005-03-13 15:05     ` Willi Egger
@ 2005-03-13 15:59       ` Gerben Wierda
  2005-03-13 17:34         ` Willi Egger
  0 siblings, 1 reply; 11+ messages in thread
From: Gerben Wierda @ 2005-03-13 15:59 UTC (permalink / raw)


Hi Willi,

Thanks.

If what you changed was the addition of the (2cm) stuff, I did try that 
but it did not change anything at that time.

But now I notice that I need to start my rows with a \NC. I would have 
thought that a \NC would be like a \crlf or a \page and that it would 
have been implied in the \NR command. I find this counterintuitive.

Anyway, Having that (2cm) stuff in the \startabulate makes all tables 
the same in column width. I used to be able to have one command 
\xttable where the result depended on what I had in the main text.

So, yes, I can use p columns, but that means that all of my tables will 
hae to have identical column widths. That is why I wanted to use c 
columns and have that decision in the text. So I would still be 
interested in a way of doing \parbox in ConTeXt.

(For non-LaTeX users \parbox{2cm}{text text text text etc} creates a 
paragraph 2 cm wide and sets the text in it. The height of the box is 
the result of that typesetting.)

G

On Mar 13, 2005, at 16:05, Willi Egger wrote:

> Hi Gerben,
>
> There is no worry about the mentioned chaos. You might be lucky, that 
> your definition is giving a result at all.
>
> If you consult the manual or read the article in the MAPS22 on 
> tabulating, you will see, that you missed a correct setup of the 
> tabulation.
>
> I attach my version and it works.
>
> KR
> Willi
>
> Gerben Wierda wrote:
>> Here is the example again, now with p columns. Never mind the 
>> non-working third example (ConTeXt wraps three elements in the third 
>> column now but not inside the \framed), but it seems that ConTeXt 
>> does not wrap the first column at all. As a result, the other two are 
>> very small.
>> G
>> PS. The ConTeXT manual does not have \starttable documentation, not 
>> does the wiki (how does 'p' work etc).
>> % Try with 'p' columns
>> \usemodule[bib] % defines \newcommand
>> \newcommand{\operand}[1]{{\sc #1}}
>> \newcommand{\ttvalue}[1]{{\sc #1}}
>> \newcommand{\xttable}[7]{\starttable[|p|p|p|]\HL %
>> #1 \NC #2 \NC #1 \operand{#3} #2 \SR\HL
>> \ttvalue{false} \NC \ttvalue{false} \NC \ttvalue{#4} \FR %
>> \ttvalue{false} \NC \ttvalue{true} \NC \ttvalue{#5} \MR %
>> \ttvalue{true} \NC \ttvalue{false} \NC \ttvalue{#6} \MR %
>> \ttvalue{true} \NC \ttvalue{true} \NC \ttvalue{#7} \LR\HL %
>> \stoptable}
>> \newcommand{\ttable}[5]{\xttable{a}{b}{#1}{#2}{#3}{#4}{#5}}
>> \starttext
>> Looks fine:\blank
>> \midaligned{%
>> \xttable{Statement X}{Statement Y}{$\Rightarrow$}%
>> {unknown}{unknown}{invalid (false)}{valid (true)}
>> }
>> This doesn't work:\blank
>> \midaligned{%
>> \xttable{Some sort of longer statement}{Another sort of longer 
>> statement}%
>> {$\Rightarrow$}%
>> {unknown}{unknown}{invalid (false)}{valid (true)}
>> }
>> This doesn't work either:\blank
>> \midaligned{%
>> \xttable{\framed[width=2cm,frame=off]{Some sort\par of longer
>> statement\par}}{\framed[width=2cm,frame=off]{Another sort\par of 
>> longer
>> statement\par}}{$\Rightarrow$}%
>> {unknown}{unknown}{invalid (false)}{valid (true)}
>> }
>> \stoptext
>> _______________________________________________
>> ntg-context mailing list
>> ntg-context@ntg.nl
>> http://www.ntg.nl/mailman/listinfo/ntg-context
> % Truthtables Gerben Wierda
> % C0ntext file
> % filename: truthtable-Wierda.tex
> % Gerben Wierda
> % W. Egger
> % 13-03-2005
>
> \setupoutput[pdftex]
> \setupbodyfont[ss,12pt]
>
> \usemodule[bib] % defines \newcommand
> \newcommand{\operand}[1]{{\sc #1}}
> \newcommand{\ttvalue}[1]{{\sc #1}}
> \newcommand{\xttable}[7]{\starttable[|p(2cm)|p(5cm)|p(3cm)|]
> \HL %
> \NC #1 \NC #2 \NC #1 \operand{#3} #2 \NC\NR
> \HL
> \NC \ttvalue{false} \NC \ttvalue{false} \NC \ttvalue{#4} \NC\NR %
> \NC \ttvalue{false} \NC \ttvalue{true} \NC \ttvalue{#5} \NC\NR %
> \NC \ttvalue{true} \NC \ttvalue{false} \NC \ttvalue{#6} \NC \NR %
> \NC \ttvalue{true} \NC \ttvalue{true} \NC \ttvalue{#7} \NC\NR\HL %
> \stoptable}
> \newcommand{\ttable}[5]{\xttable{a}{b}{#1}{#2}{#3}{#4}{#5}}
> \starttext
> Looks fine:\blank
> \midaligned{%
> \xttable{Statement X}{Statement Y}{$\Rightarrow$}%
> {unknown}{unknown}{invalid (false)}{valid (true)}
> }
>
>
>  This doesn't work:\blank
> \midaligned{%
> \xttable{Some sort of longer statement}{Another sort of longer 
> statement}%
> {$\Rightarrow$}%
> {unknown}{unknown}{invalid (false)}{valid (true)}
> }
>
> % This doesn't work either:\blank
> % \midaligned{%
> % \xttable{\framed[width=2cm,frame=off]{Some sort of longer
> % statement\par}}{\framed[width=2cm,frame=off]{Another sort of longer
> % statement\par}}{$\Rightarrow$}%
> % {unknown}{unknown}{invalid (false)}{valid (true)}
> % }
> \stoptext
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: Why I needed \parbox and why does \framed not work here?
  2005-03-13 14:06   ` Gerben Wierda
  2005-03-13 15:05     ` Willi Egger
  2005-03-13 15:12     ` Willi Egger
@ 2005-03-13 16:57     ` Patrick Gundlach
  2005-03-13 20:47     ` mickle
  3 siblings, 0 replies; 11+ messages in thread
From: Patrick Gundlach @ 2005-03-13 16:57 UTC (permalink / raw)


Hello Gerben,

> Here is the example again, now with p columns. Never mind the
> non-working third example (ConTeXt wraps three elements in the third
> column now but not inside the \framed), 

Did you read my answer to your question about \parbox? You need to
make \framed go into vertical mode by saying something like
align=lohi.

Patrick
-- 
ConTeXt wiki: http://contextgarden.net

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

* Re: Why I needed \parbox and why does \framed not work here?
  2005-03-13 15:59       ` Gerben Wierda
@ 2005-03-13 17:34         ` Willi Egger
  0 siblings, 0 replies; 11+ messages in thread
From: Willi Egger @ 2005-03-13 17:34 UTC (permalink / raw)


hi Gerben,

Gerben Wierda wrote:
> Hi Willi,
> 
> Thanks.
> 
> If what you changed was the addition of the (2cm) stuff, I did try that 
> but it did not change anything at that time.
> 
> But now I notice that I need to start my rows with a \NC. I would have 
> thought that a \NC would be like a \crlf or a \page and that it would 
> have been implied in the \NR command. I find this counterintuitive.
>
No, the \NC means new column and in order to organize this I believe it 
is natural to start with \NC and end with \NC\NR to indicate a new row 
to be started.

> Anyway, Having that (2cm) stuff in the \startabulate makes all tables 
> the same in column width. I used to be able to have one command \xttable 
> where the result depended on what I had in the main text.
What about extend your definition with another parameter?

\newcommand{\xttable}[8]{\starttable[|p(#8)|p(#8)|p(#8)|] ...

KR

Willi

> So, yes, I can use p columns, but that means that all of my tables will 
> hae to have identical column widths. That is why I wanted to use c 
> columns and have that decision in the text. So I would still be 
> interested in a way of doing \parbox in ConTeXt.
> 
> (For non-LaTeX users \parbox{2cm}{text text text text etc} creates a 
> paragraph 2 cm wide and sets the text in it. The height of the box is 
> the result of that typesetting.)
> 
> G
> 
> On Mar 13, 2005, at 16:05, Willi Egger wrote:
> 
>> Hi Gerben,
>>
>> There is no worry about the mentioned chaos. You might be lucky, that 
>> your definition is giving a result at all.
>>
>> If you consult the manual or read the article in the MAPS22 on 
>> tabulating, you will see, that you missed a correct setup of the 
>> tabulation.
>>
>> I attach my version and it works.
>>
>> KR
>> Willi
>>
>> Gerben Wierda wrote:
>>
>>> Here is the example again, now with p columns. Never mind the 
>>> non-working third example (ConTeXt wraps three elements in the third 
>>> column now but not inside the \framed), but it seems that ConTeXt 
>>> does not wrap the first column at all. As a result, the other two are 
>>> very small.
>>> G
>>> PS. The ConTeXT manual does not have \starttable documentation, not 
>>> does the wiki (how does 'p' work etc).
>>> % Try with 'p' columns
>>> \usemodule[bib] % defines \newcommand
>>> \newcommand{\operand}[1]{{\sc #1}}
>>> \newcommand{\ttvalue}[1]{{\sc #1}}
>>> \newcommand{\xttable}[7]{\starttable[|p|p|p|]\HL %
>>> #1 \NC #2 \NC #1 \operand{#3} #2 \SR\HL
>>> \ttvalue{false} \NC \ttvalue{false} \NC \ttvalue{#4} \FR %
>>> \ttvalue{false} \NC \ttvalue{true} \NC \ttvalue{#5} \MR %
>>> \ttvalue{true} \NC \ttvalue{false} \NC \ttvalue{#6} \MR %
>>> \ttvalue{true} \NC \ttvalue{true} \NC \ttvalue{#7} \LR\HL %
>>> \stoptable}
>>> \newcommand{\ttable}[5]{\xttable{a}{b}{#1}{#2}{#3}{#4}{#5}}
>>> \starttext
>>> Looks fine:\blank
>>> \midaligned{%
>>> \xttable{Statement X}{Statement Y}{$\Rightarrow$}%
>>> {unknown}{unknown}{invalid (false)}{valid (true)}
>>> }
>>> This doesn't work:\blank
>>> \midaligned{%
>>> \xttable{Some sort of longer statement}{Another sort of longer 
>>> statement}%
>>> {$\Rightarrow$}%
>>> {unknown}{unknown}{invalid (false)}{valid (true)}
>>> }
>>> This doesn't work either:\blank
>>> \midaligned{%
>>> \xttable{\framed[width=2cm,frame=off]{Some sort\par of longer
>>> statement\par}}{\framed[width=2cm,frame=off]{Another sort\par of longer
>>> statement\par}}{$\Rightarrow$}%
>>> {unknown}{unknown}{invalid (false)}{valid (true)}
>>> }
>>> \stoptext
>>> _______________________________________________
>>> ntg-context mailing list
>>> ntg-context@ntg.nl
>>> http://www.ntg.nl/mailman/listinfo/ntg-context
>>
>> % Truthtables Gerben Wierda
>> % C0ntext file
>> % filename: truthtable-Wierda.tex
>> % Gerben Wierda
>> % W. Egger
>> % 13-03-2005
>>
>> \setupoutput[pdftex]
>> \setupbodyfont[ss,12pt]
>>
>> \usemodule[bib] % defines \newcommand
>> \newcommand{\operand}[1]{{\sc #1}}
>> \newcommand{\ttvalue}[1]{{\sc #1}}
>> \newcommand{\xttable}[7]{\starttable[|p(2cm)|p(5cm)|p(3cm)|]
>> \HL %
>> \NC #1 \NC #2 \NC #1 \operand{#3} #2 \NC\NR
>> \HL
>> \NC \ttvalue{false} \NC \ttvalue{false} \NC \ttvalue{#4} \NC\NR %
>> \NC \ttvalue{false} \NC \ttvalue{true} \NC \ttvalue{#5} \NC\NR %
>> \NC \ttvalue{true} \NC \ttvalue{false} \NC \ttvalue{#6} \NC \NR %
>> \NC \ttvalue{true} \NC \ttvalue{true} \NC \ttvalue{#7} \NC\NR\HL %
>> \stoptable}
>> \newcommand{\ttable}[5]{\xttable{a}{b}{#1}{#2}{#3}{#4}{#5}}
>> \starttext
>> Looks fine:\blank
>> \midaligned{%
>> \xttable{Statement X}{Statement Y}{$\Rightarrow$}%
>> {unknown}{unknown}{invalid (false)}{valid (true)}
>> }
>>
>>
>>  This doesn't work:\blank
>> \midaligned{%
>> \xttable{Some sort of longer statement}{Another sort of longer 
>> statement}%
>> {$\Rightarrow$}%
>> {unknown}{unknown}{invalid (false)}{valid (true)}
>> }
>>
>> % This doesn't work either:\blank
>> % \midaligned{%
>> % \xttable{\framed[width=2cm,frame=off]{Some sort of longer
>> % statement\par}}{\framed[width=2cm,frame=off]{Another sort of longer
>> % statement\par}}{$\Rightarrow$}%
>> % {unknown}{unknown}{invalid (false)}{valid (true)}
>> % }
>> \stoptext
>> _______________________________________________
>> ntg-context mailing list
>> ntg-context@ntg.nl
>> http://www.ntg.nl/mailman/listinfo/ntg-context
> 
> 
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: Why I needed \parbox and why does \framed not work here?
  2005-03-13 14:06   ` Gerben Wierda
                       ` (2 preceding siblings ...)
  2005-03-13 16:57     ` Patrick Gundlach
@ 2005-03-13 20:47     ` mickle
  3 siblings, 0 replies; 11+ messages in thread
From: mickle @ 2005-03-13 20:47 UTC (permalink / raw)


Gerben Wierda <Gerben.Wierda@rna.nl> writes:

> Here is the example again, now with p columns. Never mind the
> non-working third example (ConTeXt wraps three elements in the third
> column now but not inside the \framed), but it seems that ConTeXt does
> not wrap the first column at all. As a result, the other two are very
> small.
> 
> G
> 
> PS. The ConTeXT manual does not have \starttable documentation, not
> does the wiki (how does 'p' work etc).

Have you read the documents .../general/uptodate/up-004 and up-008? I
found them very helpful in learning how to control tables and
tabulations.
-- 

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

* Re: Why I needed \parbox and why does \framed not work here?
  2005-03-13  9:08 Why I needed \parbox and why does \framed not work here? Gerben Wierda
  2005-03-13 10:57 ` Willi Egger
@ 2005-03-14 14:27 ` Taco Hoekwater
  1 sibling, 0 replies; 11+ messages in thread
From: Taco Hoekwater @ 2005-03-14 14:27 UTC (permalink / raw)



Hi Gerben and all,

A slow reaction from me. As the author of the bib module, I urge
everybody *not* to use the module for its side effect of defining
some LaTeX commands, because LaTeX support will almost certainly
be dropped in the near future.

Greetings, Taco

Gerben Wierda wrote:
> I am trying to convert to ConTeXt and I have a text with a lot of truth 
> tables using a \ttable and \xttable command I defined. I ported these to 
> ConTeXt but I can't get the \parbox -> \framed to work.
> 
> % Example document with truth tables starts here
> 
> \usemodule[bib] % defines \newcommand
> \newcommand{\operand}[1]{{\sc #1}}

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

end of thread, other threads:[~2005-03-14 14:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-13  9:08 Why I needed \parbox and why does \framed not work here? Gerben Wierda
2005-03-13 10:57 ` Willi Egger
2005-03-13 13:42   ` Gerben Wierda
2005-03-13 14:06   ` Gerben Wierda
2005-03-13 15:05     ` Willi Egger
2005-03-13 15:59       ` Gerben Wierda
2005-03-13 17:34         ` Willi Egger
2005-03-13 15:12     ` Willi Egger
2005-03-13 16:57     ` Patrick Gundlach
2005-03-13 20:47     ` mickle
2005-03-14 14:27 ` Taco Hoekwater

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