Re: [NTG-context] Setting table of contents depth by number rather than by list

2021-12-24 Thread Jason Ross via ntg-context



On 12/24/21 1:29 PM, Denis Maier wrote:


I probably wasn't clear. You will support toc:2.
This:
#+Context_Section_Levels: '(chapter section subsection)
will translate into a definesectionlevels command and inform your 
exporter about the used sectionlevels. Once the used commands are known 
it should be possible to map toc:2 to a combinedlist definition.


I can't require the user to use more document keywords to get the same 
functionality they already have with the other exporters by default.


I am really specifically looking for a way _in ConTeXt_ to create a 
table of contents with depth `n` regardless of the sectioning used.


Jason
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Setting table of contents depth by number rather than by list

2021-12-24 Thread Denis Maier via ntg-context


 
 
  
   
  
  
   
Jason Ross via ntg-context  hat am 24.12.2021 22:22 geschrieben:
   
   

   
   

   
   
On 12/24/21 1:20 PM, Denis Maier via ntg-context wrote:
   
   

   
   
>>
   
   
>> I see.
   
   
>>
   
   
>> Next try: add a new option
   
   
>>
   
   
>> "#+Context_Section_Levels:
   
   
>>
   
   
>> Thus will take an alist. Now you'll know about the user defined
   
   
>> structure levels and the toc option can be translated to the
   
   
>> corresponding setting. (Here again, you can if course define
   
   
>> reasonable defaults.)
   
   

 


 Actually,  you don't need an alist. A simple quotes list should be enough:


 


 #+Context_Section_Levels: '(chapter section subsection)


 >


 
  Denis
 

   
   

   
   

   
   
That isn't going to work. The interface needs to be the same as for the
   
   
other exporters for TOC control. I need to support "toc:2".
   
   
  
  
   I probably wasn't clear. You will support toc:2. 
   
  
  
   This:
   
  
  
   #+Context_Section_Levels: '(chapter section subsection)
  
  
   will translate into a definesectionlevels command and inform your exporter about the used sectionlevels. Once the used commands are known it should be possible to map toc:2 to a combinedlist definition.
   
  
  
   
Jason
   
   
___
   
   
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://context.aanhet.net

   
   
archive : https://bitbucket.org/phg/context-mirror/commits/

   
   
wiki : http://contextgarden.net

   
   
___
   
  
 

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Setting table of contents depth by number rather than by list

2021-12-24 Thread Jason Ross via ntg-context



On 12/24/21 1:20 PM, Denis Maier via ntg-context wrote:



I see.

Next try: add a new option

"#+Context_Section_Levels:

Thus will take an alist. Now you'll know about the user defined 
structure levels and the toc option can be translated to the 
corresponding setting. (Here again, you can if course define 
reasonable defaults.)


Actually,  you don't need an alist. A simple quotes list should be enough:

#+Context_Section_Levels: '(chapter section subsection)


Denis



That isn't going to work. The interface needs to be the same as for the 
other exporters for TOC control. I need to support "toc:2".


Jason
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Setting table of contents depth by number rather than by list

2021-12-24 Thread Denis Maier via ntg-context


 
 
  
   
  
  
   
Denis Maier via ntg-context  hat am 24.12.2021 22:13 geschrieben:
   
   

   
   

   
   

   
   

 Jason Ross via ntg-context  hat am 24.12.2021 18:53 geschrieben:


 


 


 On 12/24/21 9:49 AM, Denis Maier via ntg-context wrote:


 
  For the six = for the toc...
 
 
  
   Denis Maier via ntg-context  hat am 24.12.2021
  
  
   18:42 geschrieben:
  
  
   
  
  
   
  
  
   Can't you just define a default structurelevel scheme and a default
  
  
   combined list for the six. If a user redefines the structure level
  
  
   scheme, they will just redefine the combined list as well. Would that
  
  
   work?
  
  
   
  
  
   Denis
  
 


 


 The way the user specifies TOC depth in Org is e.g. "#+OPTIONS: toc:2".


 All exporters support that method.

   
   

   
   
I see. 

   
   

   
   
Next try: add a new option 

   
   

   
   
"#+Context_Section_Levels:
   
   

   
   
Thus will take an alist. Now you'll know about the user defined structure levels and the toc option can be translated to the corresponding setting. (Here again, you can if course define reasonable defaults.)
   
  
  
   
  
  
   Actually,  you don't need an alist. A simple quotes list should be enough:
   
  
  
   
  
  
   #+Context_Section_Levels: '(chapter section subsection) 
   
  
  

   
   

   
   
Denis 

   
   

 


 Jason


 ___


 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://context.aanhet.net 
 


 archive : https://bitbucket.org/phg/context-mirror/commits/ 
 


 wiki : http://contextgarden.net 
 


 ___

   
  
 

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Setting table of contents depth by number rather than by list

2021-12-24 Thread Denis Maier via ntg-context


 
 
  
   
  
  
   
Jason Ross via ntg-context  hat am 24.12.2021 18:53 geschrieben:
   
   

   
   

   
   
On 12/24/21 9:49 AM, Denis Maier via ntg-context wrote:
   
   

 For the six = for the toc...


 
  Denis Maier via ntg-context  hat am 24.12.2021
 
 
  18:42 geschrieben:
 
 
  
 
 
  
 
 
  Can't you just define a default structurelevel scheme and a default
 
 
  combined list for the six. If a user redefines the structure level
 
 
  scheme, they will just redefine the combined list as well. Would that
 
 
  work?
 
 
  
 
 
  Denis
 

   
   

   
   
The way the user specifies TOC depth in Org is e.g. "#+OPTIONS: toc:2".
   
   
All exporters support that method.
   
  
  
   
  
  
   I see.
   
  
  
   
  
  
   Next try: add a new option 
   
  
  
   
  
  
   "#+Context_Section_Levels:
  
  
   
  
  
   Thus will take an alist. Now you'll know about the user defined structure levels and the toc option can be translated to the corresponding setting. (Here again, you can if course define reasonable defaults.)
   
  
  
   
  
  
   Denis
   
  
  
   
   
Jason
   
   
___
   
   
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://context.aanhet.net

   
   
archive : https://bitbucket.org/phg/context-mirror/commits/

   
   
wiki : http://contextgarden.net

   
   
___
   
  
 

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Setting table of contents depth by number rather than by list

2021-12-24 Thread Jason Ross via ntg-context



On 12/24/21 9:49 AM, Denis Maier via ntg-context wrote:

For the six = for the toc...
Denis Maier via ntg-context  hat am 24.12.2021 
18:42 geschrieben:



Can't you just define a default structurelevel scheme and a default 
combined list for the six. If a user redefines the structure level 
scheme, they will just redefine the combined list as well. Would that 
work?


Denis


The way the user specifies TOC depth in Org is e.g. "#+OPTIONS: toc:2". 
All exporters support that method.


Jason
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Setting table of contents depth by number rather than by list

2021-12-24 Thread Denis Maier via ntg-context


 
 
  
   For the six = for the toc...
   
  
  
   
Denis Maier via ntg-context  hat am 24.12.2021 18:42 geschrieben:
   
   

   
   

   
   
Can't you just define a default structurelevel scheme and a default combined list for the six. If a user redefines the structure level scheme, they will just redefine the combined list as well. Would that work? 

   
   

   
   
Denis 

   
   

 Jason Ross via ntg-context <ntg-context@ntg.nl> hat am 24.12.2021 17:45 geschrieben:


 


 


 Dear list,


 


 Is it possible to set the maximum table of contents depth to a number


 rather than providing an explicit list of section names?


 


 


 Background:


 


 I am developing an exporter for Org mode. In Org, users can specify the


 number of levels they want in the table of contents with a number. I


 currently do this by having the sectioning commands be known to the


 exporter so I can generate a command like


 \setupcombinedlist


 [content]


 [list={section,subsection}]


 for n=2.


 


 I'm considering using \start/stopsectionlevel for sectioning commands


 instead. That way, users could add \definesectionlevels to the document


 preamble to use whatever sectioning scheme they wanted. However, this


 would mean that the exporter wouldn't know what sectioning commands to


 use the TOC setup.


 


 


 Thanks,


 


 Jason


 ___


 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://context.aanhet.net 
 


 archive : https://bitbucket.org/phg/context-mirror/commits/ 
 


 wiki : http://contextgarden.net 
 


 ___

   
  
 

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Setting table of contents depth by number rather than by list

2021-12-24 Thread Denis Maier via ntg-context


 
 
  
   Can't you just define a default structurelevel scheme and a default combined list for the six. If a user redefines the structure level scheme, they will just redefine the combined list as well. Would that work?
   
  
  
   
  
  
   Denis
   
  
  
   
Jason Ross via ntg-context <ntg-context@ntg.nl> hat am 24.12.2021 17:45 geschrieben:
   
   

   
   

   
   
Dear list,
   
   

   
   
Is it possible to set the maximum table of contents depth to a number
   
   
rather than providing an explicit list of section names?
   
   

   
   

   
   
Background:
   
   

   
   
I am developing an exporter for Org mode. In Org, users can specify the
   
   
number of levels they want in the table of contents with a number. I
   
   
currently do this by having the sectioning commands be known to the
   
   
exporter so I can generate a command like
   
   
\setupcombinedlist
   
   
[content]
   
   
[list={section,subsection}]
   
   
for n=2.
   
   

   
   
I'm considering using \start/stopsectionlevel for sectioning commands
   
   
instead. That way, users could add \definesectionlevels to the document
   
   
preamble to use whatever sectioning scheme they wanted. However, this
   
   
would mean that the exporter wouldn't know what sectioning commands to
   
   
use the TOC setup.
   
   

   
   

   
   
Thanks,
   
   

   
   
Jason
   
   
___
   
   
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://context.aanhet.net

   
   
archive : https://bitbucket.org/phg/context-mirror/commits/

   
   
wiki : http://contextgarden.net

   
   
___
   
  
 

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Setting table of contents depth by number rather than by list

2021-12-24 Thread Jason Ross via ntg-context

Dear list,

Is it possible to set the maximum table of contents depth to a number 
rather than providing an explicit list of section names?



Background:

I am developing an exporter for Org mode. In Org, users can specify the 
number of levels they want in the table of contents with a number. I 
currently do this by having the sectioning commands be known to the 
exporter so I can generate a command like

\setupcombinedlist
  [content]
  [list={section,subsection}]
for n=2.

I'm considering using  \start/stopsectionlevel for sectioning commands 
instead. That way, users could add \definesectionlevels to the document 
preamble to use whatever sectioning scheme they wanted. However, this 
would mean that the exporter wouldn't know what sectioning commands to 
use the TOC setup.



Thanks,

Jason
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Neste itemize in table (or vice-versa?)

2021-11-20 Thread Wolfgang Schuster via ntg-context

Alexandre Christe via ntg-context schrieb am 20.11.2021 um 16:19:

Dear all,

I'm trying something out in LMTX, which is to combine itemize with a 
table. Application could be to put a question and the answer in the 
next column.


A minimal example would be:

[...]

The numbering unfortunately starts with i) instead of a). Any 
recommendation which approach shall be preferred?


Use \itemtag to display the itemize counter, the commands ensures you 
get the correct value because most table environments process the cell 
content multiple times which lead to wrong counters.


\starttext

\startsetups [alexandre:1]
    \setupTABLE [start] [frame=off]
    \setupTABLE [c] [1] [width=.3\textwidth]
    \setupTABLE [c] [2] [width=.6\textwidth]
\stopsetups

\startitemize [a] [right=),stopper=]
\bTABLE[setups=alexandre:1]
\bTR \bTD \dontleavehmode\itemtag\quad Something \eTD \bTD Something 
\eTD \eTR
\bTR \bTD \dontleavehmode\itemtag\quad Something \eTD \bTD Something 
\eTD \eTR
\bTR \bTD \dontleavehmode\itemtag\quad Something \eTD \bTD Something 
\eTD \eTR
\bTR \bTD \dontleavehmode\itemtag\quad Something \eTD \bTD Something 
\eTD \eTR

\eTABLE
\stopitemize

\startsetups [alexandre:2]
    \setupTABLE [start] [frame=off]
    \setupTABLE [c] [2] [width=.2\textwidth]
    \setupTABLE [c] [3] [width=.6\textwidth]
\stopsetups

\startitemize [a] [right=),stopper=]
\bTABLE[setups=alexandre:2]
\bTR \bTD \itemtag \eTD \bTD Something \eTD \bTD Something \eTD \eTR
\bTR \bTD \itemtag \eTD \bTD Something \eTD \bTD Something \eTD \eTR
\bTR \bTD \itemtag \eTD \bTD Something \eTD \bTD Something \eTD \eTR
\bTR \bTD \itemtag \eTD \bTD Something \eTD \bTD Something \eTD \eTR
\eTABLE
\stopitemize

\startitemize [a] [right=),stopper=]
\starttabulate[|l|lw(.2\textwidth)|p|]
\NC \itemtag \NC Something \NC Something \NC\NR
\NC \itemtag \NC Something \NC Something \NC\NR
\NC \itemtag \NC Something \NC Something \NC\NR
\NC \itemtag \NC Something \NC Something \NC\NR
\stoptabulate
\stopitemize

\startitemize [a] [right=),stopper=]
\starttabulate[|l|lw(.2\textwidth)|p|]
\NI Something \NC Something \NC\NR
\NI Something \NC Something \NC\NR
\NI Something \NC Something \NC\NR
\NI Something \NC Something \NC\NR
\stoptabulate
\stopitemize

\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Neste itemize in table (or vice-versa?)

2021-11-20 Thread Alexandre Christe via ntg-context
Dear all,

I'm trying something out in LMTX, which is to combine itemize with a table.
Application could be to put a question and the answer in the next column.

A minimal example would be:

\starttext
\startitemize [a] [right=),stopper=]
\bTABLE[frame=off]
  \setupTABLE[column][1] [width=.3\textwidth]
  \setupTABLE[column][2] [width=.6\textwidth]
\bTR
  \bTD \item Something \eTD
  \bTD Something \eTD
\eTR
\bTR
  \bTD \item Something \eTD
  \bTD Something \eTD
\eTR
\bTR
  \bTD \item Something \eTD
  \bTD Something \eTD
\eTR
\bTR
  \bTD \item Something \eTD
  \bTD Something \eTD
\eTR
\eTABLE
\stopitemize
\stoptext

The numbering unfortunately starts with i) instead of a). Any
recommendation which approach shall be preferred?

Thanks in advance!
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Automatically adjust number of table columns

2021-09-05 Thread Sylvain Hubert via ntg-context
Dear List,

I'm trying to make "\startchoice", "\stopchoice", and "\choice", such that:

\startchoice
\choice -1
\choice 0
\choice 1
\choice N/A
\stopchoice

results in (_ for whitespace)

A. -1__B. 0__C. 1__D. N/A

while

\startchoice
\choice not so short choice
\choice must wrap here
\choice another choice
\choice yet another choice
\stopchoice

results in

A. not so short choiceB. must wrap here
C. another choice___D. yet another choice

In another word, it should have the same effect as the addData() function
in the page below (save as whatever.html and open it)




table { width: 100%; border: 1px solid black; }
#root { width: 10cm; }








function make(tag, children) {
const node = document.createElement(tag);
for (const c of children) {
if (typeof c === "string") {
node.appendChild(document.createTextNode(c));
} else {
node.appendChild(c);
}
}
return node;
}

function addData(data) {
const root = document.getElementById("root");

let table = make("table", [make("tr", data.map(d => make("td", [d])))]);
root.appendChild(table);
if (table.scrollWidth <= root.offsetWidth) {
return;
}

root.removeChild(table);
table = make("table", [
make("tr", [make("td", [data[0]]), make("td", [data[1]])]),
make("tr", [make("td", [data[2]]), make("td", [data[3]])]),
]);
root.appendChild(table);
if (table.scrollWidth <= root.offsetWidth) {
return;
}

root.removeChild(table);
table = make("table", data.map(d => make("tr", [make("td", [d])])));
root.appendChild(table);
}

addData(["1".repeat(10), "2".repeat(10), "3".repeat(10), "4".repeat(10), ]);
addData(["1".repeat(20), "2".repeat(20), "3".repeat(20), "4".repeat(20), ]);
addData(["1".repeat(30), "2".repeat(30), "3".repeat(30), "4".repeat(30), ]);




Does anyone have an idea how it can be implemented in context?

Thanks in advance!

Best,
Sylvain
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How not to display the header of the chapter page on the page with the table of contents ?

2021-08-16 Thread Wolfgang Schuster via ntg-context

Fabrice Couvreur via ntg-context schrieb am 16.08.2021 um 12:18:

Hi Wolfgang,
Pablo's solution works, but I tried yours without success. Here are 
the main lines of my project


 begin project
\startproject[terminale-environment]

\environment[terminale-style]
 ...
\stopproject
 end project


Do you need a project file?


 begin component
\project[terminale-environment]

\startcomponent[terminale_recurrence]
...
\endcomponent
 end component


You ignored the order for \startcomponent and \project. The environment 
(or project) file has to be loaded *after* \startcomponent, otherwise 
the *component mode is set after the style is already loaded.


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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Adjustment in the table of contents

2021-08-16 Thread Wolfgang Schuster via ntg-context

Fabrice Couvreur via ntg-context schrieb am 16.08.2021 um 11:24:

Hi,
I wish to have the table of contents as the attached image. The result 
is almost as expected except for the margin of the subsection.


 \setuplist
   [chapter,section,subsection]
 [width=fit,distance=\spaceamount]

 \setuplist
   [chapter]
 [alternative=b]

 \setuplist [chapter][style=bold]


 \setuplist [section]    [margin=1em]
 \setuplist [subsection] [margin=2.75em]



Use fixed values for the width.

\setuplist
  [chapter]
  [width=1em]


\setuplist
  [section]
  [margin=1em,% chapter width
   width=1.75em]

\setuplist
  [subsection]
  [margin=2.75em,% chapter width + section width
   width=2em]

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How not to display the header of the chapter page on the page with the table of contents ?

2021-08-16 Thread Fabrice Couvreur via ntg-context
Hi Wolfgang,
Pablo's solution works, but I tried yours without success. Here are the
main lines of my project

 begin product
\startproduct[terminale-manual]

\project[terminale-environment]

\startdocument

\startfrontmatter
...
\stopfrontmatter

\startbodymatter
\component[terminale_recurrence]
...
\stopbodymatter

\stopdocument

\stopproduct
 end product

 begin project
\startproject[terminale-environment]

\environment[terminale-style]
 ...
\stopproject
 end project

 begin component
\project[terminale-environment]

\startcomponent[terminale_recurrence]
...
\endcomponent
 end component

 begin environment
\startenvironment[terminale-style]
...
\startsetups [section:chapter]

\setuphead
   [chapter]
   [align=flushright,
textcommand=\groupedcommand{\blank[medium]}{},
numbercolor=darkgray,
textstyle=ChapterTextStyle,
numberstyle=ChapterNumberStyle,
before=\startChapterFrame,
after=\stopChapterFrame,
header=high]

\stopsetups

\startsectionblockenvironment [bodypart]
 \directsetup{section:chapter}
\stopsectionblockenvironment

\doifmode{*component}{\directsetup{section:chapter}}

...
\endenvironment
 end environment

Le dim. 15 août 2021 à 19:03, Wolfgang Schuster via ntg-context <
ntg-context@ntg.nl> a écrit :

