[NTG-context] Fwd: Newlines in a table cel

2011-07-04 Thread Cecil Westerhof
Sorry Hans. I send it to you instead of to the list. And I forgot the files.
Now corrected.

-- Forwarded message --
From: Cecil Westerhof cldwester...@gmail.com
Date: 2011/7/4
Subject: Re: [NTG-context] Newlines in a table cel
To: Hans Hagen pra...@wxs.nl


2011/7/4 Hans Hagen pra...@wxs.nl

 On 4-7-2011 11:59, Cecil Westerhof wrote:

 I have a macro to display MVC (model-view-controller) info:
 \define[3]\MVC{
   \starttabulate[|l|l|]
   \NC \Important[Model]:  \NC #1 \NC\NR
   \NC \Important[View]:   \NC #2 \NC\NR
   \NC \Important[Controller]: \NC #3 \NC\NR
   \stoptabulate
   \myblank
 }

 Sometimes the info is very long. Now it is displayed in one long line that
 scrolls off the screen. How can I change this. Ideally would be if I could
 give in the macro call where a new line should start, but just
 automatically
 formatted would be good enough.


 [|l|lp|]


Thanks. Much better. I did not find this. Did I not look good enough?

Attached a tex and a pdf file. It shows the original and your solution, but
also the preferred solution. (But hard coded, not with a macro.) Would it be
possible to get the preferred solution in a macro?

-- 
Cecil Westerhof



-- 
Cecil Westerhof


dummy.tex
Description: TeX document


dummy.pdf
Description: Adobe PDF document
___
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] Fwd: Newlines in a table cel

2011-07-04 Thread Wolfgang Schuster

Am 04.07.2011 um 12:50 schrieb Cecil Westerhof:

 Attached a tex and a pdf file. It shows the original and your solution, but 
 also the preferred solution. (But hard coded, not with a macro.) Would it be 
 possible to get the preferred solution in a macro?

Tell ConTeXt where is should break the line with “\\”.

\MVCa{usedmodel}{firstViewFromSeveral\\ secondViewFromSeveral\\ 
thirthViewFromSeveral\\ fourthViewFromSeveral}{usedController}

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] Fwd: Newlines in a table cel

2011-07-04 Thread Cecil Westerhof
2011/7/4 Wolfgang Schuster schuster.wolfg...@googlemail.com

  Attached a tex and a pdf file. It shows the original and your solution,
 but also the preferred solution. (But hard coded, not with a macro.) Would
 it be possible to get the preferred solution in a macro?

 Tell ConTeXt where is should break the line with “\\”.

 \MVCa{usedmodel}{firstViewFromSeveral\\ secondViewFromSeveral\\
 thirthViewFromSeveral\\ fourthViewFromSeveral}{usedController}


Thanks. In the dummy.tex it works. In my own document it does not. Looks
like I changed something in my environment. Have to find out what.

-- 
Cecil Westerhof
___
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] Fwd: Newlines in a table cel

2011-07-04 Thread Cecil Westerhof
2011/7/4 Cecil Westerhof cldwester...@gmail.com

 2011/7/4 Wolfgang Schuster schuster.wolfg...@googlemail.com

  Attached a tex and a pdf file. It shows the original and your solution,
 but also the preferred solution. (But hard coded, not with a macro.) Would
 it be possible to get the preferred solution in a macro?

 Tell ConTeXt where is should break the line with “\\”.

 \MVCa{usedmodel}{firstViewFromSeveral\\ secondViewFromSeveral\\
 thirthViewFromSeveral\\ fourthViewFromSeveral}{usedController}


 Thanks. In the dummy.tex it works. In my own document it does not. Looks
 like I changed something in my environment. Have to find out what.


It is not in my environment. The use of \completecontent wreck havoc on
this. See the attachments.

-- 
Cecil Westerhof


dummy.tex
Description: TeX document


dummy.pdf
Description: Adobe PDF document
___
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] Fwd: Newlines in a table cel

2011-07-04 Thread Wolfgang Schuster

Am 04.07.2011 um 14:58 schrieb Cecil Westerhof:

 2011/7/4 Cecil Westerhof cldwester...@gmail.com
 2011/7/4 Wolfgang Schuster schuster.wolfg...@googlemail.com
  Attached a tex and a pdf file. It shows the original and your solution, but 
  also the preferred solution. (But hard coded, not with a macro.) Would it 
  be possible to get the preferred solution in a macro?
 
 Tell ConTeXt where is should break the line with “\\”.
 
 \MVCa{usedmodel}{firstViewFromSeveral\\ secondViewFromSeveral\\ 
 thirthViewFromSeveral\\ fourthViewFromSeveral}{usedController}
 
 Thanks. In the dummy.tex it works. In my own document it does not. Looks like 
 I changed something in my environment. Have to find out what. 
 
 It is not in my environment. The use of \completecontent wreck havoc on this. 
 See the attachments.

This is *not* a minimal working example, neither it’s minimal nor it’s working.

You can fix this by replacing the \\ with \crlf to add a linebreak in the 
entries:

\define[3]\MVC
  {\starttabulate[|l|lp|]
   \NC Model:  \NC #1 \NC\NR
   \NC View:   \NC #2 \NC\NR
   \NC Controller: \NC #3 \NC\NR
   \stoptabulate}

\starttext

\MVC{usedmodel}{firstViewFromSeveral\crlf secondViewFromSeveral\crlf 
thirthViewFromSeveral\crlf fourthViewFromSeveral}{usedController}

\completecontent

\MVC{usedmodel}{firstViewFromSeveral\crlf secondViewFromSeveral\crlf 
thirthViewFromSeveral\crlf fourthViewFromSeveral}{usedController}

\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] Fwd: Newlines in a table cel

2011-07-04 Thread Cecil Westerhof
2011/7/4 Wolfgang Schuster schuster.wolfg...@googlemail.com

 This is *not* a minimal working example, neither it’s minimal nor it’s
 working.


What do you mean by this? I had a problem, thus sure it is not working.


You can fix this by replacing the \\ with \crlf to add a linebreak in the
 entries:


Works like a charm: thanks.

Is it not strange that the behavior is different before and after a
\content?

-- 
Cecil Westerhof
___
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] Fwd: Newlines in a table cel

2011-07-04 Thread Wolfgang Schuster

Am 04.07.2011 um 15:53 schrieb Cecil Westerhof:

 2011/7/4 Wolfgang Schuster schuster.wolfg...@googlemail.com
 This is *not* a minimal working example, neither it’s minimal nor it’s 
 working.
 
 What do you mean by this? I had a problem, thus sure it is not working. 

1. You example is not minimal because you have a lot of unnecessary commands in 
it.

2. Your example does not work because you use commands which aren’t defined in 
the file.

 You can fix this by replacing the \\ with \crlf to add a linebreak in the 
 entries:
 
 Works like a charm: thanks.
 
 Is it not strange that the behavior is different before and after a \content?

No because i had been wrong and \\ isn’t a valid command to end the line
in tabulate, it’s used to write tabulate in a different form, e.g. look
at \startlegend in the manual or at the following example:

\starttext

\definetabulate[test][|l|p|]
\setuptabulate [test][inner=\setquicktabulate\test]

\starttest
\test 1 \\ 2 \\
\test 3 \\ 4 \\
\stoptest

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