[NTG-context] Re: How to specify a default formatting for TABLE
Am Dienstag, 2. Juli 2024, 00:17:36 MESZ schrieb Wolfgang Schuster: > Gerion Entrup schrieb am 01.07.2024 um 23:56: > > Hi, > > > > I want to format a bunch a tables with the same formatting. > > It seems that specifying the \setupTABLE commands as part of the preamble > > works. > > > > However, I need some tables that are formatted in another way. > > Is there a generic way to specify this? > > > > Here is a MWE: > > [...] > > > > The last two tables should be formatted as if the four setupTABLE commands > > in the header are not existent. > > My solution does not work, however. > > 1. Put your table settings in a setups-block and load the one you want > at the start of your table. > > 2. You don't need \setupcolors[state=start] because colors are enabled > by default (since a veee...eeery long time). > > 3. You can replace \bTD ... \eTD with \bTH ... \eTH for table headers to > get bold text. > > begin example > \startsetups[table:a] >\setupTABLE [each] [frame=off,width=1cm,height=1cm,align={middle,lohi}] >\setupTABLE [each] [background=color,backgroundcolor=lightgray] > \stopsetups > > \startsetups[table:b] >\setupTABLE [each] > [frame=off,width=2cm,height=1.2\lineheight,align=middle] >\setupTABLE [each] [topframe=on,bottomframe=on] > \stopsetups > > \starttext > > \bTABLE >\bTR > \bTD A \eTD > \bTD B \eTD >\eTR >\bTR > \bTD C \eTD > \bTD D \eTD >\eTR > \eTABLE > > \blank > > \bTABLE[setups=table:a] >\bTR > \bTD A \eTD > \bTD B \eTD >\eTR >\bTR > \bTD C \eTD > \bTD D \eTD >\eTR > \eTABLE > > \blank > > \bTABLE[setups=table:b] >\bTR > \bTD A \eTD > \bTD B \eTD >\eTR >\bTR > \bTD C \eTD > \bTD D \eTD >\eTR > \eTABLE > > \stoptext > end example > > Wolfgang Thank you very much! That are a bunch of nice tricks. The setups environment is really powerful. I will actively search for this keyword in the documentation next time. Gerion signature.asc Description: This is a digitally signed message part. ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: How to specify a default formatting for TABLE
Gerion Entrup schrieb am 01.07.2024 um 23:56: Hi, I want to format a bunch a tables with the same formatting. It seems that specifying the \setupTABLE commands as part of the preamble works. However, I need some tables that are formatted in another way. Is there a generic way to specify this? Here is a MWE: [...] The last two tables should be formatted as if the four setupTABLE commands in the header are not existent. My solution does not work, however. 1. Put your table settings in a setups-block and load the one you want at the start of your table. 2. You don't need \setupcolors[state=start] because colors are enabled by default (since a veee...eeery long time). 3. You can replace \bTD ... \eTD with \bTH ... \eTH for table headers to get bold text. begin example \startsetups[table:a] \setupTABLE [each] [frame=off,width=1cm,height=1cm,align={middle,lohi}] \setupTABLE [each] [background=color,backgroundcolor=lightgray] \stopsetups \startsetups[table:b] \setupTABLE [each] [frame=off,width=2cm,height=1.2\lineheight,align=middle] \setupTABLE [each] [topframe=on,bottomframe=on] \stopsetups \starttext \bTABLE \bTR \bTD A \eTD \bTD B \eTD \eTR \bTR \bTD C \eTD \bTD D \eTD \eTR \eTABLE \blank \bTABLE[setups=table:a] \bTR \bTD A \eTD \bTD B \eTD \eTR \bTR \bTD C \eTD \bTD D \eTD \eTR \eTABLE \blank \bTABLE[setups=table:b] \bTR \bTD A \eTD \bTD B \eTD \eTR \bTR \bTD C \eTD \bTD D \eTD \eTR \eTABLE \stoptext end example Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Pocket Diary Photo Calendar: how to specify on which day the week begins?
Hi, I am trying to use the Pocket Diary <https://ctan.org/pkg/context-pocketdiary> module to create a photo calendar as described in the Calendar Examples <https://ctan.org/pkg/context-calendar-examples>. The examples work fine. By default weeks begin on Monday. Does anyone know how to specify that weeks begin on Sunday? I have searched through all the setvariable assignments, but nothing seems applicable. I have attached an example file so you needn't retrieve all the examples. Any help would be appreciated. -- With kind regards, Michael <http://literatesolutions.com> \usemodule[pocketdiary] %D Choose and setup the font to be used \setupbodyfont[ibmplex,ss,12pt] % Supported languages: EN,DE,NL,FR,IT,ES \mainlanguage[nl] % Switch off the page numbering \setuppagenumbering[location=] % Setup the paper size \setuppapersize[A4,portrait][A4,portrait] % Adjust the layout of the page \setuplayout [topspace=20mm, backspace=8.6mm, header=0pt, footer=0pt, height=middle, width=middle] % Setup the path where to find the calendar pictures \setupexternalfigures [directory={., ./graphics, ../graphics, ./MyPhotoDirectory}] \setupexternalfigures [location={local,global,default}] \def\testimage {cow} % dolly.png % Give pictures symbolic names for using in a loop \useexternalfigure [1] [\testimage] \useexternalfigure [2] [\testimage] \useexternalfigure [3] [\testimage] \useexternalfigure [4] [\testimage] \useexternalfigure [5] [\testimage] \useexternalfigure [6] [\testimage] \useexternalfigure [7] [\testimage] \useexternalfigure [8] [\testimage] \useexternalfigure [9] [\testimage] \useexternalfigure [10] [\testimage] \useexternalfigure [11] [\testimage] \useexternalfigure [12] [\testimage] \useexternalfigure [13] [\testimage] % Setup the variables for the Pocket diary, only year is used for the calculations. \setvariables [PocketDiary] [Year=2025] % Let the header and the footer be empty: \setupheadertexts[][] \setupfootertexts[][] % Add some label texts for the international interfaces: \setuplabeltext[en][fotocal={Photo Calendar}] \setuplabeltext[nl][fotocal=Fotokalender] \setuplabeltext[de][fotocal=Fotokalender] \setuplabeltext[fr][fotocal={Calendrier photo}] \setuplabeltext[it][fotocal={Calendario fotografico}] \setuplabeltext[es][fotocal={Calendario fotográfico}] %D Let lua is perform the magic: \startluacode local report = logs.reporter("Photo calendar") function thirddata.calendar.Photo_calendar_page(y) report("Working in function: calendar.Foto_calendar_page") local year = y --local path = file.dirname("./Fotokalender-fotos/") for i = 1,12 do local monthname = string.lower(os.date("%B", os.time{year=year,month=i,day=1})) context.startplacefigure({number="",title=""}) context.externalfigure({i}, {width = "0.8\\textwidth"}) context.stopplacefigure() context.strut() context("\\vfill") context.startalign({"middle"}) context("\\bfa") context.labeltext(monthname) context("~") context(year) context.stopalign() context.blank() thirddata.diary.monthtableH(i,year) context.page() end end \stopluacode % Setup of the month table \startsetups table:month \setupTABLE[c] [each] [width=\dimexpr\textwidth/7, frame=on, style=\tfa] \setupTABLE[r][each][height=1.8\lineheight,align={center,lohi}] \setupTABLE[c][7][foregroundcolor=red] \stopsetups % Define the macro for calling lua \define[1]\Photocalendarpages {\ctxlua{thirddata.calendar.Photo_calendar_page(#1)}} % Setup the \TEX\ side of the document \starttext % Add a title page \startstandardmakeup[page=yes,doublesided=yes] \startplacefigure [location=middle, title=, number=] {\externalfigure[13][width=\paperwidth]} \stopplacefigure \midaligned{\bfc \labeltext{fotocal}~\getvariable{PocketDiary}{Year}} \stopstandardmakeup % Call the defined macro \Photocalendarpages{\getvariable{PocketDiary}{Year}} \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Draft vertical text in margins
On Mon, 2024-06-03 at 17:04 +0200, Wolfgang Schuster wrote: > ai2472206...@yeah.net schrieb am 03.06.2024 um 11:35: > > you can try 'setuptext' and '\setuptexttexts' to put "draft" in > > margin.and use 'orientation' to change direction. > > > > > > \defineframed [marginframe] > > [width=max, height=max, > > style=\ss, > > corner=08, location=lohi, > > frame=off] > > \setuptext [style={\ss}] > > \setuptexttexts [margin] [] > > [\marginframe{\hbox orientation 1 > > {DRAFT}}] > > [\marginframe{\hbox orientation 1 > > {DRAFT}}] > > There is no need for low level option when you use \rotate, e.g. > > [\marginframe{\rotate[rotation=270]{DRAFT}}] > > \framed has a orientation key but it's not so easy to use in this > case > because you have to set length for width and height, e.g. > > \defineframed > [marginframe] > [width=\textheight, > height=\rightmarginwidth, > orientation=270] > > Wolfgang Thank you kindly, Wolfgang et al. Very helpful. -- Kip Warner OpenPGP signed/encrypted mail preferred https://www.thevertigo.com signature.asc Description: This is a digitally signed message part ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Draft vertical text in margins
ai2472206...@yeah.net schrieb am 03.06.2024 um 11:35: you can try 'setuptext' and '\setuptexttexts' to put "draft" in margin.and use 'orientation' to change direction. \defineframed[marginframe] [width=max, height=max, style=\ss, corner=08, location=lohi,frame=off] \setuptext [style={\ss}] \setuptexttexts [margin] [] [\marginframe{\hbox orientation 1 {DRAFT}}] [\marginframe{\hbox orientation 1 {DRAFT}}] There is no need for low level option when you use \rotate, e.g. [\marginframe{\rotate[rotation=270]{DRAFT}}] \framed has a orientation key but it's not so easy to use in this case because you have to set length for width and height, e.g. \defineframed [marginframe] [width=\textheight, height=\rightmarginwidth, orientation=270] Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Draft vertical text in margins
you can try 'setuptext' and '\setuptexttexts' to put "draft" in margin.and use 'orientation' to change direction. \defineframed[marginframe] [width=max, height=max, style=\ss, corner=08, location=lohi,frame=off] \setuptext [style={\ss}] \setuptexttexts [margin] [] [\marginframe{\hbox orientation 1 {DRAFT}}] [\marginframe{\hbox orientation 1 {DRAFT}}] [] \starttext \chapter{C:Some Word} \dorecurse{5}{ \section{S:Some Word} \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 / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Question about building an array of values with Lua
Hi Otared and Wolgang, Thanks for the answers. In fact, being familiar with Python and not at all with Lua, I didn't have the reflex to think of using a mathematical function which gives the remainder in the Euclidean division by 10, it's strange !! Fabrice Le jeu. 24 août 2023 à 04:06, Wolfgang Schuster < wolfgang.schuster.li...@gmail.com> a écrit : > Otared Kavian schrieb am 24.08.2023 um 01:04: > > Hi Fabrice, > > As Wolfgang points out, it is indeed possible to fill-in your table with > Lua: maybe you were wondering how to fill the columns 2, 3 and 4. In this > case you need to use the Lua function math.mod as in the following, which > is a completed version of what Wolfgang sent: > > > I guess I completely missed the units digit part :) > > %% begin filling-with-lua.tex > \starttext > > \startluacode > context.startxtable{ align = "middle,lohi", bodyfont = "9pt", framecolor = > "black" } > context.startxrow{ background = "color", backgroundcolor = "lightgray" > } > context.startxcell{ nx = 4 } > context("Units digit of") > context.stopxcell() > context.stopxrow() > context.startxrow() > context.startxcell{ width = "1cm" } > context.im("a") > context.stopxcell() > context.startxcell{ width = "1cm" } > context.im("a^2") > context.stopxcell() > context.startxcell{ width = "1cm" } > context.im("b") > context.stopxcell() > context.startxcell{ width = "1cm" } > context.im("2b^2") > context.stopxcell() > context.stopxrow() > for i = 0,9 do > context.startxrow() > for j = 1,4 do > context.startxcell() > if j == 1 then > context(i) > elseif j == 2 then > context(math.mod(i*i,10)) > elseif j == 3 then > context(i) > else > context(math.mod(2*i*i,10)) > end > context.stopxcell() > end > context.stopxrow() > end > > > I would drop the column check in this case. > > for i = 0,9 do > context.startxrow() > context.startxcell() > context(i) > context.stopxcell() > context.startxcell() > context(math.mod(i*i,10)) > context.stopxcell() > context.startxcell() > context(i) > context.stopxcell() > context.startxcell() > context(math.mod(2*i*i,10)) > context.stopxcell() > context.stopxrow() > end > > Wolfgang > > > ___ > 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] Re: Question about building an array of values with Lua
Otared Kavian schrieb am 24.08.2023 um 01:04: Hi Fabrice, As Wolfgang points out, it is indeed possible to fill-in your table with Lua: maybe you were wondering how to fill the columns 2, 3 and 4. In this case you need to use the Lua function math.mod as in the following, which is a completed version of what Wolfgang sent: I guess I completely missed the units digit part :) %% begin filling-with-lua.tex \starttext \startluacode context.startxtable{ align = "middle,lohi", bodyfont = "9pt", framecolor = "black" } context.startxrow{ background = "color", backgroundcolor = "lightgray" } context.startxcell{ nx = 4 } context("Units digit of") context.stopxcell() context.stopxrow() context.startxrow() context.startxcell{ width = "1cm" } context.im("a") context.stopxcell() context.startxcell{ width = "1cm" } context.im("a^2") context.stopxcell() context.startxcell{ width = "1cm" } context.im("b") context.stopxcell() context.startxcell{ width = "1cm" } context.im("2b^2") context.stopxcell() context.stopxrow() for i = 0,9 do context.startxrow() for j = 1,4 do context.startxcell() if j == 1 then context(i) elseif j == 2 then context(math.mod(i*i,10)) elseif j == 3 then context(i) else context(math.mod(2*i*i,10)) end context.stopxcell() end context.stopxrow() end I would drop the column check in this case. for i = 0,9 do context.startxrow() context.startxcell() context(i) context.stopxcell() context.startxcell() context(math.mod(i*i,10)) context.stopxcell() context.startxcell() context(i) context.stopxcell() context.startxcell() context(math.mod(2*i*i,10)) context.stopxcell() context.stopxrow() end Wolfgang ___ 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] Re: Question about building an array of values with Lua
Hi Fabrice, As Wolfgang points out, it is indeed possible to fill-in your table with Lua: maybe you were wondering how to fill the columns 2, 3 and 4. In this case you need to use the Lua function math.mod as in the following, which is a completed version of what Wolfgang sent: %% begin filling-with-lua.tex \starttext \startluacode context.startxtable{ align = "middle,lohi", bodyfont = "9pt", framecolor = "black" } context.startxrow{ background = "color", backgroundcolor = "lightgray" } context.startxcell{ nx = 4 } context("Units digit of") context.stopxcell() context.stopxrow() context.startxrow() context.startxcell{ width = "1cm" } context.im("a") context.stopxcell() context.startxcell{ width = "1cm" } context.im("a^2") context.stopxcell() context.startxcell{ width = "1cm" } context.im("b") context.stopxcell() context.startxcell{ width = "1cm" } context.im("2b^2") context.stopxcell() context.stopxrow() for i = 0,9 do context.startxrow() for j = 1,4 do context.startxcell() if j == 1 then context(i) elseif j == 2 then context(math.mod(i*i,10)) elseif j == 3 then context(i) else context(math.mod(2*i*i,10)) end context.stopxcell() end context.stopxrow() end context.stopxtable() \stopluacode \stoptext %% end filling-with-lua.tex Best regards: Otared > On 23 Aug 2023, at 17:48, Wolfgang Schuster > wrote: > > Fabrice Couvreur schrieb am 23.08.2023 um 19:28: >> Hi, >> I'm trying to fill an array using lua. So far it works but then I don't know >> if it's possible. > > Where do you have problems (look into cld-mkiv.pdf for hins)? > > \starttext > > \startluacode > context.startxtable{ align = "middle,lohi", bodyfont = "9pt", framecolor = > "black" } > context.startxrow{ background = "color", backgroundcolor = "lightgray" } > context.startxcell{ nx = 4 } > context("Units digit of") > context.stopxcell() > context.stopxrow() > context.startxrow() > context.startxcell{ width = "1cm" } > context.im("a") > context.stopxcell() > context.startxcell{ width = "1cm" } > context.im("a^2") > context.stopxcell() > context.startxcell{ width = "1cm" } > context.im("b") > context.stopxcell() > context.startxcell{ width = "1cm" } > context.im("2b^2") > context.stopxcell() > context.stopxrow() > for i = 0,9 do > context.startxrow() > for j = 1,4 do > context.startxcell() > if j == 1 then > context(i) > end > context.stopxcell() > end > context.stopxrow() > end > context.stopxtable() > \stopluacode > > \stoptext > > Wolfgang > > ___ > 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 > ___ Otared Kavian e-mail: ota...@gmail.com Phone: +33 6 88 26 70 95 ___ 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] Re: Question about building an array of values with Lua
Fabrice Couvreur schrieb am 23.08.2023 um 19:28: Hi, I'm trying to fill an array using lua. So far it works but then I don't know if it's possible. Where do you have problems (look into cld-mkiv.pdf for hins)? \starttext \startluacode context.startxtable{ align = "middle,lohi", bodyfont = "9pt", framecolor = "black" } context.startxrow{ background = "color", backgroundcolor = "lightgray" } context.startxcell{ nx = 4 } context("Units digit of") context.stopxcell() context.stopxrow() context.startxrow() context.startxcell{ width = "1cm" } context.im("a") context.stopxcell() context.startxcell{ width = "1cm" } context.im("a^2") context.stopxcell() context.startxcell{ width = "1cm" } context.im("b") context.stopxcell() context.startxcell{ width = "1cm" } context.im("2b^2") context.stopxcell() context.stopxrow() for i = 0,9 do context.startxrow() for j = 1,4 do context.startxcell() if j == 1 then context(i) end context.stopxcell() end context.stopxrow() end context.stopxtable() \stopluacode \stoptext Wolfgang ___ 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] Question about building an array of values with Lua
Hi, I'm trying to fill an array using lua. So far it works but then I don't know if it's possible. Thanks Fabrice \startluacode context.startxtable({"align={middle,lohi},bodyfont=9pt,framecolor=black"}) context.startxrow({"background=color, backgroundcolor=lightgray"}) context.startxcell({"nx=4"}) context("Units digit of") context.stopxcell() context.stopxrow() context.startxrow() context.startxcell({"width=1cm"}) context("\\im{a}") context.stopxcell() context.startxcell({"width=1cm"}) context("\\im{a²}") context.stopxcell() context.startxcell({"width=1cm"}) context("\\im{b}") context.stopxcell() context.startxcell({"width=1cm"}) context("\\im{2b²}") context.stopxcell() context.stopxrow() for i = 0, 9 do context.startxrow() context.startxcell() context(i) context.stopxcell() context.stopxrow() end context.stopxtable() \stopluacode ___ 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] Re: An error which is not in .log file
Thanks. After some work on it, following your advice, I reduce the compilation problem to several "wrong" files. One was trivialy fixed because I did not close one environment, but other don't. Please help: The error is here and I attach file. modules > 'pgfmath' is not found structure > sectioning > section @ level 3 : 0.0.1 -> Problemes de fraccions structure > sectioning > subject @ level 3 : 0.0.1 -> Preguntes tex error > tex error on line 25 in file ./dev.tex: \textfont0 is undefined in ordinal, font id 0, character 63) \startexercici[reference=exercici:problemes-de-fraccions-1, title={oli}] Calculeu quina part del dipòsit queda buida, sabent que l'aigua ocupa $2/5$ del recipient i l'oli, $1/4$ (vegeu figura~\in[fig:oli-aigua-diposit]). 15 \usetikzlibrary[trees] 16 \usetikzlibrary[calc, intersections, through, backgrounds, arrows, shapes.geometric, fadings, decorations.pathreplacing, shadings, shapes.geometric, patterns, fit, positioning, shapes.symbols, chains] 17 \usemodule[pgfmath] 18 %\usemodule[filter] 19 20 21 \startsection[title={Problemes de fraccions}, reference={seccio:problemes-de-fraccions}] 22 23 \subject{Preguntes} 24 25 >> \startexercici[reference=exercici:problemes-de-fraccions-1, title={oli}] Calculeu quina part del dipòsit queda buida, sabent que l'aigua ocupa $2/5$ del recipient i l'oli, $1/4$ (vegeu figura~\in[fig:oli-aigua-diposit]). 26 27 \startplacefigure[reference=fig:oli-aigua-diposit, location=force, title={Dipòsit omplit amb aigua i oli}] 28 \bTABLE[frame=off,align={middle,lohi},width=fit] 29 \bTR 30 \bTD 31 \starttikzpicture[scale=0.75] 32 % recipient 33 \draw (0,0) -- (0,10) -- (2,10) -- (2,0) -- cycle; 34 35 % aigua Somewhere in the math formula just ended, you used the stated character from an undefined font family. For example, plain TeX doesn't allow \it or \sl in subscripts. Proceed, and I'll try to forget that I needed that character. mtx-context | fatal error: return code: 1 Thanks in advance, On Tue, 15 Aug 2023 21:44:53 +0200 Wolfgang Schuster ha escrit: > Xavier B. schrieb am 15.08.2023 um 21:36: > > On Tue, 15 Aug 2023 21:13:54 +0200 > > Wolfgang Schuster ha escrit: > > > >> There is also something wrong with the structure of your document when > >> need \page[yes] after each file. > > Why is it trouble? > > When you start each subfile with \section or \subject you can use > \setuphead to force a pagebreak at the start of each new section and not > with a \page command in the document. > > Wolfgang > system > system > ConTeXt ver: 2023.08.15 18:48 LMTX fmt: 2023.8.15 int: english/english system > system > 'cont-new.mkxl' loaded open source > level 1, order 1, name '/home/xan/bin/context-current/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl' system > beware: some patches loaded from cont-new.mkiv close source> level 1, order 1, name '/home/xan/bin/context-current/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl' system > files > jobname './dev', input './dev.tex', result './dev' fonts > latin modern fonts are not preloaded languages > language 'en' is active open source > level 1, order 2, name './dev.tex' modules > 'tikz' is loaded open source > level 2, order 3, name '/home/xan/bin/context-current/tex/texmf-context/tex/context/modules/mkxl/m-tikz.mkxl' open source > level 3, order 4, name 'pgfutil-common.tex' close source> level 3, order 4, name 'pgfutil-common.tex' open source > level 3, order 5, name 'pgfutil-context.def' close source> level 3, order 5, name 'pgfutil-context.def' open source > level 3, order 6, name 'pgfrcs.code.tex' open source > level 4, order 7, name 'pgf.revision.tex' close source> level 4, order 7, name 'pgf.revision.tex' close source> level 3, order 7, name 'pgfrcs.code.tex' open source > level 3, order 8, name 'pgfsys.code.tex' open source > level 4, order 9, name 'pgfkeys.code.tex' open source > level 5, order 10, name 'pgfkeyslibraryfiltered.code.tex' close source> level 5, order 10, name 'pgfkeyslibraryfiltered.code.tex' close source> level 4, order 10, name 'pgfkeys.code.tex' cld > stack > cld > stack > use : slot = context.functions.register(f) cld > stack > and : context.functions.unregister(slot) cld > sta
[NTG-context] Re: Very strange error:
.tex' close source> level 2, order 79, name 'tikzlibraryshadings.code.tex' open source > level 2, order 80, name 'tikzlibrarypatterns.code.tex' open source > level 3, order 81, name 'pgflibrarypatterns.code.tex' close source> level 3, order 81, name 'pgflibrarypatterns.code.tex' close source> level 2, order 81, name 'tikzlibrarypatterns.code.tex' open source > level 2, order 82, name 'tikzlibraryfit.code.tex' close source> level 2, order 82, name 'tikzlibraryfit.code.tex' open source > level 2, order 83, name 'tikzlibrarypositioning.code.tex' close source> level 2, order 83, name 'tikzlibrarypositioning.code.tex' open source > level 2, order 84, name 'tikzlibraryshapes.symbols.code.tex' open source > level 3, order 85, name 'pgflibraryshapes.symbols.code.tex' close source> level 3, order 85, name 'pgflibraryshapes.symbols.code.tex' close source> level 2, order 85, name 'tikzlibraryshapes.symbols.code.tex' open source > level 2, order 86, name 'tikzlibrarychains.code.tex' close source> level 2, order 86, name 'tikzlibrarychains.code.tex' modules > 'pgfmath' is not found fonts > preloading latin modern fonts (second stage) fonts > 'fallback modern rm 12pt' is loaded structure > sectioning > section @ level 3 : 0.0.1 -> Proporcionalitat directa structure > sectioning > subject @ level 3 : 0.0.1 -> Preguntes floatblocks > '1' placed (here) floatblocks > order disturbed floatblocks > '2' placed (force) floatblocks > order disturbed floatblocks > '3' placed (force) backend > xmp > using file '/home/xan/bin/context-current/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml' pages > flushing realpage 1, userpage 1, subpage 1 floatblocks > order disturbed floatblocks > '4' placed (force) pages > flushing realpage 2, userpage 2, subpage 2 floatblocks > order disturbed floatblocks > '5' placed (force) tex error > tex error on line 540 in file ./dev.tex: The file ended when scanning an argument. 200 persones en total \par \startitemize [a, packed] \item 2 de 5 persones estan a $A$ \item a cada 4 persones de $A$ li corresponen 3 persones de $B$ \item 20\% són de $C$ \item 2/8 són de $D$ \stopitemize \par \head 420 persones en total \par \startitemize [a, packed] \item $3/4$ de persones estan a $A$ \item hi ha una correspondència: 3 de $A$ $\leftrightarrow $ 2 de $B$ \item 40\% és de $C$ \item de 5 persones, 4 són de $D$ \stopitemize \par \head 245 persones \par \startitemize [a, packed] \item $1/5$ de persones són de $A$ \item $20\%$ de persones són de $B$ \item per cada 7 persones de $A$, n'hi ha 4 de $C$ \item per cada 49 persones, n'hi ha 1 de $D$ \stopitemize \par \head 1800 persones \par \startitemize [a, packed] \item Un $30\%$ és de $A$ \item 30 de cada 50 són de $B$ \item cada 5 persones de $B$ li corresponen 2 persones de $C$ \item $D$ té un 150\% que les persones de $C$ \stopitemize \par \stopitemize \par En tots els casos, digueu quantes persones hi hauria en el subgrup més nombrós si en total hi hagués 1000 persones. \stopexercici \par \startexercici [exercici:proporcionalitat-directa-8]{relacionar diagrames} Relacioneu en cada cas els diagrames amb la proporció indicada \par \startitemize [A] \par \head Proporcions \par \startitemize [a, packed, columns] \item 2 de 5 \item 20\% \item $3/5$ \item 5 a 10 \stopitemize \par \head Diagrames \par \startitemize [a, packed, columns] \item \starttikzpicture \draw (0,0) -- (5,0); \foreach \x in {0, 1, 2,..., 5} { \draw (\x , -0.2) -- (\x , 0.2); \draw (\x ,-0.2) node[anchor=north] {\x }; } \draw [color=blue!50, line width=2pt] (0,0) -- (1,0); \stoptikzpicture \par \item \starttikzpicture \draw (0,0) -- (5,0); \foreach \x in {0, 1, 2,..., 5} { \draw (\x , -0.2) -- (\x , 0.2); \draw (\x ,-0.2) node[anchor=north] {\x }; } \draw [color=red!50, line width=2pt] (0,0) -- (2,0); \stoptikzpicture \par \item \starttikzpicture \draw (0,0) -- (5,0); \foreach \x in {0, 1, 2,..., 5} { \draw (\x , -0.2) -- (\x , 0.2); \draw (\x ,-0.2) node[anchor=north] {\x }; } \draw [color=green!50, line width=2pt] (0,0) -- (3,0); \stoptikzpicture \par \item \starttikzpicture \draw (0,0) -- (5,0); \foreach \x in {0, 1, 2,..., 5} { \draw (\x , -0.2) -- (\x , 0.2); \draw (\x ,-0.2) node[anchor=north] {\x }; } \draw [color=orange!50, line width=2pt] (0,0) -- (1.6,0); \stoptikzpicture \par \stopitemize \par \stopitemize \par Per a cada proporció, dibuixeu nous diagrames que tengui longitud 100. \stopexercici \par \par \startexercici
[NTG-context] Very strange error:
After I run context (LMTX version) to my document (attached) I get this error: tex error > tex error on line 540 in file ./dev.tex: The file ended when scanning an argument. I don't know how to start... Can anyone help me? Thanks, Xavier PS: I receive this error after upgrading to MKIV to LMTX. Before with MKIV I get no errors. dev.tex Description: TeX document return { ["errortype"]=6, ["filename"]="./dev.tex", ["lastcontext"]="\n200 persones en total \\par \\startitemize [a, packed] \\item 2 de 5 persones estan a $A$ \\item a cada 4 persones de $A$ li corresponen 3 persones de $B$ \\item 20\\% són de $C$ \\item 2/8 són de $D$ \\stopitemize \\par \\head 420 persones en total \\par \\startitemize [a, packed] \\item $3/4$ de persones estan a $A$ \\item hi ha una correspondència: 3 de $A$ $\\leftrightarrow $ 2 de $B$ \\item 40\\% és de $C$ \\item de 5 persones, 4 són de $D$ \\stopitemize \\par \\head 245 persones \\par \\startitemize [a, packed] \\item $1/5$ de persones són de $A$ \\item $20\\%$ de persones són de $B$ \\item per cada 7 persones de $A$, n'hi ha 4 de $C$ \\item per cada 49 persones, n'hi ha 1 de $D$ \\stopitemize \\par \\head 1800 persones \\par \\startitemize [a, packed] \\item Un $30\\%$ és de $A$ \\item 30 de cada 50 són de $B$ \\item cada 5 persones de $B$ li corresponen 2 persones de $C$ \\item $D$ té un 150\\% que les persones de $C$ \\stopitemize \\par \\stopitemize \\par En tots els casos, digueu quantes persones hi hauria en el subgrup més nombrós si en total hi hagués 1000 persones. \\stopexercici \\par \\startexercici [exercici:proporcionalitat-directa-8]{relacionar diagrames} Relacioneu en cada cas els diagrames amb la proporció indicada \\par \\startitemize [A] \\par \\head Proporcions \\par \\startitemize [a, packed, columns] \\item 2 de 5 \\item 20\\% \\item $3/5$ \\item 5 a 10 \\stopitemize \\par \\head Diagrames \\par \\startitemize [a, packed, columns] \\item \\starttikzpicture \\draw (0,0) -- (5,0); \\foreach \\x in {0, 1, 2,..., 5} { \\draw (\\x , -0.2) -- (\\x , 0.2); \\draw (\\x ,-0.2) node[anchor=north] {\\x }; } \\draw [color=blue!50, line width=2pt] (0,0) -- (1,0); \\stoptikzpicture \\par \\item \\starttikzpicture \\draw (0,0) -- (5,0); \\foreach \\x in {0, 1, 2,..., 5} { \\draw (\\x , -0.2) -- (\\x , 0.2); \\draw (\\x ,-0.2) node[anchor=north] {\\x }; } \\draw [color=red!50, line width=2pt] (0,0) -- (2,0); \\stoptikzpicture \\par \\item \\starttikzpicture \\draw (0,0) -- (5,0); \\foreach \\x in {0, 1, 2,..., 5} { \\draw (\\x , -0.2) -- (\\x , 0.2); \\draw (\\x ,-0.2) node[anchor=north] {\\x }; } \\draw [color=green!50, line width=2pt] (0,0) -- (3,0); \\stoptikzpicture \\par \\item \\starttikzpicture \\draw (0,0) -- (5,0); \\foreach \\x in {0, 1, 2,..., 5} { \\draw (\\x , -0.2) -- (\\x , 0.2); \\draw (\\x ,-0.2) node[anchor=north] {\\x }; } \\draw [color=orange!50, line width=2pt] (0,0) -- (1.6,0); \\stoptikzpicture \\par \\stopitemize \\par \\stopitemize \\par Per a cada proporció, dibuixeu nous diagrames que tengui longitud 100. \\stopexercici \\par \\par \\startexercici [exercici:proporcionalitat-directa-9]{representar a diagrames}Usant el diagrama $5 \\times 10$ següent (vegeu la figura~\\in [figura:diagrama-punts-5x10]) representeu la informació donada en cada cas. \\par \\placefigure [force] [figura:diagrama-punts-5x10] {Diagrama de punts $5 \\times 10$} { \\bTABLE [frame=off,align={middle,lohi},width=fit, offset=2mm] \\bTR \\bTD \\starttikzpicture \\foreach \\x in {0,...,9} \\foreach \\y in {0,...,4} { \\draw [fill=gray!50] (\\x ,\\y ) circle (0.25); } \\par \\stoptikzpicture \\eTD \\eTR \\eTABLE } \\par \\startitemize [a, columns, packed, four] \\item 40\\% \\item 4 de 5 \\item $3/4$ \\item 4 a 1 \\item 22\\% \\item $1/8$ \\item 5 a 3 \\item 3 de 8 \\stopitemize \\par Si aquestes informacions corresponguessin a mostres de peixos ferits a la mar, calculeu quants peixos malalts hi hauria en una mostra de 3000 peixos en total. \\stopexercici \\par \\startexercici [exercici:proporcionalitat-directa-antic-1]{sou} Na Marta fa feina per hores. Si fent 25 hores de feina, na Marta cobra 625 euros, quant cobrarà fent 40 hores? Quantes hores hauria de fer na Marta per cobrar exactament 2300 euros? \\stopexercici \\par \\par \\startexercici [exercici:proporcionalitat-directa-antic-2]{astronautes} Aquest és la bità cola d'un projecte espacial: \\startitemize [4] \\item S'enlairen 5 astronautes, amb 200 kg de menjar a una estació espacial \\item Al cap de 3 dies, hi ha un relleu: se'n van 2 i en vénen 3 \\item La tripulació resultant es queda durant 5 dies més \\item Tots els astronautes tornen. L'estació espacial queda buida \\stopitemize \\par Els bastarà el menjar que s'enduen al principi si sabem que quatre astronautes mengen en promig 20 kg per dia? \\stopexercici \\par \\st
Re: [NTG-context] Nuclear reactions
On Sat, 15 Apr 2023 12:02:28 -0600 Gavin via ntg-context wrote: > Hi List, > > I am still interested in knowing if there is a good way to do nuclear > reactions using \chemical. >From the chemical manual: As in mathematical typesetting mode, subscripts and superscripts can precede text. Thus, isotopes (such as this alpha particle, for example), can be written as: \chemical{^4_2He^{2+}}. But compare the alignment of \chemical{_{92}^{238}U} with \chemical{\lohi[left]{92}{238}U}. I have not used chemical formulas for some time, but \chemical{^{235)_{92}U,+,$n$,->,^{94}_{38}Sr,+,^{140}_{54}Xe,+,$2n$} "->" and "GIVES" are synonyms, as are "+" and "PLUS" (also MINUS, SINGLE, DOUBLE, TRIPLE, EQUILIBRIUM, MESOMERIC with ascii and unicode synonyms). Alignment can be altered using \lohi[left]{92}{235} (remember left is flushright) There is also "display mode" for chemical formulae: \startchemicalformula \chemical{text} \chemical{text}{below} \chemical{text}{above}{below} \stopchemicalformula where above and below can be used for labels, etc. Alan ___ 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] Nuclear reactions
Hi Gavin, maybe you have solved your problem yet. \startformula {\null}^^{194}__{38}{\rm Sr} or {\hbox{Xe}}^^{140}__{54}. \stopformula Better, ConTeXt way could be the variation on \chem: \unexpanded\def\isotope#1#2#3{\dontleavehmode\begingroup\null\lohi[left]{#2}{#3}#1\endgroup} \isotope{Sr}{38}{194} or (with more logical order of parameters) \unexpanded\def\isotope#1#2#3{\dontleavehmode\begingroup\null\lohi[left]{#1}{#2}#3\endgroup} \isotope{38}{999}{Sr} Or for text and math modes together: \unexpanded\def\isotope#1#2#3{% \ifmmode\begingroup\null^^{#1}__{#2}{\rm#3}\endgroup% \else\dontleavehmode\begingroup\null\lohi[left]{\tfx #1}{\tfx#2}\rm#3\endgroup% \fi} \isotope{999}{38}{Sr} \startformula \isotope{999}{38}{Sr} \stopformula You can do it either way, whichever way suits you better. Tomáš Od: ntg-context za uživatele Hans Åberg via ntg-context Odesláno: sobota 15. dubna 2023 22:41 Komu: mailing list for ConTeXt users Kopie: Hans Åberg Předmět: Re: [NTG-context] Nuclear reactions > On 15 Apr 2023, at 19:19, Gavin via ntg-context wrote: > > I’m writing nuclear reactions. When add prescripts to atomic symbols with two > letters, (Be, Sr, Xe, etc.) the prescripts split the atoms! One can use Unicode superscript and subscript numbers, as in ²³⁵₉₂U, which is easier to read. For input, an editor supporting text substitutions might be used. ___ 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 ___
Re: [NTG-context] Nuclear reactions
Hi List, I am still interested in knowing if there is a good way to do nuclear reactions using \chemical. But I found something that works for my current needs: \define[1]\Sr{\mathord{\rm Sr}__{38}^^{#1}} \define[1]\Xe{\mathord{\rm Xe}__{54}^^{#1}} \define[1]\U{\mathord{\rm U}__{92}^^{#1}} \starttext Reaction: \startformula \U{235} + n \rightarrow \Sr{94} + \Xe{140} + 2n \stopformula \stoptext Since I will be writing many reactions with a dozen or so different atomic symbols, it makes sense to create a command for each atomic symbol that adds the correct atomic number and takes the mass number as an argument. Hope someone else can benefit. I still getting used to ConTeXt's treatment of {…}, which does not appear to be TeX's way. Gavin > On Apr 15, 2023, at 11:19 AM, Gavin wrote: > > Hi list, > > I’m writing nuclear reactions. When add prescripts to atomic symbols with two > letters, (Be, Sr, Xe, etc.) the prescripts split the atoms! (See output > below.) > > \starttext > Text: \lohi[left]{4}{10}Be. > Reaction: > \startformula > {\rm U}^^{235}__{92} + n \rightarrow {\rm Sr}^^{94}__{38} + {\rm > Xe}^^{140}__{54} + 2n > \stopformula > \stoptext > > I looked at \chemical and \molecule, but could not find a way to make > isotopes with those. Any ideas? > > Gavin > > ___ 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] Nuclear reactions
Hi list, I’m writing nuclear reactions. When add prescripts to atomic symbols with two letters, (Be, Sr, Xe, etc.) the prescripts split the atoms! (See output below.) \starttext Text: \lohi[left]{4}{10}Be. Reaction: \startformula {\rm U}^^{235}__{92} + n \rightarrow {\rm Sr}^^{94}__{38} + {\rm Xe}^^{140}__{54} + 2n \stopformula \stoptext I looked at \chemical and \molecule, but could not find a way to make isotopes with those. Any ideas? Gavin PastedGraphic-1.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 / 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] rotated headers in natural tables
Henning Hraban Ramm via ntg-context schrieb am 15.03.2023 um 19:15: Hi! In my table, I want the header texts to be 90˚ rotated and aligned to the bottom of their cell. I couldn’t find an option to do that. Tried \dontleavehmode or \hfill in my \RtH macro to no avail. Is it possible? \define[1]{\RtH}{\rotate{#1}} \starttext \setupTABLE[offset=3pt] \setupTABLE[header][background=color,backgroundcolor=yellow,align=bottom] \bTABLE \bTABLEhead \bTR \bTH\RtH{animal}\eTH \bTH\RtH{size}\eTH \bTH\RtH{weight}\eTH \bTH\RtH{average speed}\eTH \eTR You can change the vertical alignment in a framed (and therefore also natural tables and extreme tables) with align=high, align=low and align=lohi. \bTR[align={middle,low},strut=no] \bTH \dontleavehmode\rotate{animal} \eTH \bTH \dontleavehmode\rotate{size} \eTH \bTH \dontleavehmode\rotate{weight} \eTH \bTH \dontleavehmode\rotate{average speed} \eTH \eTR \dontleavehmode is only needed when you set horizontal alignment (align=middle) and strut=no ensures there is no extra space at the bottom of the cells (remove the setting to see the difference). Wolfgang ___ 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] Absolute positioning of \startcombination... \stopcombination
Hi, I've experimented this morning with the solutions suggested by Wolfgang and Alan in reply to my post. The solution is really quite simple as suggested by Wolfgang i.e. \centerbox{..}. I have applied this to the code and I now have three different solutions to my initial problem. The Joy of ConTeXt! Thanks again Wolfgang and Alan. Best Wishes Keith McKay Here is the code showing the three solutions which others may find useful. \setuppapersize[A4,portrait]%[A4,portrait] \setuplayout [backspace=2.5cm, topspace=1cm, height=28cm, width=17cm, header=0cm, footer=0.75cm, ] \setuppagenumbering[state=start,alternative=doublesided,location=margin] \useMPlibrary [dum] \starttext %%% Me %%% \showframe [text] [text] \definelayer[test3] \setlayer[test3][] \centerbox{ {\startcombination[nx=3,ny=1,distance=15mm,after=,location=middle] {\externalfigure[dummy]}{} \rotate[rotation=90]{\externalfigure[dummy]}{} {\externalfigure[dummy][]}{} \stopcombination} } \flushlayer[test3] \page %%% Wolfgang %%% \centerbox {\bTABLE[frame=off,offset=7.5mm,align={middle,lohi}] \bTR \bTD \externalfigure[dummy] \eTD \bTD \rotate[rotation=90]{\externalfigure[dummy]} \eTD \bTD \externalfigure[dummy] \eTD \eTR \eTABLE} \page %%% Alan %%% \centerbox{ \startparagraph [align=middle] \startframed [frame=off,offset=\zeropoint] \startcombination [nx=3,ny=1,distance=15mm,after=,location=middle] {\externalfigure[dummy]}{} \rotate[rotation=90]{\externalfigure[dummy]}{} {\externalfigure[dummy][]}{} \stopcombination \stopframed \stopparagraph } \stoptext On 16/03/2023 19:50, Keith McKay wrote: Thanks Wolfgang and Alan! I will experiment with them tomorrow. Best Wishes Keith McKay ___ 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] Absolute positioning of \startcombination... \stopcombination
Thanks Wolfgang and Alan! I will experiment with them tomorrow. Best Wishes Keith McKay On Thu, 16 Mar 2023, 18:07 Alan Braslau, wrote: > On Thu, 16 Mar 2023 18:27:53 +0100 > Wolfgang Schuster via ntg-context wrote: > > > Keith McKay via ntg-context schrieb am 16.03.2023 um 17:59: > > > > > > Hi, > > > > > > I would like to position a combination of images where the centre > > > of the combination coincides with the centre of the text area of a > > > page. In the example below I have made the combination into a layer > > > thinking that this would be the easiest way to position it where I > > > wanted. However to position in the centre of the page I would need > > > to know the size of the combination and use this to calculate the x > > > and y values for positioning of the layer. I have looked at the > > > Wiki page on image size of combinations but still cant figure out > > > how to do it. Any suggestions on how to go about this or is their a > > > better way? > > > > > > Wiki Page reference: > > > https://wiki.contextgarden.net/Combinations#Image_Width > > > > > > Thanks > > > > > > Keith McKay > > > > > > %%% example %%% > > > > > > \setuppapersize[A4,portrait]%[A4,portrait] > > > > > > \setuplayout > > > > > > [backspace=2.5cm, > > > > > > topspace=1cm, > > > > > > height=28cm, > > > > > > width=17cm, > > > > > > header=0cm, > > > > > > footer=0.75cm, > > > > > > ] > > > > > > \useMPlibrary [dum] > > > > > > \starttext > > > > > > \definelayer[test3] > > > > > > \setlayer[test3][x=2cm,y=15cm] > > > > > > {\startcombination[nx=3,ny=1,distance=15mm,after=,location=middle] > > > > > > {\externalfigure[dummy]}{} > > > > > > \rotate[rotation=90]{\externalfigure[dummy]}{} > > > > > > {\externalfigure[dummy][]}{} > > > > > > \stopcombination} > > > > > > \flushlayer[test3] > > > > > > \stoptext > > > > > > > \useMPlibrary [dum] > > > > \showframe [text] [text] > > > > \setuplayout [tight] > > > > \starttext > > > > \centerbox > > {\bTABLE[frame=off,offset=7.5mm,align={middle,lohi}] > > \bTR > > \bTD > > \externalfigure[dummy] > > \eTD > > \bTD > > \rotate[rotation=90]{\externalfigure[dummy]} > > \eTD > > \bTD > > \externalfigure[dummy] > > \eTD > > \eTR > > \eTABLE} > > > > \stoptext > > > > Wolfgang > > Or you could put the combination in a frame: > > \startparagraph [align=middle] > \startframed [frame=off,offset=\zeropoint] > \startcombination [nx=3,ny=1] > {first} {} > {second}{} > {third} {} > \stopcombination > \stopframed > \stopparagraph > > Alan > ___ 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] Absolute positioning of \startcombination... \stopcombination
On Thu, 16 Mar 2023 18:27:53 +0100 Wolfgang Schuster via ntg-context wrote: > Keith McKay via ntg-context schrieb am 16.03.2023 um 17:59: > > > > Hi, > > > > I would like to position a combination of images where the centre > > of the combination coincides with the centre of the text area of a > > page. In the example below I have made the combination into a layer > > thinking that this would be the easiest way to position it where I > > wanted. However to position in the centre of the page I would need > > to know the size of the combination and use this to calculate the x > > and y values for positioning of the layer. I have looked at the > > Wiki page on image size of combinations but still cant figure out > > how to do it. Any suggestions on how to go about this or is their a > > better way? > > > > Wiki Page reference: > > https://wiki.contextgarden.net/Combinations#Image_Width > > > > Thanks > > > > Keith McKay > > > > %%% example %%% > > > > \setuppapersize[A4,portrait]%[A4,portrait] > > > > \setuplayout > > > > [backspace=2.5cm, > > > > topspace=1cm, > > > > height=28cm, > > > > width=17cm, > > > > header=0cm, > > > > footer=0.75cm, > > > > ] > > > > \useMPlibrary [dum] > > > > \starttext > > > > \definelayer[test3] > > > > \setlayer[test3][x=2cm,y=15cm] > > > > {\startcombination[nx=3,ny=1,distance=15mm,after=,location=middle] > > > > {\externalfigure[dummy]}{} > > > > \rotate[rotation=90]{\externalfigure[dummy]}{} > > > > {\externalfigure[dummy][]}{} > > > > \stopcombination} > > > > \flushlayer[test3] > > > > \stoptext > > > > \useMPlibrary [dum] > > \showframe [text] [text] > > \setuplayout [tight] > > \starttext > > \centerbox > {\bTABLE[frame=off,offset=7.5mm,align={middle,lohi}] > \bTR > \bTD > \externalfigure[dummy] > \eTD > \bTD > \rotate[rotation=90]{\externalfigure[dummy]} > \eTD > \bTD > \externalfigure[dummy] > \eTD > \eTR > \eTABLE} > > \stoptext > > Wolfgang Or you could put the combination in a frame: \startparagraph [align=middle] \startframed [frame=off,offset=\zeropoint] \startcombination [nx=3,ny=1] {first} {} {second}{} {third} {} \stopcombination \stopframed \stopparagraph Alan ___ 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] Absolute positioning of \startcombination... \stopcombination
Keith McKay via ntg-context schrieb am 16.03.2023 um 17:59: Hi, I would like to position a combination of images where the centre of the combination coincides with the centre of the text area of a page. In the example below I have made the combination into a layer thinking that this would be the easiest way to position it where I wanted. However to position in the centre of the page I would need to know the size of the combination and use this to calculate the x and y values for positioning of the layer. I have looked at the Wiki page on image size of combinations but still cant figure out how to do it. Any suggestions on how to go about this or is their a better way? Wiki Page reference: https://wiki.contextgarden.net/Combinations#Image_Width Thanks Keith McKay %%% example %%% \setuppapersize[A4,portrait]%[A4,portrait] \setuplayout [backspace=2.5cm, topspace=1cm, height=28cm, width=17cm, header=0cm, footer=0.75cm, ] \useMPlibrary [dum] \starttext \definelayer[test3] \setlayer[test3][x=2cm,y=15cm] {\startcombination[nx=3,ny=1,distance=15mm,after=,location=middle] {\externalfigure[dummy]}{} \rotate[rotation=90]{\externalfigure[dummy]}{} {\externalfigure[dummy][]}{} \stopcombination} \flushlayer[test3] \stoptext \useMPlibrary [dum] \showframe [text] [text] \setuplayout [tight] \starttext \centerbox {\bTABLE[frame=off,offset=7.5mm,align={middle,lohi}] \bTR \bTD \externalfigure[dummy] \eTD \bTD \rotate[rotation=90]{\externalfigure[dummy]} \eTD \bTD \externalfigure[dummy] \eTD \eTR \eTABLE} \stoptext Wolfgang ___ 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] Create the values of a sequence with Lua
On Mon, 31 Oct 2022, Fabrice Couvreur via ntg-context wrote: > Hi, > The idea is to fill the array with the sequence defined by > p(0) = 0.3 and p(n + 1) = 0.3 + 0.7*p(n) > The problem is that I don't really master Lua but I will learn when I have > some time! > Thanks for your help. > Fabrice You just need to adjust the order in which you are doing things... \starttext \startluacode context.startxtable({"align={middle,lohi},width=2cm,bodyfont=9pt"}) local p = {} p[0] = 0.3 for i= 0, 19 do context.startxrow() context.startxcell() context(i) context.stopxcell() -- context.startxcell() context(i+1) context.stopxcell() context.startxcell() context("%0.8f", p[i]) context.stopxcell() context.stopxrow() p[i+1] = 0.3 + 0.7*p[i] end context.stopxtable() \stopluacode \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 ___
[NTG-context] Create the values of a sequence with Lua
Hi, The idea is to fill the array with the sequence defined by p(0) = 0.3 and p(n + 1) = 0.3 + 0.7*p(n) The problem is that I don't really master Lua but I will learn when I have some time! Thanks for your help. Fabrice \starttext \startluacode context.startxtable({"align={middle,lohi},width=2cm,bodyfont=9pt"}) p = {} p[0] = 0.3 for i=0,19 do p[i+1] = 0.3+0.7*p[i]^2 end context.startxrow() for i=0,19 do context.startxcell() context(i) context.stopxcell() context.startxcell() context(i+1) context.stopxcell() context.startxcell() context("%0.8f",p[i] ) context.stopxcell() 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 / 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 make a row of text have vertical centering in tabulate environment?
On 10/25/22 02:35, Joel via ntg-context wrote: > I have a simple tabulate environment like this: > [...] > I'd like to vertically center the content in the one marked row. By > default, they seem to place each cell aligned to the top, but how can I > adjust them vertically so the text is vertically centered just in > specific rows? Hi Joel, I have no experience with tabulates, but I wouldn’t be surprised if they didn’t support vertical alignment. You can achieve that with xtables: \starttext \startxtable[frame=off, option={stretch, width}] \startxrow[topframe=on, bottomframe=on] \startxcell[nx=2] Cause \stopxcell \startxcell Effect \stopxcell \stopxrow \startxrow[bottomframe=on] \startxcell[width=.45\textwidth, align=lohi] text a \stopxcell \startxcell[width=.1\textwidth, align=lohi] text b \stopxcell \startxcell[width=.45\textwidth, align=center] \input knuth \stopxcell \stopxrow \stopxtable \stoptext xtables-mkiv.pdf contains all the details. Just in case it might help, Pablo ___ 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 make a row of text have vertical centering in tabulate environment?
Joel via ntg-context schrieb am 25.10.2022 um 02:35: I have a simple tabulate environment like this: \starttext \starttabulate[|p(.45\textwidth)|cp(.1\textwidth)|p(.45\textwidth)|] \NR \HL \NC Cause \NC \NC Effect \NC\NR \HL \NC \NC \NC \NC\NR \NC text a \NC text b \NC \input knuth \NC\NR %<-- vertically center this row \HL \NR \stoptabulate \stoptext I'd like to vertically center the content in the one marked row. By default, they seem to place each cell aligned to the top, but how can I adjust them vertically so the text is vertically centered just in specific rows? Use natural or extreme tables. \starttext \startxtable[frame=off,topframe=on,bottomframe=on] \startxrow \startxcell[width=.45\textwidth] Cause \stopxcell \startxcell[width=.1\textwidth] % empty cell \stopxcell \startxcell[width=.45\textwidth] Effect \stopxcell \stopxrow \startxrow[align={flushleft,lohi}] \startxcell text a \stopxcell \startxcell text b \stopxcell \startxcell \input knuth \stopxcell \stopxrow \stopxtable \stoptext Wolfgang ___ 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] startTEXpage on A4
I would suggest the approach of Wolfgang because the standard setting of \framed(texts)’ width is fit and the height setting can be changed to this too. Further I would suggest to use an overlay and a Metafun graphic for the cut-indicators. \defineoverlay[Cutpointstight][\useMPgraphic{Cutpointstight}] \startuniqueMPgraphic{Cutpointstight} path p; p := unitsquare xscaled OverlayWidth yscaled OverlayHeight; draw ulcorner p; draw urcorner p; draw llcorner p; draw lrcorner p; \stopuniqueMPgraphic \framedtext [height=fit, align={lohi,center}, background=Cutpointstight, foregroundcolor=black, frame=off, offset=3pt] {{\tfa HALITGARII EPISCOPI \blank[small] De vitiis et virtutibus \blank[small] Ordinum Poenitentium} \blank[small] Libri V.} I hope this solves your issue Willi > On 9 Oct 2022, at 20:49, Leah Neukirchen via ntg-context > wrote: > > Hans Hagen via ntg-context writes: > >> On 10/9/2022 3:52 PM, Leah Neukirchen via ntg-context wrote: >>> Wolfgang Schuster via ntg-context writes: >>> >>>> Leah Neukirchen via ntg-context schrieb am 09.10.2022 um 15:19: >>>>> Hi, >>>>> >>>>> is there a way to have something like >>>>> >>>>> \setuppapersize[A5][A4] >>>>> >>>>> but have the "inner paper size" be a computed fit like in >>>>> \startTEXpage? >>>>> >>>>> Or, alternatively, is there is a way to print crop marks around >>>>> an environment like \startTEXpage? >>>> >>>> Can you be more concrete what your goal is, there are a few ways to solve >>>> your problem but with a few more information we can give you a good >>>> solution. >>> Say I want to print some stickers or paper strips of non-fixed size, >>> and get crop marks around them to know where to cut. >>> With \setuppapersize and \setuparranging I can do this nicely if I >>> know the size in advance, but in some cases I don't. >> >> \definepapersize >> [label] >> [width=6cm, >> height=25mm] > > But that requires knowing the size in advance. Think of the labels in > a museum that depend how long the description is. ;) > > -- > Leah Neukirchenhttps://leahneukirchen.org/ > ___ > 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] \startcolumnset ... \stopcolumnset is working.
Dear all, I didn’t test “\startcolumnset … \stopcolumnset” for some time, because I got error whenever I tested it under Mac OS Big Sur. However, two days ago, I tested it, and found that it was working. I install updated version today and run a test file again. Finally, I get an output without error! I don't know what is happened, but it is a good news. Here is a sample file which I simplified one that is given by one of the experts. Someone may modify it better. Thanks to ConTeXt team. Best regards, Dalyoung \startuseMPgraphic{squareBox} draw topboundary OverlayBox leftenlarged 1mm rightenlarged 1mm; draw bottomboundary OverlayBox leftenlarged 1mm rightenlarged 1mm; draw rightboundary OverlayBox shifted (1mm,0); draw leftboundary OverlayBox shifted (-1mm,0); \stopuseMPgraphic \defineoverlay [headerBox] [\useMPgraphic{squareBox}] \startuseMPgraphic{verticalrule3} draw rightboundary OverlayBox shifted (1mm,0); %if CurrentColumn = 1: shifted(-2mm,0) fi ; draw leftboundary OverlayBox shifted (-1mm,0); %if CurrentColumn = 2: shifted(2mm,0) fi ; draw bottomboundary OverlayBox leftenlarged 1mm rightenlarged 1mm; \stopuseMPgraphic \defineoverlay [verticalrule] [\useMPgraphic{verticalrule3}] \definecolumnset [exam] [n=2, background=verticalrule] \setuplayout[width=19cm, height=26cm, header=1cm, footer=.5cm,backspace=1cm] \setupheader[before=\vfil, after=\vfil] \setupbackgrounds[header][text][frame=off, background=headerBox, align=lohi]%topframe= \setupbackgrounds[footer][text][frame=off, background=screen] \define[3]\headTitle{\setupheadertexts[][\bf #1 \hfill #2 \hfill #3 \hfill ID: \hskip 2cm Name: \hskip 2cm]} \setupmathematics[autopunctuation=no, integral=nolimits] \setupbodyfont[rm,10pt] \setuppagenumbering[location=footer] \setupcolors[state=start] %\setupexternalfigure[directory={/Users/graph/Documents/figures,}] \headTitle{2021. 12. 12.}{Set Theory}{Final Exam} \starttext \startcolumnset[exam] \startitemize[n] \item The first problem. \column \item The second problem. \column \item The third problem. \column \item The third problem. \stopitemize \stopcolumnset \stoptext ___ 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] Auto width and height on table cells
On 6/30/22 18:10, Angel M Alganza via ntg-context wrote: > [...] > No, you aren't, and it almost does it, except when the fixed width > column is other than the first one, I'm afraid. Hi Ángel, there might be a way to get it, as long as you don’t define height directly, such as in: \starttext \showframe \startbuffer row\currentxtablerow--col\currentxtablecolumn \stopbuffer \startbuffer[table] \startxtable[option={stretch, height}, align={lohi, middle}] \startxrow \dorecurse{5} {\startxcell[width=.115\textwidth]\inlinebuffer\stopxcell} \startxcell\inlinebuffer\stopxcell \stopxrow \startxrow \dorecurse{5} {\startxcell\inlinebuffer\stopxcell} \startxcell[offset=1em]\input zapf\stopxcell \stopxrow \dorecurse{5} {\startxrow \dorecurse{6} {\startxcell\inlinebuffer\stopxcell} \stopxrow} \stopxtable \stopbuffer \getbuffer[table] \page \setuppapersize[A3, landscape] \getbuffer[table] \stoptext Again, just in case it helps, Pablo ___ 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] Auto width and height on table cells
On 6/30/22 09:46, Angel M Alganza via ntg-context wrote: > [...] > How about the auto row height? That'd be the only thing I'm missing. Hi Ángel, I’m not sure whether I’m totally missing your point, but I think this is a way that might achieve what you want: \starttext \showframe \startbuffer row\currentxtablerow--col\currentxtablecolumn \stopbuffer \startbuffer[table] \startxtable[option={stretch, height}, align={lohi, middle}] \startxrow \startxcell[width=3cm, option=fixed]\inlinebuffer\stopxcell \dorecurse{5} {\startxcell\inlinebuffer\stopxcell} \stopxrow \startxrow \startxcell[height=3cm, option=fixed]\inlinebuffer\stopxcell \dorecurse{5} {\startxcell\inlinebuffer\stopxcell} \stopxrow \dorecurse{5} {\startxrow \dorecurse{6} {\startxcell\inlinebuffer\stopxcell} \stopxrow} \stopxtable \stopbuffer \getbuffer[table] \page \setuppapersize[A3, landscape] \getbuffer[table] \stoptext Just in case it helps, Pablo ___ 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] right item marks for associative questions?
Damien Thiriet via ntg-context schrieb am 12.04.2022 um 20:46: Thank you for all your answers. I will have a deeper look at them. My first comments: If you are certain that the there will be no multi-line item Unfortunately there are often some. History teachers are not known for loving short texts, at least in France. Using the “columns" feature is one way to go Might be, but I do not always give the same number of answers on both columns Something I forgot to put in my MWE is that I randomize both lists. Messing the answers is a good way to prevent pupils from cheating, especially with long answers.. That makes a four columns table more cumbersome, so I believe. You can use different alignment settings to move the bullet points to the right side of your lists. \starttext \bTABLE[frame=off,width=.4\textwidth,columndistance=.2\textwidth,align={normal,lohi}] \bTR \bTD \startitemize[circle,random][align=righttoleft] \startitem {\lefttoright One} \stopitem \startitem {\lefttoright Two} \stopitem \startitem {\lefttoright Three} \stopitem \stopitemize \eTD \bTD \startitemize[circle,random] \startitem First \stopitem \startitem Second \stopitem \startitem Third \stopitem \startitem Foruth \stopitem \stopitemize \eTD \eTR \eTABLE \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 ___
Re: [NTG-context] right item marks for associative questions?
On 4/12/22 12:16 AM Damien Thiriet via ntg-context wrote: > Hi! > > I am used to giving associative questions to my pupils, > something like > > * connect the author with its ideas > > Friedrich Nietzsche * * "God is dead" > Woody Allen * * "Nietzsche is dead, God is dead > and I don't feel so good" > God * * "Nietzsche is dead" > > I design it as a two-cells xtable with itemized lists inside. > How can I have the item mark on the right side? If you are certain that the there will be no multi-line item (i.e. item text is short enough that it fits in slightly less than half of textwidth) you can use an enumeration, and put the contents inside a two-column layout: %%% start example-1 \define[1]\aitemcmd{\inframed[width=1cm,align=flushright,frame=off]{(#1)}} \defineenumeration [aitem] \setupenumeration [aitem] [text=, alternative=empty, headstyle=normal, width=fit, align=flushright, closesymbol={\getnumber[aitem]}, closecommand=\aitemcmd] \starttext \startcolumns[distance=1cm] \startitemize[n] \dorecurse{5}{ \startaitem whatever left \stopaitem } \stopitemize \startitemize[a][left=(,right=),stopper=,width=1cm] \dorecurse{5}{ \startitem whatever right \stopitem } \stopitemize \stopcolumns \stoptext %%% stop example-1 [You can tweak the alternative, align, closesymbol, closecommand to get exactly what you want; the example above will give a somewhat symmetric layout] More generally, if the text can multi-line, then I think TABLE (with proper alignment options) might be better-suited: %%% start example-2 \define\startItemize{ \bTABLE\setupTABLE[frame=on,align=lohi] \setupTABLE[2][distance=1cm,align={flushright,lohi}] \setupTABLE[2,3][width=0.05\textwidth] \setupTABLE[1][align=flushright,width=0.4\textwidth] \setupTABLE[4][align=flushleft,width=0.4\textwidth] } \define\stopItemize{\eTABLE} \define[1]\metI{\bTR \bTD #1 \eTD \bTD (\character{\currentTABLErow}) \eTD} \define[1]\Item{\bTD (\currentTABLErow) \eTD \bTD #1 \eTD \eTR} \starttext \startItemize \dorecurse{5}{ \metI {whatever here on the left} \Item {whatever here on the right} } \stopItemize \stoptext %%% stop example-2 Best, Sreeram ___ 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] Makeup on same page as main content
On Sunday, March 6, 2022 5:17 AM mastermind_ x via ntg-context wrote: > Any pointers on how I can achieve this? You don't have a MWE, so based on my understanding of your illustration, I have the following: %%% SOF % required for 'cow' \setupexternalfigures[location={local,default}] \setvariables [assignments] [set={\setups[assignments:set]}] \startsetups assignments:set \writestatus{variables}{assignments:set is being called..} \startalignment[middle] \bTABLE[frame=off] \setupTABLE[c][1][align=flushleft,style=bold,distance=2cm] \setupTABLE[c][2][align={flushright,lohi}] \bTR \bTD \externalfigure[cow][height=2cm] \eTD \bTD \doiftextelse{\getvariable{assignments}{date}}{\getvariable{assignments}{date}}{\date} \eTD \eTR \bTR \bTD Course: \getvariable{assignments}{code} \eTD \bTD \getvariable{assignments}{assignment} \eTD \eTR \bTR \bTD Name \eTD \bTD \getvariable{assignments}{name} \eTD \eTR \bTR \bTD Class \eTD \bTD \getvariable{assignments}{class} \eTD \eTR \eTABLE \stopalignment \stopsetups \starttext \setvariables [assignments] [code={AB1234}, date={January 1, 2038}, assignment={whatever}, name={the name}, class={1970}] \input tufte \page \setvariables [assignments] [code={AB1234}, date=, assignment={whatever}, name={the name}, class={2038}] \input knuth \stoptext %%% EOF Essentially, variables in ConTeXt has a nice set key which can be made to trigger anything when the variables are set. So you can give it a setup to do whatever you want by just saying \setvariables[assignments][...] wherever in the document you desire. See here for an example [there is also a 'reset' key]: https://wiki.contextgarden.net/Setups [Since you said 'framed assignment box' you can enable the frames of the cell you want, and change formatting as needed] Sreeram ___ 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 create cell data that spans four rows in a table?
Willi Egger via ntg-context schrieb am 08.01.2022 um 23:57: I would suggest not to use \starttable at all. To me the most suitable table environment for such a table is \bTABLE \eTABLE. It gives you all kind of control over layout, dimensions, frames on and off etc. I agree natural tables or extreme tables are the better choice for this table layout but it can be improved. 1. Keep the layout/settings local. To ensure the \setupTABLE settings don't affect other tables you can either put \start and \stop at the begin and end of the table, e.g. \start \setupTABLE[...] \bTABLE ... \eTABLE \stop or put the settings in a setup-environment and load them on a pertable basis, e.g. \startsetups[fancytable] \setupTABLE[...] \stopsetups \bTABLE[setups=fancytable] ... \eTABLE 2. Font changes are local to cells When you apply a font switch to the whole content of a table cell there is no need to put braces around the text, e.g. \bTD \bf ... \eTD can be used without problem. When you make this change for a table header and the result is bold text there is a even simpler method because a special cell type exists here, e.g. \bTH ... \eTH creates bold text. 3. Simple markup For natural tables with short texts in each cell there exists a simple mode which uses \starttable inspired markup with the short \NC and \NR commands to mark the start of each cell and row. The example table of the OP can be written like below. \starttext \startsetups [tableframe] \setupTABLE [c] [1][leftframe=off,width=40mm] \setupTABLE [c] [2][rightframe=off, width=60mm] \setupTABLE [c] [each] [align={lohi,center}] \stopsetups \startTABLE[setups=tableframe] \NC \bf Eons \NC \bf Eras \NC\NR \NC Hadeon Eon\NC \NC\NR \NC[ny=4] Archanon Eon\NC Eoarchean Era\NC\NR \NC Paleoarchean Era \NC\NR \NC Mesoarchean Era \NC\NR \NC Neoarchean Era \NC\NR \NC[ny=3] Proterozoic Eon \NC Paleoproterozoic Era \NC\NR \NC Mesoproterozoic Era \NC\NR \NC Neoproterozoic Era \NC\NR \NC[ny=3] Phanerozoic Eon \NC Paleozoic Era\NC\NR \NC Mesozoic Era \NC\NR \NC Cenozoic Era \NC\NR \stopTABLE \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 ___
Re: [NTG-context] How to create cell data that spans four rows in a table?
Thank you! The code is much easier to understand than the other way I was trying to use. --Joel On Saturday, January 8, 2022, 04:00:12 PM MST, Willi Egger via ntg-context wrote: I would suggest not to use \starttable at all. To me the most suitable table environment for such a table is \bTABLE \eTABLE. It gives you all kind of control over layout, dimensions, frames on and off etc. \setupTABLE[c][1][leftframe=off,width=40mm] \setupTABLE[c][2][rightframe=off, width=60mm] \setupTABLE[c][each][align={lohi,center}] \bTABLE \bTR \bTD {\bf Eons}\eTD \bTD {\bf Eras} \eTD \eTR \bTR \bTD Hadeon Eon \eTD \bTD \eTD \eTR \bTR \bTD[ny=4] Archanon Eon \eTD \bTD Eoarchean Era \eTD \eTR \bTR \bTD Paleoarchean Era \eTD \eTR \bTR \bTD Mesoarchean Era \eTD \eTR \bTR \bTD Neoarchean Era \eTD \eTR \bTR \bTD[ny=3] Proterozoic Eon \eTD \bTD Paleoproterozoic Era \eTD \eTR \bTR \bTD Mesoproterozoic Era \eTD \eTR \bTR \bTD Neoproterozoic Era\eTD \eTR \bTR \bTD[ny=3] Phanerozoic Eon \eTD \bTD Paleozoic Era \eTD \bTR \bTD Mesozoic Era\eTD \eTR \bTR \bTD Cenozoic Era \eTD \eTR \eTABLE Willi > On 8 Jan 2022, at 22:39, Joel via ntg-context wrote: > > I created a table that has some cells span multiple rows. This works good > with cells that span an odd-number of rows, but when I try to span 4 rows, > the text isn't quite vertically centered. How can I get the cell with the > text "Archaeon Eon" to be a little lower, so it is centered within its box? > > --Joel > > Minimum working example: > > \starttext > > \starttable[|c|c|] > \NC {\bf Eons} \NC {\bf Eras} \NC \AR > \HL > \NC Hadeon Eon \VL \NC \AR > \HL > \NC \VL Eoarchean Era \NC \AR > \DC \DL[1] \DR > \NC \smash{Archaeon Eon} \VL Paleoarchean Era \NC \AR > \DC \DL[1] \DR > \NC \VL Mesoarchean Era \NC \AR > \DC \DL[1] \DR > \NC \VL Neoarchean Era \NC \AR > > \HL\NC \VL Paleoproterozoic Era \NC \AR > \DC \DL[1] \DR > \NC Proterozoic Eon \VL Mesoproterozoic Era \NC \AR > \DC \DL[1] \DR > \NC \VL Neoproterozoic Era \NC \AR > \HL > > > \HL\NC \VL Paleozoic Era \NC \AR > \DC \DL[1] \DR > \NC Phanerozoic Eon \VL Mesozoic Era \NC \AR > \DC \DL[1] \DR > \NC \VL Cenozoic Era \NC \AR > \HL > \stoptable > > \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 ___ ___ 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 create cell data that spans four rows in a table?
I would suggest not to use \starttable at all. To me the most suitable table environment for such a table is \bTABLE \eTABLE. It gives you all kind of control over layout, dimensions, frames on and off etc. \setupTABLE[c][1][leftframe=off,width=40mm] \setupTABLE[c][2][rightframe=off, width=60mm] \setupTABLE[c][each][align={lohi,center}] \bTABLE \bTR \bTD {\bf Eons}\eTD \bTD {\bf Eras} \eTD \eTR \bTR \bTD Hadeon Eon \eTD \bTD \eTD \eTR \bTR \bTD[ny=4] Archanon Eon \eTD \bTD Eoarchean Era \eTD \eTR \bTR \bTD Paleoarchean Era \eTD \eTR \bTR \bTD Mesoarchean Era \eTD \eTR \bTR \bTD Neoarchean Era \eTD \eTR \bTR \bTD[ny=3] Proterozoic Eon \eTD \bTD Paleoproterozoic Era \eTD \eTR \bTR \bTD Mesoproterozoic Era \eTD \eTR \bTR \bTD Neoproterozoic Era\eTD \eTR \bTR \bTD[ny=3] Phanerozoic Eon \eTD \bTD Paleozoic Era \eTD \bTR \bTD Mesozoic Era\eTD \eTR \bTR \bTD Cenozoic Era \eTD \eTR \eTABLE Willi > On 8 Jan 2022, at 22:39, Joel via ntg-context wrote: > > I created a table that has some cells span multiple rows. This works good > with cells that span an odd-number of rows, but when I try to span 4 rows, > the text isn't quite vertically centered. How can I get the cell with the > text "Archaeon Eon" to be a little lower, so it is centered within its box? > > --Joel > > Minimum working example: > > \starttext > > \starttable[|c|c|] > \NC {\bf Eons} \NC {\bf Eras} \NC \AR > \HL > \NC Hadeon Eon \VL \NC \AR > \HL > \NC \VL Eoarchean Era \NC \AR > \DC \DL[1] \DR > \NC \smash{Archaeon Eon} \VL Paleoarchean Era \NC \AR > \DC \DL[1] \DR > \NC \VL Mesoarchean Era \NC \AR > \DC \DL[1] \DR > \NC \VL Neoarchean Era \NC \AR > > \HL\NC \VL Paleoproterozoic Era \NC \AR > \DC \DL[1] \DR > \NC Proterozoic Eon \VL Mesoproterozoic Era \NC \AR > \DC \DL[1] \DR > \NC \VL Neoproterozoic Era \NC \AR > \HL > > > \HL\NC \VL Paleozoic Era \NC \AR > \DC \DL[1] \DR > \NC Phanerozoic Eon \VL Mesozoic Era \NC \AR > \DC \DL[1] \DR > \NC \VL Cenozoic Era \NC \AR > \HL > \stoptable > > \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 ___
Re: [NTG-context] Critical Editions?
On 12/21/21 10:50 AM, hanneder--- via ntg-context wrote: > > Details: > I was able to find the article "Ediciones críticas con ConTeXt" (is > this in use?) Hi Jürgen, if you mean http://www.ediciones-criticas.tk/pdf/criticas-context.pdf, this is outdated. I hope to update it in a not so distant future... 😅. > I also found out that for simple editions context already works. For > critical editions in my field we need both footnote references based > on linenumbers (for prose), but also references to verse number, > which can be entered manually. As far as I can remember linenotes are footnotes with references to line numbers. I don’t think it makes a difference if the line number is set automatically by ConTeXt or the user specifies a given value. > So far, so good. Any hints to a more sophisticated solution are highly > welcome. (I am a simple TeX user) I’m only a ConTeXt newbie (who has been using it for about a decade 😅). There might be other solutions, but I’m afraid I don’t know which is exactly the problem you are facing. Sorry, but the text structure isn’t clear to me (this is independent from the fact that I don’t understand a word from the language you may be using). BTW, I could only make your sample work in the following form: \starttext \setupnotation[linenote] [alternative=serried,width=broad,distance=.5em,display=no] \setupnote[linenote][way=bypage,paragraph=yes,rule=off] \definenote [variant] \setupnotation[variant][number=no] \setupnote[variant][way=bypage,paragraph=yes,rule=off] \definelines[slokaed][][indenting={yes, small, even}, before={\startnarrower\startlinenumbering}, after={\stoplinenumbering\stopnarrower}] \definelines[slokaedplain][][indenting={yes, small, even}, before=\startnarrower, after=\stopnarrower] \startslokaed mano buddhir ahaṃ prāṇās tanmātrendriyajīvanam yaṃ dṛṣṭvā\linenote{dṛṣṭvā ] dṛṣṭva G\lohi{pc}{1}} vinivartante tam \linenote{tam ] tat} upāsyam upāsmahe \stopslokaed \startslokaedplain mano buddhir ahaṃ prāṇās tanmātrendriyajīvanam yaṃ dṛṣṭvā\variant{2c dṛṣṭvā ] dṛṣṭva} vinivartante tam \variant{2d tam ] tat} upāsyam upāsmahe (2) \stopslokaedplain \stoptext Just in case it might help, Pablo ___ 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] aligning Malayalam horizontally across column
On Fri, 31 Dec 2021 20:49:30 +0530 kauśika wrote: > If the height varies due to the formation of conjuncts, I > think you are better off using "(natural) tables" : > https://wiki.contextgarden.net/TABLE > In particular, setting align=lohi for the two columns concerned > should work. Again, your example is not clear enough for me to > suggest much Hi Kausika, I used natural tables as you suggested and it has solved both my problems. Thanks again for all your help, Have a wonderful year ahead, ajith ___ 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] aligning Malayalam horizontally across column
On Friday, December 31, 2021 6:25:01 PM IST Ajith R via ntg-context wrote: > The problems are that - a) the group, with the two short paras get > separated into different columns and sometimes pages. How can I prevent > that? In other words, how do I tell Context that this should be treated > as cohesive unit? b) The horizontal space doesn't align across columns. > This probably is because the different conjuncts in each of these lines > have different heights. How can I ask Context to treat each of these > cohesive units as having the same height? Your example is not clear enough for me to address b). I think I understand what problem you have described in a). If you want to explicitly typeset paragraphs into a columnar format, use 'paragraphs': \defineparagraphs[mypar][n=5] \setupparagraphs[mypar][1][width=…] \setupparagraphs[mypar][2][width=…] \setupparagraphs[mypar][3][width=…] \setupparagraphs[mypar][4][width=…] \setupparagraphs[mypar][5][width=…] Now, you can do \startmypar this is the first column \mypar and here is the second column \mypar the third column is here \mypar and the fourth column is here \mypar and the last (fifth) column \stopmypar [If you end up using this you will have to "denote columns" in your script- generated file by using \mypar] Look into the options of \setupparagraphs for more details (there is a height option as well). If the height varies due to the formation of conjuncts, I think you are better off using "(natural) tables" : https://wiki.contextgarden.net/TABLE In particular, setting align=lohi for the two columns concerned should work. Again, your example is not clear enough for me to suggest much. kauśika ___ 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] Critical Editions?
Thanks for bringing this topic up again. I'd also be highly interested in this! Denis > -Ursprüngliche Nachricht- > Von: ntg-context Im Auftrag von hanneder-- > - via ntg-context > Gesendet: Dienstag, 21. Dezember 2021 10:51 > An: ntg-context@ntg.nl > Cc: hanne...@staff.uni-marburg.de > Betreff: [NTG-context] Critical Editions? > > > I just started switching after long years of typesetting with La-/Omega- > /pdfTeX to Context and was exploring the capabilities of the program for > typesetting critical editions. So I was wondering whether there is any > updated information on how to produce critical editions? > > > Details: > I was able to find the article "Ediciones críticas con ConTeXt" (is this in > use?) > as well as a plan of and a remark concerning critTeXt: "As I learned from a > thread on NTG-context from early 2010 we shouldn't expect a dedicated > package, but that ConTeXt will eventually incorporate the needed > functionalities." What is the status of that? > > > I also found out that for simple editions context already works. For critical > editions in my field we need both footnote references based on > linenumbers (for prose), but also references to verse number, which can be > entered manually. The main problem for me was to find the command > \linenote :) > > % Setup of \linenote > \setupnotation[linenote] > [alternative=serried,width=broad,distance=.5em,display=no] > \setupnote[linenote][way=bypage,paragraph=yes,rule=off] > > % \variant as a footnote without reference number \definenote [variant] > [footnote] \setupnotation[variant][number=no] > \setupnote[variant][way=bypage,paragraph=yes,rule=off] > > % Two "environments" for Sanskrit verses, one with, one without > linenumbers. > > % SANSKRIT EDITION linenumbers > \definelines[slokaed][][indenting={yes, small, even}, > > before=\startnarrower\startlinenumbering,after=\stoplinenumbering\stopn > arrower] > > % SANSKRIT EDITION plain (referring to verses) > \definelines[slokaedplain][][indenting={yes, small, even}, >before=\startnarrower,after=\stopnarrower] > > With this the code of the edition can be pleasently minimalistic: > > \startslokaed > mano buddhir ahaṃ prāṇās tanmātrendriyajīvanam >yaṃ dṛṣṭvā\linenote{dṛṣṭvā ] dṛṣṭva G\lohi{pc}{1}} vinivartante tam > \linenote{tam ] tat} upāsyam upāsmahe} \stopslokaed > > > \startslokaedplain > mano buddhir ahaṃ prāṇās tanmātrendriyajīvanam yaṃ dṛṣṭvā\variant{2c > dṛṣṭvā ] dṛṣṭva} vinivartante tam \variant{2d tam ] tat} upāsyam upāsmahe > (2) \stopslokaedplain > > So far, so good. Any hints to a more sophisticated solution are highly > welcome. (I am a simple TeX > user) > Thanks > Jürgen > > > > --- > > Prof. Dr. Juergen Hanneder > Philipps-Universitaet Marburg > FG Indologie u. Tibetologie > Deutschhausstr.12 > 35032 Marburg > Germany > Tel. 0049-6421-28-24930 > hanne...@staff.uni-marburg.de > > __ > _ > 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] Critical Editions?
I just started switching after long years of typesetting with La-/Omega-/pdfTeX to Context and was exploring the capabilities of the program for typesetting critical editions. So I was wondering whether there is any updated information on how to produce critical editions? Details: I was able to find the article "Ediciones críticas con ConTeXt" (is this in use?) as well as a plan of and a remark concerning critTeXt: "As I learned from a thread on NTG-context from early 2010 we shouldn't expect a dedicated package, but that ConTeXt will eventually incorporate the needed functionalities." What is the status of that? I also found out that for simple editions context already works. For critical editions in my field we need both footnote references based on linenumbers (for prose), but also references to verse number, which can be entered manually. The main problem for me was to find the command \linenote :) % Setup of \linenote \setupnotation[linenote] [alternative=serried,width=broad,distance=.5em,display=no] \setupnote[linenote][way=bypage,paragraph=yes,rule=off] % \variant as a footnote without reference number \definenote [variant] [footnote] \setupnotation[variant][number=no] \setupnote[variant][way=bypage,paragraph=yes,rule=off] % Two "environments" for Sanskrit verses, one with, one without linenumbers. % SANSKRIT EDITION linenumbers \definelines[slokaed][][indenting={yes, small, even}, before=\startnarrower\startlinenumbering,after=\stoplinenumbering\stopnarrower] % SANSKRIT EDITION plain (referring to verses) \definelines[slokaedplain][][indenting={yes, small, even}, before=\startnarrower,after=\stopnarrower] With this the code of the edition can be pleasently minimalistic: \startslokaed mano buddhir ahaṃ prāṇās tanmātrendriyajīvanam yaṃ dṛṣṭvā\linenote{dṛṣṭvā ] dṛṣṭva G\lohi{pc}{1}} vinivartante tam \linenote{tam ] tat} upāsyam upāsmahe} \stopslokaed \startslokaedplain mano buddhir ahaṃ prāṇās tanmātrendriyajīvanam yaṃ dṛṣṭvā\variant{2c dṛṣṭvā ] dṛṣṭva} vinivartante tam \variant{2d tam ] tat} upāsyam upāsmahe (2) \stopslokaedplain So far, so good. Any hints to a more sophisticated solution are highly welcome. (I am a simple TeX user) Thanks Jürgen --- Prof. Dr. Juergen Hanneder Philipps-Universitaet Marburg FG Indologie u. Tibetologie Deutschhausstr.12 35032 Marburg Germany Tel. 0049-6421-28-24930 hanne...@staff.uni-marburg.de ___ 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] \startcolumnset ... \stopcolumnset fatal error: return code 11
Hi, I have used newcolumnset module to make a test sheet. It was made by the help of experts in the list. It worked fine a month ago and also worked via TeXlive 2021. But I got error using the recent version. Thanks Nicola and John for testing. I have listed it before and tried to find out the cause. I have test the following file in the editors, vscode, vim, atom and even in the terminal. It might be an apple binary problem as Hans suspected. I’d like to know that it is the only problem for Mac users. Here is the code and the part of error message: It was tested in vscode, vim and terminal too. I am using Mac OSX, ConTeXt ver: 2021.12.03 15:20 LMTX fmt: 2021.12.9 int: english/english Thank you for reading. Best regards, Dalyoung %%% \startuseMPgraphic{verticalrule0} if CurrentColumn < NOfColumns : draw rightboundary OverlayBox shifted (4mm,0); setbounds currentpicture to OverlayBox enlarged 2.5mm; fi; \stopuseMPgraphic \startuseMPgraphic{squareBox} draw topboundary OverlayBox leftenlarged 1mm rightenlarged 1mm; draw rightboundary OverlayBox shifted (1mm,0); %if CurrentColumn = 1: shifted(-2mm,0) fi ; draw leftboundary OverlayBox shifted (-1mm,0); %if CurrentColumn = 2: shifted(2mm,0) fi ; draw bottomboundary OverlayBox leftenlarged 1mm rightenlarged 1mm; \stopuseMPgraphic \defineoverlay [headerBox] [\useMPgraphic{squareBox}] \startuseMPgraphic{verticalrule3} draw rightboundary OverlayBox shifted (1mm,0); %if CurrentColumn = 1: shifted(-2mm,0) fi ; draw leftboundary OverlayBox shifted (-1mm,0); %if CurrentColumn = 2: shifted(2mm,0) fi ; draw bottomboundary OverlayBox leftenlarged 1mm rightenlarged 1mm; \stopuseMPgraphic \defineoverlay [verticalrule] [\useMPgraphic{verticalrule3}] \definecolumnset [exam] [n=2, background=verticalrule] \setuplayout[width=19cm, height=26cm, header=1cm, footer=.5cm,backspace=1cm] \setupheader[before=\vfil, after=\vfil] \setupbackgrounds[header][text][frame=off, background=headerBox, align=lohi]%topframe= \setupbackgrounds[footer][text][frame=off, background=screen] \define[3]\headTitle{\setupheadertexts[][\bf #1 \hfill #2 \hfill #3 \hfill ID: \hskip 2cm Name: \hskip 2cm]} \setupmathematics[autopunctuation=no, integral=nolimits] \setupbodyfont[rm,10pt] \setuppagenumbering[location=footer] \setupcolors[state=start] %\setupexternalfigure[directory={/Users/graph/Documents/figures,}] \headTitle{2021. 12. 9.}{Set Theory}{Final Exam} \usemodule[newcolumnsets] \starttext %\startcolumns[rule=on,n=2,leftframe=on] \startcolumnset[exam] \startitemize[n] \item The first problem. \vfill \column \item The second problem. \vfill \column \item The third problem. \vfill \column \stopitemize \stopcolumnset %\stopcolumns \stoptext %% … open source > level 2, order 3, name ‘/Users/graph/ConTeXtLM/tex/texmf-context/tex/context/base/mkiv/m-newcolumnsets.mkiv' close source> level 2, order 3, name '/Users/graph/ConTeXtLM/tex/texmf-context/tex/context/base/mkiv/m-newcolumnsets.mkiv' mtx-context | fatal error: return code: 11 The terminal process "zsh '-c', 'mtxrun --autogenerate --script context --autopdf --purge '/Users/graph/Library/Mobile Documents/com~apple~CloudDocs/texMain/ColumnsetTest.tex''" terminated with exit code: 1. ___ 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] About "clearpage"
MANUEL GONZALEZ SUAREZ via ntg-context schrieb am 16.12.2021 um 20:15: Hi all: In the example below: [...] \newdimen\Margin \Margin=2cm \newdimen\MarginRaise \MarginRaise=56ex [...] \startsetups[text a] \raise\MarginRaise\hbox{\vtop{\hsize=\Margin% \startalignment[right] \getmarking[chapter] \stopalignment }} \stopsetups \startsetups[text b] \raise\MarginRaise\hbox{\vtop{\hsize=\Margin% \startalignment[left] \getmarking[section] \stopalignment }} \stopsetups \definemeasure [MarginWidth] [2cm] \definemeasure [MarginRaise] [56ex] \defineframed [MarginBlock] [frame=off, width=\measure{MarginWidth}, height=max, offset=0pt, boffset=\measure{MarginRaise}, align={inner,lohi}] \startsetups[text a] \startframed[MarginBlock] \getmarking[chapter] \stopframed \stopsetups \startsetups[text b] \startframed[MarginBlock] \getmarking[section] \stopframed \stopsetups How can I avoid the last page of the first chapter that appears in the PDF (page 4 in my output) before starting the new chapter? Chapters start by default on a right page when you use a doublesided layout, to change this behavior set a different value to the page key. \setuphead [chapter] [page=yes] 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] using the newcolumnsets module
Dear all, I made an exam form by the help of the experts in this list. However, it was not working after recent update. Here is a code which I made for the test. If I use “\startcolumns \stopcolumns”, then it has no problem. But using “\startcolumnset[exam] … \stopcolumnset” produces error message “return code 11”. It loads “m-newcolumnset.tex” without problem. What is the cause of this error? Thank you for reading. Best regards, Dalyoung \startuseMPgraphic{verticalrule0} if CurrentColumn < NOfColumns : draw rightboundary OverlayBox shifted (4mm,0); setbounds currentpicture to OverlayBox enlarged 2.5mm; fi; \stopuseMPgraphic \startuseMPgraphic{squareBox} draw topboundary OverlayBox leftenlarged 1mm rightenlarged 1mm; draw rightboundary OverlayBox shifted (1mm,0); %if CurrentColumn = 1: shifted(-2mm,0) fi ; draw leftboundary OverlayBox shifted (-1mm,0); %if CurrentColumn = 2: shifted(2mm,0) fi ; draw bottomboundary OverlayBox leftenlarged 1mm rightenlarged 1mm; \stopuseMPgraphic \defineoverlay [headerBox] [\useMPgraphic{squareBox}] \startuseMPgraphic{verticalrule3} draw rightboundary OverlayBox shifted (1mm,0); %if CurrentColumn = 1: shifted(-2mm,0) fi ; draw leftboundary OverlayBox shifted (-1mm,0); %if CurrentColumn = 2: shifted(2mm,0) fi ; draw bottomboundary OverlayBox leftenlarged 1mm rightenlarged 1mm; \stopuseMPgraphic \defineoverlay [verticalrule] [\useMPgraphic{verticalrule3}] \definecolumnset [exam] [n=2, background=verticalrule] \setuplayout[width=19cm, height=26cm, header=1cm, footer=.5cm,backspace=1cm] \setupheader[before=\vfil, after=\vfil] \setupbackgrounds[header][text][frame=off, background=headerBox, align=lohi]%topframe= \setupbackgrounds[footer][text][frame=off, background=screen] \define[3]\headTitle{\setupheadertexts[][\bf #1 \hfill #2 \hfill #3 \hfill ID: \hskip 2cm Name: \hskip 2cm]} \setupmathematics[autopunctuation=no, integral=nolimits] \setupbodyfont[rm,10pt] \setuppagenumbering[location=footer] \setupcolors[state=start] %\setupexternalfigure[directory={/Users/graph/Documents/figures,}] \headTitle{2021. 12. 9.}{Set Theory}{Final Exam} \usemodule[newcolumnsets] \starttext \startcolumns[rule=on,n=2,leftframe=on] %\startcolumnset[exam] \startitemize[n] \item The first problem. \vfill \column \item The second problem. \vfill \column \item The third problem. \vfill \column \stopitemize %\stopcolumnset \stopcolumns \stoptext error messages: system > ConTeXt ver: 2021.11.30 19:49 LMTX fmt: 2021.12.1 int: english/english system > system > 'cont-new.mkxl' loaded open source > level 1, order 1, name '/Users/graph/ConTeXtL/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl' system > beware: some patches loaded from cont-new.mkiv close source> level 1, order 1, name '/Users/graph/ConTeXtL/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl' system > files > jobname '/Users/graph/Library/Mobile Documents/com~apple~CloudDocs/texMain/ColumnsetTest', input '/Users/graph/Library/Mobile Documents/com~apple~CloudDocs/texMain/ColumnsetTest.tex', result '/Users/graph/Library/Mobile Documents/com~apple~CloudDocs/texMain/ColumnsetTest' fonts > latin modern fonts are not preloaded languages > language 'en' is active open source > level 1, order 2, name '/Users/graph/Library/Mobile Documents/com~apple~CloudDocs/texMain/ColumnsetTest.tex' fonts > preloading latin modern fonts (third stage) fonts > 'fallback modern-designsize rm 10pt' is loaded colors > 'rgb' color space is supported colors > 'cmyk' color space is supported modules > 'newcolumnsets' is loaded open source > level 2, order 3, name '/Users/graph/ConTeXtL/tex/texmf-context/tex/context/base/mkiv/m-newcolumnsets.mkiv' close source> level 2, order 3, name '/Users/graph/ConTeXtL/tex/texmf-context/tex/context/base/mkiv/m-newcolumnsets.mkiv' mtx-context | fatal error: return code: 11 The terminal process "zsh '-c', 'export PATH=~/ConTeXtL/tex/texmf-osx-64/bin:$PATH;mtxrun --autogenerate --script context --autopdf --purge '/Users/graph/Library/Mobile Documents/com~apple~CloudDocs/texMain/ColumnsetTest.tex''" terminated with exit code: 1. ___ 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] weekend upload
Dear Aditya, Thank you for your code and an explanation. > Let's assume that the last MPpage was a \startuseMPgraphic{boxes} > \stopuseMPgraphic. Suppose I wanted to use these pictures in a presentation. > On the first slide, I can use > >\useMPgraphic[stacking=0]{boxes} > > to show the three boxes, and on the next slide, I can use > >\useMPgraphic[stacking={-1,0}]{boxes} > I tried to reproduce your example using \startuseMPgraphic{boxes} … \stopuseMPgraphic, and useMPgraphic[stacking=0]{boxes} . A modified one of your code is below. There is no error message but no output at all. Would you please tell me what is wrong in here? Best regards, Dalyoung \startMPdefinitions input boxes; primarydef a +- b = a -- (xpart a, ypart b) -- b enddef ; primarydef a -+ b = a -- (xpart b, ypart a) -- b enddef ; \stopMPdefinitions \defineframed [boxframed] [ width=6em, height=2\lineheight, align={middle,lohi}, background=color, backgroundcolor=blue, foregroundcolor=white, forefroundstyle=bold, ] \startuseMPgraphic[offset=2mm]{boxes} boxit.A("\boxframed{Box A}"); boxit.B("\boxframed{Box B}"); boxit.C("\boxframed{Box C}"); defaultdx := 0pt; defaultdy := 0pt; A.c = origin; B.w - A.e = (1cm, 0); 0.5[ A.s, B.s ] - C.n = (0, 1cm); stacking := 0; drawunboxed(A,B,C); stacking := 1; drawarrow A.s +- C.w ; drawarrow B.s +- C.e ; newpath highlight; highlight := (A.sw -- B.se -- B.ne -- A.nw) enlarged EmWidth; fill highlight withcolor "darkgray" withstacking -1; \stopuseMPgraphic \starttext \useMPgraphic[stacking={0}]{boxes} \useMPgraphic[stacking={0,1}]{boxes} \useMPgraphic[stacking=-1]{boxes} \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] Fuzzy lines
On 5/13/21 8:02 PM, Henning Hraban Ramm wrote: Unfortunately, the deviation of edge points is too big – try my attached test file. Strangely, if I include the MP code in a ConTeXt document, I find the discussion interesting. Could you send complete documents, like Aditya did? When I try to compile your files, I get all sorts of errors, so I suspect they are not complete. Would be appreciated if you could send a ConTeXt document. I'm still not quite sure what you're looking for... Thomas \setupbodyfont[20pt] \showframe \startuseMPgraphic{fuzzy} path p ; p := (0,0) -- (0,OverlayHeight) -- (OverlayWidth,OverlayHeight) -- (OverlayWidth,0) -- cycle ; pickup pencircle scaled .5pt ; for i=1 upto 20 : draw p enlarged -5pt randomized 15pt withcolor blue ; endfor ; \stopuseMPgraphic \defineoverlay [Fuzzy] [\useMPgraphic{fuzzy}] \startTEXpage \framed [height=20cm,width=12cm,frame=on,background=Fuzzy,align={middle,lohi}] {Test} \stopTEXpage test.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
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
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
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
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
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}] > > \startlu
Re: [NTG-context] Lua code and table
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 - Han
Re: [NTG-context] Lua code and table
> 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
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
[NTG-context] Lua code and table
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 ___
[NTG-context] 3 questions about xtables after reading manuals
I've been trying out xtables and reading the manual, some things I can't find how to do (or if it's possible on xtables): 1. How to align whole columns. It seems I have to add [align=middle] to each cell I want to have centered in a raggedright aligned table. In tabulate you can use [|l|c|] to do this, is it possible in xtables? Seems weird if it's not. Or did I miss something? 2. I know how to use [option=stretch] to fill the textwidth, but can I make specific columns "tight", so they don't get stretched beyond their content? 3. When I use [option=tight] sometimes columns are narrowed so much as to break a line of 4 or 5 words. MWE: % \startplacetable[location=none] %\startxtable[align={middle,lohi},option=tight] % This makes the first column too narrow. Lines are not that long \startxtable[align={middle,lohi}] \startxtablehead[head] \startxrow \startxcell[align=right] \strong{Concepto}\crlf\small{Cifras en miles de pesos} \stopxcell \startxcell \strong{Dato} \stopxcell \stopxrow \stopxtablehead \startxtablebody[body] \startxrow \startxcell[align=right] Bono \stopxcell \startxcell Ordinario \stopxcell \stopxrow \startxrow \startxcell[align=right] Valor nominal \stopxcell \startxcell \$100\,000 \stopxcell \stopxrow \startxrow \startxcell[align=right] Tasa cupón - periodicidad anual \stopxcell \startxcell 12,50\,\letterpercent{} \stopxcell \stopxrow \startxrow \startxcell[align=right] Cupón \stopxcell \startxcell \$12\,500 \stopxcell \stopxrow \startxrow \startxcell[align=right] Vencimiento en años \stopxcell \startxcell 5 \stopxcell \stopxrow \startxrow \startxcell[align=right] Tasa de negociación (tasa de mercado) \stopxcell \startxcell 12,50\,\letterpercent{} \stopxcell \stopxrow \startxrow \startxcell[align=right] Precio de venta \stopxcell \startxcell \$100\,000 \stopxcell \stopxrow \startxrow \startxcell[align=right] Costos de transacción/ precio de venta \stopxcell \startxcell 0 \stopxcell \stopxrow \startxrow \startxcell[align=right] Fecha de emisión \stopxcell \startxcell 30-mar-X6 \stopxcell \stopxrow \stopxtablebody \stopxtable \stopplacetable Can I make this table to be "tight" but only so much as to allow "short lines" (i.e: lines that don't make the table go wider than textwidth). I can do it with manual width, but wondering if it's possible. Thank you . -- 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 ___
[NTG-context] Hatch a cell : meta:hash:left
Hi, I seem to have seen a method for hatching the cell of a table, but maybe it's my imagination. The following code does not work. Thanks for your help. Fabrice ## hatching.tex # \setupcolors[state=start] \usemodule[xwi] \starttext \startxtable [align={lohi,middle}, width=1.5cm,framecolor=purple] \startxrow \startxcell[background=color,backgroundcolor=paleturquoise] i \stopxcell \startxcell [background=meta:hash:left, meta:hash:linecolor=green] \stopxcell \startxcell 0 \stopxcell \startxcell 1 \stopxcell \startxcell 2 \stopxcell \stopxrow \stopxtable \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 ___
[NTG-context] specify column-width, with option=stretch
Hi, I would like to specify the column-width of the first column to 5mm: --8<---cut here---start->8--- \starttext \setupTABLE[textwidth=99mm, option=stretch] \setupTABLE[c][each][align={lohi, middle}] \setupTABLE[c][1][height=5mm, style=\tfxx] \framed[width=5mm, offset=0pt]{5} \bTABLE \bTR \bTD[nr=2] \setupinterlinespace[1.8ex] 1\\2\\3 \eTD \bTD bla \eTD \bTD blablabla \eTD \eTR \bTR \bTD[nc=2] blabla \eTD \eTR \eTABLE\par \framed[width=99mm, offset=0pt]{99} \stoptext --8<---cut here---end--->8--- How could I do that please? TIA for any hints, -- 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] \dorecurse{}{} problem
Hi Dalyoung, I don't know why \recurselevel returns 0 inside a tabulate environment, but the following works fine: \starttext \startxtable[frame=off,bottomframe=on,width=1cm,align={middle,lohi}] \startxrow\startxcell \stopxcell\stopxrow % just to have a line on the top of the first row \dorecurse{8} {\startxrow\startxcell \recurselevel \stopxcell\stopxrow} \stopxtable \stoptext Best regards: Otared K. > On 21 Sep 2020, at 16:07, Jeong Dal wrote: > > Hi, > > I tried to make a table using \dorecurse or \doloop as in the example. > There is no error but \recurselevel is not increased, all are 0 in the first > example and only two rows are created with the \recurselevel 0 and 2 only in > the second example. > > Does the tabulate cause the error? > What is wrong in this MWE? > > Thank you for reading. > > Best regards, > > Dalyoung > > * > \startbuffer[AdjacencyList1] > \starttabulate[|c|cw(2cm)|] > \HL > \dorecurse{8} >{\NC \recurselevel \NC \NC\NR \HL} > \stoptabulate > \stopbuffer > > \startbuffer[AdjacencyList2] > \starttabulate[|c|cw(2cm)|] > \HL > \doloop{ >\ifnum \recurselevel=7 > \exitloop >\fi >\NC \recurselevel \NC \NC\NR \HL > } > \stoptabulate > \stopbuffer > > \starttext > \getbuffer[AdjacencyList1] > > \getbuffer[AdjacencyList2] > \stoptext > >> 2020. 9. 21. 오후 10:50, ntg-context-requ...@ntg.nl 작성: >> >> Send ntg-context mailing list submissions to >> ntg-context@ntg.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> https://mailman.ntg.nl/mailman/listinfo/ntg-context >> or, via email, send a message with subject or body 'help' to >> ntg-context-requ...@ntg.nl >> >> You can reach the person managing the list at >> ntg-context-ow...@ntg.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of ntg-context digest..." >> >> >> Today's Topics: >> >> 1. Parallel text support (Denis Maier) >> 2. Re: Parallel text support (Taco Hoekwater) >> 3. Re: ZapfDingbats Unicode differences MKIV vs LMTX >> (Christoph Reller) >> 4. Re: ZapfDingbats Unicode differences MKIV vs LMTX (Hans Hagen) >> 5. Math fonts for Nimbus fonts (Otared Kavian) >> 6. Re: 2020 Meeting recordings? (Taco Hoekwater) >> >> >> -- >> >> Message: 1 >> Date: Mon, 21 Sep 2020 12:21:37 +0200 >> From: Denis Maier >> To: ntg-context@ntg.nl >> Subject: [NTG-context] Parallel text support >> Message-ID: <780fe43c-f2c3-6ea1-04f5-d4d5c22e7...@mailbox.org> >> Content-Type: text/plain; charset=utf-8; format=flowed >> >> Hi, >> >> I'm trying to typeset a parallel text that should appear in columns. The >> sources are XML, and there I have to use tables for this. So, I thought >> the easiest way is to use extreme tables for this: >> >> = >> \starttext >> >> \dorecurse{3}{\input knuth} >> >> \startxtable[split=yes,frame=off] >> \startxrow >> \startxcell Text \stopxcell >> \startxcell Übersetzung \stopxcell >> \stopxrow >> \startxrow >> \startxcell \input ward \stopxcell >> \startxcell \input tufte \stopxcell >> \stopxrow >> \stopxtable >> >> \stoptext >> = >> >> However, as it turns out, split only seems to mean that the table is >> split between rows, individual rows stay on the same page. >> >> Is there a better approach? I've found the page-streams, but that seems >> to be too much... >> >> Best, >> Denis >> >> >> -- >> >> Message: 2 >> Date: Mon, 21 Sep 2020 13:58:11 +0200 >> From: Taco Hoekwater >> To: mailing list for ConTeXt users >> Subject: Re: [NTG-context] Parallel text support >> Message-ID: >> Content-Type: text/plain;charset=utf-8 >> >> >> >>> On 21 Sep 2020, at 12:21, Denis Maier wrote: >>> >>> >>> However, as it turns out, split only seems to mean that the table is split >>> between rows, individual rows stay on the same page. >>> >>> Is there a better approach? I've found the page-streams, but that seems to >>> be too much… >> >> \starttabulate >> >> >> >> -- >> >>
[NTG-context] Color specific cells in a table
Hello, This table will be used to illustrate Pascal's triangle. I manage to color the cell (2,0) but I would also like to color the cells (2,1) and (3,1). Is it possible ? Thank you Fabrice \usecolors[X11] \starttext \startluacode local background_one = { align = "middle", style = "type", background = "color", backgroundcolor = "thistle2", foregroundcolor = "white", } local background_two = { align = "middle", style = "type", background = "color", backgroundcolor = "peachpuff", foregroundcolor = "white", } context.startxtable({"align={middle,lohi}, width=1cm,offset=0.8ex,bodyfont=9pt,framecolor=cyan"}) context.startxrow() context.startxcell({"background=color,backgroundcolor=thistle2"}) context("") context.stopxcell() for j = 0, 7 do context.startxcell({"foregroundstyle=bold,background=color,backgroundcolor=thistle2"}) context(j) context.stopxcell() end context.startxcell({"foregroundstyle=bold,background=color,backgroundcolor=thistle2"}) context("\\dots") context.stopxcell() context.stopxrow() for i = 0, 7 do context.startxrow() context.startxcell({"foregroundstyle=bold,background=color,backgroundcolor=thistle2"}) context(i) context.stopxcell() for j = 0, 8 do context.startxcell(j>i and background_one or i == 2 and j == 0 and background_two) context("") context.stopxcell() end context.stopxrow() end context.startxrow() context.startxcell({"background=color,backgroundcolor=thistle2"}) context("\\dots") context.stopxcell() for i = 0, 8 do context.startxcell() context("") context.stopxcell() end context.stopxrow() 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] memoir-style chapter heading
Thank you Otared. The power of ConTeXt never ceases to amaze me, though despite the excellent work done on the wiki recently, it is the little things like the use of \raise that could be better described, especially in a range of applied instances. We find it, combined with hbox, in reference to marginal and centered headers, but it is not intuitive - for me at least - to be able to apply it as you have done in your example. The little process we have gone through, which is step-by-step, is most helpful, and I feel that I can now use these ideas in other instances and in slightly different ways. Thank you. How important is the 'lohi' addition you made to \framed? I removed it to see what would happen and did not notice any appreciable difference in the output. Julian On 18/8/20 11:19 pm, Otared Kavian wrote: Hi Julian, Actually one can tweak more or less the height at which the chapter number appears: below is an example in which one uses \raise and \hbox. \setuppagenumbering[state=start,location=footer] \setuphead[chapter] [ % numberstyle={\switchtobodyfont[48pt]}, numbercolor=gray, alternative=command, command=\MemoirChapter, ] %\define[2]\MemoirChapter % {\startoverlay % {#1} % {#2} % \stopoverlay} \define[2]\MemoirChapter {\framed[frame=off,width=broad,align={middle,lohi}] {\startoverlay {\raise1.5ex\hbox{\switchtobodyfont[48pt]#1}} {#2} \stopoverlay} } \starttext \startchapter[title={This is a test},ownnumber=1234] \input knuth.tex \stopchapter \stoptext Best regards: Otared On 18 Aug 2020, at 11:47, jbf wrote: Thanks Otared - and whether using the earlier example (Aditya's with my minor 'centering' adjustment)) or yours, I agree - the number is just a bit too low, and of course, using this method we probably can't make adjustments to that. So ultimately it looks like I'll have to get my skills up to working with layers as well as overlays, where minute adjustments of the kind can be made. But wouldn't it be great if we could just do a bit of vertical adjustment in the overlay! Julian On 18/8/20 6:45 pm, Otared Kavian wrote: Hi Julian, Indeed you can modify slightly what Aditya said to obtain what you want: you can put the overlay into a framed environment as in the following example. Though, to my taste the number is a little bit too low… %% begin example \setuppagenumbering[state=start,location=footer] \setuphead[chapter] [ numberstyle={\switchtobodyfont[48pt]}, numbercolor=gray, alternative=command, command=\MemoirChapter, ] \define[2]\MemoirChapter {\framed[frame=off,width=broad,align=middle] {\startoverlay {#1} {#2} \stopoverlay} } \starttext \startchapter[title={This is a test}] \input knuth.tex \stopchapter \stoptext %% end example Best regards: Otared On 18 Aug 2020, at 01:18, jbf wrote: I meant to include an example of what I mean, since at least it seems to work (am including just the definition part of your example), So at least I can get middle and right alignment. \define[2]\MemoirChapter {\midaligned{\startoverlay {#1} {#2} \stopoverlay}} Julian On 17/8/20 4:54 pm, Aditya Mahajan wrote: On Mon, 17 Aug 2020, jbf wrote: Am completely new to using Metafun, which I presume I would need to use to achieve a Hansen Memoir-style Chapter heading (chapter title overlayed on a large lightgray number). Of course, I am assuming I would need to use Metafun to create this... So my first question is to ask if I could achieve the same effect without Metafun? I have read through the Metafun manual, and I think I can understand how to overlay text on a graphic (MP), but it would be currently beyond me to draw numbers of the kind we find in, say, the Memoir examples. Has anyone created such an example? I was keenly looking for one in the manual and elsewhere, in terms of ConTeXt/Metafun commands, but could not find one. But I'd be quite prepared to 'have a go' at this, if I had some pointers of just where to start! I assume I would have to \defineoverlay[number] and then add text on top \framed (but without the frame borders). Am I at least correct about this? You don't need metafun for something this simple. Here is a crude implementation: \setuphead[chapter] [ numberstyle={\switchtobodyfont[48pt]}, numbercolor=gray, alternative=command, command=\MemoirChapter, ] \define[2]\MemoirChapter% {\startoverlay {#1} {#2} \stopoverlay} \starttext \startchapter[title={This is a test}] \stopchapter \stoptext Overlays don't allow tu
Re: [NTG-context] weird issue with xtable
On 8/13/20 2:33 PM, Taco Hoekwater wrote: > [...] > I forgot to answer this. Simple explanation: > > * 'restricted horizontal mode' is inside an \hbox{} or something similar like > a header/footer, > where line breaks are forbidden > * ‘horizontal mode’ is inside a paragraph, where line breaks are possible > > But the ‘restricted’ part is not relevant to your problem, \prevdepth > is forbidden in horizontal mode regardless of restrictions; it is > only allowed in vertical mode. Manny thanks for your explanation, Taco. > Somehow your table ends up being typeset in a horizontal context, > based on the error message (at least, if we assume that the error > message was triggered by a table). I think it is easy to trigger the error: \setupxtable[split=yes] \starttext \ifvmode yes\else no\fi \startxtable[align={middle,lohi},columndistance=0em] \startxrow \startxcell \dontleavehmode \externalfigure[cow.pdf] [scale=500] \stopxcell \stopxrow \stopxtable \stoptext > But why that is? I do not have any other good ideas. And > unfortunately lots of different things in ConTeXt can trigger an > implicit horizontal context.> > For debugging, you could try adding this to the preamble (or grouped > around each xtable, for slightly less damage to the vertical > spacing):> > \let\prevdepth\relax > \newdimen\prevdepth > > that should at least remove the error report. The vertical spacing > in the pdf output will be wrong (!!!), but perhaps the output can > provide a clue about what triggered the problem. No idea of what is going wrong here. My setups are even simplistic: \setupxtable [frame=off, option=stretch, split=repeat, header=repeat] \setupxtable [split-table] [split=yes] \startxmlsetups xml:table:split \blank \startembeddedxtable[split-table] \xmlflush{#1} \stopembeddedxtable \blank \stopxmlsetups But it seems that this cannot be fixed without investing much time. I’m afraid I don’t have this time now. Many thanks for your 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] Bug with lmtx and color in table
Hello, With the latest version of lmtx, the background color of cells does not work. Thank you. Fabrice \starttext \startxtable [align={middle,lohi}, offset=0.8ex,background=color, backgroundcolor=red,frame=off] \startxrow \startxcell \m{\displaystyle\binom{n-1}{k-1}} \stopxcell \startxcell[width=fit] \m{+} \stopxcell \startxcell \m{\displaystyle\binom{n-1}{k}} \stopxcell \stopxrow \startxrow \startxcell \stopxcell \startxcell[width=fit] \m{=} \stopxcell \startxcell \m{\displaystyle\binom{n}{k}} \stopxcell \stopxrow \stopxtable \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] Code lua in a table
Hello, I am making progress and I almost get what I want to achieve but I still have two problems : how to color cells not containing numbers with the same color as the others ? how to color in salmon, for example, cells 1 2 ? 3 Thank you Fabrice \usecolors[X11] \startuseMPgraphic{DiagonalRule} rulethickness := \frameddimension{rulethickness}; drawoptions( withpen pencircle scaled rulethickness withcolor \MPcolor{\framedparameter{framecolor}}); pair leftcorner, rightcorner; leftcorner := (rulethickness, \overlayheight-rulethickness); rightcorner := (\overlaywidth-rulethickness, rulethickness); draw leftcorner -- rightcorner; \stopuseMPgraphic \defineoverlay [DiagonalRule] [\useMPgraphic{DiagonalRule}] \define[2]\DiagonalLabel{% \setuptabulate [after={\blank[\frameddimension{offset}]}] \starttabulate [|p|r|] \NC\NC #2 \NC\NR \NC #1 \NC\NC\NR \stoptabulate } \starttext \startluacode function Binom(n,k) if k > n then return "" elseif (n == 0 or k == 0) then return 1 else return math.round((n*Binom(n-1,k-1))/k) end end context.startxtable({"align={middle,lohi}, width=1cm,offset=0.8ex,bodyfont=9pt,framecolor=cyan"}) context.startxrow() context.startxcell({"background=DiagonalRule,background=color,backgroundcolor=thistle2"}) context("\\DiagonalLabel{\\m{n}}{\\m{k}}") context.stopxcell() for j = 0, 7 do context.startxcell({"background=color,backgroundcolor=thistle2"}) context(j) context.stopxcell() end context.startxcell({"background=color,backgroundcolor=thistle2"}) context("\\dots") context.stopxcell() context.stopxrow() for i = 0, 7 do context.startxrow() context.startxcell({"background=color,backgroundcolor=thistle2"}) context(i) context.stopxcell() for j = 0, 8 do context.startxcell() context(Binom(i,j)) context.stopxcell() end context.stopxrow() end context.startxrow() context.startxcell({"background=color,backgroundcolor=thistle2"}) context("\\dots") context.stopxcell() for i = 0, 8 do context.startxcell({"background=color,backgroundcolor=thistle2"}) context("") context.stopxcell() end context.stopxrow() context.stopxtable() \stopluacode \stoptext Le lun. 20 juil. 2020 à 14:55, Hans Hagen a écrit : > On 7/20/2020 2:40 PM, Jeong Dal wrote: > > > I also wonder where is the boundary of ConTeXt. > The boundaries are set and shift by users (the mailing list) and > curiosity (personal). > > 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] Code lua in a table
Small correction : \starttext \startluacode function Binom(n,k) if k > n then return 0 elseif (n == 0 or k == 0) then return 1 else return (n*Binom(n-1,k-1))/k end end context.startxtable({"align={middle,lohi}, width=1cm,offset=0.8ex,bodyfont=9pt"}) for i = 0, 9 do context.startxrow({"background=color,backgroundcolor=cyan"}) for j = 0, i do context.startxcell() context(Binom(i,j)) context.stopxcell() end context.stopxrow() end context.stopxtable() \stopluacode \stoptext Le sam. 18 juil. 2020 à 22:25, Fabrice Couvreur a écrit : > Hi Wolfgang, > > It works but why did you ask this question since I finally use context ? > >> Are you sure you want to use context(...) here? >> > How not to display the .0 ? > Fabrice > > Le sam. 18 juil. 2020 à 22:22, Wolfgang Schuster < > wolfgang.schuster.li...@gmail.com> a écrit : > >> Fabrice Couvreur schrieb am 18.07.2020 um 22:09: >> > Hi, >> > I improved the code to be able to display the grid but I cannot display >> > the coefficients. >> > Thank you >> > Fabrice >> > >> > \starttext >> > >> > \startluacode >> > function Binom(n,k) >> > if k > n then >> > return 0 >> > elseif (n == 0 or k == 0) then >> > return 1 >> > else >> > return (n*Binom(n-1,k-1))/k >> > end >> > >> > end >> > >> > context.startxtable({"align={middle,lohi}, >> > width=1.2cm,offset=0.8ex,bodyfont=9pt"}) >> > for i = 1, 10 do >> >context.startxrow({"background=color,backgroundcolor=cyan"}) >> > for j = 1, i do >> >context.startxcell() >> > \ctxlua{context(Binom(i,j))} >> >> Remove \ctxlua: >> >> context(Binom(i,j)) >> >> 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 ___
Re: [NTG-context] Code lua in a table
Hi Wolfgang, It works but why did you ask this question since I finally use context ? > Are you sure you want to use context(...) here? > How not to display the .0 ? Fabrice Le sam. 18 juil. 2020 à 22:22, Wolfgang Schuster < wolfgang.schuster.li...@gmail.com> a écrit : > Fabrice Couvreur schrieb am 18.07.2020 um 22:09: > > Hi, > > I improved the code to be able to display the grid but I cannot display > > the coefficients. > > Thank you > > Fabrice > > > > \starttext > > > > \startluacode > > function Binom(n,k) > > if k > n then > > return 0 > > elseif (n == 0 or k == 0) then > > return 1 > > else > > return (n*Binom(n-1,k-1))/k > > end > > > > end > > > > context.startxtable({"align={middle,lohi}, > > width=1.2cm,offset=0.8ex,bodyfont=9pt"}) > > for i = 1, 10 do > >context.startxrow({"background=color,backgroundcolor=cyan"}) > > for j = 1, i do > >context.startxcell() > > \ctxlua{context(Binom(i,j))} > > Remove \ctxlua: > > context(Binom(i,j)) > > 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 ___
Re: [NTG-context] Code lua in a table
Fabrice Couvreur schrieb am 18.07.2020 um 22:09: Hi, I improved the code to be able to display the grid but I cannot display the coefficients. Thank you Fabrice \starttext \startluacode function Binom(n,k) if k > n then return 0 elseif (n == 0 or k == 0) then return 1 else return (n*Binom(n-1,k-1))/k end end context.startxtable({"align={middle,lohi}, width=1.2cm,offset=0.8ex,bodyfont=9pt"}) for i = 1, 10 do context.startxrow({"background=color,backgroundcolor=cyan"}) for j = 1, i do context.startxcell() \ctxlua{context(Binom(i,j))} Remove \ctxlua: context(Binom(i,j)) 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] Code lua in a table
Hi, I improved the code to be able to display the grid but I cannot display the coefficients. Thank you Fabrice \starttext \startluacode function Binom(n,k) if k > n then return 0 elseif (n == 0 or k == 0) then return 1 else return (n*Binom(n-1,k-1))/k end end context.startxtable({"align={middle,lohi}, width=1.2cm,offset=0.8ex,bodyfont=9pt"}) for i = 1, 10 do context.startxrow({"background=color,backgroundcolor=cyan"}) for j = 1, i do context.startxcell() \ctxlua{context(Binom(i,j))} context.stopxcell() end context.stopxrow() end context.stopxtable() \stopluacode \stoptext Le sam. 18 juil. 2020 à 20:32, Wolfgang Schuster < wolfgang.schuster.li...@gmail.com> a écrit : > Fabrice Couvreur schrieb am 18.07.2020 um 20:05: > > Hello, > I want to display the values of Pascal's triangle in a table. > Unfortunately my knowledge of Lua is not sufficient to run this code. > Thank you. > Fabrice > > \starttext > > \startluacode > function Binom(n,k) >if k > n then > return 0 >elseif (n == 0 or k == 0) then > return 1 >else > return (n*Binom(n-1,k-1))/k > end > context(Binom(n,k)) > > Are you sure you want to use context(...) here? > > end > > context.startxtable({"align={middle,lohi}, > width=1.2cm,offset=0.8ex,bodyfont=9pt"}) > context.startxrow({"background=color,backgroundcolor=green"}) > for i = 0, 10 do > for j = 0, i do > context.startxcell() > context(Binom(i,j)) > context.stopxcell() > end > end > context.stopxrow() > > context.stopxtable() > > 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 ___
Re: [NTG-context] Code lua in a table
Fabrice Couvreur schrieb am 18.07.2020 um 20:05: Hello, I want to display the values of Pascal's triangle in a table. Unfortunately my knowledge of Lua is not sufficient to run this code. Thank you. Fabrice \starttext \startluacode function Binom(n,k) if k > n then return 0 elseif (n == 0 or k == 0) then return 1 else return (n*Binom(n-1,k-1))/k end context(Binom(n,k)) Are you sure you want to use context(...) here? end context.startxtable({"align={middle,lohi}, width=1.2cm,offset=0.8ex,bodyfont=9pt"}) context.startxrow({"background=color,backgroundcolor=green"}) for i = 0, 10 do for j = 0, i do context.startxcell() context(Binom(i,j)) context.stopxcell() end end context.stopxrow() context.stopxtable() 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] Code lua in a table
Hello, I want to display the values of Pascal's triangle in a table. Unfortunately my knowledge of Lua is not sufficient to run this code. Thank you. Fabrice \starttext \startluacode function Binom(n,k) if k > n then return 0 elseif (n == 0 or k == 0) then return 1 else return (n*Binom(n-1,k-1))/k end context(Binom(n,k)) end context.startxtable({"align={middle,lohi}, width=1.2cm,offset=0.8ex,bodyfont=9pt"}) context.startxrow({"background=color,backgroundcolor=green"}) for i = 0, 10 do for j = 0, i do context.startxcell() context(Binom(i,j)) context.stopxcell() end end context.stopxrow() \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] Incorrect placement of a table with LMTX
Hi Otared, Thanks, it works perfectly. Best regards. fabrice Le mar. 14 juil. 2020 à 12:23, Otared Kavian a écrit : > Hi Fabrice, > > You should enclose the table into \startplacetable... \stopplacetable as > in: > > \startplacetable[number=no] > % here put your xtable > \stopplacetable > > Best regards: Otared > > > On 14 Jul 2020, at 11:28, Fabrice Couvreur > wrote: > > Hello, > In my lessons, I often have to include tables, figures, ... in > definitions, theorems ... > With the context engine it works fine but not with lmtx. > Thanks for your help. > Fabrice > > \setupenumerations > [before={\blank}, >after={\blank}, >alternative=serried, >title=yes, >titleleft=, >titleright=, >prefix=yes, >prefixsegments=chapter, >way=bychapter, >titlestyle=bold, >width=broad] > > \defineenumeration >[definition] >[text=Définition, > number=yes, > headcommand=\groupedcommand{}{.}, > style=italic] > > \starttext > > \startdefinition > \blank > \startxtable[align={lohi,middle},width=2cm,offset=0.8ex] > \startxrow > \startxcell > 1 > \stopxcell > \startxcell > 2 > \stopxcell > \stopxrow > \startxrow > \startxcell > 3 > \stopxcell > \startxcell > 4 > \stopxcell > \stopxrow > \stopxtable > \stopdefinition > > \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 > > ___ > ___ 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] Incorrect placement of a table with LMTX
Hi Fabrice, You should enclose the table into \startplacetable... \stopplacetable as in: \startplacetable[number=no] % here put your xtable \stopplacetable Best regards: Otared > On 14 Jul 2020, at 11:28, Fabrice Couvreur > wrote: > > Hello, > In my lessons, I often have to include tables, figures, ... in definitions, > theorems ... > With the context engine it works fine but not with lmtx. > Thanks for your help. > Fabrice > > \setupenumerations > [before={\blank}, >after={\blank}, >alternative=serried, >title=yes, >titleleft=, >titleright=, >prefix=yes, >prefixsegments=chapter, >way=bychapter, >titlestyle=bold, >width=broad] > > \defineenumeration >[definition] >[text=Définition, > number=yes, > headcommand=\groupedcommand{}{.}, > style=italic] > > \starttext > > \startdefinition > \blank > \startxtable[align={lohi,middle},width=2cm,offset=0.8ex] > \startxrow > \startxcell > 1 > \stopxcell > \startxcell > 2 > \stopxcell > \stopxrow > \startxrow > \startxcell > 3 > \stopxcell > \startxcell > 4 > \stopxcell > \stopxrow > \stopxtable > \stopdefinition > > \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 ___
[NTG-context] Incorrect placement of a table with LMTX
Hello, In my lessons, I often have to include tables, figures, ... in definitions, theorems ... With the context engine it works fine but not with lmtx. Thanks for your help. Fabrice \setupenumerations [before={\blank}, after={\blank}, alternative=serried, title=yes, titleleft=, titleright=, prefix=yes, prefixsegments=chapter, way=bychapter, titlestyle=bold, width=broad] \defineenumeration [definition] [text=Définition, number=yes, headcommand=\groupedcommand{}{.}, style=italic] \starttext \startdefinition \blank \startxtable[align={lohi,middle},width=2cm,offset=0.8ex] \startxrow \startxcell 1 \stopxcell \startxcell 2 \stopxcell \stopxrow \startxrow \startxcell 3 \stopxcell \startxcell 4 \stopxcell \stopxrow \stopxtable \stopdefinition \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] offset for background overlay
mf schrieb am 11.04.2020 um 23:59: Thanks Hans and Wolfgang. @Wolfgang: your solution is clearer, but unfortunately it works only for this MWE. In the real case the triangle extends over 2 rows, but the table has more than 2 rows. I tried grouping the first two rows in a \bTABLEbody[background=triangle], but it doesn't work. How about nested tables: \starttext \bTABLE[width=1cm,height=1cm] \bTR \bTD A \eTD \bTD B \eTD \bTD C \eTD \bTD E \eTD \eTR \bTR \bTD E \eTD \bTD[nc=2,nr=2,strut=no,align={middle,lohi}] {\bTABLE \bTR \bTD[nc=2] X \eTD \eTR \bTR \bTD Y \eTD \bTD Z \eTD \eTR \eTABLE} \eTD \bTD H \eTD \eTR \bTR \bTD I \eTD \bTD L \eTD \eTR \bTR \bTD M \eTD \bTD N \eTD \bTD O \eTD \bTD P \eTD \eTR \eTABLE \stoptext @both: \setupoverlay[hoffset=...,voffset=...]? \setupframed[backgroundhoffset=...,backgroundvoffset=...] (\bTD inherits from \framed)? Or maybe a method in MP to set the bounding box of the resulting overlay? setbounds in combination with leftenlarged, topenlarged etc. \setupframed has already a backgroundoffset option, whose value can be: - a DIMENSION (an offset that is both horizontal and vertical) - a "frame": what does it mean? (I looked into pack-rul.mkiv, with no results) ConTeXt uses the value from the frameoffset key for backgroundoffset. \startuseMPgraphic{frameborder} draw OverlayBox withcolor blue ; \stopuseMPgraphic \defineoverlay[frameborder][\useMPgraphic{frameborder}] \setupheader[state=high] \setupfooter[state=high] \starttext \setupframed [width=4cm, height=4cm, offset=1cm] \framed{} \framed[frame=off,background=frameborder]{} \framed[frameoffset=-5mm]{} \framed[frameoffset=-5mm,frame=off,background=frameborder]{} \framed[backgroundoffset=-5mm,frame=off,background=frameborder]{} \framed[frameoffset=-5mm,backgroundoffset=frame,frame=off,background=frameborder]{} \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] Background color of a framedtext that covers floats
Hi, Is there a more elegant way to have a white background for the table ? In fact, my question is more general : if we insert an image, the background color envelops this image : how to solve this problem ? Thank you. Fabrice \definecolor[fondpaille][c=0,m=0,y=0.2,k=0] \starttext \startframedtext [frame=off,width=\textwidth, background=color,backgroundcolor=fondpaille] \input tufte \startlinecorrection[blank] \startmidaligned \startxtable [align={lohi,middle}, option={stretch},framecolor=cyan, offset=0.8ex,background=color,backgroundcolor=white] \startxrow \startxcell \bf Profondeur \m{x} (en mètre) \stopxcell \startxcell \bf Pression \m{P} (en bar) \stopxcell \startxcell \bf Volume \m{V} (en \m{\text{dm}^{3}}) \stopxcell \stopxrow \startxrow \startxcell 0 (niveau de la mer) \stopxcell \startxcell 1 \stopxcell \startxcell 1 \stopxcell \stopxrow \startxrow \startxcell 10 \stopxcell \startxcell 2 \stopxcell \startxcell 0,5 \stopxcell \stopxrow \stopxtable \stopmidaligned \stoplinecorrection \stopframedtext \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] Bug (Lua) ?
Lua strings can be split across lines by using so called long brackets according to the Lua Reference Manual: [[split string]] or (very first newline ignored): [[ split string]] or with matched levels: [==[ ]==] dr. Hans van der Meer > On 19 Mar 2020, at 14:29, Aditya Mahajan wrote: > > On Thu, 19 Mar 2020, mf wrote: > >> Il 19/03/20 11:20, Fabrice Couvreur ha scritto: >>> Hi, >>> this file did not pose any problems but today yes. >>> Thank you. >>> Fabrice >>> \starttext >>> \startluacode >>> local letters_1 = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" } >>> local letters_2 = { "1", "Année", "1998", "1999", "2000", "2001", "2002", >>> "2003", "2004", "2005","2006" } >>> context.startxtable({"align={middle,lohi}, >>> width=1.2cm,offset=0.8ex,bodyfont=9pt"}) >> >> context.startxtable( { align = "middle,lohi", width = "1.2cm", offset = >> "0.8ex", bodyfont = "9pt" } ) >> >> The argument is a lua table. Values are usually strings. >> >>> context.startxrow({"background=color,backgroundcolor=green"}) >> >> context.startxrow( { background = "color", backgroundcolor = "green" } ) >> >> ... and so on. > > A table with just one string entry also works, but lua strings cannot be > split across lines. So, if you remove the newline after "align={middle,lohi}, > that also works. > > 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 > ___ ___ 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] Bug (Lua) ?
On Thu, 19 Mar 2020, mf wrote: Il 19/03/20 11:20, Fabrice Couvreur ha scritto: Hi, this file did not pose any problems but today yes. Thank you. Fabrice \starttext \startluacode local letters_1 = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" } local letters_2 = { "1", "Année", "1998", "1999", "2000", "2001", "2002", "2003", "2004", "2005","2006" } context.startxtable({"align={middle,lohi}, width=1.2cm,offset=0.8ex,bodyfont=9pt"}) context.startxtable( { align = "middle,lohi", width = "1.2cm", offset = "0.8ex", bodyfont = "9pt" } ) The argument is a lua table. Values are usually strings. context.startxrow({"background=color,backgroundcolor=green"}) context.startxrow( { background = "color", backgroundcolor = "green" } ) ... and so on. A table with just one string entry also works, but lua strings cannot be split across lines. So, if you remove the newline after "align={middle,lohi}, that also works. 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] Bug (Lua) ?
Hi mf, Thanks ! Fabrice Le jeu. 19 mars 2020 à 11:46, mf a écrit : > Il 19/03/20 11:20, Fabrice Couvreur ha scritto: > > Hi, > > this file did not pose any problems but today yes. > > Thank you. > > Fabrice > > > > \starttext > > \startluacode > > local letters_1 = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" } > > local letters_2 = { "1", "Année", "1998", "1999", "2000", "2001", "2002", > > "2003", "2004", "2005","2006" } > > context.startxtable({"align={middle,lohi}, > > width=1.2cm,offset=0.8ex,bodyfont=9pt"}) > > > > context.startxtable( { align = "middle,lohi", width = "1.2cm", offset = > "0.8ex", bodyfont = "9pt" } ) > > The argument is a lua table. Values are usually strings. > > > context.startxrow({"background=color,backgroundcolor=green"}) > > context.startxrow( { background = "color", backgroundcolor = "green" } ) > > ... and so on. > > Best wishes, > Massi > > ___ > 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] Bug (Lua) ?
Il 19/03/20 11:20, Fabrice Couvreur ha scritto: Hi, this file did not pose any problems but today yes. Thank you. Fabrice \starttext \startluacode local letters_1 = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" } local letters_2 = { "1", "Année", "1998", "1999", "2000", "2001", "2002", "2003", "2004", "2005","2006" } context.startxtable({"align={middle,lohi}, width=1.2cm,offset=0.8ex,bodyfont=9pt"}) context.startxtable( { align = "middle,lohi", width = "1.2cm", offset = "0.8ex", bodyfont = "9pt" } ) The argument is a lua table. Values are usually strings. context.startxrow({"background=color,backgroundcolor=green"}) context.startxrow( { background = "color", backgroundcolor = "green" } ) ... and so on. Best wishes, Massi ___ 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] Bug (Lua) ?
On 3/19/2020 11:20 AM, Fabrice Couvreur wrote: Hi, this file did not pose any problems but today yes. really? lua error > lua error on line 34 in file /home/viserion/Table.tex: [ctxlua]:5: unfinished string near '"align={middle,lohi},' there is a " before align - 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] Bug (Lua) ?
Hi, this file did not pose any problems but today yes. Thank you. Fabrice \starttext \startluacode local letters_1 = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" } local letters_2 = { "1", "Année", "1998", "1999", "2000", "2001", "2002", "2003", "2004", "2005","2006" } context.startxtable({"align={middle,lohi}, width=1.2cm,offset=0.8ex,bodyfont=9pt"}) context.startxrow({"background=color,backgroundcolor=green"}) context.startxcell({"background=color,backgroundcolor=white,frame=off"}) context("") context.stopxcell() for _, letter in ipairs(letters_1) do context.startxcell() context(letter) context.stopxcell() end context.stopxrow() context.startxrow() for _, letter in ipairs(letters_2) do context.startxcell() context(letter) context.stopxcell() end context.stopxrow() context.startxrow() context.startxcell() context("2") context.stopxcell() context.startxcell({"width=2cm"}) context("Prix (kg)") context.stopxcell() for i=0,8 do context.startxcell() context("%0.5g",1.031^i) context.stopxcell() end context.stopxrow() context.stopxtable() \stopluacode \stoptext lua error > lua error on line 34 in file /home/viserion/Table.tex: [ctxlua]:5: unfinished string near '"align={middle,lohi},' 1 \starttext 2 \startluacode 3 local letters_1 = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" } 4 local letters_2 = { "1", "Année", "1998", "1999", "2000", "2001", "2002", 5 "2003", "2004", "2005","2006" } 6 >> context.startxtable({"align={middle,lohi}, 7 width=1.2cm,offset=0.8ex,bodyfont=9pt"}) 8 9 context.startxrow({"background=color,backgroundcolor=green"}) 10 context.startxcell({"background=color,backgroundcolor=white,frame=off"}) 11 context("") 12 context.stopxcell() 13 for _, letter in ipairs(letters_1) do 14 context.startxcell() 15 context(letter) context.stopxcell() 16 end mtx-context | fatal error: return code: 256 TeX Output exited abnormally with code 1 at Thu Mar 19 11:15:49 ___ 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] Hatch color in a table cell
Hi, I would like to hatch the cell green. Thank you. Fabrice \usecolors[xwi] \startuniqueMPgraphic{meta:hash}{linewidth,linecolor,angle,gap} if unknown context_back : input mp-back ; fi ; some_hash ( OverlayWidth, OverlayHeight , \MPvar{linewidth}, \MPvar{linecolor} , \MPvar{angle}, \MPvar{gap} ) ; \stopuniqueMPgraphic \setupMPvariables [meta:hash] [gap=.25\bodyfontsize, angle=45, linewidth=\overlaylinewidth, linecolor=\overlaylinecolor] \def\metahashoverlay#1{\uniqueMPgraphic{meta:hash}{angle=#1}} \defineoverlay[meta:hash:right] [\metahashoverlay{ +45}] \defineoverlay[meta:hash:left] [\metahashoverlay{ -45}] \defineoverlay[meta:hash:horizontal][\metahashoverlay{+180}] \defineoverlay[meta:hash:vertical] [\metahashoverlay{ -90}] \starttext \startmidaligned \startxtable [align={lohi,middle}, width=1.5cm, background=color, backgroundcolor=white, framecolor=purple, meta:hash:linecolor=green] \startxrow \startxcell[background=color,backgroundcolor=paleturquoise] i \stopxcell \startxcell[background=meta:hash:right,frame=off] \stopxcell \startxcell 0 \stopxcell \startxcell 1 \stopxcell \startxcell 2 \stopxcell \stopxrow \startxrow \startxcell[background=color,backgroundcolor=paleturquoise] S \stopxcell \startxcell 0 \stopxcell \startxcell \stopxcell \startxcell \stopxcell \startxcell \stopxcell \stopxrow \startxrow \startxcell[background=color,backgroundcolor=paleturquoise] a \stopxcell \startxcell 3 \stopxcell \startxcell \stopxcell \startxcell \stopxcell \startxcell \stopxcell \stopxrow \stopxtable \stopmidaligned \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 ___
[NTG-context] New to metapost, could use some help with first steps
Hans was so kind to help me with a setup for some generated output. I am trying to understand every line of his example so I can expand on his exmaple to make it fully functional. In his example there is: context('draw textext("\\framed[frame=off,offset=5bp,align={middle,lohi,verytolerant,broad},width=%sbp]{%s}") shifted center AllNodes[%i] ;',w,name,i) as command to draw a node and the node type is defined like this: context("save ApplicationComponent ; path ApplicationComponent ; ApplicationComponent := unitsquare ; ") For a quick example this works, but ‘unitsquare’ is a simple thing. How do I create a more complex shape that is reusable? What if I would like the path to be like this: With this as the complex behaviour of the shape The font size scaled so the label fits inside the image (choice yes/no) The small boxes sized according to the font size or sized according to the box size (choice text/box) The bounding box following the actual complex outline The upper of the two small boxes in line with the upper text line (in case the size is coupled to the text size) The colour of the background a default colour or given as parameter This is one of the more complex shapes, if I can do this one it might give me enough information to define all the other ones. Sorry to bother all of you but the learning curve is steep and I always have not enough time. Gerben Wierda Chess and the Art of Enterprise Architecture <https://ea.rna.nl/the-book/> Mastering ArchiMate <https://ea.rna.nl/the-book-edition-iii/> Architecture for Real Enterprises <https://www.infoworld.com/blog/architecture-for-real-enterprises/> at InfoWorld On Slippery Ice <https://eapj.org/on-slippery-ice/> at EAPJ ___ 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] extreme table and right frames with vertically spanned cells
On 1/4/20 7:00 PM, Damien Thiriet wrote: > Hi list, > > It looks like switching off right frame is not taken into account when > spanning cell vertically. Hi Damien, this might be a bug, since other options work fine, such as in: \starttext \startTEXpage[offset=1em] \startxtable \startxrow \startxcell A \stopxcell \startxcell[ny=2, background=color, backgroundcolor=blue, rightframe=off, align=lohi, foregroundcolor=yellow] B \stopxcell \stopxrow \startxrow \startxcell C \stopxcell \stopxrow \startxrow \startxcell 1 \stopxcell \startxcell 2 \stopxcell \stopxrow \startxrow \startxcell[nx=2, background=color, backgroundcolor=orange, bottomframe=off, align=center, foregroundcolor=gray] 3 \stopxcell \stopxrow \stopxtable \stopTEXpage \stoptext Happy New Year 2020 to all, 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] Tent style cards
On 12/22/2019 11:23 AM, Wolfgang Schuster wrote: Pavneet Arora schrieb am 21.12.2019 um 23:08: Hello. I am trying to do up some tent style table place holder cards for my daughter's wedding, and have been wracking my brain for a solution for a couple of days now. Having tried many alternatives, this is the closest I have come up with. But mirroring doesn't work. If I use \setuparranging[2*4] mirroring works, but I only need tent style (1*2 head-to-head) so that I can trim to size. Any template that could be suggested would be most helpful as the wedding is on Mon (yikes!). Simple solution: \starttexdefinition TableCard #1 \setupTABLE [start] [frame=off,width=4in,height=3in,align={middle,lohi},style=\tfd] \setupTABLE [row] [1] [orientation=180] %\setupTABLE [start] [leftframe=on,rightframe=on] %\setupTABLE [row] [1] [topframe=on] %\setupTABLE [row] [2] [bottomframe=on] \bTABLE \bTR \bTD #1 \eTD \eTR \bTR \bTD #1 \eTD \eTR \eTABLE \stoptexdefinition \starttext \TableCard{Insert Name} \stoptext Now that's one for Pavneets upcoming context cookbook project, after the wedding is done, 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] Tent style cards
Pavneet Arora schrieb am 21.12.2019 um 23:08: Hello. I am trying to do up some tent style table place holder cards for my daughter's wedding, and have been wracking my brain for a solution for a couple of days now. Having tried many alternatives, this is the closest I have come up with. But mirroring doesn't work. If I use \setuparranging[2*4] mirroring works, but I only need tent style (1*2 head-to-head) so that I can trim to size. Any template that could be suggested would be most helpful as the wedding is on Mon (yikes!). Simple solution: \starttexdefinition TableCard #1 \setupTABLE [start] [frame=off,width=4in,height=3in,align={middle,lohi},style=\tfd] \setupTABLE [row] [1] [orientation=180] %\setupTABLE [start] [leftframe=on,rightframe=on] %\setupTABLE [row] [1] [topframe=on] %\setupTABLE [row] [2] [bottomframe=on] \bTABLE \bTR \bTD #1 \eTD \eTR \bTR \bTD #1 \eTD \eTR \eTABLE \stoptexdefinition \starttext \TableCard{Insert Name} \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 ___
Re: [NTG-context] Tent style cards
On 12/21/19 11:08 PM, Pavneet Arora wrote: > Hello. > > I am trying to do up some tent style table place holder cards for my > daughter's wedding, and have been wracking my brain for a solution for a > couple of days now. > > Having tried many alternatives, this is the closest I have come up with. > But mirroring doesn't work. If I use \setuparranging[2*4] mirroring > works, but I only need tent style (1*2 head-to-head) so that I can trim > to size. > > Any template that could be suggested would be most helpful as the > wedding is on Mon (yikes!). Hi Paavnet, I think this could achieve what you might need: \definepapersize[tblcard][width=4in,height=3in] \setuppapersize[tblcard][letter,portrait] \setuparranging[2TOP] \setuplayout[ height=3in, width=4in, topspace=0in, header=0in, bottomspace=0in, footer=0in, backspace=0.0in, %% location=middle, marking=on, ] \startbuffer[tblcard] \startframedtext [frame=off, width=\textwidth, height=\textheight, align={lohi, middle}] \tfd A Name \stopframedtext \stopbuffer \starttext %~ \showframe \rotate[rotation=180]{\getbuffer[tblcard]} \page \getbuffer[tblcard] \stoptext I hope it goes on time ;-), 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] Number format with lua
On 11/9/19 10:38 PM, Fabrice Couvreur wrote: > Hi, > In the table below, how to have numbers with only three decimals ? > Thank you. > Fabrice > > \starttext > \startluacode > local letters_1 = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" } > local letters_2 = { "1", "Année", "1998", "1999", "2000", "2001", "2002", > "2003", "2004", "2005","2006" } > context.startxtable({"align={middle,lohi}, > width=1.2cm,offset=0.8ex,bodyfont=9pt"}) > > context.startxrow({"background=color,backgroundcolor=green"}) > context.startxcell({"background=color,backgroundcolor=white,frame=off"}) > context("") > context.stopxcell() > for _, letter in ipairs(letters_1) do > context.startxcell() > context(letter) context.stopxcell() > end > context.stopxrow() > > context.startxrow() > for _, letter in ipairs(letters_2) do > context.startxcell() context(letter) context.stopxcell() > end > context.stopxrow() > > context.startxrow() > context.startxcell() context("2") context.stopxcell() > context.startxcell({"width=2cm"}) context("Prix (kg)") context.stopxcell() > for i=0,8 do > context.startxcell() context("%0.5g",1.031^i) context.stopxcell() Have you tried context.startxcell() context("%0.3g",1.031^i) context.stopxcell() ? Cheers, Henri > end > context.stopxrow() > > 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 > ___ > ___ 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] Number format with lua
Hi, In the table below, how to have numbers with only three decimals ? Thank you. Fabrice \starttext \startluacode local letters_1 = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" } local letters_2 = { "1", "Année", "1998", "1999", "2000", "2001", "2002", "2003", "2004", "2005","2006" } context.startxtable({"align={middle,lohi}, width=1.2cm,offset=0.8ex,bodyfont=9pt"}) context.startxrow({"background=color,backgroundcolor=green"}) context.startxcell({"background=color,backgroundcolor=white,frame=off"}) context("") context.stopxcell() for _, letter in ipairs(letters_1) do context.startxcell() context(letter) context.stopxcell() end context.stopxrow() context.startxrow() for _, letter in ipairs(letters_2) do context.startxcell() context(letter) context.stopxcell() end context.stopxrow() context.startxrow() context.startxcell() context("2") context.stopxcell() context.startxcell({"width=2cm"}) context("Prix (kg)") context.stopxcell() for i=0,8 do context.startxcell() context("%0.5g",1.031^i) context.stopxcell() end context.stopxrow() 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 ___
[NTG-context] Bad cooperation between \unit and TABLE
Hi all, I came across the problem with bad aligment of cells in natural tables (longer MWE below): When I use \unit for better typesetting of units, lines 6, 6a, 8 and 9 are sloppy-aligned -- first, the alignmentcharacter is ignored, secondly the very huge space appears between e.g. m and 2. It seems that it happens at any time when the exponent in any form is required. Moreover, the line 11 is also sloppy-aligned as a consequence of the use of \unit|\high commands because if the line 2a is active, the alignment position is computed properly and the line 11 is ok. Is it a bug, or am I doing something wrong? Best wishes, Tomáš \starttext \setupTABLE[c][2][alignmentcharacter={text->,}, aligncharacter=yes, align={lohi,middle}] \bTABLE \bTR\bTD Line \#1 \eTD \bTD39 \eTD \eTR \bTR\bTD Line \#2 \eTD \bTD 42,185 \eTD\eTR %\bTR\bTD Line \#2a \eTD \bTD 55 550,21 \eTD\eTR \bTR\bTD Line \#3 \eTD \bTD 41,85\,\% \eTD \eTR \bTR\bTD Line \#4 \eTD \bTD 1125,80 centimeter \eTD\eTR \bTR\bTD Line \#5\eTD \bTD 1125,80 \unit{cm} \eTD\eTR \bTR\bTD Line \#6 \eTD \bTD 129,30 \unit{square centimeter} \eTD\eTR \bTR\bTD Line \#6a \eTD \bTD 129,30 \unit{m2} \eTD\eTR \bTR\bTD Line \#7 \eTD \bTD 129,30 \unit{m}\eTD\eTR \bTR\bTD Line \#8 \eTD \bTD 129,30 cm$^{\tfxx2}$\,\eTD\eTR \bTR\bTD Line \#9 \eTD \bTD 0,21 m\high{2} \eTD\eTR \bTR\bTD Line \#10 \eTD \bTD 41,85 \% \eTD\eTR \bTR\bTD Line \#11 \eTD \bTD 55 550,21 \eTD\eTR \bTR\bTD Line \#12 \eTD \bTD 0,21 \eTD\eTR \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] issue splitting tables and horizontal mode
Pablo Rodriguez schrieb am 18.10.2019 um 16:23: Dear list, I have another issue related to extreme tables. \setupxtable[split=yes] \starttext \startmakeup[standard] \dontleavehmode \startxtable[align={middle,lohi},columndistance=0em] \startxrow \startxcell \dontleavehmode \externalfigure[cow.pdf] [scale=500] \stopxcell \startxcell \dontleavehmode \externalfigure[cow.pdf] [scale=500] \stopxcell \stopxrow \stopxtable \stopmakeup \stoptext When splitting extreme tables, I cannot use \dontleavehmode. 1. What is the purpose of \dontleavehmode in your example? 2. Why do you try to split a table in a makup environment (which will never work)? Since this worked before, am I missing something or is this a bug? It isn't a bug but a side effect of the way how split=yes works. The normal splitters uses a simple placement method where each table row is placed below each other. To prevent unwanted white space between the lines \nointerlineskip is used but the command works only a vertical mode. With \dontleavehmode like in your example you force horizontal mode for the table which results in the error message. You can reproduce the error with the following minimal example: \starttext \dontleavehmode \vbox{} \nointerlineskip \vbox{} \stoptext The reason why this doens't happen when splitting is disabled or when the header or footer lines are repeated is that ConTeXt puts the collected lines for each table in a \vbox. When you flush the lines in the \vbox the are placed in vertical modes and your \dontleavehmode is only applied to the outer \vbox while the lines itself are placed in vertical mode. \starttext \dontleavehmode \vbox {\vbox{} \nointerlineskip \vbox{}} \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] issue splitting tables and horizontal mode
Dear list, I have another issue related to extreme tables. \setupxtable[split=yes] \starttext \startmakeup[standard] \dontleavehmode \startxtable[align={middle,lohi},columndistance=0em] \startxrow \startxcell \dontleavehmode \externalfigure[cow.pdf] [scale=500] \stopxcell \startxcell \dontleavehmode \externalfigure[cow.pdf] [scale=500] \stopxcell \stopxrow \stopxtable \stopmakeup \stoptext When splitting extreme tables, I cannot use \dontleavehmode. Since this worked before, am I missing something or is this a bug? Many thanks for your 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] Size of the font (Metapost + xtable)
Hello, I can not change the font size of my figures in the table. Thank you Fabrice \usecolors[xwi] \startbuffer[myfigure] \dontleavehmode \startMPcode defaultfont := "texgyrepagella-regular*default" ; defaultscale :=0.8 ; numeric alpha ; alpha = 60 ; path circle ; circle = fullcircle scaled 1.4cm ; draw circle withcolor blue ; drawarrow 0.9cm * dir 25 {dir 90} .. 0.9cm * dir 45 {dir (90+alpha)} withcolor \MPcolor{darkred} ; drawdot origin withpen pencircle scaled 2pt ; drawdot 0.7cm*dir 0 withpen pencircle scaled 2pt ; label.llft(btex \m{O} etex,origin) ; label.rt(btex \m{A} etex,0.7cm*dir 0) ; \stopMPcode \stopbuffer \starttext \startlinecorrection[blank] \startmidaligned \startxtable[align={middle,lohi},width=2.25cm] \startxrow \startxcell [background=color,backgroundcolor=paleturquoise] Angle en degré \stopxcell \startxcell 180 \stopxcell \startxcell 360 \stopxcell \startxcell 90 \stopxcell \startxcell 45 \stopxcell \startxcell 60 \stopxcell \startxcell 210 \stopxcell \stopxrow \startxrow \startxcell [background=color,backgroundcolor=paleturquoise] Position de \m{M} \stopxcell \startxcell \dontleavehmode \startMPcode defaultfont := "texgyrepagella-regular*default" ; defaultscale :=0.8 ; numeric alpha ; alpha = 60 ; path circle ; circle = fullcircle scaled 1.4cm ; draw circle withcolor blue ; drawarrow 0.9cm * dir 25 {dir 90} .. 0.9cm * dir 45 {dir (90+alpha)} withcolor \MPcolor{darkred} ; drawdot origin withpen pencircle scaled 2pt ; drawdot 0.7cm*dir 0 withpen pencircle scaled 2pt ; drawdot 0.7cm*dir 180 withpen pencircle scaled 2pt ; label.llft(btex \m{O} etex,origin) ; label.rt(btex \m{A} etex,0.7cm*dir 0) ; label.lft(btex \m{M} etex,0.7cm*dir 180) ; \stopMPcode \stopxcell \startxcell \getbuffer[myfigure] \stopxcell \startxcell \getbuffer[myfigure] \stopxcell \startxcell \getbuffer[myfigure] \stopxcell \startxcell \getbuffer[myfigure] \stopxcell \startxcell \getbuffer[myfigure] \stopxcell \stopxrow \startxrow \startxcell [background=color,backgroundcolor=paleturquoise] Longueur \m{L} en hm \stopxcell \startxcell \m{\pi \times 1} \stopxcell \startxcell \unknown \stopxcell \startxcell \unknown \stopxcell \startxcell \unknown \stopxcell \startxcell \unknown \stopxcell \startxcell \unknown \stopxcell \stopxrow \stopxtable \stopmidaligned \stoplinecorrection \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 ___
[NTG-context] Border in xtable
Hello, In the table below, why the border of the first line is not drawn ? Thank you Fabrice \definecolor[ColorA][0.8(white)] \definecolor[ColorB][0.9(white)] \starttext \startxtable [align={lohi,middle}, width=2cm,bodyfont=11pt] \startxrow[background=color,backgroundcolor=ColorA,foregroundstyle=white] \startxcell[width=10cm,nc=4] Variété A \stopxcell \stopxrow \startxrow[background=color,backgroundcolor=ColorB] \startxcell[width=4cm] Âge (en jours) \stopxcell \startxcell[background=color,backgroundcolor=white] 12 \stopxcell \startxcell[background=color,backgroundcolor=white] 20 \stopxcell \startxcell[background=color,backgroundcolor=white] 38 \stopxcell \stopxrow \startxrow[background=color,backgroundcolor=ColorB] \startxcell[width=4cm] Hauteur (en cm) \stopxcell \startxcell[background=color,backgroundcolor=white] 11 \stopxcell \startxcell[background=color,backgroundcolor=white] 15 \stopxcell \startxcell[background=color,backgroundcolor=white] 24 \stopxcell \stopxrow \stopxtable \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 ___
[NTG-context] CrossWords Puzzles with context
After some attempts to build crosswords puzzles with context, I found this approach: 1) Create the puzzle with genxword https://github.com/riverrun/genxword <https://github.com/riverrun/genxword> 2) Edit the output table and change all {} to * 3) Save the table in a file (p.e. crosswords.txt) 3) In context use this script (Revised By Wolfgang Schuster) \startluacode context.startmidaligned() context.bTABLE( { rulethickness = ".25pt", width = ".8cm", height = ".8cm", align = "{lohi, middle}" } ) for line in io.lines("crosswords.txt") do for w in (line .. "|"):gmatch("([^|]*)|") do -- print (w) if w == ' ' then context.bTR() elseif w == '.' then context.eTR() else if w == '* ' then context.bTD( { frame = "off" } ) context.eTD() else ww = string.match (w, "%d+") print (ww) if ww then context.bTD( { foregroundstyle = "\\bfxx" } ) context("%s",ww) context.eTD() else context.bTD() -- context("%s",w) context.eTD() end end end end end context.eTABLE() context.stopmidaligned() \stopluacode Files: crossword.txt file: |* |* |[2]T|* |* |* |* |* |* |* |* |* |* |* |* |* |. |[1]A|D|R|I|A|N|O|* |* |* |* |* |* |* |* |* |. |* |* |A|* |* |* |* |* |* |* |* |* |* |* |* |* |. |[6]H|* |J|* |* |* |[4]T|* |* |* |* |* |* |* |* |* |. |[3]I|T|A|L|I|C|A|* |* |* |* |* |* |* |* |* |. |S|* |N|* |* |* |R|* |* |* |* |* |* |* |* |* |. |P|* |O|* |* |* |G|* |[10]S|* |* |[7]P|* |* |* |* |. |A|* |* |* |[5]G|U|A|D|A|L|Q|U|I|[9]V|I|[8]R|. |L|* |* |* |* |* |R|* |N|* |* |B|* |E|* |O|. |I|* |* |* |* |* |Y|* |T|* |* |L|* |N|* |M|. |S|* |* |* |* |* |E|* |I|* |* |I|* |U|* |A|. |* |* |* |* |* |* |N|* |P|* |* |O|* |S|* |N|. |* |* |* |* |* |* |* |* |O|* |* |* |* |* |* |O|. |* |* |* |* |* |* |* |* |N|* |* |* |* |* |* |S|. |* |* |* |* |* |* |* |* |C|* |* |* |* |* |* |* |. |* |* |* |[11]A|N|F|I|T|E|A|T|R|O|* |* |* |. Output ___ 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] aligning rotated text in a natural table
Thanks for that Wolfgang. It doesn't seem to work though. The text stays at the left. Meantime I have tried two other approaches. Only an approach using a \framed handles longer lines. My problem with the 3. \framed approach is: how do I get the size of the current table cell? In the MWE I used fixed values, in the actual document that would not be good - too many different cells. I am trying a further approach using MetaPost and OverlayBox. Seems possible (line wrapping also an issue), but quite involved... Thanks, Martin New MWS: \setupTABLE[c][1][width=20mm] \setupTABLE[c][2,3][width=30mm] \setupTABLE[r][1][height= 50mm,align={lohi}] \bTABLE \bTR \bTD \dontleavehmode{\rotate{1. a bit more text again, entering the age of long sentences}} \eTD \bTD \hbox to \dimexpr(.5\lineheight+.5\hsize){\hss{\rotate{2. a bit more text again, and see if linebreaking works}}} \eTD \bTD \rotate[rotation=90,location=depth]{\framed[frame=on,align={lohi,middle},width=\dimexpr(\o verlaywidth-05pt),width=48mm,height=29mm]{3. even more huge text, wondering where the rabbit runs)}} \eTD \eTR \eTABLE On Wed, 2019-06-12 at 22:23 +0200, Wolfgang Schuster wrote: > Martin Althoff schrieb am 12.06.2019 um 13:11: > > I am trying to align rotated text horizontally and vertically in a table > > cell. Vertically > > is no problem, horizontally it fails. Non-rotated text is, of course, fine. > > > > What can I do to fix the problem? Thanks for suggestions. > > > > Martin > > > > using: mtx-context | current version: 2019.05.18 10:42 > > PDF of my output is attached. > > > > MWE: > > > > \starttext > > \setupTABLE[c][1][width=7mm] > > \setupTABLE[c][2][width=30mm] > > \setupTABLE[r][each][align={lohi,middle},height= 50mm] > > > > \bTABLE > > \bTR > > \bTD \rotate[270]{\switchtobodyfont[8pt]a bit more text} \eTD > > \bTD \dontleavehmode\rotate[...]{...} \eTD > > 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] aligning rotated text in a natural table
Martin Althoff schrieb am 12.06.2019 um 13:11: I am trying to align rotated text horizontally and vertically in a table cell. Vertically is no problem, horizontally it fails. Non-rotated text is, of course, fine. What can I do to fix the problem? Thanks for suggestions. Martin using: mtx-context | current version: 2019.05.18 10:42 PDF of my output is attached. MWE: \starttext \setupTABLE[c][1][width=7mm] \setupTABLE[c][2][width=30mm] \setupTABLE[r][each][align={lohi,middle},height= 50mm] \bTABLE \bTR \bTD \rotate[270]{\switchtobodyfont[8pt]a bit more text} \eTD \bTD \dontleavehmode\rotate[...]{...} \eTD 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] aligning rotated text in a natural table
Hi Willi, thanks for the quick reply. I have the [align=lohi] as part of the setupTABLE statement. Now I tried adding it into the particular cell -- again no effect even if I add "middle". \bTD[align=lohi] \rotate[270]{\switchtobodyfont[8pt]a bit more text} \eTD I suspect the rotate mechanism places the object independent of the align= statement. For that reason some other handling might be needed. I just don't know which :) Martin On Wed, 2019-06-12 at 14:31 +0200, Willi Egger wrote: > Martin, did you try to add [align=lohi]? > > Willi > > > On 12 Jun 2019, at 13:11, Martin Althoff wrote: > > > > I am trying to align rotated text horizontally and vertically in a table > > cell. Vertically > > is no problem, horizontally it fails. Non-rotated text is, of course, fine. > > > > What can I do to fix the problem? Thanks for suggestions. > > > > Martin > > > > using: mtx-context | current version: 2019.05.18 10:42 > > PDF of my output is attached. > > > > MWE: > > > > \starttext > > \setupTABLE[c][1][width=7mm] > > \setupTABLE[c][2][width=30mm] > > \setupTABLE[r][each][align={lohi,middle},height= 50mm] > > > > \bTABLE > > \bTR > > \bTD \rotate[270]{\switchtobodyfont[8pt]a bit more text} \eTD > > \bTD blah \eTD > > \eTR > > > > \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] aligning rotated text in a natural table
Martin, did you try to add [align=lohi]? Willi > On 12 Jun 2019, at 13:11, Martin Althoff wrote: > > I am trying to align rotated text horizontally and vertically in a table > cell. Vertically > is no problem, horizontally it fails. Non-rotated text is, of course, fine. > > What can I do to fix the problem? Thanks for suggestions. > > Martin > > using: mtx-context | current version: 2019.05.18 10:42 > PDF of my output is attached. > > MWE: > > \starttext > \setupTABLE[c][1][width=7mm] > \setupTABLE[c][2][width=30mm] > \setupTABLE[r][each][align={lohi,middle},height= 50mm] > > \bTABLE > \bTR > \bTD \rotate[270]{\switchtobodyfont[8pt]a bit more text} \eTD > \bTD blah \eTD > \eTR > > \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 > ___ ___ 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 ___