> Pablo Rodriguez via ntg-context schrieb am 15.08.2021 um 18:33:
> > On 8/15/21 6:02 PM, Fabrice Couvreur via ntg-context wrote:
> >> A small note : this method works if I compile the project but if I
> >> compile only one chapter, the header no longer appears.
> > Hi Fabrice,
> >
> > I have never used projects and chapters (or whatever the right name is).
> >
> > I’m not sure I get what you’re experiencing: with a single chapter, do
> > you have the fancy layout or not?
> >
> > It would make sense that the fancy chapter doesn’t appear only compiling
> > a chapter. I guess there is no \startbodymatter...\stopbodymatter
> > wrapping it.
> >
> > Another approach would be:
> >
> > [...]
>
> Setting values for \title is a way to avoid the chapter setup for the
> table of contents etc.
> but there is a way to set values which are used only when you process a
> component file.
>
> To make it work one has to load the environment file after
> \startcomponent because you
> can use the *component mode to check whether the parent file is a
> product or a component.
>
>  begin product
> \startproduct [*]
>
> \environment [...]
>
> \startfrontmatter
> ...
> \stopfrontmatter
>
> \startbodymatter
> \component [...]
> \stopbodymatter
>
> \stopproduct
>  end product
>
>  begin component
> \startcomponent [*]
>
> \environment [...]
>
> ...
>
> \stopcomponent
>  end component
>
>  begin environment
> \startenvironment [*]
>
> \startsetups [section:chapter]
>
>  \setuphead
>  [chapter]
>  [...]
>
> \stopsetups
>
> \startsectionblockenvironment [bodypart]
>  \directsetup{section:chapter}
> \stopsectionblockenvironment
>
> \doifmode{*component}{\directsetup{section:chapter}}
>
> \stopenvironment
>  end environment
>
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Adjustment in the table of contents

2021-08-16 Thread Fabrice Couvreur via ntg-context
Hi,
I wish to have the table of contents as the attached image. The result is
almost as expected except for the margin of the subsection.

 \setuplist
   [chapter,section,subsection]
   [width=fit,distance=\spaceamount]

 \setuplist
   [chapter]
   [alternative=b]

 \setuplist [chapter][style=bold]


 \setuplist [section][margin=1em]
 \setuplist [subsection] [margin=2.75em]

Thanks
Fabrice
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How not to display the header of the chapter page on the page with the table of contents ?

2021-08-15 Thread Wolfgang Schuster via ntg-context

Pablo Rodriguez via ntg-context schrieb am 15.08.2021 um 18:33:

On 8/15/21 6:02 PM, Fabrice Couvreur via ntg-context wrote:

A small note : this method works if I compile the project but if I
compile only one chapter, the header no longer appears.

Hi Fabrice,

I have never used projects and chapters (or whatever the right name is).

I’m not sure I get what you’re experiencing: with a single chapter, do
you have the fancy layout or not?

It would make sense that the fancy chapter doesn’t appear only compiling
a chapter. I guess there is no \startbodymatter...\stopbodymatter
wrapping it.

Another approach would be:

[...]


Setting values for \title is a way to avoid the chapter setup for the 
table of contents etc.
but there is a way to set values which are used only when you process a 
component file.


To make it work one has to load the environment file after 
\startcomponent because you
can use the *component mode to check whether the parent file is a 
product or a component.


 begin product
\startproduct [*]

\environment [...]

\startfrontmatter
...
\stopfrontmatter

\startbodymatter
\component [...]
\stopbodymatter

\stopproduct
 end product

 begin component
\startcomponent [*]

\environment [...]

...

\stopcomponent
 end component

 begin environment
\startenvironment [*]

\startsetups [section:chapter]

    \setuphead
    [chapter]
    [...]

\stopsetups

\startsectionblockenvironment [bodypart]
    \directsetup{section:chapter}
\stopsectionblockenvironment

\doifmode{*component}{\directsetup{section:chapter}}

\stopenvironment
 end environment

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How not to display the header of the chapter page on the page with the table of contents ?

2021-08-15 Thread Fabrice Couvreur via ntg-context
Hi Pablo,
The second solution works as I want it to
Thanks
Fabrice

Le dim. 15 août 2021 à 18:33, Pablo Rodriguez via ntg-context <
ntg-context@ntg.nl> a écrit :

> On 8/15/21 6:02 PM, Fabrice Couvreur via ntg-context wrote:
> > A small note : this method works if I compile the project but if I
> > compile only one chapter, the header no longer appears.
>
> Hi Fabrice,
>
> I have never used projects and chapters (or whatever the right name is).
>
> I’m not sure I get what you’re experiencing: with a single chapter, do
> you have the fancy layout or not?
>
> It would make sense that the fancy chapter doesn’t appear only compiling
> a chapter. I guess there is no \startbodymatter...\stopbodymatter
> wrapping it.
>
> Another approach would be:
>
> \setuphead
>[chapter]
>[align=flushright,
> textcommand=\groupedcommand{\blank[medium]}{},
> numbercolor=darkgray,
> textstyle=ChapterTextStyle,
> numberstyle=ChapterNumberStyle,
> before=\startChapterFrame,
> after=\stopChapterFrame,
> header=high]
>
> \setuphead
>   [title]
>   [header=empty,
>align=,
>textcommand=,
>textstyle=,
>style=\tfc,
>before={\blank[2*big]},
>after={\blank[2*big]}]
>
> I hope it helps,
>
> Pablo
>
> --
> http://www.ousia.tk
>
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How not to display the header of the chapter page on the page with the table of contents ?

2021-08-15 Thread Pablo Rodriguez via ntg-context
On 8/15/21 6:02 PM, Fabrice Couvreur via ntg-context wrote:
> A small note : this method works if I compile the project but if I
> compile only one chapter, the header no longer appears.

Hi Fabrice,

I have never used projects and chapters (or whatever the right name is).

I’m not sure I get what you’re experiencing: with a single chapter, do
you have the fancy layout or not?

It would make sense that the fancy chapter doesn’t appear only compiling
a chapter. I guess there is no \startbodymatter...\stopbodymatter
wrapping it.

Another approach would be:

\setuphead
   [chapter]
   [align=flushright,
textcommand=\groupedcommand{\blank[medium]}{},
numbercolor=darkgray,
textstyle=ChapterTextStyle,
numberstyle=ChapterNumberStyle,
before=\startChapterFrame,
after=\stopChapterFrame,
header=high]

\setuphead
  [title]
  [header=empty,
   align=,
   textcommand=,
   textstyle=,
   style=\tfc,
   before={\blank[2*big]},
   after={\blank[2*big]}]

I hope it helps,

Pablo

--
http://www.ousia.tk
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How not to display the header of the chapter page on the page with the table of contents ?

2021-08-15 Thread Fabrice Couvreur via ntg-context
A small note : this method works if I compile the project but if I compile
only one chapter, the header no longer appears.

Le dim. 15 août 2021 à 17:01, Fabrice Couvreur 
a écrit :

> Hi Pablo,
> Thanks, it works.
> Fabrice
>
> Le dim. 15 août 2021 à 16:20, Pablo Rodriguez via ntg-context <
> ntg-context@ntg.nl> a écrit :
>
>> On 8/15/21 12:49 PM, Fabrice Couvreur via ntg-context wrote:
>> > Hello,
>> > Wolfgang created a
>> > heading https://mailman.ntg.nl/pipermail/ntg-context/2021/102870.html
>> > for the chapters of my book.
>> > How can I prevent this header from appearing on the page with the table
>> > of contents ?
>>
>> Hi Fabrice,
>>
>> a simple way would be:
>>
>>   \startsectionblockenvironment[bodypart]
>> \setuphead
>>[chapter]
>>[align=flushright,
>> textcommand=\groupedcommand{\blank[medium]}{},
>> numbercolor=darkgray,
>> textstyle=ChapterTextStyle,
>> numberstyle=ChapterNumberStyle,
>> before=\startChapterFrame,
>> after=\stopChapterFrame,
>> header=high]
>>   \stopsectionblockenvironment
>>
>> Then use frontmatter and bodymatter.
>>
>> Just in case it might help,
>>
>> Pablo
>> --
>> http://www.ousia.tk
>>
>> ___
>> 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://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : http://contextgarden.net
>>
>> ___
>>
>
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How not to display the header of the chapter page on the page with the table of contents ?

2021-08-15 Thread Fabrice Couvreur via ntg-context
Hi Pablo,
Thanks, it works.
Fabrice

Le dim. 15 août 2021 à 16:20, Pablo Rodriguez via ntg-context <
ntg-context@ntg.nl> a écrit :

> On 8/15/21 12:49 PM, Fabrice Couvreur via ntg-context wrote:
> > Hello,
> > Wolfgang created a
> > heading https://mailman.ntg.nl/pipermail/ntg-context/2021/102870.html
> > for the chapters of my book.
> > How can I prevent this header from appearing on the page with the table
> > of contents ?
>
> Hi Fabrice,
>
> a simple way would be:
>
>   \startsectionblockenvironment[bodypart]
> \setuphead
>[chapter]
>[align=flushright,
> textcommand=\groupedcommand{\blank[medium]}{},
> numbercolor=darkgray,
> textstyle=ChapterTextStyle,
> numberstyle=ChapterNumberStyle,
> before=\startChapterFrame,
> after=\stopChapterFrame,
> header=high]
>   \stopsectionblockenvironment
>
> Then use frontmatter and bodymatter.
>
> Just in case it might help,
>
> Pablo
> --
> http://www.ousia.tk
>
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How not to display the header of the chapter page on the page with the table of contents ?

2021-08-15 Thread Pablo Rodriguez via ntg-context
On 8/15/21 12:49 PM, Fabrice Couvreur via ntg-context wrote:
> Hello,
> Wolfgang created a
> heading https://mailman.ntg.nl/pipermail/ntg-context/2021/102870.html
> for the chapters of my book.
> How can I prevent this header from appearing on the page with the table
> of contents ?

Hi Fabrice,

a simple way would be:

  \startsectionblockenvironment[bodypart]
\setuphead
   [chapter]
   [align=flushright,
textcommand=\groupedcommand{\blank[medium]}{},
numbercolor=darkgray,
textstyle=ChapterTextStyle,
numberstyle=ChapterNumberStyle,
before=\startChapterFrame,
after=\stopChapterFrame,
header=high]
  \stopsectionblockenvironment

Then use frontmatter and bodymatter.

Just in case it might help,

Pablo
--
http://www.ousia.tk
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] How not to display the header of the chapter page on the page with the table of contents ?

2021-08-15 Thread Fabrice Couvreur via ntg-context
Hello,
Wolfgang created a heading
https://mailman.ntg.nl/pipermail/ntg-context/2021/102870.html for the
chapters of my book.
How can I prevent this header from appearing on the page with the table of
contents ?
Thanks
Fabrice
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to place text before a table inside a column environment

2021-07-22 Thread Michael Guravage
Thanks for the suggestion.

I've already tried columnsets. With or without grid=yes, with or without a
columnspan, using columnsets produces the following log even though the
table fits on one page.

pages   > flushing realpage 1, userpage 1, subpage 1
pages   > flushing realpage 2, userpage 2, subpage 2
pages   > flushing realpage 3, userpage 3, subpage 3
pages   > flushing realpage 4, userpage 4, subpage 4
pages   > flushing realpage 5, userpage 5, subpage 5
pages   > flushing realpage 6, userpage 6, subpage 6
pages   > flushing realpage 7, userpage 7, subpage 7
pages   > flushing realpage 8, userpage 8, subpage 8
pages   > flushing realpage 9, userpage 9, subpage 9
pages   > flushing realpage 10, userpage 10, subpage 10
pages   > flushing realpage 11, userpage 11, subpage 11
pages   > flushing realpage 12, userpage 12, subpage 12
pages   > flushing realpage 13, userpage 13, subpage 13
pages   > flushing realpage 14, userpage 14, subpage 14
pages   > flushing realpage 15, userpage 15, subpage 15
pages   > flushing realpage 16, userpage 16, subpage 16
pages   > flushing realpage 17, userpage 17, subpage 17
pages   > flushing realpage 18, userpage 18, subpage 18
pages   > flushing realpage 19, userpage 19, subpage 19
pages   > flushing realpage 20, userpage 20, subpage 20
pages   > flushing realpage 21, userpage 21, subpage 21
...

I stopped counting at 200,

Cheers,

Michael




On Thu, Jul 22, 2021 at 1:14 PM Henning Hraban Ramm  wrote:

> columnsets need \setuplayout[grid=yes] – did you check that?
>
> HR
>
> > Am 22.07.2021 um 12:42 schrieb Michael Guravage :
> >
> > No, I'm afraid not. I have been combining the various table and column
> environments, all without success - yet.
> >
> > Michael
> >
> >
> >
> > On Thu, Jul 22, 2021 at 12:01 PM Henning Hraban Ramm 
> wrote:
> > Hi Michael,
> >
> > you could try columnsets and use a columnsetspan for the text above the
> columns.
> >
> > I don’t know if tables work well within a columnset, though.
> >
> > Hraban
> >
> >
> > > Am 22.07.2021 um 11:52 schrieb Michael Guravage <
> gurav...@literatesolutions.com>:
> > >
> > > I have created a table and placed it inside a columns environment;
> which works as advertised. However, if I place any text before the column
> environment, the columns break. More clearly stated, only one column
> appears on the first table page; whereas two columns resume on subsequent
> pages. I have attached a mwe where you can use --mode=title to invoke the
> broken columns.
> > >
> > > Any advice on how to place text above the columns environment would be
> gratefully received.
> > >
> > > With kind regards,
> > >
> > > Michael
> > >
> > >
> ___
> > > 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://context.aanhet.net
> > > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > > wiki : http://contextgarden.net
> > >
> ___
> >
> >
> ___
> > 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://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : http://contextgarden.net
> >
> ___
> >
> ___
> > 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://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : http://contextgarden.net
> >

Re: [NTG-context] How to place text before a table inside a column environment

2021-07-22 Thread Henning Hraban Ramm
columnsets need \setuplayout[grid=yes] – did you check that?

HR

> Am 22.07.2021 um 12:42 schrieb Michael Guravage :
> 
> No, I'm afraid not. I have been combining the various table and column 
> environments, all without success - yet.
> 
> Michael
> 
> 
> 
> On Thu, Jul 22, 2021 at 12:01 PM Henning Hraban Ramm  wrote:
> Hi Michael,
> 
> you could try columnsets and use a columnsetspan for the text above the 
> columns.
> 
> I don’t know if tables work well within a columnset, though.
> 
> Hraban
> 
> 
> > Am 22.07.2021 um 11:52 schrieb Michael Guravage 
> > :
> > 
> > I have created a table and placed it inside a columns environment; which 
> > works as advertised. However, if I place any text before the column 
> > environment, the columns break. More clearly stated, only one column 
> > appears on the first table page; whereas two columns resume on subsequent 
> > pages. I have attached a mwe where you can use --mode=title to invoke the 
> > broken columns. 
> > 
> > Any advice on how to place text above the columns environment would be 
> > gratefully received.
> > 
> > With kind regards,
> > 
> > Michael
> > 
> > ___
> > 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://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : http://contextgarden.net
> > ___
> 
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to place text before a table inside a column environment

2021-07-22 Thread Michael Guravage
No, I'm afraid not. I have been combining the various table and column
environments, all without success - yet.

Michael



On Thu, Jul 22, 2021 at 12:01 PM Henning Hraban Ramm  wrote:

> Hi Michael,
>
> you could try columnsets and use a columnsetspan for the text above the
> columns.
>
> I don’t know if tables work well within a columnset, though.
>
> Hraban
>
>
> > Am 22.07.2021 um 11:52 schrieb Michael Guravage <
> gurav...@literatesolutions.com>:
> >
> > I have created a table and placed it inside a columns environment; which
> works as advertised. However, if I place any text before the column
> environment, the columns break. More clearly stated, only one column
> appears on the first table page; whereas two columns resume on subsequent
> pages. I have attached a mwe where you can use --mode=title to invoke the
> broken columns.
> >
> > Any advice on how to place text above the columns environment would be
> gratefully received.
> >
> > With kind regards,
> >
> > Michael
> >
> >
> ___
> > 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://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : http://contextgarden.net
> >
> ___
>
>
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to place text before a table inside a column environment

2021-07-22 Thread Henning Hraban Ramm
Hi Michael,

you could try columnsets and use a columnsetspan for the text above the columns.

I don’t know if tables work well within a columnset, though.

Hraban


> Am 22.07.2021 um 11:52 schrieb Michael Guravage 
> :
> 
> I have created a table and placed it inside a columns environment; which 
> works as advertised. However, if I place any text before the column 
> environment, the columns break. More clearly stated, only one column appears 
> on the first table page; whereas two columns resume on subsequent pages. I 
> have attached a mwe where you can use --mode=title to invoke the broken 
> columns. 
> 
> Any advice on how to place text above the columns environment would be 
> gratefully received.
> 
> With kind regards,
> 
> Michael
> 
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] How to place text before a table inside a column environment

2021-07-22 Thread Michael Guravage
I have created a table and placed it inside a columns environment; which
works as advertised. However, if I place any text before the column
environment, the columns break. More clearly stated, only one column
appears on the first table page; whereas two columns resume on subsequent
pages. I have attached a mwe where you can use --mode=title to invoke the
broken columns.

Any advice on how to place text above the columns environment would be
gratefully received.

With kind regards,

Michael
\startsetups[tablesettings]
  \setupTABLE[c][1][style=\tfc, color=darkred, align=left]
  \setupTABLE[c][2][width=3cm, align=middle]
  \setupTABLE[c][each][frame=off]
\stopsetups

\switchtobodyfont[10pt]

\starttext
  \doifmode{title}{\title{Rooster}}

  \startcolumns[n=2]
\bTABLE[split=yes, setups=tablesettings]
\dorecurse{75}{\bTR \bTD 25 \eTD \bTD aug, wo \eTD \bTD Lecture \eTD \eTR}
\eTABLE
  \stopcolumns
\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] \startplacetable[location=none] doesn't have a "Table X" label, but \startplacetable[location=force] does

2021-06-15 Thread T. Kurt Bond
That did it!  Thanks!

On Mon, Jun 14, 2021 at 5:52 AM Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> wrote:

> T. Kurt Bond  schrieb am Mo., 14. Juni 2021, 09:23:
>
>> I've got three questions:
>>
>>1.
>>
>>I've got a document with some xtables. If I use
>>\startplacetable[location=none] the tables *don't* have a "Table X"
>>label, but they float and end up in locations where I don't want them. If 
>> I
>>use \startplacetable[location=force] the tables *do* have a "Table X"
>>label (which I don't want), but the tables *do* show up where I want
>>them, that is, they don't float.
>>
>>How do I get rid of the "Table X" label when I use
>>\startplacetable[location=force]?
>>
>>
> \startplacetable [location={force,none}]
>
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>


-- 
T. Kurt Bond, tkurtb...@gmail.com, https://tkurtbond.github.io
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] \startplacetable[location=none] doesn't have a "Table X" label, but \startplacetable[location=force] does

2021-06-14 Thread Wolfgang Schuster
T. Kurt Bond  schrieb am Mo., 14. Juni 2021, 09:23:

> I've got three questions:
>
>1.
>
>I've got a document with some xtables. If I use
>\startplacetable[location=none] the tables *don't* have a "Table X"
>label, but they float and end up in locations where I don't want them. If I
>use \startplacetable[location=force] the tables *do* have a "Table X"
>label (which I don't want), but the tables *do* show up where I want
>them, that is, they don't float.
>
>How do I get rid of the "Table X" label when I use
>\startplacetable[location=force]?
>
>
\startplacetable [location={force,none}]

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] \startplacetable[location=none] doesn't have a "Table X" label, but \startplacetable[location=force] does

