Re: [NTG-context] Aaligned numbers in a matrix?
On Mon, 27 Feb 2023, Bruce Horrocks via ntg-context wrote: > I'm using the following MWE to produce a matrix: > > \definemathmatrix[bmatrix] > [matrix:brackets] > [simplecommand=bmatrix] > \starttext > $ a \rightarrow > \bmatrix{1, 2, 3, 4; >2, 1, 4, 3; >3,-4, 1,-2; >4,-3, 2,-1} $ > \stoptext > > The columns with negative numbers in are centred and I would rather have them > right-aligned so that the digits stack up above each other and the negative > signs stick out to the left, so to speak. Is there an easy way to achieve > this? You can right align all columns, though I am not sure that this looks better, because column 2 and 3 now appear to be "too close". \definemathmatrix[bmatrix] [matrix:brackets] [align=all:right,simplecommand=bmatrix] \starttext $ a \rightarrow \bmatrix{1, 2, 3, 4; 2, 1, 4, 3; 3,-4, 1,-2; 4,-3, 2,-1} $ \stoptext Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Aaligned numbers in a matrix?
See if this way suits you. \definemathmatrix[bmatrix] [matrix:brackets] [simplecommand=bmatrix] \starttext $ a \rightarrow \bmatrix{1, \hfill 2, 3, \hfill 4; 2, \hfill 1, 4, \hfill 3; 3,-4, 1,-2; 4,-3, 2,-1} $ \stoptext Bruce Horrocks via ntg-context 於 2023年2月27日 週一 上午8:56寫道: > I'm using the following MWE to produce a matrix: > > \definemathmatrix[bmatrix] > [matrix:brackets] > [simplecommand=bmatrix] > \starttext > $ a \rightarrow > \bmatrix{1, 2, 3, 4; >2, 1, 4, 3; >3,-4, 1,-2; >4,-3, 2,-1} $ > \stoptext > > The columns with negative numbers in are centred and I would rather have > them right-aligned so that the digits stack up above each other and the > negative signs stick out to the left, so to speak. Is there an easy way to > achieve this? > > — > 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 / > https://www.ntg.nl/mailman/listinfo/ntg-context > webpage : https://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : https://contextgarden.net > > ___ > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Aaligned numbers in a matrix?
I'm using the following MWE to produce a matrix: \definemathmatrix[bmatrix] [matrix:brackets] [simplecommand=bmatrix] \starttext $ a \rightarrow \bmatrix{1, 2, 3, 4; 2, 1, 4, 3; 3,-4, 1,-2; 4,-3, 2,-1} $ \stoptext The columns with negative numbers in are centred and I would rather have them right-aligned so that the digits stack up above each other and the negative signs stick out to the left, so to speak. Is there an easy way to achieve this? — 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 / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] How to add data from another PDF in index?
Fantastic! Exactly what I needed. My publisher was gong to ask for the information of this index soon, so its great that already works! --Joel On Sunday, February 26, 2023 at 11:45:48 AM MST, Alan Braslau wrote: Hans needs to confirm, "In the next update..." Test files (MWEs): % index-1.tex \setupinteraction[state=start] \starttext test \index{entry WB.1} \page empty \page test \index{another WB.1} \page empty \page test \index{onemore WB.1} \page empty \page test \index{whatever WB.1} \page empty \page test \index{common} \page empty \page \placeregister[index] \stoptext % index-2.tex \setupinteraction[state=start] \defineregister[xedni] \useregister[workbook][index-1][index][WB ] \starttext test \index{onemore TB.1} \page test \index{another TB.1} \page test \index{entry TB.1} \page test \index{common} \page test \xedni{onemore TB.2} \page test \xedni{another TB.2} \page test \xedni{entry TB.2} \page test \xedni{common} \page \placeregister[index,xedni,workbook] \stoptext This seems to work well - I have applied it to a long and complicated multi-volume book project to great success! We need to thank Hans for the quick implementation. Alan On Fri, 24 Feb 2023 05:43:01 + (UTC) Joel via ntg-context wrote: > I am making a textbook and workbook set. > I have this custom index using this code, in both the textbook and > workbook: % > \defineregister[learnedshort][compress=yes] > \setupregister[learnedshort][style=sansbold, textstyle=slanted, n=2, > pagenumber=yes, indicator=no] % > \defineregister[learnedlong][compress=yes] > \setupregister[learnedlong][style=sansbold, textstyle=slanted, n=2, > pagenumber=yes, indicator=no] % > \define[1]\learnedis{% > \txt{} \getvalue{#1} > \learnedshort{#1} > \learnedlong{#1} > } > \define[1]\learned{% > \learnedshort{#1} > \learnedlong{\getvalue{#1}} > } > > \starttext > > \learnedis{blah blah} > > \input knuth > > \learnedis{some more} > > > \startchapter[title=Standards] > \placelearnedshort > \stopchapter > > \stoptext > > > My question is, can I have references to the Workbook page numbers in > the textbook? And visa-versa? > > For instance, the Textbook index currently looks like this: > - > Standards > blah blah 1 > some more 2 > -- > With the data in the Workbook it might look like this: > Standards > blah blah 1, WB: 1, 3-8 > > some more 2, WB: 8-9 > yet more WB: 10, 12 > > -- > Is this possible to merge index information like this? > --Joel -- Alan Braslau 816 West Mountain Avenue Fort Collins, CO 80521 USA mobile: (970) 237-0957 Conserve energy! ;-) ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] How to add data from another PDF in index?
Hans needs to confirm, "In the next update..." Test files (MWEs): % index-1.tex \setupinteraction[state=start] \starttext test \index{entryWB.1} \page empty \page test \index{another WB.1} \page empty \page test \index{onemore WB.1} \page empty \page test \index{whatever WB.1} \page empty \page test \index{common}\page empty \page \placeregister[index] \stoptext % index-2.tex \setupinteraction[state=start] \defineregister[xedni] \useregister[workbook][index-1][index][WB ] \starttext test \index{onemore TB.1} \page test \index{another TB.1} \page test \index{entry TB.1} \page test \index{common} \page test \xedni{onemore TB.2} \page test \xedni{another TB.2} \page test \xedni{entry TB.2} \page test \xedni{common} \page \placeregister[index,xedni,workbook] \stoptext This seems to work well - I have applied it to a long and complicated multi-volume book project to great success! We need to thank Hans for the quick implementation. Alan On Fri, 24 Feb 2023 05:43:01 + (UTC) Joel via ntg-context wrote: > I am making a textbook and workbook set. > I have this custom index using this code, in both the textbook and > workbook: % > \defineregister[learnedshort][compress=yes] > \setupregister[learnedshort][style=sansbold, textstyle=slanted, n=2, > pagenumber=yes, indicator=no] % > \defineregister[learnedlong][compress=yes] > \setupregister[learnedlong][style=sansbold, textstyle=slanted, n=2, > pagenumber=yes, indicator=no] % > \define[1]\learnedis{% > \txt{} \getvalue{#1} > \learnedshort{#1} > \learnedlong{#1} > } > \define[1]\learned{% > \learnedshort{#1} > \learnedlong{\getvalue{#1}} > } > > \starttext > > \learnedis{blah blah} > > \input knuth > > \learnedis{some more} > > > \startchapter[title=Standards] > \placelearnedshort > \stopchapter > > \stoptext > > > My question is, can I have references to the Workbook page numbers in > the textbook? And visa-versa? > > For instance, the Textbook index currently looks like this: > - > Standards > blah blah 1 > some more 2 > -- > With the data in the Workbook it might look like this: > Standards > blah blah 1, WB: 1, 3-8 > > some more 2, WB: 8-9 > yet more WB: 10, 12 > > -- > Is this possible to merge index information like this? > --Joel -- Alan Braslau 816 West Mountain Avenue Fort Collins, CO 80521 USA mobile: (970) 237-0957 Conserve energy! ;-) ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Can ConTeXt display a simple itemized list as a comma-separated list?
On 2/25/2023 5:01 PM, Joel via ntg-context wrote: I have a list like this: \startitemize[1] \item fish \item eggs \item milk \stopitemize Is there any command in ConTeXt to make this display the items as a comma-separated list, like this: fish, eggs, milk Or a semi-colon-separated list? fish; eggs; milk In the next update you can set a textseparator. \starttext \startitemize[none,text][textseparator=;] \item fish \item eggs \item milk \stopitemize \defineitemgroup [fooditems] \setupitemgroup [fooditems] [each] [none,text] [textseparator=;] \blank[2*line] \startfooditems \item fish \item eggs \item milk \stopfooditems \stoptext - 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 / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] [m-database] How to properly add module arguments?
Hi Paul, > I added a stanza to the appropriate interface file: > > --- begin stanza added to i-database.xml --- > > I modeled that after the stanza for the argument `strip`. I think > that's the only thing I need to do in the interface file. I'd recommend completely ignoring the interface i-*.xml files. They don't do anything particularly useful for a third-party module. >\c!skipheader=\v!no, % <- Added, following the pattern with strip This line is your issue. Inside \unprotect...\protect, "!" is treated as a letter, so you're trying to expand the value of the macro "\c!skipheader". The problem is that that macro isn't defined anywhere. Backing up a little further, the \c!... commands are all string *C*onstants. If you see a command with a name like \c!blah, it almost certain expands to exactly the string "blah". Why is this useful? Well, if you run ConTeXt in another language, then the \c!... commands will instead contain that string but in the other language. So something like \c!left would be "left" in English, "gauche" in French, "links" in German, "vlevo" in Czech, etc. You could define \c!skipheader to just be "skipheader", or you could give it a translated value for 10 or so languages. But the easier solution is to just use the string "skipheader" directly: \setupdatabase [\c!separator={,}, \c!quotechar=, \c!commentchar=, \c!strip=\v!no, skipheader=\v!no, % <-- HERE \c!before=, \c!after=, \c!first=, \c!last=, \c!left=, \c!right=] As a more general suggestion, it is usually a really bad idea to modify the standard ConTeXt files since any changes will be overwritten on updates. Probably the best solution is to make a new file called "t-xdatabase.mkiv" stored in your texmf-local/, start the file with "\usemodule[database]" then add any changes after that. Or, just copy and paste the original file into your new file. (Maybe you were doing this already though) Hope this helps, -- Max ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___