Re: [NTG-context] Setting options for every n-th row in natural TABLEs
Natural tables have “odd” and “even” keywords for \setupTABLE but none in the way you like it. What I would do is to use a overlay in combination with metapost to create the background but there is no global register to access the current column/row of a cell, e.g. \currenttablecolumn (this name is already used by tables) and \currenttablerow. ... Maybe \currentTABLEcolumn (no collision with tables' \currenttablecolumn) and \currentTABLErow could be defined for this purpose. Lukas -- Ing. Lukáš Procházka [mailto:l...@pontex.cz] Pontex s. r. o. [mailto:pon...@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Wiki example compilation failure
Hello, maybe the known problem with the wiki and the current Ctx versions. The following code: \setuppapersize[A5] \starttext \definedelimitedtext[mydt] \setupdelimitedtext[mydt][left=\leftguillemot,right=\rightguillemot] \quotation{Clancy of the Overflow}, by Banjo Paterson \startmydt And an answer came directed in a manner unexpected, and I think the same was written with a thumbnail dipped in tar; 't was his shearing-mate who wrote it, and verbatim I will quote it: \quotation{Clancy's gone to Queensland droving, and we don't know where he are.} \stopmydt \stoptext is successfully compiled by the current Ctx version whilst the same example on http://wiki.contextgarden.net/Command/setupdelimitedtext is not. Best regards, Lukas -- Ing. Lukáš Procházka [mailto:l...@pontex.cz] Pontex s. r. o. [mailto:pon...@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Wiki example compilation failure
Hi Lukáš, (CC Mojca, Taco) [\setupdelimitedtext example] is successfully compiled by the current Ctx version whilst the same example on http://wiki.contextgarden.net/Command/setupdelimitedtext is not. Yes, the wiki's ConTeXt installation is about a year old, as you can see at http://wiki.contextgarden.net/Help:Context I remember not getting that to particular example to work, and in the end wrapping it in texcode instead of context tags. Hans, can you take the version in TeX Live 2012 and promote it to the current stable version, or is that not so easy (or not your responsibility? Once that is done, Taco can update the wiki's ConTeXt. Thanks, Sietse ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Darwin x86_64 is not supported yet error.
On Mon, Sep 3, 2012 at 6:51 AM, Jeong Dalyoung wrote: Dear all, Today I tried to update ConTeXt using first setup and got an error message: Error: your system Darwin x86_64 is not supported yet. first setup worked well before I upgrade Mac OS to Mountain Lion from snow leopard two weeks ago. I'm clueless. The system Darwin X86_64 is definitely supported and it should work without problems on Mountain Lion (apart from maybe complaining gatekeeper which is not the case here). Maybe it's a problem in the shell? Mojca ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Darwin x86_64 is not supported yet error.
Hi Jeong, Like Mojca says, this is very strange. I've attached a trimmed-down version of first-setup.sh with some debug print statements sprinkled in; could you run that and post its output here? The output should be something like this, possibly without the two 'branch' lines. === system branch is Linux: Linux === cpu branch is i*86: i686 === system: Linux === cpu: i686 === platform: linux Cheers, Sietse On Mon, Sep 3, 2012 at 10:15 AM, Mojca Miklavec mojca.miklavec.li...@gmail.com wrote: On Mon, Sep 3, 2012 at 6:51 AM, Jeong Dalyoung wrote: Dear all, Today I tried to update ConTeXt using first setup and got an error message: Error: your system Darwin x86_64 is not supported yet. first setup worked well before I upgrade Mac OS to Mountain Lion from snow leopard two weeks ago. I'm clueless. The system Darwin X86_64 is definitely supported and it should work without problems on Mountain Lion (apart from maybe complaining gatekeeper which is not the case here). Maybe it's a problem in the shell? Mojca ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ debug.sh Description: Bourne shell script ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Czech typographic speciality
___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Wiki example compilation failure
On Mon, 03 Sep 2012 10:01:25 +0200, Sietse Brouwer sbbrou...@gmail.com wrote: http://wiki.contextgarden.net/Help:Context BTW: Which of the following specifications is correct [for wiki]: context mode=mkiv source=yes or context mode=mkiv source=yes? The former is used in the prelast example on http://wiki.contextgarden.net/Help:Context and - AFAIK (see e.g. http://www.w3schools.com/xml/xml_attributes.asp) - it is not in accordance with X[HT]ML specification; whilst the latter is in accordance with X[HT]ML specification. So is it sure that mode=mkiv is OK [on wiki - its parser doesn't require quotation marks for element attributes] or mode=mkiv should be preferred or even required? Best regards, Lukas -- Ing. Lukáš Procházka [mailto:l...@pontex.cz] Pontex s. r. o. [mailto:pon...@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] About Chapter head definition and FunnyFrame
Dear Wolfgang, Both of your methods are working fine. \define[2]\Myheader{?} with a recent beta or \unexpanded\def\Myheader#1#2{?} I also find out a new method '\defineheadalternative' too. Thank you so much. Best regards, Dalyoung ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Darwin x86_64 is not supported yet error.
Dear Mojca and Sietse, Thank for your concern. I have tried to update ConTeXt installed in a MacBook which was upgraded to Mountain Lion a week ago too. First-setup.sh runs very well without any errors. Tomorrow, I will run your first-setup.sh in a iMac which had a problem to update. I'll report the result tomorrow. There may be different setting in a terminal as Mojca said. Best regards, Dalyoung ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] underbar/margin text
Hi, I have to typeset some underlined text with margin notes by its side. Is there a way to prevent the notes themself to get underlined? I tried putting the note-command in a group, simplifying its content etc. (In my real file I use \defineinmargin, btw.) \starttext \underbar{Test Test Test\footnote{footnote}~Test Test Test\par Test\inleft{marginal} Test Test Test Test Test \par} \stoptext (As one can see, there’s also an issue with the footnote-sign breaking the continued line, which is not urgent for me, at least by now.) Cheers, Daniel ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Wiki example compilation failure
Procházka Lukáš wrote: BTW: Which of the following specifications is correct [for wiki]: context mode=mkiv source=yes or context mode=mkiv source=yes? Both work. Because both work, we have no way to force future edits to be XHTML compliant, so I don't think it is productive to try to enforce XHTML compliance in this. Instead, if we ever do need compliant XHTML, we can have a bot run a find-and-replace. I do understand that the non-compliant example might cause confusion, so Ive added a note explicitly stating that omitting the quotation marks is okay. http://wiki.contextgarden.net/index.php?title=Help%3AContextaction=historysubmitdiff=20362oldid=19861 Does that look all right to you? Cheers, Sietse ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Wiki example compilation failure
On Mon, 03 Sep 2012 14:18:14 +0200, Sietse Brouwer sbbrou...@gmail.com wrote: context mode=mkiv source=yes or context mode=mkiv source=yes? Both work. Because both work, we have no way to force future edits to be XHTML compliant, so I don't think it is productive to try to enforce XHTML compliance in this. Instead, if we ever do need compliant XHTML, we can have a bot run a find-and-replace. I do understand that the non-compliant example might cause confusion, so Ive added a note explicitly stating that omitting the quotation marks is okay. http://wiki.contextgarden.net/index.php?title=Help%3AContextaction=historysubmitdiff=20362oldid=19861 Does that look all right to you? Perfect, thank you. Best regards, Lukas Cheers, Sietse -- Ing. Lukáš Procházka [mailto:l...@pontex.cz] Pontex s. r. o. [mailto:pon...@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Page number in the edge
Hi, moving the page number into the edge in the following way seems straightforward, but fails. “edge” is not recognised as “margin” or “header” is. I wonder why. Is this intended or am I misusing the command? \setuplayout [backspace=5cm, width=10cm, edge=1cm] \setuppagenumbering [location={header, edge}] % fails: centred in the header % [location={header, margin}] % works % also works %\setupheadertexts %[edge] [] [pagenumber] \starttext \showframe \dorecurse{10}{\null\page} \stoptext Marco ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \setupdelimitedtext not working in TeXLive 2012
On 09/03/2012 12:31 AM, Wolfgang Schuster wrote: Am 03.09.2012 um 04:14 schrieb Bill Meahan subscribed_li...@meahan.net: The syntax changed in MkIV, you need now \setupdelimitedtext[quotation:1][..,..=..,..] etc. Thanks, Wolfgang! Super-helpful as always and much appreciated. -- Bill Meahan Westland, Michigan USA ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Setting options for every n-th row in natural TABLEs
On Mon, 3 Sep 2012, Procházka Lukáš Ing. - Pontex s. r. o. wrote: Natural tables have “odd” and “even” keywords for \setupTABLE but none in the way you like it. What I would do is to use a overlay in combination with metapost to create the background but there is no global register to access the current column/row of a cell, e.g. \currenttablecolumn (this name is already used by tables) and \currenttablerow. ... Maybe \currentTABLEcolumn (no collision with tables' \currenttablecolumn) and \currentTABLErow could be defined for this purpose. I agree. In addition, \currentTABLEheaderrow, \currentTABLEheadercolumn, \currentTABLEfooterrow, \currentTABLEfootercolumn, and the \max... version of all of these are also useful at the user level. 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] ConTeXt color to text
Hi, for a batch command (ImageMagick) I need to convert ConTeXt colors to a text representation (e.g. rgb 'red' - 'rgb(255,0,0)'; same for color models cmyk and gray). What is the best way to get (read only) access to the color channels of a defined color? Peter ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] ConTeXt color to text
On 3-9-2012 18:59, Peter Rolf wrote: Hi, for a batch command (ImageMagick) I need to convert ConTeXt colors to a text representation (e.g. rgb 'red' - 'rgb(255,0,0)'; same for color models cmyk and gray). What is the best way to get (read only) access to the color channels of a defined color? \colorcomponents{red} \colorvalue{red} in next beta: \startluacode -- inspect(attributes.colors.spec(red)) -- table={ -- [b]=0, -- [c]=0, -- [model]=cmyk, -- [g]=0, -- [k]=0, -- [m]=1, -- [r]=1, -- [s]=0.3, -- [y]=1, -- } \stopluacode - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Stretching width in natural TABLEs
If you know the width of the first column and total width, then you can use arithmetic, as in the example below. But perhaps this already occurred to you, and you were wondering if the widths and stretching can be handled automatically -- the short answer is I don't know. \starttext \setupTABLE[c][1][width={2cm}] \setupTABLE[c][2][width={\dimexpr(\textwidth-2cm)/3\relax}] \setupTABLE[c][3][width={\dimexpr(\textwidth-2cm)* 2 / 3\relax}] \startTABLE \NC One \NC Two \NC Three \NC\NR \NC A \NC B \NC C \NC\NR \stopTABLE \stoptext On Sep 2, 2012, at 12:24 PM, Aditya Mahajan wrote: Hi, Is it possible to stretch the widths of each column in natural TABLEs, so that the widths are in a certain propotion? For example, suppose I have a table with three columns and I want to set the width of the first column to a fixed amount, and split the remaining space between columns two and three in a 1:2 ratio. Extreme tables implement something similar using option={stretch, width}, but AFAIU, it is not possible to fix the width of a particular column. 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Include chapter number in figure numbering
Hi, how do I include the chapter number in the figure numbering? The following example used to produce (as of November 2011) “Figure 1.1”. A current beta yields merely “Figure 1”. \starttext \startchapter [title=Foo] \startplacefigure [title=Bar] \stopplacefigure \stopchapter \stoptext Marco ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Include chapter number in figure numbering
Marco Patzer wrote: how do I include the chapter number in the figure numbering? Untested: \setupcaptions[prefixsegment=chapter] or \setupcaption[figure][prefixsegment=chapter] should both work. (The former should affect table captions, too.) Slightly more at http://wiki.contextgarden.net/Command/setupcaptions Which is not the first place one would look, admittedly, although it's logical once you realize it. This requires some crosslinks from some pages describing \placefigure-related things, I think. Cheers, Sietse The following example used to produce (as of November 2011) “Figure 1.1”. A current beta yields merely “Figure 1”. \starttext \startchapter [title=Foo] \startplacefigure [title=Bar] \stopplacefigure \stopchapter \stoptext Marco ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Darwin x86_64 is not supported yet error.
Dear Sietse, I run your code and got the following result: === system branch is Darwin: Darwin === cpu branch is x86_64: x86_64 === system: Darwin === cpu: x86_64 === platform: osx-64 It seems to me that the system is OK. But first-setup.sh issues the same error message. After downloading first-setup.sh again and try to update again, I'll report the result. Thank you. Best regards, Dalyoung ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Stretching width in natural TABLEs
On Mon, 3 Sep 2012, Michael Rogers wrote: On Sep 2, 2012, at 12:24 PM, Aditya Mahajan wrote: Is it possible to stretch the widths of each column in natural TABLEs, so that the widths are in a certain propotion? For example, suppose I have a table with three columns and I want to set the width of the first column to a fixed amount, and split the remaining space between columns two and three in a 1:2 ratio. If you know the width of the first column and total width, then you can use arithmetic, as in the example below. But perhaps this already occurred to you, and you were wondering if the widths and stretching can be handled automatically -- the short answer is I don't know. \starttext \setupTABLE[c][1][width={2cm}] \setupTABLE[c][2][width={\dimexpr(\textwidth-2cm)/3\relax}] \setupTABLE[c][3][width={\dimexpr(\textwidth-2cm)* 2 / 3\relax}] \startTABLE \NC One \NC Two \NC Three \NC\NR \NC A \NC B \NC C \NC\NR \stopTABLE \stoptext Apart from being hard to maintain, this works well if I know the width of a cell in advance. But most of the time I want something the width of the fixed column to be determined using width=fit option, so I cannot precompute the width of other columns. 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Weird result for autowidth=force in framed
Hi, autowidth=force only works if I also set align=something. Is this a bug or a feature? \starttext \framed[width=5cm, autowidth=force, align=normal]{Small} \framed[width=5cm, autowidth=force, align=]{Small} \framed[width=5cm, autowidth=force,]{Small} \stoptext 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Stretching width in natural TABLEs
On Sun, 2 Sep 2012, Aditya Mahajan wrote: Hi, Is it possible to stretch the widths of each column in natural TABLEs, so that the widths are in a certain propotion? For example, suppose I have a table with three columns and I want to set the width of the first column to a fixed amount, and split the remaining space between columns two and three in a 1:2 ratio. Extreme tables implement something similar using option={stretch, width}, but AFAIU, it is not possible to fix the width of a particular column. I notice that \setupTABLE[c][1][width=fit] \setupTABLE[c][2][width=broad] \setupTABLE[c][3][width=broad] splits the remaining space equally between columns 2 and 3. So, after starting at the code of pack-rul for a while, I realized that \setupTABLE[c][1][width=fit] \setupTABLE[c][2][width=0.33\hsize] \setupTABLE[c][3][width=0.66\hsize] should work and it does! Now if someone could explain WHY it works, I'll be enlightened. 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Stretching width in natural TABLEs
On Sep 3, 2012, at 9:39 PM, Aditya Mahajan wrote: On Mon, 3 Sep 2012, Michael Rogers wrote: On Sep 2, 2012, at 12:24 PM, Aditya Mahajan wrote: Is it possible to stretch the widths of each column in natural TABLEs, so that the widths are in a certain propotion? For example, suppose I have a table with three columns and I want to set the width of the first column to a fixed amount, and split the remaining space between columns two and three in a 1:2 ratio. If you know the width of the first column and total width, then you can use arithmetic, as in the example below. But perhaps this already occurred to you, and you were wondering if the widths and stretching can be handled automatically -- the short answer is I don't know. \starttext \setupTABLE[c][1][width={2cm}] \setupTABLE[c][2][width={\dimexpr(\textwidth-2cm)/3\relax}] \setupTABLE[c][3][width={\dimexpr(\textwidth-2cm)* 2 / 3\relax}] \startTABLE \NC One \NC Two \NC Three \NC\NR \NC A \NC B \NC C \NC\NR \stopTABLE \stoptext Apart from being hard to maintain, this works well if I know the width of a cell in advance. But most of the time I want something the width of the fixed column to be determined using width=fit option, so I cannot precompute the width of other columns. Aditya That's what I was afraid. It's just I had the same problem last week, and a deadline made me settle for the ad hoc approach. You made me curious enough to go look at the source, and one can hack it to work. See below, if interested. Not optimal, and might break in future. By the way, what you posted in your other message, \setupTABLE[c][1][width=fit] \setupTABLE[c][2][width=0.33\hsize] \setupTABLE[c][3][width=0.66\hsize] extends into the right margin by the width of the first column or thereabouts, for me. Michael The hack: \unprotect % adapted from \tabl_ntb_stretch_widths, tabl-ntb.mkiv, ll. 1296f \def\tabl_ntb_mystretch_widths % more variants, e.g. a max to \dimend {\ifcase\c_tabl_ntb_maximum_col\else % else division by zero \!!dimend\zeropoint \!!dimene\hsize \dorecurse\c_tabl_ntb_maximum_col {\advance\!!dimend\dimexpr\tabl_ntb_get_wid\recurselevel+\naturaltablelocalparameter\c!columndistance\relax \advance\!!dimene-\tabl_ntb_get_dis\recurselevel}% \advance\!!dimend\dimexpr-\naturaltablelocalparameter\c!columndistance+\naturaltablelocalparameter\c!leftmargindistance+\naturaltablelocalparameter\c!rightmargindistance\relax % distribute width (stretch) \ifdim\!!dimend\!!dimene \advance\!!dimend-\!!dimene \!!dimend-\!!dimend % \divide\!!dimend\c_tabl_ntb_maximum_col % \dorecurse\c_tabl_ntb_maximum_col % {\tabl_ntb_set_wid\recurselevel{\the\dimexpr\tabl_ntb_get_wid\recurselevel+\!!dimend\relax}}% \divide\!!dimend3 %%% divide remainder into three equal parts {\tabl_ntb_set_wid2{\the\dimexpr\tabl_ntb_get_wid2+\!!dimend\relax}}%%% add one part to 2nd column {\tabl_ntb_set_wid3{\the\dimexpr\tabl_ntb_get_wid3+\!!dimend * 2\relax}}%%% add two parts to 3rd column \fi \fi} \def\usemystretch{\let\tabl_ntb_stretch_widths\tabl_ntb_mystretch_widths} \protect \starttext \startsetups mystretch \usemystretch \setupTABLE[option=stretch] \stopsetups \startTABLE[setups=mystretch] \NC One \NC Two \NC Three \NC\NR \NC A \NC B \NC C \NC\NR \stopTABLE \stoptext BTW, the above could be adapted to a key of the form stretch={n1,n2,...} (e.g. stretch={0,1,2}) which would divide the remaining proportionally. Maybe not worth doing, though...maybe harder than I think -- the table stuff is complicated, and I'm assuming that since it worked once, I haven't messed anything up. This e-mail message (including any attachments) is for the sole use of the intended recipient(s) and may contain confidential and privileged information. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message (including any attachments) is strictly prohibited. If you have received this message in error, please contact the sender by reply e-mail message and destroy all copies of the original message (including attachments). ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Stretching width in natural TABLEs
On Tue, 4 Sep 2012, Rogers, Michael K wrote: On Sep 3, 2012, at 9:39 PM, Aditya Mahajan wrote: On Mon, 3 Sep 2012, Michael Rogers wrote: On Sep 2, 2012, at 12:24 PM, Aditya Mahajan wrote: Is it possible to stretch the widths of each column in natural TABLEs, so that the widths are in a certain propotion? For example, suppose I have a table with three columns and I want to set the width of the first column to a fixed amount, and split the remaining space between columns two and three in a 1:2 ratio. If you know the width of the first column and total width, then you can use arithmetic, as in the example below. But perhaps this already occurred to you, and you were wondering if the widths and stretching can be handled automatically -- the short answer is I don't know. \starttext \setupTABLE[c][1][width={2cm}] \setupTABLE[c][2][width={\dimexpr(\textwidth-2cm)/3\relax}] \setupTABLE[c][3][width={\dimexpr(\textwidth-2cm)* 2 / 3\relax}] \startTABLE \NC One \NC Two \NC Three \NC\NR \NC A \NC B \NC C \NC\NR \stopTABLE \stoptext Apart from being hard to maintain, this works well if I know the width of a cell in advance. But most of the time I want something the width of the fixed column to be determined using width=fit option, so I cannot precompute the width of other columns. Aditya That's what I was afraid. It's just I had the same problem last week, and a deadline made me settle for the ad hoc approach. You made me curious enough to go look at the source, and one can hack it to work. See below, if interested. Not optimal, and might break in future. By the way, what you posted in your other message, \setupTABLE[c][1][width=fit] \setupTABLE[c][2][width=0.33\hsize] \setupTABLE[c][3][width=0.66\hsize] extends into the right margin by the width of the first column or thereabouts, for me. Ah, thats makes more sense. I was so happy to see the right ratio of the widths, that I did not notice that. The hack: Thanks. I'll play around with it tomorrow. 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Darwin x86_64 is not supported yet error.
Dear Sietse, I download first-setup.sh and run it. It runs well and updates everything. the updated version is ConTeXt ver: 2012.08.28 20:00 MKIV fmt: 2012.9.4 Thank you for your help. Best regards, Dalyoung ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___