2021-06-14 Thread T. Kurt Bond
I've got three questions:

   1.

   I've got a document with some xtables. If I use
   \startplacetable[location=none] the tables *don't* have a "Table X"
   label, but they float and end up in locations where I don't want them. If I
   use \startplacetable[location=force] the tables *do* have a "Table X"
   label (which I don't want), but the tables *do* show up where I want
   them, that is, they don't float.

   How do I get rid of the "Table X" label when I use
   \startplacetable[location=force]?
   2.

   Also, when I constructed the example I used

   \startmode[locationforce]
   \startplacetable[location=force]
   \stopmode
   \startnotmode[locationforce]
   \startplacetable[location=none]
   \stopmode

   so I could build both outputs from the same input file. When the
   locationforce mode was *not* set the command finished with no errors,
   but when the locationforce mode *was* set the command finished with the
   error:

   tex error   > tex error on line 229 in file
./table-location-label-wrong.ctx: The file ended when scanning an
argument.

   however, when I used

   
\doifmodeelse{locationforce}{\startplacetable[location=force]}{\startplacetable[location=none]}

   instead, it worked fine.
   3.

   Even when I use the --noconsole option on my context invocation, there
   is a lot of information that is written to the console. It looks like the
   information is repeated for each run context makes over the file. Is there
   some way to get this information to show up in the log file, instead of on
   the console?

ConTeXt's version information:

ConTeXt  ver: 2021.06.13 19:21 LMTX  fmt: 2021.6.13  int: english/english.

I've attached my example (table-location-label.ctx), the GNUmakefile I use
to build it using --mode so that the same source produces both the version
with location=force and location=none, and the two PDF output files (
table-location-label-none.pdf and table-location-label-force.pdf).

I've also attached the version where I tried to use \startmode/\startnotmode
 (table-location-label-wrong.ctx).

-- 
T. Kurt Bond, tkurtb...@gmail.com, https://tkurtbond.github.io


table-location-label-force.pdf
Description: Adobe PDF document


table-location-label-none.pdf
Description: Adobe PDF document


table-location-label-wrong.ctx
Description: Binary data


table-location-label.ctx
Description: Binary data
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Expanding a table into the second column

2021-05-22 Thread Jeroen
In a document with two columns, is there a method to expand a table
partially into the second column in case there are many tablecolumns to show
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] NotoColorEmoji - loca table not found

2021-05-14 Thread Hans Hagen

On 5/14/2021 6:33 PM, Adam Reviczky wrote:

Hi Hans,

Yes, sorry about the error :).

Thanks for the explanation, will use lmtx for that, though probably best 
just using another font (some mentioned on the list 
https://www.mail-archive.com/ntg-context@ntg.nl/msg92800.html 
 and 
https://mailman.ntg.nl/pipermail/ntg-context/2020/098136.html 
) or svg 
or metapost as I do not need it in colour.


I spend quite a bit of time looking into this (it's already a while ago 
when I implemented all this and color stuff in otf is a bit of a mess 
and evolving, so in retrospect it's probably better to wait a few years 
to see how that works out; the same for variable fonts ... hadr to deal 
with when there are not many fonts and fuzzy specs.)


Anyway, the problem is this: these png emoji are using palettes + masks 
and that combinaiton gives:


- with gm (gs) : white background
- with mutool  : black background
- with luatex  : a mess
- with lmtx: what we want

now, testing all this takes a lot of time in mkiv because building the 
cache file takes time, so it's one of these moments i wonder if a modern 
machine would do better than my old but reliable machine. The outcome is 
that in mkiv one can do this:


\enabledirectives[backend.otfpng.method=lmtx]   % the real deal, slow
\enabledirectives[backend.otfpng.method=mutool] % black bg
\enabledirectives[backend.otfpng.method=gm] % white bg, default

So, when you have a fast machine or a coffe break, you can use the lmtx 
method (can be configures in cont-loc.mkiv).


As manetioned, in lmtx it is done differently so no penalties there.

I thought it would be easier via fonts but backtracking on the idea now 
and maybe using something like this instead: 
https://thenounproject.com/term/handshake/153516/ 
.
btw, some emoji fonts have both bw outlines and bitmap color, some use 
png (bloated), and microsoft fonts have efficient outline color (nice 
mechanism).


Hans

(who never uses emoji)


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] NotoColorEmoji - loca table not found

2021-05-14 Thread Adam Reviczky
Hi Hans,

Yes, sorry about the error :).

Thanks for the explanation, will use lmtx for that, though probably best
just using another font (some mentioned on the list
https://www.mail-archive.com/ntg-context@ntg.nl/msg92800.html and
https://mailman.ntg.nl/pipermail/ntg-context/2020/098136.html) or svg or
metapost as I do not need it in colour.

I thought it would be easier via fonts but backtracking on the idea now and
maybe using something like this instead:
https://thenounproject.com/term/handshake/153516/.

Thank you,
Adam

On Fri, May 14, 2021 at 4:33 PM Hans Hagen  wrote:

> On 5/14/2021 3:21 AM, Jairo A. del Rio wrote:
> >
> >
> > El jue, 13 de may. de 2021 a la(s) 19:52, Adam Reviczky
> > (revic...@gmail.com ) escribió:
> >
> > Thanks Jairo,
> >
> > That indeed works, should've read that it is bitmap only.
> >
> > I do get a white background though (MKIV), is that how the bitmap is
> > stored?
> >
> >
> > In LuaLaTeX with Harfbuzz shaper as well as ConTeXt LMTX, transparency
> > is properly handled, so I suppose ConTeXt MkIV is to blame in this case.
> > In case you understand how does ConTeXt handle with bitmap fonts,
> > relevant files are under
> >
> /home/coragyps/lmtx/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/fonts/
> >
> > \definefontfeature[Emoji][default][sbix=yes]
> >
> > \starttext
> >
> >
>  
> \framed[background=color,background=black]{\definedfont[file:NotoColorEmoji.ttf*Emoji]\char"1F91D}
>
> took me quite a while to realize that there is an error in that line
>
> > \stoptext
> >
> >
> > In Hans' example for applecoloremoji there is no white background
> > (page 5, bachotex-2017-emoji.pdf).
> >
> > I also do not get a white background with LibreOfiice.
> >
> >
> >
> > I'd wait for Hans to fix it, as I don't really understand font
> > management in ConTeXt...
> in lmtx we use a different method
>
> in mkiv we can actually switch to a variant that was on hold till
> texlive release (i.e. luatex 1.13, i forgot about that)
>
> even then, because we cache the problem in mkiv is more with the
> conversion tools that drop masks ..
>
> Hans
>
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] NotoColorEmoji - loca table not found

2021-05-14 Thread Hans Hagen

On 5/14/2021 3:21 AM, Jairo A. del Rio wrote:



El jue, 13 de may. de 2021 a la(s) 19:52, Adam Reviczky 
(revic...@gmail.com ) escribió:


Thanks Jairo,

That indeed works, should've read that it is bitmap only.

I do get a white background though (MKIV), is that how the bitmap is
stored?


In LuaLaTeX with Harfbuzz shaper as well as ConTeXt LMTX, transparency 
is properly handled, so I suppose ConTeXt MkIV is to blame in this case. 
In case you understand how does ConTeXt handle with bitmap fonts, 
relevant files are under 
/home/coragyps/lmtx/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/fonts/


\definefontfeature[Emoji][default][sbix=yes]

\starttext


\framed[background=color,background=black]{\definedfont[file:NotoColorEmoji.ttf*Emoji]\char"1F91D}


took me quite a while to realize that there is an error in that line


\stoptext


In Hans' example for applecoloremoji there is no white background
(page 5, bachotex-2017-emoji.pdf).

I also do not get a white background with LibreOfiice.



I'd wait for Hans to fix it, as I don't really understand font 
management in ConTeXt...

in lmtx we use a different method

in mkiv we can actually switch to a variant that was on hold till 
texlive release (i.e. luatex 1.13, i forgot about that)


even then, because we cache the problem in mkiv is more with the 
conversion tools that drop masks ..


Hans



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] NotoColorEmoji - loca table not found

2021-05-14 Thread Hans Hagen

On 5/14/2021 1:49 AM, Jairo A. del Rio wrote:
In ConTeXt LMTX this works just fine (try mtxrun --generate and context 
--make first):


\definefontfeature[Emoji][default][sbix=yes]

\starttext

\definedfont[file:NotoColorEmoji.ttf*Emoji]\char"1F91D

\stoptext

However, when one tries to convert it with ImageMagick the following 
happens:


     Error reading a content stream. The page may be incomplete.
                Output may be incorrect.
     Error: Ignoring spurious ET operator.
                Output may be incorrect.
     Error: File did not complete the page properly and may be damaged.
                Output may be incorrect.


Only SVG fonts don't trigger this error in LMTX.


I confirm ConTeXt MkIV is having issues with emoji fonts. It seems that 
GraphicsMagick is not properly generating images as it complains about 
an improper header.
my experiences with graphicmagick and such conversions are bad, one can 
also get pdf with missing objects and so ... when you have a version 
that works, best stick to that before updating (or keep it around)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] NotoColorEmoji - loca table not found

2021-05-14 Thread Hans Hagen

On 5/14/2021 1:26 AM, Adam Reviczky wrote:

Hi,

I am trying to use the 'handshake' character 
(https://www.fileformat.info/info/unicode/char/1f91d/fontsupport.htm 
) 
from the Noto Color Emoji font 
(https://github.com/googlefonts/noto-emoji/blob/main/fonts/NotoColorEmoji.ttf 
).


The following MWE gives an error:

\starttext

\definedfont[file:NotoColorEmoji.ttf] \char"1F91D

\stoptext


works here (lmtx):

\starttext
\definedfont[file:NotoColorEmoji.ttf*color]

\emoji{handshake}
\char"1F91D
\stoptext

two handhakes ... (you need to use the color feature, this font doesn't 
have non colored ones btw)


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] NotoColorEmoji - loca table not found

2021-05-13 Thread Jairo A. del Rio
El jue, 13 de may. de 2021 a la(s) 19:52, Adam Reviczky (revic...@gmail.com)
escribió:

> Thanks Jairo,
>
> That indeed works, should've read that it is bitmap only.
>
> I do get a white background though (MKIV), is that how the bitmap is
> stored?
>
>
In LuaLaTeX with Harfbuzz shaper as well as ConTeXt LMTX, transparency is
properly handled, so I suppose ConTeXt MkIV is to blame in this case. In
case you understand how does ConTeXt handle with bitmap fonts, relevant
files are under
/home/coragyps/lmtx/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/fonts/


> \definefontfeature[Emoji][default][sbix=yes]
>
> \starttext
>
>
> \framed[background=color,background=black]{\definedfont[file:NotoColorEmoji.ttf*Emoji]\char"1F91D}
>
> \stoptext
>
>
> In Hans' example for applecoloremoji there is no white background (page 5,
> bachotex-2017-emoji.pdf).
>
> I also do not get a white background with LibreOfiice.
>
>
>
I'd wait for Hans to fix it, as I don't really understand font management
in ConTeXt...

Jairo


