Hello, Why is the text wrapping around the board or far too far ? Thank you. Fabrice \definefloat [recipe] [figure] \setupfloat [recipe] [default={right,none}] \starttext \placerecipe{}{% \startxtable[align={middle,lohi},width=1.7 cm] \startxrow[background=color,backgroundcolor=gray] \startxcell[width=3.5cm,frame=off,align={middle,right}, background=color,backgroundcolor=white] Consommation pour la production de 1 UM \hfill\startMPcode drawarrow (0,0)--(0,0.35cm)--(0.35cm,0.35cm)withpen pencircle scaled 1bp; \stopMPcode \stopxcell \startxcell Ind. \stopxcell \startxcell Agri. \stopxcell \stopxrow \startxrow \startxcell[background=color,backgroundcolor=gray] Ind. \stopxcell \startxcell 0,5 \stopxcell \startxcell 0,2 \stopxcell \stopxrow \startxrow \startxcell[background=color,backgroundcolor=gray] Agri. \stopxcell \startxcell 0,2 \stopxcell \startxcell 0,6 \stopxcell \stopxrow \startxrow \startxcell[nx=3,frame=off,align={right}] Lecture du tableau : pour la production d'un bien équivalent à 1 UM, l'industrie consomme l'équivalent de 0,5 UM de sa propre production et l'équivalent de 0,2 UM de la production de l'agriculture. \stopxcell \stopxrow \stopxtable } \dorecurse{10}{\input knuth} \stoptext
On 10/10/18 7:26 PM, Fabrice Couvreur wrote:
Hello, Why is the text wrapping around the board or far too far ?
Hi Fabrice, replace the following command: \startxtable[align={middle,lohi}] It works now. It is rather weird that the total width for the table is 1.7cm and one of its cells is 3.5cm. I hope it helps, Pablo
Thank you. Fabrice
\definefloat [recipe] [figure]
\setupfloat [recipe] [default={right,none}]
\starttext \placerecipe{}{% \startxtable[align={middle,lohi},width=1.7 cm] \startxrow[background=color,backgroundcolor=gray] \startxcell[width=3.5cm,frame=off,align={middle,right}, background=color,backgroundcolor=white] Consommation pour la production de 1 UM \hfill\startMPcode drawarrow (0,0)--(0,0.35cm)--(0.35cm,0.35cm)withpen pencircle scaled 1bp; \stopMPcode \stopxcell \startxcell Ind. \stopxcell \startxcell Agri. \stopxcell \stopxrow \startxrow \startxcell[background=color,backgroundcolor=gray] Ind. \stopxcell \startxcell 0,5 \stopxcell \startxcell 0,2 \stopxcell \stopxrow \startxrow \startxcell[background=color,backgroundcolor=gray] Agri. \stopxcell \startxcell 0,2 \stopxcell \startxcell 0,6 \stopxcell \stopxrow \startxrow \startxcell[nx=3,frame=off,align={right}] Lecture du tableau : pour la production d'un bien équivalent à 1 UM, l'industrie consomme l'équivalent de 0,5 UM de sa propre production et l'équivalent de 0,2 UM de la production de l'agriculture. \stopxcell \stopxrow \stopxtable } \dorecurse{10}{\input knuth} \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 ___________________________________________________________________________________
Hi Pablo,
Thank you, I thought that indicating width = 1.7cm, the size of the cells
would have been 1.7cm.
Fabrice
Le mer. 10 oct. 2018 à 19:46, Pablo Rodriguez
On 10/10/18 7:26 PM, Fabrice Couvreur wrote:
Hello, Why is the text wrapping around the board or far too far ?
Hi Fabrice,
replace the following command:
\startxtable[align={middle,lohi}]
It works now. It is rather weird that the total width for the table is 1.7cm and one of its cells is 3.5cm.
I hope it helps,
Pablo
Thank you. Fabrice
\definefloat [recipe] [figure]
\setupfloat [recipe] [default={right,none}]
\starttext \placerecipe{}{% \startxtable[align={middle,lohi},width=1.7 cm] \startxrow[background=color,backgroundcolor=gray] \startxcell[width=3.5cm,frame=off,align={middle,right}, background=color,backgroundcolor=white] Consommation pour la production de 1 UM \hfill\startMPcode drawarrow (0,0)--(0,0.35cm)--(0.35cm,0.35cm)withpen pencircle scaled 1bp; \stopMPcode \stopxcell \startxcell Ind. \stopxcell \startxcell Agri. \stopxcell \stopxrow \startxrow \startxcell[background=color,backgroundcolor=gray] Ind. \stopxcell \startxcell 0,5 \stopxcell \startxcell 0,2 \stopxcell \stopxrow \startxrow \startxcell[background=color,backgroundcolor=gray] Agri. \stopxcell \startxcell 0,2 \stopxcell \startxcell 0,6 \stopxcell \stopxrow \startxrow \startxcell[nx=3,frame=off,align={right}] Lecture du tableau : pour la production d'un bien équivalent à 1 UM, l'industrie consomme l'équivalent de 0,5 UM de sa propre production et l'équivalent de 0,2 UM de la production de l'agriculture. \stopxcell \stopxrow \stopxtable } \dorecurse{10}{\input knuth} \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
___________________________________________________________________________________
___________________________________________________________________________________ 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
___________________________________________________________________________________
Fabrice Couvreur schrieb am 10.10.18 um 20:09:
Hi Pablo, Thank you, I thought that indicating width = 1.7cm, the size of the cells would have been 1.7cm.
You’re correct and what Pablo meant is the textwidth option for natural tables where you can set a width for the whole table. The big space below the table in your example is a wrong calculation of the cell height for the merged cells. The height is probably wrong because ConTeXt uses the width of the first column (and not of all merged cells) to determine the height. \starttext \startxtable[width=2cm] \startxrow \startxcell Column 1 \stopxcell \startxcell Column 2 \stopxcell \stopxrow \startxrow \startxcell[nx=2] Merged column \stopxcell \stopxrow \stopxtable \stoptext When your goal of the merged cells is to create a caption for the table you can use the “nonumber” keyword for placetable to get rid of the label and counter of the float. \starttext \startplacetable[location={nonumber,right},title={A long title for this short table}] \startxtable[width=2cm] \startxrow \startxcell Column 1 \stopxcell \startxcell Column 2 \stopxcell \stopxrow \stopxtable \stopplacetable \input knuth \stoptext Wolfgang
participants (3)
-
Fabrice Couvreur
-
Pablo Rodriguez
-
Wolfgang Schuster