> Adam
>
> On Fri, May 14, 2021 at 12:51 AM Jairo A. del Rio 
> wrote:
>
>> In ConTeXt LMTX this works just fine (try mtxrun --generate and context
>> --make first):
>>
>> \definefontfeature[Emoji][default][sbix=yes]
>>
>> \starttext
>>
>> \definedfont[file:NotoColorEmoji.ttf*Emoji]\char"1F91D
>>
>> \stoptext
>>
>> However, when one tries to convert it with ImageMagick the following
>> happens:
>>
>> Error reading a content stream. The page may be incomplete.
>>Output may be incorrect.
>> Error: Ignoring spurious ET operator.
>>Output may be incorrect.
>> Error: File did not complete the page properly and may be damaged.
>>Output may be incorrect.
>>
>>
>> Only SVG fonts don't trigger this error in LMTX.
>>
>>
>> I confirm ConTeXt MkIV is having issues with emoji fonts. It seems that
>> GraphicsMagick is not properly generating images as it complains about an
>> improper header.
>>
>> Jairo
>>
>> El jue, 13 de may. de 2021 a la(s) 18:26, Adam Reviczky (
>> revic...@gmail.com) escribió:
>>
>>> Hi,
>>>
>>> I am trying to use the 'handshake' character (
>>> https://www.fileformat.info/info/unicode/char/1f91d/fontsupport.htm)
>>> from the Noto Color Emoji font (
>>> https://github.com/googlefonts/noto-emoji/blob/main/fonts/NotoColorEmoji.ttf
>>> ).
>>>
>>> The following MWE gives an error:
>>>
>>> \starttext
>>>
>>> \definedfont[file:NotoColorEmoji.ttf] \char"1F91D
>>>
>>> \stoptext
>>>
>>> fonts   > otf loading > loading 'NotoColorEmoji.ttf', hash
>>> 'notocoloremoji'
>>> system  > lua > compiling
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tma'
>>> into
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tmc'
>>> system  > lua > dumping
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tma'
>>> into
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tmc'
>>> stripped
>>> fonts   > otf loading > loading done
>>> fonts   > otf loading > saving 'NotoColorEmoji.ttf' in cache
>>> system  > lua > compiling
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tma'
>>> into
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tmc'
>>> system  > lua > dumping
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tma'
>>> into
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tmc'
>>> stripped
>>> fonts   > otf loading > loading, optimizing, packing and caching
>>> time 2.557
>>> pages   > flushing realpage 1, userpage 1, subpage 1
>>> close source> level 2, order 3

Re: [NTG-context] NotoColorEmoji - loca table not found

2021-05-13 Thread Adam Reviczky
Thanks Jairo,

That indeed works, should've read that it is bitmap only.

I do get a white background though (MKIV), is that how the bitmap is stored?

\definefontfeature[Emoji][default][sbix=yes]

\starttext

\framed[background=color,background=black]{\definedfont[file:NotoColorEmoji.ttf*Emoji]\char"1F91D}

\stoptext


In Hans' example for applecoloremoji there is no white background (page 5,
bachotex-2017-emoji.pdf).

I also do not get a white background with LibreOfiice.


Adam

On Fri, May 14, 2021 at 12:51 AM Jairo A. del Rio 
wrote:

> In ConTeXt LMTX this works just fine (try mtxrun --generate and context
> --make first):
>
> \definefontfeature[Emoji][default][sbix=yes]
>
> \starttext
>
> \definedfont[file:NotoColorEmoji.ttf*Emoji]\char"1F91D
>
> \stoptext
>
> However, when one tries to convert it with ImageMagick the following
> happens:
>
> Error reading a content stream. The page may be incomplete.
>Output may be incorrect.
> Error: Ignoring spurious ET operator.
>Output may be incorrect.
> Error: File did not complete the page properly and may be damaged.
>Output may be incorrect.
>
>
> Only SVG fonts don't trigger this error in LMTX.
>
>
> I confirm ConTeXt MkIV is having issues with emoji fonts. It seems that
> GraphicsMagick is not properly generating images as it complains about an
> improper header.
>
> Jairo
>
> El jue, 13 de may. de 2021 a la(s) 18:26, Adam Reviczky (
> revic...@gmail.com) escribió:
>
>> Hi,
>>
>> I am trying to use the 'handshake' character (
>> https://www.fileformat.info/info/unicode/char/1f91d/fontsupport.htm)
>> from the Noto Color Emoji font (
>> https://github.com/googlefonts/noto-emoji/blob/main/fonts/NotoColorEmoji.ttf
>> ).
>>
>> The following MWE gives an error:
>>
>> \starttext
>>
>> \definedfont[file:NotoColorEmoji.ttf] \char"1F91D
>>
>> \stoptext
>>
>> fonts   > otf loading > loading 'NotoColorEmoji.ttf', hash
>> 'notocoloremoji'
>> system  > lua > compiling
>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tma'
>> into
>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tmc'
>> system  > lua > dumping
>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tma'
>> into
>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tmc'
>> stripped
>> fonts   > otf loading > loading done
>> fonts   > otf loading > saving 'NotoColorEmoji.ttf' in cache
>> system  > lua > compiling
>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tma'
>> into
>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tmc'
>> system  > lua > dumping
>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tma'
>> into
>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tmc'
>> stripped
>> fonts   > otf loading > loading, optimizing, packing and caching
>> time 2.557
>> pages   > flushing realpage 1, userpage 1, subpage 1
>> close source> level 2, order 3, name '/tmp/MWE.tex'
>> close source> level 1, order 3, name
>> '/usr/share/texmf/tex/context/base/mkiv/cont-yes.mkiv'
>> ! error:  (file NotoColorEmoji.ttf) (ttf): loca table not
>> foundmtx-context | fatal error: return code: 256
>>
>> Any idea what is wrong?
>>
>> Adam
>>
>>
>> ___
>> 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://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : http://contextgarden.net
>>
>> ___
>>
>
> ___
> If your question is of intere

Re: [NTG-context] NotoColorEmoji - loca table not found

2021-05-13 Thread Jairo A. del Rio
In ConTeXt LMTX this works just fine (try mtxrun --generate and context
--make first):

\definefontfeature[Emoji][default][sbix=yes]

\starttext

\definedfont[file:NotoColorEmoji.ttf*Emoji]\char"1F91D

\stoptext

However, when one tries to convert it with ImageMagick the following
happens:

    Error reading a content stream. The page may be incomplete.
   Output may be incorrect.
    Error: Ignoring spurious ET operator.
   Output may be incorrect.
    Error: File did not complete the page properly and may be damaged.
   Output may be incorrect.


Only SVG fonts don't trigger this error in LMTX.


I confirm ConTeXt MkIV is having issues with emoji fonts. It seems that
GraphicsMagick is not properly generating images as it complains about an
improper header.

Jairo

El jue, 13 de may. de 2021 a la(s) 18:26, Adam Reviczky (revic...@gmail.com)
escribió:

> Hi,
>
> I am trying to use the 'handshake' character (
> https://www.fileformat.info/info/unicode/char/1f91d/fontsupport.htm) from
> the Noto Color Emoji font (
> https://github.com/googlefonts/noto-emoji/blob/main/fonts/NotoColorEmoji.ttf
> ).
>
> The following MWE gives an error:
>
> \starttext
>
> \definedfont[file:NotoColorEmoji.ttf] \char"1F91D
>
> \stoptext
>
> fonts   > otf loading > loading 'NotoColorEmoji.ttf', hash
> 'notocoloremoji'
> system  > lua > compiling
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tma'
> into
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tmc'
> system  > lua > dumping
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tma'
> into
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tmc'
> stripped
> fonts   > otf loading > loading done
> fonts   > otf loading > saving 'NotoColorEmoji.ttf' in cache
> system  > lua > compiling
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tma'
> into
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tmc'
> system  > lua > dumping
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tma'
> into
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tmc'
> stripped
> fonts   > otf loading > loading, optimizing, packing and caching
> time 2.557
> pages   > flushing realpage 1, userpage 1, subpage 1
> close source> level 2, order 3, name '/tmp/MWE.tex'
> close source> level 1, order 3, name
> '/usr/share/texmf/tex/context/base/mkiv/cont-yes.mkiv'
> ! error:  (file NotoColorEmoji.ttf) (ttf): loca table not foundmtx-context
> | fatal error: return code: 256
>
> Any idea what is wrong?
>
> Adam
>
>
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] NotoColorEmoji - loca table not found

2021-05-13 Thread Adam Reviczky
Hi,

I am trying to use the 'handshake' character (
https://www.fileformat.info/info/unicode/char/1f91d/fontsupport.htm) from
the Noto Color Emoji font (
https://github.com/googlefonts/noto-emoji/blob/main/fonts/NotoColorEmoji.ttf
).

The following MWE gives an error:

\starttext

\definedfont[file:NotoColorEmoji.ttf] \char"1F91D

\stoptext

fonts   > otf loading > loading 'NotoColorEmoji.ttf', hash
'notocoloremoji'
system  > lua > compiling
'/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tma'
into
'/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tmc'
system  > lua > dumping
'/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tma'
into
'/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tmc'
stripped
fonts   > otf loading > loading done
fonts   > otf loading > saving 'NotoColorEmoji.ttf' in cache
system  > lua > compiling
'/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tma'
into
'/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tmc'
system  > lua > dumping
'/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tma'
into
'/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tmc'
stripped
fonts   > otf loading > loading, optimizing, packing and caching
time 2.557
pages   > flushing realpage 1, userpage 1, subpage 1
close source> level 2, order 3, name '/tmp/MWE.tex'
close source> level 1, order 3, name
'/usr/share/texmf/tex/context/base/mkiv/cont-yes.mkiv'
! error:  (file NotoColorEmoji.ttf) (ttf): loca table not foundmtx-context
| fatal error: return code: 256

Any idea what is wrong?

Adam
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Table disappears in floatcombination

2021-03-28 Thread Christoph Reller
On Mon, Jan 4, 2021 at 7:59 PM Christoph Reller 
wrote:

> On Sat, Dec 26, 2020 at 3:01 PM Hans Hagen  wrote:
>
>> On 12/26/2020 2:56 PM, Christoph Reller wrote:
>> >
>> > On Sat, Dec 26, 2020 at 10:54 AM Hans Hagen > > <mailto:j.ha...@xs4all.nl>> wrote:
>> >
>> > On 12/25/2020 9:47 PM, Christoph Reller wrote:
>> >  > Hi,
>> >  >
>> >  > Consider the following MWE:
>> >  >
>> >  > \definefloat[combination][figure]
>> >  > \setupcaptions[
>> >  >number=no, %<- comment and table appears
>> >  >align=flushright]
>> >  > \starttext
>> >  > \startplacecombination[title=Combination]
>> >  >\startfloatcombination
>> >  >  \startplacetable%[title=Table] %<- uncomment and table
>> appears
>> >  >\bTABLE \bTR \bTD Cell \eTD \eTR \eTABLE
>> >  >  \stopplacetable
>> >  >    \stopfloatcombination
>> >  > \stopplacecombination
>> >  > \stoptext
>> >  >
>> >  > In the latest LMTX version of ConTeXt, the table is not shown.
>> > (In MKIV
>> >  > it is present.) Either commenting line 3 or activating the table
>> > title
>> >  > in line 8 makes the table appear.
>> >
>> > what version of mkiv did you test?
>> >
>> >
>> > Okay, the MKIV version is a little bit dated: 2018.05.19_21.46.
>> > Still: How can I get floats without captions within a
>> > floatcombination environment?
>> I (or Wolfgang) needs to look into it, maybe something got lost.
>>
>
> I hope that you find the time to solve this issue. Disappearing tables are
> not so nice :(
> Your work is much appreciated!
>

Just a reminder that this issue still persists in the latest version of
ConTeXt LMTX. A fix would be highly appreciated.

Cheers, Christoph
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Lua code and table

2021-02-20 Thread Fabrice Couvreur
Hi Hans
The xx.tex file works for me
Thanks
Fabrice

Le ven. 19 févr. 2021 à 14:28, Hans Hagen  a écrit :

> On 2/19/2021 2:12 PM, Jano Kula wrote:
> > Hi,
> >
> > On Fri, 19 Feb 2021 at 13:06, Hans Hagen  > <mailto:j.ha...@xs4all.nl>> wrote:
> >
> > On 2/19/2021 12:42 PM, Fabrice Couvreur wrote:
> >  > Hi Hans,Thanks again for the ideas to improve my code. However, I
> > am new
> >  > to Lua and my level is far from sufficient to understand
> > everything. Why
> >  > in no table do the crosses appear in the cells; which was my
> > original
> >  > idea.Thank you.Fabrice
> > I get a cross (see attached).
> >
> >
> > I've got no crosses with ConTeXt  ver: 2021.02.05 17:45 LMTX.
> > Fresh install of ConTeXt  ver: 2021.02.19 13:15 LMTX gives me no
> > crosses, too.
> > No missing fonts in both cases.
> > Log and tuc attached.
> And with the previously attached xx.tex file? maybe the mailer messes up
> something?
>
> Hans
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Lua code and table

2021-02-19 Thread Hans Hagen

On 2/19/2021 2:12 PM, Jano Kula wrote:

Hi,

On Fri, 19 Feb 2021 at 13:06, Hans Hagen <mailto:j.ha...@xs4all.nl>> wrote:


On 2/19/2021 12:42 PM, Fabrice Couvreur wrote:
 > Hi Hans,Thanks again for the ideas to improve my code. However, I
am new
 > to Lua and my level is far from sufficient to understand
everything. Why
     > in no table do the crosses appear in the cells; which was my
original
 > idea.Thank you.Fabrice
I get a cross (see attached).


I've got no crosses with ConTeXt  ver: 2021.02.05 17:45 LMTX.
Fresh install of ConTeXt  ver: 2021.02.19 13:15 LMTX gives me no 
crosses, too.

No missing fonts in both cases.
Log and tuc attached.
And with the previously attached xx.tex file? maybe the mailer messes up 
something?


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Lua code and table

2021-02-19 Thread Jano Kula
Hi,

On Fri, 19 Feb 2021 at 13:06, Hans Hagen  wrote:

> On 2/19/2021 12:42 PM, Fabrice Couvreur wrote:
> > Hi Hans,Thanks again for the ideas to improve my code. However, I am new
> > to Lua and my level is far from sufficient to understand everything. Why
> > in no table do the crosses appear in the cells; which was my original
> > idea.Thank you.Fabrice
> I get a cross (see attached).
>

I've got no crosses with ConTeXt  ver: 2021.02.05 17:45 LMTX.
Fresh install of ConTeXt  ver: 2021.02.19 13:15 LMTX gives me no crosses,
too.
No missing fonts in both cases.
Log and tuc attached.

Jano


hans-metapost.log
Description: Binary data


hans-metapost.tuc
Description: Binary data
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Lua code and table

2021-02-19 Thread Hans Hagen

On 2/19/2021 12:42 PM, Fabrice Couvreur wrote:
Hi Hans,Thanks again for the ideas to improve my code. However, I am new 
to Lua and my level is far from sufficient to understand everything. Why 
in no table do the crosses appear in the cells; which was my original 
idea.Thank you.Fabrice

I get a cross (see attached).

Hans



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
\setupbodyfont[pagella]

\starttext

\definextable
  [MyTable]
  [align={middle,lohi},
   width=0.8cm,
   offset=0.8ex,
   bodyfont=9pt,
   framecolor=cyan]

\startluacode
function document.MyTable(specification)

local pattern= specification.pattern
local action = specification.action
local conversion = specification.conversion or "Characters"

local n = #pattern

--  context.startxtable { align = "middle,lohi", width = "0.8cm", offset = 
"0.8ex", bodyfont = "9pt", framecolor = "cyan" }
context.startxtable { "MyTable" }
context.startxrow()
context.startxcell { frame = "off" }
context()
context.stopxcell()
for i=1,n do
context.startxcell()
context.convertnumber(conversion,i)
context.stopxcell()
end
context.stopxrow()
for i=1,n do
context.startxrow()
context.startxcell()
context.convertnumber(conversion,i)
context.stopxcell()
for j=1,n do
context.startxcell { align = "middle" }
action(string.sub(pattern[i],j,j))
context.stopxcell()
end
context.stopxrow()
end
context.stopxtable()

end
\stopluacode

\startuniqueMPgraphic{cross}{width,height,depth,color,line}
draw image (
draw (\MPvar{depth},\MPvar{height}) -- (\MPvar{width},0) ;
draw (\MPvar{depth},0) -- (\MPvar{width},\MPvar{height}) ;
)
withpen pencircle scaled \MPvar{line}
withcolor \MPvar{color} ;
\stopuniqueMPgraphic

\definesymbol
  [MyRedCross]
  [\uniqueMPgraphic{cross}{width=1em,height=1ex,depth=.5ex,color=red,line=.2ex}]

\definesymbol
  [MyGreenCross]
  
[\uniqueMPgraphic{cross}{width=1em,height=1ex,depth=.5ex,color=green,line=.2ex}]

\startluacode
document.MyTable {
action = function(value)
context(value == "X" and 1 or 0)
end,
conversion = "Characters",
pattern = {
".XXX..XX",
"X...XXX.",
"X..X.XXX",
"X.X.X..X",
".X.X.XX.",
".XX.X...",
"XXX.X...",
"X.XX"
}
}
\stopluacode

\startluacode
document.MyTable {
action = function(value)
context(value == "X" and 1 or 0)
end,
conversion = "Greek",
pattern = {
".XXX..XX",
"X...XXX.",
"X..X.XXX",
"X.X.X..X",
}
}
\stopluacode

\startluacode
document.MyTable {
action = function(value)
if value == "X" then
context.symbol { "MyRedCross" }
end
end,
conversion = "Romannumerals",
pattern = {
".XXX..XX",
"X...XXX.",
"X..X.XXX",
"X.X.X..X",
".X.X.XX.",
".XX.X...",
"XXX.X...",
"X.XX"
}
}
\stopluacode

\startluacode
document.MyTable {
action = function(value)
context.symbol { value == "X" and "MyRedCross"  or "MyGreenCross" }
end,
conversion = "Romannumerals",
pattern = {
"X.X.X..X",
".X.X.XX.",
".XX.X...",
"XXX.X...",
"X.XX"
}
}
\stopluacode

\stoptext


xx.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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Lua code and table

2021-02-19 Thread Fabrice Couvreur
Hi Hans, Thanks again for the ideas to improve my code. However, I am new
to Lua and my level is far from sufficient to understand everything. Why in
no table do the crosses appear in the cells; which was my original idea. Thank
you. Fabrice

Le jeu. 18 févr. 2021 à 16:28, Fabrice Couvreur 
a écrit :

> Hello Jano,
> Thanks.
> Fabrice
>
> Le jeu. 18 févr. 2021 à 16:27, Jano Kula  a écrit :
>
>> Hello Fabrice,
>>
>>
>>
>> On Thu, 18 Feb 2021 at 16:19, Fabrice Couvreur <
>> fabrice1.couvr...@gmail.com> wrote:
>>
>>> Hi all, Thanks to you, I'm not at your level with Lua, but I'm learning
>>> thanks to you
>>> Hans, I compiled your code and I get an error message :
>>>
>>> lua error   > lua error on line 50 in file ./table_1.tex:
>>>
>>> token call, syntax: [ctxlua]:11: unexpected symbol near '='
>>>
>>> 13 \startluacode
>>> 14  function document.MyTable(specification)
>>> 15
>>> 16  local pattern= specification.pattern
>>> 17  local action = specification.action
>>> 18  local conversion = specification.conversion or
>>> "Characters"
>>> 19
>>> 20  local n = #pattern
>>> 21
>>> 22  --  context.startxtable { align = "middle,lohi", width =
>>> "0.8cm",
>>> 23 >>  offset = "0.8ex", bodyfont = "9pt", framecolor = "cyan" }
>>>
>>
>> Just comment out line 23, too, or join 22 + 23 to one line.
>>
>> Jano
>>
>>
>>
>> ___
>> 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://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : http://contextgarden.net
>>
>> ___
>>
>
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Lua code and table

2021-02-18 Thread Fabrice Couvreur
Hello Jano,
Thanks.
Fabrice

Le jeu. 18 févr. 2021 à 16:27, Jano Kula  a écrit :

> Hello Fabrice,
>
>
>
> On Thu, 18 Feb 2021 at 16:19, Fabrice Couvreur <
> fabrice1.couvr...@gmail.com> wrote:
>
>> Hi all, Thanks to you, I'm not at your level with Lua, but I'm learning
>> thanks to you
>> Hans, I compiled your code and I get an error message :
>>
>> lua error   > lua error on line 50 in file ./table_1.tex:
>>
>> token call, syntax: [ctxlua]:11: unexpected symbol near '='
>>
>> 13 \startluacode
>> 14  function document.MyTable(specification)
>> 15
>> 16  local pattern= specification.pattern
>> 17  local action = specification.action
>> 18  local conversion = specification.conversion or
>> "Characters"
>> 19
>> 20  local n = #pattern
>> 21
>> 22  --  context.startxtable { align = "middle,lohi", width =
>> "0.8cm",
>> 23 >>  offset = "0.8ex", bodyfont = "9pt", framecolor = "cyan" }
>>
>
> Just comment out line 23, too, or join 22 + 23 to one line.
>
> Jano
>
>
>
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Lua code and table

2021-02-18 Thread Jano Kula
Hello Fabrice,



On Thu, 18 Feb 2021 at 16:19, Fabrice Couvreur 
wrote:

> Hi all, Thanks to you, I'm not at your level with Lua, but I'm learning
> thanks to you
> Hans, I compiled your code and I get an error message :
>
> lua error   > lua error on line 50 in file ./table_1.tex:
>
> token call, syntax: [ctxlua]:11: unexpected symbol near '='
>
> 13 \startluacode
> 14  function document.MyTable(specification)
> 15
> 16  local pattern= specification.pattern
> 17  local action = specification.action
> 18  local conversion = specification.conversion or "Characters"
> 19
> 20  local n = #pattern
> 21
> 22  --  context.startxtable { align = "middle,lohi", width =
> "0.8cm",
> 23 >>  offset = "0.8ex", bodyfont = "9pt", framecolor = "cyan" }
>

Just comment out line 23, too, or join 22 + 23 to one line.

Jano
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Lua code and table

2021-02-18 Thread Fabrice Couvreur
Hi all, Thanks to you, I'm not at your level with Lua, but I'm learning
thanks to you
Hans, I compiled your code and I get an error message :

lua error   > lua error on line 50 in file ./table_1.tex:

token call, syntax: [ctxlua]:11: unexpected symbol near '='

13 \startluacode
14  function document.MyTable(specification)
15
16  local pattern= specification.pattern
17  local action = specification.action
18  local conversion = specification.conversion or "Characters"
19
20  local n = #pattern
21
22  --  context.startxtable { align = "middle,lohi", width =
"0.8cm",
23 >>  offset = "0.8ex", bodyfont = "9pt", framecolor = "cyan" }
24  context.startxtable { "MyTable" }
25  context.startxrow()
26  context.startxcell { frame = "off" }
27  context()
28  context.stopxcell()
29  for i=1,n do
30  context.startxcell()
31  context.convertnumber(conversion,i)
32  context.stopxcell()
33  end

mtx-context | fatal error: return code: 256

TeX Output exited abnormally with code 1 at Thu Feb 18 16:13:29


Thank you very much
Fabrice

Le jeu. 18 févr. 2021 à 10:06, Hans Hagen  a écrit :

> On 2/18/2021 12:22 AM, Bruce Horrocks wrote:
>
> >> On 17 Feb 2021, at 17:40, Fabrice Couvreur 
> wrote:
> >>
> >> Hi, The code works, but is it possible to make it shorter ?
> OK, here is my take, based on earlier posts, bringing together some
> 'technologies':
>
> (1) make a document function which isolatees the code
> (2) then call it where needed
> (3) use the built in conversion code
> (4) use so called unique mp graphics (smaller files, faster run)
> (5) use symbols to get the baseline right
> (6) use a little abstraction in the table setup
>
> watch how we can pass a table instead of a string, so
>
> context.startxtable { align = "middle,lohi", width = "0.8cm", offset =
> "0.8ex", bodyfont = "9pt", framecolor = "cyan" }
>
> is ok, but anm abstraction is even better. Now, who will wikify it ...
>
> %%% code %%%
>
> \setupbodyfont[pagella]
>
> \starttext
>
> \definextable
>[MyTable]
>[align={middle,lohi},
> width=0.8cm,
> offset=0.8ex,
> bodyfont=9pt,
> framecolor=cyan]
>
> \startluacode
>  function document.MyTable(specification)
>
>  local pattern= specification.pattern
>  local action = specification.action
>  local conversion = specification.conversion or "Characters"
>
>  local n = #pattern
>
>  --  context.startxtable { align = "middle,lohi", width = "0.8cm",
> offset = "0.8ex", bodyfont = "9pt", framecolor = "cyan" }
>  context.startxtable { "MyTable" }
>  context.startxrow()
>  context.startxcell { frame = "off" }
>  context()
>  context.stopxcell()
>  for i=1,n do
>  context.startxcell()
>  context.convertnumber(conversion,i)
>  context.stopxcell()
>  end
>  context.stopxrow()
>  for i=1,n do
>  context.startxrow()
>  context.startxcell()
>  context.convertnumber(conversion,i)
>  context.stopxcell()
>  for j=1,n do
>  context.startxcell { align = "middle" }
>  action(string.sub(pattern[i],j,j))
>  context.stopxcell()
>  end
>  context.stopxrow()
>  end
>  context.stopxtable()
>
>  end
> \stopluacode
>
> \startuniqueMPgraphic{cross}{width,height,depth,color,line}
>  draw image (
>  draw (\MPvar{depth},\MPvar{height}) -- (\MPvar{width},0) ;
>  draw (\MPvar{depth},0) -- (\MPvar{width},\MPvar{height}) ;
>  )
>  withpen pencircle scaled \MPvar{line}
>  withcolor \MPvar{color} ;
> \stopuniqueMPgraphic
>
> \definesymbol
>[MyRedCross]
>
>
> [\uniqueMPgraphic{cross}{width=1em,height=1ex,depth=.5ex,color=red,line=.2ex}]
>
> \definesymbol
>[MyGreenCross]
>
>
> [\uniqueMPgraphic{cross}{width=1em,height=1ex,depth=.5ex,color=green,line=.2ex}]
>
> \startluacode
>  document.MyTab

Re: [NTG-context] Lua code and table

2021-02-18 Thread Hans Hagen

On 2/18/2021 12:22 AM, Bruce Horrocks wrote:


On 17 Feb 2021, at 17:40, Fabrice Couvreur  wrote:

Hi, The code works, but is it possible to make it shorter ?
OK, here is my take, based on earlier posts, bringing together some 
'technologies':


(1) make a document function which isolatees the code
(2) then call it where needed
(3) use the built in conversion code
(4) use so called unique mp graphics (smaller files, faster run)
(5) use symbols to get the baseline right
(6) use a little abstraction in the table setup

watch how we can pass a table instead of a string, so

context.startxtable { align = "middle,lohi", width = "0.8cm", offset = 
"0.8ex", bodyfont = "9pt", framecolor = "cyan" }


is ok, but anm abstraction is even better. Now, who will wikify it ...

%%% code %%%

\setupbodyfont[pagella]

\starttext

\definextable
  [MyTable]
  [align={middle,lohi},
   width=0.8cm,
   offset=0.8ex,
   bodyfont=9pt,
   framecolor=cyan]

\startluacode
function document.MyTable(specification)

local pattern= specification.pattern
local action = specification.action
local conversion = specification.conversion or "Characters"

local n = #pattern

--  context.startxtable { align = "middle,lohi", width = "0.8cm", 
offset = "0.8ex", bodyfont = "9pt", framecolor = "cyan" }

context.startxtable { "MyTable" }
context.startxrow()
context.startxcell { frame = "off" }
context()
context.stopxcell()
for i=1,n do
context.startxcell()
context.convertnumber(conversion,i)
context.stopxcell()
end
context.stopxrow()
for i=1,n do
context.startxrow()
context.startxcell()
context.convertnumber(conversion,i)
context.stopxcell()
for j=1,n do
context.startxcell { align = "middle" }
action(string.sub(pattern[i],j,j))
context.stopxcell()
end
context.stopxrow()
end
context.stopxtable()

end
\stopluacode

\startuniqueMPgraphic{cross}{width,height,depth,color,line}
draw image (
draw (\MPvar{depth},\MPvar{height}) -- (\MPvar{width},0) ;
draw (\MPvar{depth},0) -- (\MPvar{width},\MPvar{height}) ;
)
withpen pencircle scaled \MPvar{line}
withcolor \MPvar{color} ;
\stopuniqueMPgraphic

\definesymbol
  [MyRedCross]

[\uniqueMPgraphic{cross}{width=1em,height=1ex,depth=.5ex,color=red,line=.2ex}]

\definesymbol
  [MyGreenCross]

[\uniqueMPgraphic{cross}{width=1em,height=1ex,depth=.5ex,color=green,line=.2ex}]

\startluacode
document.MyTable {
action = function(value)
context(value == "X" and 1 or 0)
end,
conversion = "Characters",
pattern = {
".XXX..XX",
"X...XXX.",
"X..X.XXX",
"X.X.X..X",
".X.X.XX.",
".XX.X...",
"XXX.X...",
"X.XX"
}
}
\stopluacode

\startluacode
document.MyTable {
action = function(value)
context(value == "X" and 1 or 0)
end,
conversion = "Greek",
pattern = {
".XXX..XX",
"X...XXX.",
"X..X.XXX",
"X.X.X..X",
}
}
\stopluacode

\startluacode
document.MyTable {
action = function(value)
if value == "X" then
context.symbol { "MyRedCross" }
end
end,
conversion = "Romannumerals",
pattern = {
".XXX..XX",
"X...XXX.",
"X..X.XXX",
"X.X.X..X",
".X.X.XX.",
".XX.X...",
"XXX.X...",
"X.XX"
}
}
\stopluacode

\startluacode
document.MyTable {
action = function(value)
context.symbol { value == "X" and "MyRedCross"  or 
"MyGreenCross" }

end,
conversion = "Romannumerals",
pattern = {
"X.X.X..X",
".X.X.XX.",
".XX.X...",
"XXX.X...",
"X.XX"
}
}
\stopluacode

\stoptext


-
  Hans Hagen | 

Re: [NTG-context] Lua code and table

2021-02-17 Thread Bruce Horrocks


> On 17 Feb 2021, at 17:40, Fabrice Couvreur  
> wrote:
> 
> Hi, The code works, but is it possible to make it shorter ? 
> Thank you
> Fabrice
> 

You can reduce the size of the test by storing the pattern in a table:

\startluacode
  local background_one = {
   align = "middle",
   style = "type",
   background = "DiagonalRule",
  }

  local letters_1 = { "A", "B", "C", "D", "E", "F", "G", "H" }
  local pattern_1 = { 
".XXX..XX",
"X...XXX.",
"X..X.XXX",
"X.X.X..X",
".X.X.XX.",
".XX.X...",
"XXX.X...",
"X.XX" }
  context.startxtable({"align={middle,lohi}, 
width=0.8cm,offset=0.8ex,bodyfont=9pt,framecolor=cyan"})
  context.startxrow()
  context.startxcell({"frame=off"})
  context()
  context.stopxcell()
  for _, letter in ipairs(letters_1) do
context.startxcell()
context(letter) context.stopxcell()
  end
  context.stopxrow()
   for i, letter in ipairs(letters_1) do
  context.startxrow()
context.startxcell()
context(letter)
context.stopxcell()
  for j = 1, 8 do
context.startxcell( string.sub(pattern_1[i],j,j) == "X" and background_one )
  context()
  context.stopxcell()
  end
  context.stopxrow()
  end
  context.stopxtable()
\stopluacode

—
Bruce Horrocks
Hampshire, UK

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Lua code and table

2021-02-17 Thread Hans Hagen

On 2/17/2021 10:26 PM, Wolfgang Schuster wrote:

Fabrice Couvreur schrieb am 17.02.2021 um 18:40:

Hi,The code works, but is it possible to make it shorter ?
Thank you
Fabrice


\startuseMPgraphic{DiagonalRule}
    rulethickness := \frameddimension{rulethickness};

    drawoptions(
      withpen pencircle scaled rulethickness
      withcolor \MPcolor{\framedparameter{framecolor}});

    pair leftcorner, rightcorner, Leftcorner, Rightcorner;
    leftcorner  := (rulethickness, \overlayheight-rulethickness);
    rightcorner := (\overlaywidth-rulethickness, rulethickness);
    Leftcorner  := ( rulethickness, rulethickness);
    Rightcorner := 
(\overlaywidth-rulethickness,\overlayheight-rulethickness);


    draw leftcorner -- rightcorner;
    draw Leftcorner -- Rightcorner;
  \stopuseMPgraphic



\startuseMPgraphic{DiagonalRule}
     drawoptions(
     withpen pencircle scaled OverlayLineWidth
     withcolor OverlayLineColor
     );

     draw ulcorner OverlayBox -- lrcorner OverlayBox ;
     draw llcorner OverlayBox -- urcorner OverlayBox ;
\stopuseMPgraphic

Often this also works:

\startuseMPgraphic{DiagonalRule}
draw image (
draw ulcorner OverlayBox -- lrcorner OverlayBox ;
draw llcorner OverlayBox -- urcorner OverlayBox ;
)
withpen pencircle scaled OverlayLineWidth
withcolor OverlayLineColor ;
\stopuseMPgraphic


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Lua code and table

2021-02-17 Thread Wolfgang Schuster

Fabrice Couvreur schrieb am 17.02.2021 um 18:40:

Hi,The code works, but is it possible to make it shorter ?
Thank you
Fabrice


\startuseMPgraphic{DiagonalRule}
    rulethickness := \frameddimension{rulethickness};

    drawoptions(
      withpen pencircle scaled rulethickness
      withcolor \MPcolor{\framedparameter{framecolor}});

    pair leftcorner, rightcorner, Leftcorner, Rightcorner;
    leftcorner  := (rulethickness, \overlayheight-rulethickness);
    rightcorner := (\overlaywidth-rulethickness, rulethickness);
    Leftcorner  := ( rulethickness, rulethickness);
    Rightcorner := 
(\overlaywidth-rulethickness,\overlayheight-rulethickness);


    draw leftcorner -- rightcorner;
    draw Leftcorner -- Rightcorner;
  \stopuseMPgraphic



\startuseMPgraphic{DiagonalRule}
drawoptions(
withpen pencircle scaled OverlayLineWidth
withcolor OverlayLineColor
);

draw ulcorner OverlayBox -- lrcorner OverlayBox ;
draw llcorner OverlayBox -- urcorner OverlayBox ;
\stopuseMPgraphic

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Lua code and table

2021-02-17 Thread Tomas Hala
Hi Fabrice,

see below, I attached two ideas how to do it.

The best,

Tomáš

Wed, Feb 17, 2021 ve 06:40:54PM +0100 Fabrice Couvreur napsal(a):
#Hi,  The code works, but is it possible to make it shorter ?
#Thank you
#Fabrice
#\startuseMPgraphic{DiagonalRule}
#   rulethickness := \frameddimension{rulethickness};
# 
#   drawoptions(
#     withpen pencircle scaled rulethickness
#     withcolor \MPcolor{\framedparameter{framecolor}});
# 
#   pair leftcorner, rightcorner, Leftcorner, Rightcorner;
#   leftcorner  := (rulethickness, \overlayheight-rulethickness);
#   rightcorner := (\overlaywidth-rulethickness, rulethickness);
#   Leftcorner  := ( rulethickness, rulethickness);
#   Rightcorner :=
#(\overlaywidth-rulethickness,\overlayheight-rulethickness);
# 
#   draw leftcorner -- rightcorner;
#   draw Leftcorner -- Rightcorner;
# \stopuseMPgraphic
# 
#\defineoverlay
#  [DiagonalRule]
#  [\useMPgraphic{DiagonalRule}]
# 
#\define[2]\DiagonalLabel{%
#  \setuptabulate [after={\blank[\frameddimension{offset}]}]
#  \starttabulate [|p|r|]
#    \NC    \NC \bf #2 \NC\NR
#    \NC \bf #1 \NC    \NC\NR
#  \stoptabulate
#}
#\starttext
#\startluacode
#  local background_one = {
#   align = "middle",
#   style = "type",
#   background = "DiagonalRule",
#  }
# 
#  local letters_1 = { "A", "B", "C", "D", "E", "F", "G", "H" }
#  context.startxtable({"align={middle,lohi},
#width=0.8cm,offset=0.8ex,bodyfont=9pt,framecolor=cyan"})
#  context.startxrow()
#  context.startxcell({"frame=off"})
#  context()
#  context.stopxcell()
#  for _, letter in ipairs(letters_1) do
#    context.startxcell()
#    context(letter) context.stopxcell()
#  end
#  context.stopxrow()
#   for _, letter in ipairs(letters_1) do
#  context.startxrow()
#    context.startxcell()
#    context(letter)
#    context.stopxcell()
#  for j = 0, 7 do
#  context.startxcell(  j == 0 and letter == "B" and background_one
#  or j == 0 and letter == "C" and background_one
#  or j == 0 and letter == "D" and background_one
#  or j == 0 and letter == "G" and background_one
#  or j == 0 and letter == "H" and background_one
#  or j == 1 and letter == "A" and background_one
#  or j == 1 and letter == "E" and background_one
#  or j == 1 and letter == "F" and background_one
#  or j == 1 and letter == "G" and background_one
#  or j == 2 and letter == "A" and background_one
#  or j == 2 and letter == "D" and background_one
#  or j == 2 and letter == "F" and background_one
#  or j == 2 and letter == "G" and background_one
#  or j == 2 and letter == "H" and background_one
#  or j == 3 and letter == "A" and background_one
#  or j == 3 and letter == "C" and background_one
#  or j == 3 and letter == "E" and background_one
#  or j == 3 and letter == "H" and background_one
#  or j == 4 and letter == "B" and background_one
#  or j == 4 and letter == "D" and background_one
#  or j == 4 and letter == "F" and background_one
#  or j == 4 and letter == "G" and background_one
#  or j == 5 and letter == "B" and background_one
#  or j == 5 and letter == "C" and background_one
#  or j == 5 and letter == "E" and background_one
#  or j == 6 and letter == "A" and background_one
#  or j == 6 and letter == "B" and background_one
#  or j == 6 and letter == "C" and background_one
#  or j == 6 and letter == "E" and background_one
#  or j == 7 and letter == "A" and background_one
#  or j == 7 and letter == "C" and background_one
#  or j == 7 and letter == "D" and background_one
#  )
#  context()
#  context.stopxcell()
#  end
#  context.stopxrow()
#  end
#  context.stopxtable()
#\stopluacode
#\stoptext

%%%=
\starttext
\startluacode

function test()
  for x=0,7 do 
for y=65,72 do 
  local yy=string.char(y)
  context(x)  
  context(" "..yy)
  context(f1(x,yy)..f2(x,yy)..f3(x,yy))
  context.par()
  end end
end

local background_one = true

function f1 (j,letter)
  local res=
   j == 0  and  letter == "B"  and  background_one  
or j == 0  and  letter == "C"  and  background_one 
or j == 0  and  letter == "D"  and  background_one 
or j == 0  and  letter == "G"  and  background_one 
or j == 0  and  letter == "H"  and  background_one 
or j == 1  and  letter == "A"  and  background_one 
or j == 1  and  letter == "E"  and  background_one 
or j == 1  and  letter == "F"  and  background_one 
or j == 1  and  letter == "G"  and  background_one 
or j == 2  and  letter == "A"  and  background_one 
or j == 2  and  letter == "D"  and  background_one 
or j == 2  and  letter == "F"  and  background_one 
or j == 2  and  letter == "G"  and  background_one 
or j == 2  and  letter == "H"  and  

[NTG-context] Lua code and table

2021-02-17 Thread Fabrice Couvreur
Hi, The code works, but is it possible to make it shorter ?
Thank you
Fabrice


\startuseMPgraphic{DiagonalRule}
   rulethickness := \frameddimension{rulethickness};

   drawoptions(
 withpen pencircle scaled rulethickness
 withcolor \MPcolor{\framedparameter{framecolor}});

   pair leftcorner, rightcorner, Leftcorner, Rightcorner;
   leftcorner  := (rulethickness, \overlayheight-rulethickness);
   rightcorner := (\overlaywidth-rulethickness, rulethickness);
   Leftcorner  := ( rulethickness, rulethickness);
   Rightcorner :=
(\overlaywidth-rulethickness,\overlayheight-rulethickness);

   draw leftcorner -- rightcorner;
   draw Leftcorner -- Rightcorner;
 \stopuseMPgraphic

\defineoverlay
  [DiagonalRule]
  [\useMPgraphic{DiagonalRule}]

\define[2]\DiagonalLabel{%
  \setuptabulate [after={\blank[\frameddimension{offset}]}]
  \starttabulate [|p|r|]
\NC\NC \bf #2 \NC\NR
\NC \bf #1 \NC\NC\NR
  \stoptabulate
}
\starttext
\startluacode
  local background_one = {
   align = "middle",
   style = "type",
   background = "DiagonalRule",
  }

  local letters_1 = { "A", "B", "C", "D", "E", "F", "G", "H" }
  context.startxtable({"align={middle,lohi},
width=0.8cm,offset=0.8ex,bodyfont=9pt,framecolor=cyan"})
  context.startxrow()
  context.startxcell({"frame=off"})
  context()
  context.stopxcell()
  for _, letter in ipairs(letters_1) do
context.startxcell()
context(letter) context.stopxcell()
  end
  context.stopxrow()
   for _, letter in ipairs(letters_1) do
  context.startxrow()
context.startxcell()
context(letter)
context.stopxcell()
  for j = 0, 7 do
  context.startxcell(  j == 0 and letter == "B" and background_one
  or j == 0 and letter == "C" and background_one
  or j == 0 and letter == "D" and background_one
  or j == 0 and letter == "G" and background_one
  or j == 0 and letter == "H" and background_one
  or j == 1 and letter == "A" and background_one
  or j == 1 and letter == "E" and background_one
  or j == 1 and letter == "F" and background_one
  or j == 1 and letter == "G" and background_one
  or j == 2 and letter == "A" and background_one
  or j == 2 and letter == "D" and background_one
  or j == 2 and letter == "F" and background_one
  or j == 2 and letter == "G" and background_one
  or j == 2 and letter == "H" and background_one
  or j == 3 and letter == "A" and background_one
  or j == 3 and letter == "C" and background_one
  or j == 3 and letter == "E" and background_one
  or j == 3 and letter == "H" and background_one
  or j == 4 and letter == "B" and background_one
  or j == 4 and letter == "D" and background_one
  or j == 4 and letter == "F" and background_one
  or j == 4 and letter == "G" and background_one
  or j == 5 and letter == "B" and background_one
  or j == 5 and letter == "C" and background_one
  or j == 5 and letter == "E" and background_one
  or j == 6 and letter == "A" and background_one
  or j == 6 and letter == "B" and background_one
  or j == 6 and letter == "C" and background_one
  or j == 6 and letter == "E" and background_one
  or j == 7 and letter == "A" and background_one
  or j == 7 and letter == "C" and background_one
  or j == 7 and letter == "D" and background_one
  )
  context()
  context.stopxcell()
  end
  context.stopxrow()
  end
  context.stopxtable()
\stopluacode
\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to improve visually a table

2021-02-16 Thread Alain Delmotte

  
  

Le 16/02/2021 à 21:31, Wolfgang
  Schuster a écrit :


  
  Alain Delmotte schrieb am 16.02.2021 um 21:00:
  

Le 16/02/2021 à 20:02, Wolfgang Schuster a écrit :

  
  Alain Delmotte schrieb am 16.02.2021 um 19:23:
  

Hi!
I am progressing in the use of
ConTeXt by applying it to some specific projects.
  
For two manuals I am preparing
for myself I'd like to reproduce the original work.
What I'd like to have:

What I have so far:


How to obtain the first?
  
  
  Can you show your code for the table.
  
  Wolfgang
  

Here it is, but I did it to have a sufficiently good table,
  as I didn't know how to recreate the original.
\placetable[none,here]{}{
\starttabulate[|i1Slw(20mm)|i1Slp(20mm)|i1lp(7cm)|]
\DB
  espéranto \NC {\bf exemple} \NC {\bf équivalent en
  français}\NR\TB
\NC
  {\bs g} \NC {\bs g}azeto, {\bs g}itaro \NC toujours comme le g
  de gare (jamais comme le j) \NR\HL
\NC
  {\bs c} \NC la{\bs c}a \NC ts, comme dans tsé-tsé \NR\HL
\NC
  {\bs j} \NC {\bs j}es \NC comme le y de yoga ou le ia de piano
  ou le ill de pareil, œil, fouille \NR\HL
\NC
  {\bs s} \NC ta{\bs s}o \NC toujours ss comme dans tasse
  (jamais comme un z) \NR\HL
\NC
  {\bs h} \NC {\bs h}a lo \NC la combinaison ha se prononce
  comme quand on rit : ha !, ha !, ha ! Pareil pour ho : ho !,ho
  !,ho ! et hi : hi !,hi !, hi ! \NR\HL
\stoptabulate

  Thanks for your answer,
  
  
  You achieve better results with natural tables where each cell is
  a \framed block where you have options to add backgrounds colors,
  rounded corners and custom border colors.
  
  Look at the attachment for a example.
  
  Wolfgang
  


Thank you Wolfgang,
I continued to explore the wiki and I
did find the description for the natural table and I did
discover what you are sugesting me. I'll continue to test.
Thanks again,
Alain

  
  

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to improve visually a table

2021-02-16 Thread Wolfgang Schuster

Alain Delmotte schrieb am 16.02.2021 um 21:00:

Le 16/02/2021 à 20:02, Wolfgang Schuster a écrit :

Alain Delmotte schrieb am 16.02.2021 um 19:23:


Hi!

I am progressing in the use of ConTeXt by applying it to some 
specific projects.


For two manuals I am preparing for myself I'd like to reproduce the 
original work.


What I'd like to have:

nice table

What I have so far:

present state

How to obtain the first?



Can you show your code for the table.

Wolfgang

Here it is, but I did it to have a sufficiently good table, as I 
didn't know how to recreate the original.


\placetable[none,here]{}{

\starttabulate[|i1Slw(20mm)|i1Slp(20mm)|i1lp(7cm)|]

\DB espéranto \NC {\bf exemple} \NC {\bf équivalent en français}\NR\TB

\NC {\bs g} \NC {\bs g}azeto, {\bs g}itaro \NC toujours comme le g de 
gare (jamais comme le j) \NR\HL


\NC {\bs c} \NC la{\bs c}a \NC ts, comme dans tsé-tsé \NR\HL

\NC {\bs j} \NC {\bs j}es \NC comme le y de yoga ou le ia de piano ou 
le ill de pareil, œil, fouille \NR\HL


\NC {\bs s} \NC ta{\bs s}o \NC toujours ss comme dans tasse (jamais 
comme un z) \NR\HL


\NC {\bs h} \NC {\bs h}a lo \NC la combinaison ha se prononce comme 
quand on rit : ha !, ha !, ha ! Pareil pour ho : ho !,ho !,ho ! et hi 
: hi !,hi !, hi ! \NR\HL


\stoptabulate


Thanks for your answer,



You achieve better results with natural tables where each cell is a 
\framed block where you have options to add backgrounds colors, rounded 
corners and custom border colors.


Look at the attachment for a example.

Wolfgang

\setupbodyfont[dejavu,10pt,ss]

\starttext

\definecolor [tableheader] [x=00ADEF]

\startsetups[tablesettings]
\setupTABLE[start][framecolor=gray,loffset=.5ex,roffset=.5ex]
   
%\setupTABLE[header][background=color,backgroundcolor=tableheader,foregroundcolor=white]
   %\setupTABLE[header][1][corner=08]
   %\setupTABLE[header][3][corner=05]

\setupTABLE[row][first][background=color,backgroundcolor=tableheader,foregroundcolor=white]
\setupTABLE[first][first][corner=08]
\setupTABLE[last][first][corner=05]
\setupTABLE[first][last][corner=07]
\setupTABLE[last][last][corner=06]
\setupTABLE[column][last][style={\setcharacterspacing[frenchpunctuation]}]
\stopsetups

\bTABLE[setups=tablesettings]
%\bTABLEhead
\bTR
\bTH espéranto \eTH
\bTH exemple \eTH
\bTH équivalent en français \eTH
\eTR
%\eTABLEhead
%\bTABLEbody
\bTR
\bTD {\bs g} \eTD
\bTD {\bs g}azeto, {\bs g}itaro \eTD
\bTD toujours comme le g de gare (jamais comme le j) \eTD
\eTR
\bTR
\bTD {\bs c} \eTD
\bTD la{\bs c}a \eTD
\bTD ts, comme dans tsé-tsé \eTD
\eTR
\bTR
\bTD {\bs j} \eTD
\bTD {\bs j}es \eTD
\bTD comme le y de yoga ou le ia de piano ou le ill de pareil, œil, fouille 
\eTD
\eTR
\bTR
\bTD {\bs s} \eTD
\bTD ta{\bs s}o \eTD
\bTD toujours ss comme dans tasse (jamais comme un z) \eTD
\eTR
\bTR
\bTD {\bs h} \eTD
\bTD {\bs h}a lo \eTD
\bTD la combinaison ha se prononce comme quand on rit: ha!, ha!, ha! Pareil 
pour ho: ho!, ho!, ho! et hi: hi!, hi!, hi! \eTD
\eTR
%\eTABLEbody
\eTABLE

\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to improve visually a table

2021-02-16 Thread Wolfgang Schuster

Alain Delmotte schrieb am 16.02.2021 um 19:23:


Hi!

I am progressing in the use of ConTeXt by applying it to some specific 
projects.


For two manuals I am preparing for myself I'd like to reproduce the 
original work.


What I'd like to have:

nice table

What I have so far:

present state

How to obtain the first?



Can you show your code for the table.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] How to improve visually a table

2021-02-16 Thread Alain Delmotte

  
  
Hi!
I am progressing in the use of ConTeXt
by applying it to some specific projects.
  
For two manuals I am preparing for
myself I'd like to reproduce the original work.
What I'd like to have:

What I have so far:


How to obtain the first?
Thanks,
Alain



  

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Table of Content

2021-02-12 Thread Hans Hagen

On 2/12/2021 4:52 PM, Pablo Rodriguez wrote:

On 2/12/21 4:40 PM, Hans Hagen wrote:

On 2/12/2021 3:43 PM, Pablo Rodriguez wrote:

[...]
"\page\null\page" does the trick in your case.


\page[left,empty,right] etc


Hans,

I never thought this were possible:

   \starttext
   \page[left,empty,right,
   left,empty,right,
   left,empty,right]
   \stoptext

pretty old feature ... there are more options

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Table of Content

2021-02-12 Thread Pablo Rodriguez
On 2/12/21 4:40 PM, Hans Hagen wrote:
> On 2/12/2021 3:43 PM, Pablo Rodriguez wrote:
>> [...]
>> "\page\null\page" does the trick in your case.
>
> \page[left,empty,right] etc

Hans,

I never thought this were possible:

  \starttext
  \page[left,empty,right,
  left,empty,right,
  left,empty,right]
  \stoptext

Pablo
--
http://www.ousia.tk
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Table of Content

2021-02-12 Thread Pablo Rodriguez
On 2/11/21 12:11 PM, Ursula Hermann wrote:
> Dear List!
>
>
> I did this example, which works perfect. If i would like to  take a new
> page after the Table of Content, is \page the right way? 

Hi Ursula,

"\page\null\page" does the trick in your case.

"\setuppagenumber[alternative=doublesided]" is a much more consistent
approach, but I don’t know what your requirements might be.

Just in case it helps,

Pablo
--
http://www.ousia.tk
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Table of Content

2021-02-11 Thread Ursula Hermann
Dear List!


I did this example, which works perfect. If i would like to  take a new page 
after the Table of Content, is \page the right way?

% mode=mkiv
\setuppapersize[A7][A7]
\language[de]
%list the "subject" sections in the ToC but don't modify the "section" counter:
\setuphead[subject]  [incrementnumber=list]

%"width": distance between number and text in the ToC entry, "margin" : indent 
of ToC entry relative to left page margin
\setuplist[section][width=1.5em]
\setuplist[subsection][width=2.5em, margin=1.5em]
\setuplist[subject]
\setuplist[subject, section, subsection]

\setupcombinedlist[content][list={subject,section,subsection}, alternative=c]

\starttext
\placecontent
\setupuserpagenumber[numberconversion=romannumerals]
\setcounter[userpage][5]
\page
\subject{Vorwort}
\page
\setupuserpagenumber[numberconversion=numbers]
\setcounter[userpage][12]
\section{One}
\subsection{Sec A}
\section{Two}
\subject{Bibliography}
\stoptext

Uschi


___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Table disappears in floatcombination

2020-12-26 Thread Christoph Reller
On Sat, Dec 26, 2020 at 10:54 AM Hans Hagen  wrote:

> On 12/25/2020 9:47 PM, Christoph Reller wrote:
> > Hi,
> >
> > Consider the following MWE:
> >
> > \definefloat[combination][figure]
> > \setupcaptions[
> >number=no, %<- comment and table appears
> >align=flushright]
> > \starttext
> > \startplacecombination[title=Combination]
> >\startfloatcombination
> >  \startplacetable%[title=Table] %<- uncomment and table appears
> >\bTABLE \bTR \bTD Cell \eTD \eTR \eTABLE
> >  \stopplacetable
> >\stopfloatcombination
> > \stopplacecombination
> > \stoptext
> >
> > In the latest LMTX version of ConTeXt, the table is not shown. (In MKIV
> > it is present.) Either commenting line 3 or activating the table title
> > in line 8 makes the table appear.
>
> what version of mkiv did you test?
>

Okay, the MKIV version is a little bit dated: 2018.05.19_21.46.
Still: How can I get floats without captions within a
floatcombination environment?
Christoph
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Table disappears in floatcombination

2020-12-26 Thread Hans Hagen

On 12/25/2020 9:47 PM, Christoph Reller wrote:

Hi,

Consider the following MWE:

\definefloat[combination][figure]
\setupcaptions[
   number=no, %<- comment and table appears
   align=flushright]
\starttext
\startplacecombination[title=Combination]
   \startfloatcombination
     \startplacetable%[title=Table] %<- uncomment and table appears
       \bTABLE \bTR \bTD Cell \eTD \eTR \eTABLE
     \stopplacetable
   \stopfloatcombination
\stopplacecombination
\stoptext

In the latest LMTX version of ConTeXt, the table is not shown. (In MKIV 
it is present.) Either commenting line 3 or activating the table title 
in line 8 makes the table appear.


what version of mkiv did you test?

Also, once the captions appear, they don't align on the right side. When 
changing the caption alignment to "align=flushleft", they align 
perfectly on the left side.


Am I doing something wrong?

Cheers,

Christoph

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Table disappears in floatcombination

2020-12-25 Thread Christoph Reller
Hi,

Consider the following MWE:

\definefloat[combination][figure]
\setupcaptions[
  number=no, %<- comment and table appears
  align=flushright]
\starttext
\startplacecombination[title=Combination]
  \startfloatcombination
\startplacetable%[title=Table] %<- uncomment and table appears
  \bTABLE \bTR \bTD Cell \eTD \eTR \eTABLE
\stopplacetable
  \stopfloatcombination
\stopplacecombination
\stoptext

In the latest LMTX version of ConTeXt, the table is not shown. (In MKIV it
is present.) Either commenting line 3 or activating the table title in line
8 makes the table appear.

Also, once the captions appear, they don't align on the right side. When
changing the caption alignment to "align=flushleft", they align perfectly
on the left side.

Am I doing something wrong?

Cheers,

Christoph
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] LMTX and addplot table

2020-12-12 Thread Hans Hagen

On 12/12/2020 3:35 PM, Jean-Philippe Rey wrote:

I wiped t-tikz.  The only noticeable difference is that now I need to 
explicitly \usemodule[tikz] in order to use pgfplots. I checked and 
found the line


\usemodule[t][tikz]

in t-pgfplots.tex.  I guess that explains it.
probably ... anyway, when we enable more strong protection of macros in 
context one needs the mentioned variant anyway (that way I can deal with 
it .. there a few tikz files in the test suite so they would bark when 
something fails)


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] LMTX and addplot table

2020-12-12 Thread Hans Hagen

On 12/12/2020 3:35 PM, Jean-Philippe Rey wrote:

By default, pgfplotstable breaks lines at white space (tab or space 
according to the pgfplotstable manual). I used tabs as column separators 
in my demo file. With MKiV, the columns are correctly split but with 
LMTX, pgfplotstable sees a single column.


I explicitly stated that the columns are separated with tabs:

\addplot table [x=t, y=E, col sep=tab] {mfe-addplot.dat};

and it works. I tried to change the columns separator to a space, 
instead of a tab and it also works.


I don't know what pgfplotstable uses to split columns, but the 
conclusion is that with MkIV 'col sep=space' means space or tab, whereas 
with LMTX it means strictly a space character.


Thank you very much for your help.
I think I have it running now but you have to wait for an update (one of 
those curious border cases where tex bends a rule by turning tabs into 
spaces (the alternative is to let the tab token flagged as spacer travel 
around which would permits round trip). Makes me wonder I should have 
that as option in luametatex (but as I'm now in metapost mode I delay 
that pondering.)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] LMTX and addplot table

2020-12-12 Thread Jean-Philippe Rey


> Le 12 déc. 2020 à 13:20, Hans Hagen  a écrit :
> 
> On 12/12/2020 12:19 PM, Jean-Philippe Rey wrote:
>>> Le 12 déc. 2020 à 11:58, Hans Hagen >> <mailto:j.ha...@xs4all.nl>> a écrit :
>>> 
>>> On 12/12/2020 10:36 AM, Jean-Philippe Rey wrote:
>>>> Dear list,
>>>> I am unable to draw a plot using an external file with LMTX. Here is a 
>>>> minimal example
>>>> =====
>>>> \usemodule[pgfplots]
>>>> \starttext
>>>> \starttikzpicture
>>>> \startaxis
>>>> \addplot table [x=t, y=E] {mfe-addplot.dat};
>>>> \stopaxis
>>>> \stoptikzpicture
>>>> \stoptext
>>>> =
>>>> The ConTeXt run fails with an "Undefined control sequence" error (see 
>>>> attached log file). I don't know if this is an LMTX or PGF issue. The 
>>>> example works fine with MkIV. I tried with the tikz version available on 
>>>> ConTeXt garden (pgf 3.0.1, pgfplots 1.16) and the last one from CTAN (pgf 
>>>> 3.1.7a, pgfplots 1.17) with the same result.
> 
> wipe t-tikz.* on your machine in order to use m-tikz.mkiv in the distribution 
> because it looks like it does a bad catcode table change ... that went 
> unnoticed because a chardef'd constant gets typeset (and when that happens 
> before \starttext you won't see it but it actually does introduce some funny 
> char); in lmtx we don't use chardef for that so that can give an error then 
> when loading
> 
> anyway, you're not suffering from that i think but better use the right 
> module loader anyway


I wiped t-tikz.  The only noticeable difference is that now I need to 
explicitly \usemodule[tikz] in order to use pgfplots. I checked and found the 
line

\usemodule[t][tikz]

in t-pgfplots.tex.  I guess that explains it.


> then you can define the \PackageError macro (I did it with some trial and 
> error but the next seems to work:
> 
> \let\PackageError\writestatus
> 
> so I'll add something like that to m-tikz.mkiv

As Wolfgang pointed out, \PackageError takes three parameters, the third is 
meant to be displayed when the user types H to an error prompt. I defined it as

\def/PackageError#1#2#3{\writestatus{#1}{#2 (#3)}}

that effectively displays the error message in the console and the log file.


> which still looks bad but at least you don't crash .. i'll look into that 
> later today (as i'm splitting mkiv/lmtx code i use a slightly different file 
> reader so maybe that's it)

I guess that you've pinpointed the problem.

By default, pgfplotstable breaks lines at white space (tab or space according 
to the pgfplotstable manual). I used tabs as column separators in my demo file. 
With MKiV, the columns are correctly split but with LMTX, pgfplotstable sees a 
single column.

I explicitly stated that the columns are separated with tabs:

\addplot table [x=t, y=E, col sep=tab] {mfe-addplot.dat};

and it works. I tried to change the columns separator to a space, instead of a 
tab and it also works.

I don't know what pgfplotstable uses to split columns, but the conclusion is 
that with MkIV 'col sep=space' means space or tab, whereas with LMTX it means 
strictly a space character.

Thank you very much for your help.

-- 
Jean-Philippe Rey
jean-philippe@centralesupelec.fr 
<mailto:jean-philippe@centralesupelec.fr>
91192 Gif-sur-Yvette Cedex - France
Empreinte PGP : 807A 5B2C 69E4 D4B5 783A 428A 1B5E E83E 261B BF51

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] LMTX and addplot table

2020-12-12 Thread Wolfgang Schuster

Hans Hagen schrieb am 12.12.2020 um 13:20:

On 12/12/2020 12:19 PM, Jean-Philippe Rey wrote:
Le 12 déc. 2020 à 11:58, Hans Hagen <mailto:j.ha...@xs4all.nl>> a écrit :


On 12/12/2020 10:36 AM, Jean-Philippe Rey wrote:

Dear list,
I am unable to draw a plot using an external file with LMTX. Here 
is a minimal example

=
\usemodule[pgfplots]
\starttext
\starttikzpicture
\startaxis
\addplot table [x=t, y=E] {mfe-addplot.dat};
\stopaxis
\stoptikzpicture
\stoptext
=
The ConTeXt run fails with an "Undefined control sequence" error 
(see attached log file). I don't know if this is an LMTX or PGF 
issue. The example works fine with MkIV. I tried with the tikz 
version available on ConTeXt garden (pgf 3.0.1, pgfplots 1.16) and 
the last one from CTAN (pgf 3.1.7a, pgfplots 1.17) with the same 
result.


looks like \PackageError is undefined which is something PGF


\PackageError is a LaTeX command which takes 3 argument: 
\PackageError{}{}{}


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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] LMTX and addplot table

2020-12-12 Thread Hans Hagen

On 12/12/2020 12:19 PM, Jean-Philippe Rey wrote:



Le 12 déc. 2020 à 11:58, Hans Hagen <mailto:j.ha...@xs4all.nl>> a écrit :


On 12/12/2020 10:36 AM, Jean-Philippe Rey wrote:

Dear list,
I am unable to draw a plot using an external file with LMTX. Here is 
a minimal example

=
\usemodule[pgfplots]
\starttext
\starttikzpicture
\startaxis
\addplot table [x=t, y=E] {mfe-addplot.dat};
\stopaxis
\stoptikzpicture
\stoptext
=
The ConTeXt run fails with an "Undefined control sequence" error (see 
attached log file). I don't know if this is an LMTX or PGF issue. The 
example works fine with MkIV. I tried with the tikz version available 
on ConTeXt garden (pgf 3.0.1, pgfplots 1.16) and the last one from 
CTAN (pgf 3.1.7a, pgfplots 1.17) with the same result.


looks like \PackageError is undefined which is something PGF

but maybe you should

! Package pgfplots Warning: running in backwards compatibility mode 
(unsuitable tick labels; missing features). Consider writing 
\pgfplotsset{compat=1.17} into your preamble.


use that setting in order to not end up at that command


Thanks Hans, but it doesn't seem to change anything.

I am not really a tikz user but can run it here

wipe t-tikz.* on your machine in order to use m-tikz.mkiv in the 
distribution because it looks like it does a bad catcode table change 
... that went unnoticed because a chardef'd constant gets typeset (and 
when that happens before \starttext you won't see it but it actually 
does introduce some funny char); in lmtx we don't use chardef for that 
so that can give an error then when loading


anyway, you're not suffering from that i think but better use the right 
module loader anyway


then you can define the \PackageError macro (I did it with some trial 
and error but the next seems to work:


\let\PackageError\writestatus

so I'll add something like that to m-tikz.mkiv

after all that I get this:

PGFPlots: reading {mfe-addplot.dat}

pgfplots> Sorry, could not retrieve column 't' from table 
'\\pgfplotstableread@filename@@table@name '. Please check spelling (or 
introduce name aliases).
pgfplots> Sorry, could not retrieve column 'E' from table 
'\\pgfplotstableread@filename@@table@name '. Please check spelling (or 
introduce name aliases).
pgfplots> Sorry, the requested column number '' in table 
'mfe-addplot.dat' does not exist!? Please verify you used the correct 
index 0 <= i < N.
pgfplots> Sorry, the requested column number '' in table 
'mfe-addplot.dat' does not exist!? Please verify you used the correct 
index 0 <= i < N.
NOTE: coordinate (,) has been dropped because of a coordinate filter. 
(see also unbounded coords=jump).


pgfplots> Sorry, the requested column number '' in table 
'mfe-addplot.dat' does not exist!? Please verify you used the correct 
index 0 <= i < N.
pgfplots> Sorry, the requested column number '' in table 
'mfe-addplot.dat' does not exist!? Please verify you used the correct 
index 0 <= i < N.
NOTE: coordinate (,) has been dropped because of a coordinate filter. 
(see also unbounded coords=jump).


pgfplots> Sorry, the requested column number '' in table 
'mfe-addplot.dat' does not exist!? Please verify you used the correct 
index 0 <= i < N.
pgfplots> Sorry, the requested column number '' in table 
'mfe-addplot.dat' does not exist!? Please verify you used the correct 
index 0 <= i < N.
NOTE: coordinate (,) has been dropped because of a coordinate filter. 
(see also unbounded coords=jump).


pgfplots> Sorry, the requested column number '' in table 
'mfe-addplot.dat' does not exist!? Please verify you used the correct 
index 0 <= i < N.
pgfplots> Sorry, the requested column number '' in table 
'mfe-addplot.dat' does not exist!? Please verify you used the correct 
index 0 <= i < N.
NOTE: coordinate (,) has been dropped because of a coordinate filter. 
(see also unbounded coords=jump).


! Package pgfplots Warning: the current plot has no coordinates (or all 
have been filtered away)


 [warning /pgfplots/warning/plot without coordinates]

! Package pgfplots Warning: You have an axis with empty range (in 
direction y). Replacing it with a default range and clearing all plots.


 [warning /pgfplots/warning/empty range cleared axis]

which still looks bad but at least you don't crash .. i'll look into 
that later today (as i'm splitting mkiv/lmtx code i use a slightly 
different file reader so maybe that's it)


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
_

Re: [NTG-context] LMTX and addplot table

2020-12-12 Thread Hans Hagen

On 12/12/2020 10:36 AM, Jean-Philippe Rey wrote:

Dear list,

I am unable to draw a plot using an external file with LMTX. Here is a minimal 
example

=
\usemodule[pgfplots]
\starttext
\starttikzpicture
\startaxis
\addplot table [x=t, y=E] {mfe-addplot.dat};
\stopaxis
\stoptikzpicture
\stoptext
=

The ConTeXt run fails with an "Undefined control sequence" error (see attached 
log file). I don't know if this is an LMTX or PGF issue. The example works fine with 
MkIV. I tried with the tikz version available on ConTeXt garden (pgf 3.0.1, pgfplots 
1.16) and the last one from CTAN (pgf 3.1.7a, pgfplots 1.17) with the same result.


looks like \PackageError is undefined which is something PGF

but maybe you should

! Package pgfplots Warning: running in backwards compatibility mode 
(unsuitable tick labels; missing features). Consider writing 
\pgfplotsset{compat=1.17} into your preamble.


use that setting in order to not end up at that command

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] LMTX and addplot table

2020-12-12 Thread Jean-Philippe Rey
Dear list,

I am unable to draw a plot using an external file with LMTX. Here is a minimal 
example

=
\usemodule[pgfplots]
\starttext
\starttikzpicture
\startaxis
\addplot table [x=t, y=E] {mfe-addplot.dat};
\stopaxis
\stoptikzpicture
\stoptext
=

The ConTeXt run fails with an "Undefined control sequence" error (see attached 
log file). I don't know if this is an LMTX or PGF issue. The example works fine 
with MkIV. I tried with the tikz version available on ConTeXt garden (pgf 
3.0.1, pgfplots 1.16) and the last one from CTAN (pgf 3.1.7a, pgfplots 1.17) 
with the same result.

The same example works fine if I provide the data inline. This looks like a 
problem while reading the data file.

Thanks for your insight.

Best regards,

-- 
Jean-Philippe Rey
jean-philippe@centralesupelec.fr
91192 Gif-sur-Yvette Cedex - France
Empreinte PGP : 807A 5B2C 69E4 D4B5 783A 428A 1B5E E83E 261B BF51
<>

mfe-addplot.log
Description: Binary data
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How can I make "natural table" be exactly as wide as the textwidth?

2020-12-08 Thread T. Kurt Bond
Here's a MWE that produces the oddly distributed columns:

\setuplayout[backspace=0.5in,width=4.5in,topspace=0.5in,
top=0in,topdistance=0in,
  header=0in,headerdistance=0in,bottom=0.25in,bottomdistance=0.125in,
  footer=0.25in,footerdistance=0.25in,height=7.75in]
\setuppagenumbering[location={footer,middle}]
\setupwhitespace[quarterline]
\setupbodyfont[pagella,9pt]
\definepapersize[digest][width=5.5in,height=8.5in]
\setuppapersize[digest]
\starttext
\startplacetable[location=force,title={Stun Levels}]
\definecolor[back-3][r=.8,g=.8,b=.8]
\setupTABLE[background=color,frame=off,framecolor=white]
\setupTABLE[row][odd][backgroundcolor=back-3]
\setupTABLE[row][1][topframe=on,bottomframe=on,framecolor=
black,rulethickness=0.75pt]
\setupTABLE[row][4][bottomframe=on,framecolor=black,rulethickness=0.75pt]
\bTABLE[width=broad]
\bTR\bTD {\bf Damage >\\Soak by:}\  \eTD\bTD {\bf
Stun\\Level}\eTD\bTD {\bf Stun\\Effects}   \eTD\eTR
\bTR\bTD 0 or less\eTD\bTD Unharmed \eTD\bTD None.
  \eTD\eTR
\bTR\bTD 1 to 8   \eTD\bTD Stunned  \eTD\bTD -1D on all actions for
2D rounds.   \eTD\eTR
\bTR\bTD 9+   \eTD\bTD Severely\\Stunned\eTD\bTD The character is
knocked unconscious for 2D minutes.\eTD\eTR
\eTABLE
\stopplacetable
\stoptext


Naively, I expected the third column, which has the longest text, to absorb
more of the width, rather than the three columns getting about the same
width.

I added the following two lines before the \bTABLE:

\setupTABLE[column][1][width=6em]
\setupTABLE[column][2][width=6em]


This caused all the space not used by the first two columns to be used by
the third column.

Thinking about it a little more, the first result makes sense: there is
probably no way for ConTeXt to figure out that the third column should be
wider unless it is given some constraints.

Interestingly, groff's tbl has a Column Specifier, x or X, that, after
computing all the widths of columns without an x specifier, uses the
remaining line width for the columns with an x, distributing them equally
across the columns with x specifiers.  (I often use groff for
quick-and-dirty documents, or where ConTeXt is not installed; I use ConTeXt
for documents that are more complex, or ones that need their appearance
customized.)  This is particularly useful when one column has paragraph
length text contents, and the other columns don't.

I don't suppose there is a bTABLE equivalent?  Or an equivalent in one of
ConTeXt's other table types?

On Sun, Dec 6, 2020 at 11:20 PM Aditya Mahajan  wrote:

> On Sun, 6 Dec 2020, T. Kurt Bond wrote:
> > On Sun, Dec 6, 2020 at 2:20 AM Aditya Mahajan  wrote:
> >
> > > On Sun, 6 Dec 2020, T. Kurt Bond wrote:
> > >
> > > > Setting maxwidth and textwidth on the \bTABLE doesn't seem to do
> > > anything.
> > >
> > > Use:
> > >
> > > \bTABLE[width=broad]
> > >
> > > \eTABLE
>
> > That did the trick!  It did distribute the new width oddly, with adding
> > more width to the the first and second columns, while the third column,
> > which had the most text to wrap, was not as wide as it could have been.
> I
> > had to set widths for the first and second columns, and had to experiment
> > to get them right.
>
> A MWE (Minimal working example) is needed to see what is going on.
>
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>


-- 
T. Kurt Bond, tkurtb...@gmail.com, https://tkurtbond.github.io
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How can I make "natural table" be exactly as wide as the textwidth?

2020-12-06 Thread Aditya Mahajan
On Sun, 6 Dec 2020, T. Kurt Bond wrote:
> On Sun, Dec 6, 2020 at 2:20 AM Aditya Mahajan  wrote:
> 
> > On Sun, 6 Dec 2020, T. Kurt Bond wrote:
> >
> > > Setting maxwidth and textwidth on the \bTABLE doesn't seem to do
> > anything.
> >
> > Use:
> >
> > \bTABLE[width=broad]
> >
> > \eTABLE

> That did the trick!  It did distribute the new width oddly, with adding
> more width to the the first and second columns, while the third column,
> which had the most text to wrap, was not as wide as it could have been.  I
> had to set widths for the first and second columns, and had to experiment
> to get them right.

A MWE (Minimal working example) is needed to see what is going on.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How can I make "natural table" be exactly as wide as the textwidth?

2020-12-06 Thread T. Kurt Bond
That did the trick!  It did distribute the new width oddly, with adding
more width to the the first and second columns, while the third column,
which had the most text to wrap, was not as wide as it could have been.  I
had to set widths for the first and second columns, and had to experiment
to get them right.

Thanks for the help!

On Sun, Dec 6, 2020 at 2:20 AM Aditya Mahajan  wrote:

> On Sun, 6 Dec 2020, T. Kurt Bond wrote:
>
> > Setting maxwidth and textwidth on the \bTABLE doesn't seem to do
> anything.
>
> Use:
>
> \bTABLE[width=broad]
>
> \eTABLE
>
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>


-- 
T. Kurt Bond, tkurtb...@gmail.com, https://tkurtbond.github.io
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How can I make "natural table" be exactly as wide as the textwidth?

2020-12-05 Thread Aditya Mahajan
On Sun, 6 Dec 2020, T. Kurt Bond wrote:

> Setting maxwidth and textwidth on the \bTABLE doesn't seem to do anything.

Use: 

\bTABLE[width=broad]

\eTABLE

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Can you make a \setupTABLE only apply to one table?

2020-12-05 Thread Aditya Mahajan
On Sat, 5 Dec 2020, T. Kurt Bond wrote:

> If I understand correctly, \setupTABLE applies to each table after the
> \setupTABLE, correct?  If so, can you make it only apply to one table?

If you really need it for one table:

\bTABLE
\setupTABLE[...][...]
\setupTABLE[...][...]
\bTR ... \eTR
\eTABLE

A better option is to add it inside a setup:

\startsetup table:formatting
  \setupTABLE[...][...]
  \setupTABLE[...][...]
\stopsetup

\bTABLE[setups={table:formatting}]

\eTABLE

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] How can I make "natural table" be exactly as wide as the textwidth?

2020-12-05 Thread T. Kurt Bond
Setting maxwidth and textwidth on the \bTABLE doesn't seem to do anything.

-- 
T. Kurt Bond, tkurtb...@gmail.com, https://tkurtbond.github.io
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Can I caption a table without using something that makes it float?

2020-12-05 Thread T. Kurt Bond
Oh, after looking at some examples I found that
\startplacetable[location=force,title={Caption
Text}] places the table without the extra vertical space, as long as there
wasn't a \setupalign[line] !

On Sat, Dec 5, 2020 at 11:01 PM T. Kurt Bond  wrote:

> If I use \placetable or startplacetable with location=force it shows up
> but there is lots of space before and after it, I assume it is because it
> is a float.  Is there a way I can caption the table without using something
> that makes it float, or remove the space otherwise?
>
> --
> T. Kurt Bond, tkurtb...@gmail.com, https://tkurtbond.github.io
>


-- 
T. Kurt Bond, tkurtb...@gmail.com, https://tkurtbond.github.io
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Can I caption a table without using something that makes it float?

2020-12-05 Thread T. Kurt Bond
If I use \placetable or startplacetable with location=force it shows up but
there is lots of space before and after it, I assume it is because it is a
float.  Is there a way I can caption the table without using something that
makes it float, or remove the space otherwise?

-- 
T. Kurt Bond, tkurtb...@gmail.com, https://tkurtbond.github.io
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Can you make a \setupTABLE only apply to one table?

2020-12-05 Thread T. Kurt Bond
Thanks for the help!


On Sat, Dec 5, 2020 at 10:21 PM Jairo A. del Rio 
wrote:

> Hi,
> You could enclose your table and setup using \bgroup and \egroup
>
> \bgroup
> \setupTABLE ...
> \bTABLE ... \eTABLE
> \egroup
>
> \begingroup ... \endgroup also works, although I have to admit I'm not
> aware of the differences between both.
>
> Regards,
>
> Jairo :)
>
> El sáb., 5 de dic. de 2020 10:01 p. m., T. Kurt Bond 
> escribió:
>
>> If I understand correctly, \setupTABLE applies to each table after the
>> \setupTABLE, correct?  If so, can you make it only apply to one table?
>>
>> --
>> T. Kurt Bond, tkurtb...@gmail.com, https://tkurtbond.github.io
>>
>> ___
>> 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://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : http://contextgarden.net
>>
>> ___
>>
>
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>


-- 
T. Kurt Bond, tkurtb...@gmail.com, https://tkurtbond.github.io
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Can you make a \setupTABLE only apply to one table?

2020-12-05 Thread Jairo A. del Rio
Hi,
You could enclose your table and setup using \bgroup and \egroup

\bgroup
\setupTABLE ...
\bTABLE ... \eTABLE
\egroup

\begingroup ... \endgroup also works, although I have to admit I'm not
aware of the differences between both.

Regards,

Jairo :)

El sáb., 5 de dic. de 2020 10:01 p. m., T. Kurt Bond 
escribió:

> If I understand correctly, \setupTABLE applies to each table after the
> \setupTABLE, correct?  If so, can you make it only apply to one table?
>
> --
> T. Kurt Bond, tkurtb...@gmail.com, https://tkurtbond.github.io
>
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Can you make a \setupTABLE only apply to one table?

2020-12-05 Thread T. Kurt Bond
If I understand correctly, \setupTABLE applies to each table after the
\setupTABLE, correct?  If so, can you make it only apply to one table?

-- 
T. Kurt Bond, tkurtb...@gmail.com, https://tkurtbond.github.io
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] startCSV Wiki, Natural Table

2020-11-24 Thread Fabrice L


> Le 24 nov. 2020 à 13:36, Wolfgang Schuster 
>  a écrit :
> 
> Fabrice L schrieb am 24.11.2020 um 19:08:
>>> Le 24 nov. 2020 à 12:52, Wolfgang Schuster 
>>>  a écrit :
>>> 
>>> Fabrice L schrieb am 24.11.2020 um 18:44:
>>>> Hi,
>>>> I was using in the past (MKII) a snippet of code to produce (natural) 
>>>> tables from CSV. I was trying to compile my code with MKIV, but this does 
>>>> not work anymore. As a matter of fact, it doe snot work at all, nor MKII, 
>>>> nor MKIV (probably my error !).
>>>> So I came back to the wiki, where my code came from, and the code below is 
>>>> just a copy for the wiki. It is supposed to make a table with three 
>>>> columns, but there is only one column in the resulting table…  I admit I 
>>>> do not understand the code, but is there is missing \eTR somewhere ?
>>> Use the database module.
>>> 
>>> \usemodule[database]
>>> 
>>> \defineseparatedlist
>>>  [CSV]
>>>  [separator={,},
>>>  before=\bTABLE,
>>>   after=\eTABLE,
>>>   first=\bTR,
>>>last=\eTR,
>>>left=\bTD,
>>>   right=\eTD]
>>> 
>>> \starttext
>>> 
>>> \startCSV
>>> 1,2,3
>>> 3,5,6
>>> 7,8,9
>>> \stopCSV
>>> 
>>> \stoptext
>>> 
>>> Wolfgang
>> Wolfgang, thanks. I have seen the use if the database module on the wiki, 
>> but was trying to do without it, the reason is that my documents are often 
>> shared with colleagues, for which installation of modules is most often very 
>> difficult.
> 
> There is nothing to install because the database module is part of ConTeXt.

I see… wonderfull ! Thanks a lot for the help. 
> 
> Wolfgang

Fabrice.___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] startCSV Wiki, Natural Table

2020-11-24 Thread Wolfgang Schuster

Fabrice L schrieb am 24.11.2020 um 19:08:

Le 24 nov. 2020 à 12:52, Wolfgang Schuster  
a écrit :

Fabrice L schrieb am 24.11.2020 um 18:44:

Hi,
I was using in the past (MKII) a snippet of code to produce (natural) tables 
from CSV. I was trying to compile my code with MKIV, but this does not work 
anymore. As a matter of fact, it doe snot work at all, nor MKII, nor MKIV 
(probably my error !).
So I came back to the wiki, where my code came from, and the code below is just 
a copy for the wiki. It is supposed to make a table with three columns, but 
there is only one column in the resulting table…  I admit I do not understand 
the code, but is there is missing \eTR somewhere ?

Use the database module.

\usemodule[database]

\defineseparatedlist
  [CSV]
  [separator={,},
  before=\bTABLE,
   after=\eTABLE,
   first=\bTR,
last=\eTR,
left=\bTD,
   right=\eTD]

\starttext

\startCSV
1,2,3
3,5,6
7,8,9
\stopCSV

\stoptext

Wolfgang

Wolfgang, thanks. I have seen the use if the database module on the wiki, but 
was trying to do without it, the reason is that my documents are often shared 
with colleagues, for which installation of modules is most often very difficult.


There is nothing to install because the database module is part of ConTeXt.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] startCSV Wiki, Natural Table

2020-11-24 Thread Fabrice L


> Le 24 nov. 2020 à 12:52, Wolfgang Schuster 
>  a écrit :
> 
> Fabrice L schrieb am 24.11.2020 um 18:44:
>> Hi,
>> I was using in the past (MKII) a snippet of code to produce (natural) tables 
>> from CSV. I was trying to compile my code with MKIV, but this does not work 
>> anymore. As a matter of fact, it doe snot work at all, nor MKII, nor MKIV 
>> (probably my error !).
>> So I came back to the wiki, where my code came from, and the code below is 
>> just a copy for the wiki. It is supposed to make a table with three columns, 
>> but there is only one column in the resulting table…  I admit I do not 
>> understand the code, but is there is missing \eTR somewhere ?
> 
> Use the database module.
> 
> \usemodule[database]
> 
> \defineseparatedlist
>  [CSV]
>  [separator={,},
>  before=\bTABLE,
>   after=\eTABLE,
>   first=\bTR,
>last=\eTR,
>left=\bTD,
>   right=\eTD]
> 
> \starttext
> 
> \startCSV
> 1,2,3
> 3,5,6
> 7,8,9
> \stopCSV
> 
> \stoptext
> 
> Wolfgang

Wolfgang, thanks. I have seen the use if the database module on the wiki, but 
was trying to do without it, the reason is that my documents are often shared 
with colleagues, for which installation of modules is most often very 
difficult. 
Anyway, I will use the database module this time, so simple ! Thanks again.

Fabrice
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] startCSV Wiki, Natural Table

2020-11-24 Thread Wolfgang Schuster

Fabrice L schrieb am 24.11.2020 um 18:44:

Hi,

I was using in the past (MKII) a snippet of code to produce (natural) tables 
from CSV. I was trying to compile my code with MKIV, but this does not work 
anymore. As a matter of fact, it doe snot work at all, nor MKII, nor MKIV 
(probably my error !).

So I came back to the wiki, where my code came from, and the code below is just 
a copy for the wiki. It is supposed to make a table with three columns, but 
there is only one column in the resulting table…  I admit I do not understand 
the code, but is there is missing \eTR somewhere ?


Use the database module.

\usemodule[database]

\defineseparatedlist
  [CSV]
  [separator={,},
  before=\bTABLE,
   after=\eTABLE,
   first=\bTR,
last=\eTR,
left=\bTD,
   right=\eTD]

\starttext

\startCSV
1,2,3
3,5,6
7,8,9
\stopCSV

\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] startCSV Wiki, Natural Table

2020-11-24 Thread Fabrice L
Hi,

I was using in the past (MKII) a snippet of code to produce (natural) tables 
from CSV. I was trying to compile my code with MKIV, but this does not work 
anymore. As a matter of fact, it doe snot work at all, nor MKII, nor MKIV 
(probably my error !). 

So I came back to the wiki, where my code came from, and the code below is just 
a copy for the wiki. It is supposed to make a table with three columns, but 
there is only one column in the resulting table…  I admit I do not understand 
the code, but is there is missing \eTR somewhere ?

Thanks for any help.
Fabrice.

Ps: in case someone is interested, I use this to produce statistical tables for 
teaching. I can share.. ! 

% --
\starttext

% Iterate over all the lines of text captured with \obeylines active
% command to call is first argument, is not called for empty lines
\bgroup
\obeylines
\gdef\ProcessLines#1#2{\doProcessLines{#1}#2^^M\doProcessLines}%
\gdef\doProcessLines#1#2^^M#3\doProcessLines{%
 \doifnotempty{#2}{#1{#2}}%
 \doifnotempty{#3}{\doProcessLines{#1}#3\doProcessLines}%
}%
\egroup

\def\startCSV{\bgroup\obeylines\dostartCSV}

\def\TBLentry#1{\bTD#1\eTD}
\def\TBLline#1{\bTR\processcommalist[#1]\TBLentry}

\def\dostartCSV#1\stopCSV{%
  \bTABLE
  \ProcessLines\TBLline{#1}%
  \eTABLE
  \egroup
}

% some additional settings for the table may be made as well
\setupTABLE[c][2][style=\tt]
\setupTABLE[c][3][align=middle]
\setupTABLE[r][1][style=bold] 

\startCSV
Name,Email,Accepted
\CONTEXT,wo...@trying.to,Yes
Hans,m...@developer.of,Yes
Bug,g...@rid.of,No
\stopCSV

\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How can I make the notes under this table inherit the width of the table, and not the \textwidth?

2020-11-10 Thread Andres Conrado Montoya
By the way, I already tried with \framed, but I can't get it to take the
current float width.

-- 
Andrés Conrado Montoya
Andi Kú
andresconr...@gmail.com
http://sesentaycuatro.com
http://messier87.com
http://chiquitico.org

Los fines no justifican los medios, porque la medida verdadera de nuestro
carácter está dada por los medios que estamos dispuestos a utilizar, no por
los fines que proclamamos.


“You develop an instant global consciousness, a people orientation, an
intense dissatisfaction with the state of the world, and a compulsion to do
something about it. From out there on the moon, international politics look
so petty. You want to grab a politician by the scruff of the neck and drag
him a quarter of a million miles out and say, ‘Look at that, you son of a
bitch.’” — Apollo 14 astronaut Edgar Mitchell
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How can I make the notes under this table inherit the width of the table, and not the \textwidth?

2020-11-10 Thread Andres Conrado Montoya
> Hi Andrés,
>
> You could probably put the notes inside a \start...\stopxtablefoot
>
> Sylvain

Thanks Sylvain, but I have a lot of tables to edit...This may work, but I
would prefer to explore programmatic solutions involving the two defined
macros(\fuentent & \fuente in my example), because I really don't want to
go back and edit a hundred or so tables.

-- 
Andrés Conrado Montoya
Andi Kú
andresconr...@gmail.com
http://sesentaycuatro.com
http://messier87.com
http://chiquitico.org

Los fines no justifican los medios, porque la medida verdadera de nuestro
carácter está dada por los medios que estamos dispuestos a utilizar, no por
los fines que proclamamos.


“You develop an instant global consciousness, a people orientation, an
intense dissatisfaction with the state of the world, and a compulsion to do
something about it. From out there on the moon, international politics look
so petty. You want to grab a politician by the scruff of the neck and drag
him a quarter of a million miles out and say, ‘Look at that, you son of a
bitch.’” — Apollo 14 astronaut Edgar Mitchell
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How can I make the notes under this table inherit the width of the table, and not the \textwidth?

2020-11-10 Thread Sylvain Hubert
Hi Andrés,

You could probably put the notes inside a \start...\stopxtablefoot

Sylvain

On Tue, 10 Nov 2020 at 21:49, Andres Conrado Montoya <
andresconr...@gmail.com> wrote:

> MWE (sorry for the long table, I hadn't anything else at hand):
>
> 
> \definehighlight[emph][style={\em}]
> \definehighlight[strong][style={\bf}]
>
> \setupfloat[table][default={here}]
>
> \definereferenceformat[figura][text={Figura~}]
> \definereferenceformat[tabla][text={Tabla~}]
>
> \setupcaptions[style={\sans\small},
>   width=max,
>   prefix=no,
>   align={flushleft,nothyphenated},
>   way=bytext]
> \setupcaption[table][location=top]
>
> \setupthinrules[width=15em] % width of horizontal rules
>
> \setupxtable[frame=off,option=stretch,bodyfont=small,foregroundstyle=sans]
> \setupxtable[head][topframe=on,bottomframe=on,foregroundstyle=sansbold]
> \setupxtable[body][bottomframe=on]
> \setupxtable[foot][bottomframe=on]
>
> \define[1]\fuentent{\start\switchtobodyfont[sans,small]#1\par\stop}
>
> \define[1]\fuente{\start\switchtobodyfont[sans,small]\emph{Fuente:}~#1\par\stop}
>
> \starttext
> \reference[tbl:t03]{}%
> \startplacetable[title={Composición química y valor energético de recursos
> forrajeros de corte en el área de influencia del Subproyecto Carne Bovina
> (trópico de altura).}]
> \startxtable[option=tight,bodyfont=7pt]
> \startxtablehead[head]
> \startxrow
> \startxcell[align=right,width=.1\textwidth] \strong{Altura\crlf (msnm)}
> \stopxcell
> \startxcell[align=right,width=.28\textwidth] \strong{Gramíneas forrajeras
> de corte} \stopxcell
> \startxcell[align=middle,width=.06\textwidth] \strong{Edad (días)}
> \stopxcell
> \startxcell[align=middle,width=.05\textwidth] \strong{MS
> (\letterpercent{})} \stopxcell
> \startxcell[align=middle,width=.1\textwidth] \strong{PC\crlf
>  (\letterpercent{} MS)} \stopxcell
> \startxcell[align=middle,width=.1\textwidth] \strong{FDN\crlf
> (\letterpercent{} MS)} \stopxcell
> \startxcell[align=middle,width=.1\textwidth] \strong{FDA\crlf
> (\letterpercent{} MS)} \stopxcell
> \startxcell[align=middle,width=.1\textwidth] \strong{EM\crlf {\bfxx
> (Mcal/kg MS)}} \stopxcell
> \startxcell[align=middle,width=.1\textwidth] \strong{ENm\crlf {\bfxx
> (Mcal/kg MS)}} \stopxcell
> \startxcell[align=middle,width=.1\textwidth] \strong{ENg\crlf {\bfxx
> (Mcal/kg MS)}} \stopxcell
> \startxcell[align=middle,width=.1\textwidth] \strong{ENl\crlf {\bfxx
> (Mcal/kg MS)}} \stopxcell
> \stopxrow
> \stopxtablehead
> \startxtablebody[body]
> \startxrow
> \startxcell[align=right,ny=2] 1800-1860 \stopxcell
> \startxcell[align=right,ny=2] \strong{Cuba 22}\crlf (\emph{P. glaucum} x
> \emph{P. thyphoides}) \stopxcell
> \startxcell[align=middle] 90 \stopxcell
> \startxcell[align=middle] 29,0 \stopxcell
> \startxcell[align=middle] 10,6 \stopxcell
> \startxcell[align=middle] 64,1 \stopxcell
> \startxcell[align=middle] 30,8 \stopxcell
> \startxcell[align=middle] 1,92 \stopxcell
> \startxcell[align=middle] 1,08 \stopxcell
> \startxcell[align=middle] 0,52 \stopxcell
> \startxcell[align=middle] 1,19 \stopxcell
> \stopxrow
> \startxrow
> \startxcell[align=middle] 210 \stopxcell
> \startxcell[align=middle] 27,8 \stopxcell
> \startxcell[align=middle] 6,2 \stopxcell
> \startxcell[align=middle] 69,1 \stopxcell
> \startxcell[align=middle] 33,6 \stopxcell
> \startxcell[align=middle] 1,78 \stopxcell
> \startxcell[align=middle] 0,94 \stopxcell
> \startxcell[align=middle] 0,40 \stopxcell
> \startxcell[align=middle] 1,09 \stopxcell
> \stopxrow
> \startxrow
> \startxcell[align=right,ny=3] 1800-2186 \stopxcell
> \startxcell[align=right,ny=3] \strong{King Grass} \crlf (\emph{P.
> purpureum} x \emph{P. typhoides}) \stopxcell
> \startxcell[align=middle] 91 \stopxcell
> \startxcell[align=middle] 22,3 \stopxcell
> \startxcell[align=middle] 8,7 \stopxcell
> \startxcell[align=middle] 65,4 \stopxcell
> \startxcell[align=middle] 32,1 \stopxcell
> \startxcell[align=middle] 1,86 \stopxcell
> \startxcell[align=middle] 1,02 \stopxcell
> \startxcell[align=middle] 0,46 \stopxcell
> \startxcell[align=middle] 1,14 \stopxcell
> \stopxrow
> \startxrow
> \startxcell[align=middle] 150 \stopxcell
> \startxcell[align=middle] 23,6 \stopxcell
> \startxcell[align=middle] 7,2 \stopxcell
> \startxcell[align=middle] 66,9 \stopxcell
> \startxcell[align=middle] 32,8 \stopxcell
> \startxcell[align=middle] 1,81 \stopxcell
> \startxcell[align=middle] 0,98 \stopxcell
> \startxcell[align=middle] 0,42 \stopxcell
> \startxcell[align=middle] 1,11 \stopxcell
> \stopxrow
> \startxrow
> \startxcell[align=middle] 182 \stopxcell
> \startxcell[align=middle] 27,0 \stop

Re: [NTG-context] page ends with a section title followed by a table

2020-11-10 Thread Aditya Mahajan
On Tue, 10 Nov 2020, Sylvain Hubert wrote:
> Indeed. Thanks for the information!
> 
> For the record, this is how the problem is finally solved:
> 
> \setuphead[section][after={\blank[sampage]}]
> \begingroup\setupindenting[no]\dontleavehmode\startxtable …
> \stopxtable\endgroup

Unless you have other reasons to create a group, you can just use:

\noindentation\dontleavehmode
\startxtable
...
\stopxtable

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] How can I make the notes under this table inherit the width of the table, and not the \textwidth?

2020-11-10 Thread Andres Conrado Montoya
MWE (sorry for the long table, I hadn't anything else at hand):


\definehighlight[emph][style={\em}]
\definehighlight[strong][style={\bf}]

\setupfloat[table][default={here}]

\definereferenceformat[figura][text={Figura~}]
\definereferenceformat[tabla][text={Tabla~}]

\setupcaptions[style={\sans\small},
  width=max,
  prefix=no,
  align={flushleft,nothyphenated},
  way=bytext]
\setupcaption[table][location=top]

\setupthinrules[width=15em] % width of horizontal rules

\setupxtable[frame=off,option=stretch,bodyfont=small,foregroundstyle=sans]
\setupxtable[head][topframe=on,bottomframe=on,foregroundstyle=sansbold]
\setupxtable[body][bottomframe=on]
\setupxtable[foot][bottomframe=on]

\define[1]\fuentent{\start\switchtobodyfont[sans,small]#1\par\stop}
\define[1]\fuente{\start\switchtobodyfont[sans,small]\emph{Fuente:}~#1\par\stop}

\starttext
\reference[tbl:t03]{}%
\startplacetable[title={Composición química y valor energético de recursos
forrajeros de corte en el área de influencia del Subproyecto Carne Bovina
(trópico de altura).}]
\startxtable[option=tight,bodyfont=7pt]
\startxtablehead[head]
\startxrow
\startxcell[align=right,width=.1\textwidth] \strong{Altura\crlf (msnm)}
\stopxcell
\startxcell[align=right,width=.28\textwidth] \strong{Gramíneas forrajeras
de corte} \stopxcell
\startxcell[align=middle,width=.06\textwidth] \strong{Edad (días)}
\stopxcell
\startxcell[align=middle,width=.05\textwidth] \strong{MS
(\letterpercent{})} \stopxcell
\startxcell[align=middle,width=.1\textwidth] \strong{PC\crlf
 (\letterpercent{} MS)} \stopxcell
\startxcell[align=middle,width=.1\textwidth] \strong{FDN\crlf
(\letterpercent{} MS)} \stopxcell
\startxcell[align=middle,width=.1\textwidth] \strong{FDA\crlf
(\letterpercent{} MS)} \stopxcell
\startxcell[align=middle,width=.1\textwidth] \strong{EM\crlf {\bfxx
(Mcal/kg MS)}} \stopxcell
\startxcell[align=middle,width=.1\textwidth] \strong{ENm\crlf {\bfxx
(Mcal/kg MS)}} \stopxcell
\startxcell[align=middle,width=.1\textwidth] \strong{ENg\crlf {\bfxx
(Mcal/kg MS)}} \stopxcell
\startxcell[align=middle,width=.1\textwidth] \strong{ENl\crlf {\bfxx
(Mcal/kg MS)}} \stopxcell
\stopxrow
\stopxtablehead
\startxtablebody[body]
\startxrow
\startxcell[align=right,ny=2] 1800-1860 \stopxcell
\startxcell[align=right,ny=2] \strong{Cuba 22}\crlf (\emph{P. glaucum} x
\emph{P. thyphoides}) \stopxcell
\startxcell[align=middle] 90 \stopxcell
\startxcell[align=middle] 29,0 \stopxcell
\startxcell[align=middle] 10,6 \stopxcell
\startxcell[align=middle] 64,1 \stopxcell
\startxcell[align=middle] 30,8 \stopxcell
\startxcell[align=middle] 1,92 \stopxcell
\startxcell[align=middle] 1,08 \stopxcell
\startxcell[align=middle] 0,52 \stopxcell
\startxcell[align=middle] 1,19 \stopxcell
\stopxrow
\startxrow
\startxcell[align=middle] 210 \stopxcell
\startxcell[align=middle] 27,8 \stopxcell
\startxcell[align=middle] 6,2 \stopxcell
\startxcell[align=middle] 69,1 \stopxcell
\startxcell[align=middle] 33,6 \stopxcell
\startxcell[align=middle] 1,78 \stopxcell
\startxcell[align=middle] 0,94 \stopxcell
\startxcell[align=middle] 0,40 \stopxcell
\startxcell[align=middle] 1,09 \stopxcell
\stopxrow
\startxrow
\startxcell[align=right,ny=3] 1800-2186 \stopxcell
\startxcell[align=right,ny=3] \strong{King Grass} \crlf (\emph{P.
purpureum} x \emph{P. typhoides}) \stopxcell
\startxcell[align=middle] 91 \stopxcell
\startxcell[align=middle] 22,3 \stopxcell
\startxcell[align=middle] 8,7 \stopxcell
\startxcell[align=middle] 65,4 \stopxcell
\startxcell[align=middle] 32,1 \stopxcell
\startxcell[align=middle] 1,86 \stopxcell
\startxcell[align=middle] 1,02 \stopxcell
\startxcell[align=middle] 0,46 \stopxcell
\startxcell[align=middle] 1,14 \stopxcell
\stopxrow
\startxrow
\startxcell[align=middle] 150 \stopxcell
\startxcell[align=middle] 23,6 \stopxcell
\startxcell[align=middle] 7,2 \stopxcell
\startxcell[align=middle] 66,9 \stopxcell
\startxcell[align=middle] 32,8 \stopxcell
\startxcell[align=middle] 1,81 \stopxcell
\startxcell[align=middle] 0,98 \stopxcell
\startxcell[align=middle] 0,42 \stopxcell
\startxcell[align=middle] 1,11 \stopxcell
\stopxrow
\startxrow
\startxcell[align=middle] 182 \stopxcell
\startxcell[align=middle] 27,0 \stopxcell
\startxcell[align=middle] 6,7 \stopxcell
\startxcell[align=middle] 68,8 \stopxcell
\startxcell[align=middle] 35,6 \stopxcell
\startxcell[align=middle] 1,77 \stopxcell
\startxcell[align=middle] 0,93 \stopxcell
\startxcell[align=middle] 0,38 \stopxcell
\startxcell[align=middle] 1,08 \stopxcell
\stopxrow
\startxrow
\startxcell[align=right,ny=3] 1800-1850 \stopxcell
\startxcell[align=right,ny=3] \strong{King Grass morado} \crlf
(\emph{Pennisetum purpureum}) \stopxcell
\startxcell[align=middle] 98 \stopxcell
\startxcell[align=middle] 20,8 \stopxcell
\startxcell[align=middle] 13,1 \stopxcell
\startxcell[align=middle] 62,3 \stopxcell
\startxcell[align=middle] 30,8 \stopxcell
\startxcell[align=middle] 1,99 \stopxcell
\startxcell[align=middle

Re: [NTG-context] page ends with a section title followed by a table

2020-11-10 Thread Sylvain Hubert
On Tue, 10 Nov 2020 at 19:23, Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> wrote:

> Sylvain Hubert schrieb am 10.11.2020 um 19:11:
>
> > Weirdly enough, "\hskip 0pt" solves the problem.
> >
> >  \setuphead[section][after={\blank[samepage]\hskip 0pt}]
> >  \starttext
> >  \showframe
> >  \dorecurse{50}{a }
> >  \startsection[title=spec]
> >  \startxtable
>
>
> What happens when you \hskip is that you switch to horizontal
> mode and the preferred to do this is to use \dontleavehmode.
>
> \dontleavehmode
> \startxtable
>
> Wolfgang
>

Indeed. Thanks for the information!

For the record, this is how the problem is finally solved:

\setuphead[section][after={\blank[sampage]}]
\begingroup\setupindenting[no]\dontleavehmode\startxtable …
\stopxtable\endgroup

Sylvain
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] page ends with a section title followed by a table

2020-11-10 Thread Wolfgang Schuster

Sylvain Hubert schrieb am 10.11.2020 um 19:11:


Weirdly enough, "\hskip 0pt" solves the problem.

     \setuphead[section][after={\blank[samepage]\hskip 0pt}]
     \starttext
     \showframe
     \dorecurse{50}{a }
     \startsection[title=spec]
     \startxtable



What happens when you \hskip is that you switch to horizontal
mode and the preferred to do this is to use \dontleavehmode.

\dontleavehmode
\startxtable

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] page ends with a section title followed by a table

2020-11-10 Thread Sylvain Hubert
On Tue, 10 Nov 2020 at 18:25, Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> wrote:

> Sylvain Hubert schrieb am 10.11.2020 um 18:06:
>
> > Thanks for the suggestion, but as illustrated by the second example,
> > copied here, where the section title is at the top of the page:
> >
> >  \starttext
> >  \showframe
> >  \dorecurse{50}{a }
> >  \startsection[title=spec][before={\blank[preference,big]},
> > after={\blank[samepage,big]}]
>
> Your settings in the second argument of \startsection make no sense
> because the optional argument is for userdata (values like author etc.)
>
> >  \startxtable
> >  \startxrow
> >  \startxcell[ny=30]a\stopxcell\startxcell 1\stopxcell
> >  \stopxrow
> >  \dorecurse{29}{\startxrow\startxcell 2\stopxcell\stopxrow}
> >  \stopxtable
> >  \stoptext
> >
> > it is sometimes difficult to predict how much remaining space should
> > trigger a line break.
>
> You can either reformat your table or put the table in a float
> environment to move it to a place where it fits.
>
> Wolfgang
>

Weirdly enough, "\hskip 0pt" solves the problem.

\setuphead[section][after={\blank[samepage]\hskip 0pt}]
\starttext
\showframe
\dorecurse{50}{a }
\startsection[title=spec]
\startxtable
\startxrow
\startxcell[ny=30]a\stopxcell\startxcell 1\stopxcell
\stopxrow
\dorecurse{29}{\startxrow\startxcell 2\stopxcell\stopxrow}
\stopxtable
\stoptext

Sylvain
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] page ends with a section title followed by a table

2020-11-10 Thread Wolfgang Schuster

Sylvain Hubert schrieb am 10.11.2020 um 18:06:

Thanks for the suggestion, but as illustrated by the second example, 
copied here, where the section title is at the top of the page:


     \starttext
     \showframe
     \dorecurse{50}{a }
     \startsection[title=spec][before={\blank[preference,big]}, 
after={\blank[samepage,big]}]


Your settings in the second argument of \startsection make no sense
because the optional argument is for userdata (values like author etc.)


     \startxtable
     \startxrow
     \startxcell[ny=30]a\stopxcell\startxcell 1\stopxcell
     \stopxrow
     \dorecurse{29}{\startxrow\startxcell 2\stopxcell\stopxrow}
     \stopxtable
     \stoptext

it is sometimes difficult to predict how much remaining space should 
trigger a line break.


You can either reformat your table or put the table in a float
environment to move it to a place where it fits.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] page ends with a section title followed by a table

2020-11-10 Thread Sylvain Hubert
On Tue, 10 Nov 2020 at 17:54, Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> wrote:

> Pablo Rodriguez schrieb am 10.11.2020 um 15:59:
> > On 11/10/20 9:55 AM, Sylvain Hubert wrote:
> >> Dear List,
> >>
> >> In the following example, the section title appears at the very end of
> >> the first page.
> >> [...]
> >> Does anyone know where to adjust the penalty in this case, so that the
> >> section title can be repositioned to the next page?
> > Hi Sylvain,
> >
> >\setuphead[title]
> >  [before={\blank[preference, big],
> >   after={\blank[samepage, big]]
> >
> > In this case, the blank space before sets a preference for inserting a
> > page break. The blank space after requires to be in the same page with
> > next paragraph.
>
> Another method is to move the section title to the next page when the
> remaining spaces
> is below a specified number of lines. The following setup forces a page
> break when
> less than 4 lines remain on the current page.
>
> \setuphead
>[section]
>[before={\testpage[4]\blank[2*big]}]
>
> Wolfgang
>

Hi Wolfgang,

Thanks for the suggestion, but as illustrated by the second example, copied
here, where the section title is at the top of the page:

\starttext
\showframe
\dorecurse{50}{a }
\startsection[title=spec][before={\blank[preference,big]},
after={\blank[samepage,big]}]
\startxtable
\startxrow
\startxcell[ny=30]a\stopxcell\startxcell 1\stopxcell
\stopxrow
\dorecurse{29}{\startxrow\startxcell 2\stopxcell\stopxrow}
\stopxtable
\stoptext

it is sometimes difficult to predict how much remaining space should
trigger a line break.

Sylvain
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


<    1   2   3   4   5   6   7   8   9   10   >