[NTG-context] Re: The graph is not visible.
Hi, Thanks for your help. I did several tests playing only with the code of component 5 which interferes with that of component 14. @Aditya begingroup; . endgroup; does not work. @Hans save defaultfont, defaultscale; maybe also: save circle, p, q, b ; I get an empty rectangle in place of the graph in composant 5. @Taco The solution that works is to add component 14 to the code numeric a, b; Fabrice Le ven. 26 avr. 2024 à 10:45, Aditya Mahajan a écrit : > On Fri, 26 Apr 2024, Taco Hoekwater wrote: > > > > > > > > On 25 Apr 2024, at 23:12, Fabrice Couvreur < > fabrice1.couvr...@gmail.com> wrote: > > > > > > Hi, > > > Here is the code that interferes with the graph from the last chapter > but why ? > > > > Because of this “path b”: > > > > > path circle, p, q, b; > > > > which interferes with the assignment line from the other graphic code: > > > > > b := xpart(reverse C_f intersectionpoint reverse C_g); > > > > because there “b” is a now a path, not a numeric. > > > > Adding > > > >numeric a,b; > > > > fixes the problem in chapter 14. > > Woundn't newnumeric be better? > > There are very few instances where I want variables defined in one block > to be reused in another block. So, I almost always use > > \startMPcode > begingroup; > > endgroup; > \stopMPcode > > to avoid such issues. > > > Aditya___ > 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 > > ___ > ___ 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: The graph is not visible.
Hi, Here is the code that interferes with the graph from the last chapter but why ? \startMPcode pickup pencircle xscaled 1; defaultfont := "texgyrepagella-regular*default" ; defaultscale := 0.8 ; path circle, p, q, b; circle = fullcircle xscaled 5cm yscaled 3.5cm; p = (point 2 of circle .. (-0.15cm,1.5cm) ..(0,0)..(0.15cm,-1.5cm).. point 6 of circle); q = (subpath(0,2) of circle -- p -- subpath(6,8) of circle --cycle); b = (reverse p -- subpath(2,6) of circle -- cycle); definecolor [ name = "mp:red", r = 1 ]; definecolor [ name = "mp:blue", r = 0.54, g = 0.17, b = 0.89 ]; fill q withcolor "mp:red" withtransparency(1,0.4) ; fill b withcolor "mp:blue" withtransparency(1,0.4) ; draw circle; draw p; label("$\overline{\text{A}}$",( 1.5cm,0)); label("$\text{A}$",(-1.5cm,0)); label.top("E",(0,1.85cm)); \stopMPcode Le jeu. 25 avr. 2024 à 16:55, Fabrice Couvreur a écrit : > Hi Hans and Taco, > @Hans, I compiled by commenting and uncommenting one component at a time; > it is component 5 which interferes with the metapost code of component 14 > All I have to do now is find out what the cause is. > Fabrice > > Le jeu. 25 avr. 2024 à 16:40, Taco Hoekwater a écrit : > >> >> >> > On 25 Apr 2024, at 16:08, Fabrice Couvreur >> wrote: >> > >> > Hi Taco, >> > I knew I wouldn't be able to explain what was happening. >> > The code works perfectly and the figure is clearly visible in the >> component chapter-14 : >> >> It is probably not related to the figure itself. Something may be >> different in this component compared to the other ones. I cannot really >> say, of course. Still, using external image instead of inline metapost may >> be fix it. Not elegant, but if it works it works! >> >> Good luck, >> Taco >> >> >> > >> > \startcomponent[chapter-14] >> > \startMPpage >> > ... >> > \stopMPpage >> > \stopcomponent >> > >> > But if I compile my project, it disappears !! >> > >> > \startproduct[terminale-manual] >> > \startbodymatter >> > \component[chapter-1] >> > \component[chapter-2] >> > \component[chapter-3] >> > \component[chapter-4] >> > \component[chapter-5] >> > \component[chapter-6] >> > \component[chapter-7] >> > \component[chapter-8] >> > \component[chapter-9] >> > \component[chapter-10] >> > \component[chapter-11] >> > \component[chapter-12] >> > \component[chapter-13] >> > \component[chapter-14] >> > \stopbodymatter >> > \stopproduct >> >> — >> Taco Hoekwater E: t...@bittext.nl >> genderfluid (all pronouns) >> >> >> >> ___ >> 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 >> >> ___ >> > ___ 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: The graph is not visible.
Hi Hans and Taco, @Hans, I compiled by commenting and uncommenting one component at a time; it is component 5 which interferes with the metapost code of component 14 All I have to do now is find out what the cause is. Fabrice Le jeu. 25 avr. 2024 à 16:40, Taco Hoekwater a écrit : > > > > On 25 Apr 2024, at 16:08, Fabrice Couvreur > wrote: > > > > Hi Taco, > > I knew I wouldn't be able to explain what was happening. > > The code works perfectly and the figure is clearly visible in the > component chapter-14 : > > It is probably not related to the figure itself. Something may be > different in this component compared to the other ones. I cannot really > say, of course. Still, using external image instead of inline metapost may > be fix it. Not elegant, but if it works it works! > > Good luck, > Taco > > > > > > \startcomponent[chapter-14] > > \startMPpage > > ... > > \stopMPpage > > \stopcomponent > > > > But if I compile my project, it disappears !! > > > > \startproduct[terminale-manual] > > \startbodymatter > > \component[chapter-1] > > \component[chapter-2] > > \component[chapter-3] > > \component[chapter-4] > > \component[chapter-5] > > \component[chapter-6] > > \component[chapter-7] > > \component[chapter-8] > > \component[chapter-9] > > \component[chapter-10] > > \component[chapter-11] > > \component[chapter-12] > > \component[chapter-13] > > \component[chapter-14] > > \stopbodymatter > > \stopproduct > > — > Taco Hoekwater E: t...@bittext.nl > genderfluid (all pronouns) > > > > ___ > 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 > > ___ > ___ 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: The graph is not visible.
> On 25 Apr 2024, at 16:08, Fabrice Couvreur > wrote: > > Hi Taco, > I knew I wouldn't be able to explain what was happening. > The code works perfectly and the figure is clearly visible in the component > chapter-14 : It is probably not related to the figure itself. Something may be different in this component compared to the other ones. I cannot really say, of course. Still, using external image instead of inline metapost may be fix it. Not elegant, but if it works it works! Good luck, Taco > > \startcomponent[chapter-14] > \startMPpage > ... > \stopMPpage > \stopcomponent > > But if I compile my project, it disappears !! > > \startproduct[terminale-manual] > \startbodymatter > \component[chapter-1] > \component[chapter-2] > \component[chapter-3] > \component[chapter-4] > \component[chapter-5] > \component[chapter-6] > \component[chapter-7] > \component[chapter-8] > \component[chapter-9] > \component[chapter-10] > \component[chapter-11] > \component[chapter-12] > \component[chapter-13] > \component[chapter-14] > \stopbodymatter > \stopproduct — Taco Hoekwater E: t...@bittext.nl genderfluid (all pronouns) ___ 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: The graph is not visible.
On 4/25/2024 4:08 PM, Fabrice Couvreur wrote: Hi Taco, I knew I wouldn't be able to explain what was happening. The code works perfectly and the figure is clearly visible in the component chapter-14 : \startcomponent[chapter-14] \startMPpage ... \stopMPpage \stopcomponent But if I compile my project, it disappears !! \startproduct[terminale-manual] \startbodymatter \component[chapter-1] \component[chapter-2] \component[chapter-3] \component[chapter-4] \component[chapter-5] \component[chapter-6] \component[chapter-7] \component[chapter-8] \component[chapter-9] \component[chapter-10] \component[chapter-11] \component[chapter-12] \component[chapter-13] \component[chapter-14] \stopbodymatter \stopproduct -- compile with specific preceding chapters commented -- when the interfering one is found, make a copy and strip till the problem is gone it might be that you redefine something metapost 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 / 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: The graph is not visible.
Hi Taco, I knew I wouldn't be able to explain what was happening. The code works perfectly and the figure is clearly visible in the component chapter-14 : \startcomponent[chapter-14] \startMPpage ... \stopMPpage \stopcomponent But if I compile my project, it disappears !! \startproduct[terminale-manual] \startbodymatter \component[chapter-1] \component[chapter-2] \component[chapter-3] \component[chapter-4] \component[chapter-5] \component[chapter-6] \component[chapter-7] \component[chapter-8] \component[chapter-9] \component[chapter-10] \component[chapter-11] \component[chapter-12] \component[chapter-13] \component[chapter-14] \stopbodymatter \stopproduct Le jeu. 25 avr. 2024 à 13:36, Taco Hoekwater a écrit : > H Fabrice, > > You did not provide a good minimum test because the graph by itself > renders fine: > > > > Best wishes, > Taco > (if all else fails, you can replace \startMPcode with \startMPpage and > generate a standalone graph that way) > > > On 25 Apr 2024, at 12:27, Fabrice Couvreur > wrote: > > > > Hi, > > I don't know if I can explain the problem I'm having. I made a project > with 14 chapters. In each of them, there are graphics embedding metapost > code. I proceed as follows : I compile each chapter alone with lmtx then I > compile the project containing the 14 chapters. I didn't encounter any > problems except with a graphic from the last chapter. It is indeed in > chapter 14 but not in the project ! I give the code for this graph. > > Thanks. > > Fabrice > > > > \startMPcode > > > >interim linejoin := mitered; > >interim ahangle := 30; > >numeric u, pi; > > > >pi = 3.141592653589793; > >u = 1.5cm; > > > >vardef graph_of_function (suffix f) (expr xmin, xmax, > xsep) = > > for x = xmin step xsep until xmax: (x, f(x)) .. endfor > (xmax, f(xmax)) > >enddef ; > > > >vardef vline (suffix f, g) (expr x) = (x, min(f(x), > g(x))) -- (x, max(f(x),g(x))) enddef; > > > >vardef area_between_functions (suffix f, g)(expr a, b, > xsep) = > > buildcycle(graph_of_function(f, a, b, xsep), vline(f, > g, b), > > reverse graph_of_function(g, a, b, xsep), reverse > vline(f, g, a)) > >enddef; > > > >vardef xaxis (expr xmin, xmax) = (xmin, 0) -- (xmax, 0) > enddef ; > >vardef yaxis (expr ymin, ymax) = (0, ymin) -- (0, ymax) > enddef ; > > > > > >xmin:=-pi/2; xmax := 3*pi/2; > >ymin := -1.5; ymax := 5; > > > > > >vardef f(expr x)= exp(-x)*(-cos(x)+sin(x)+1) enddef; > >vardef g(expr x)=-exp(-x)*cos(x) enddef; > >path C_f, C_g; > >C_f = graph_of_function(f,xmin, xmax, .1); > >C_g = graph_of_function(g, xmin, xmax, .1); > > > >a := xpart(C_f intersectionpoint C_g); > >b := xpart(reverse C_f intersectionpoint reverse C_g); > > > >fill (area_between_functions(f, g, a, b, 0.1)) scaled u > withcolor 0.4[white, blue]; > >draw C_f scaled u withcolor blue; > >draw C_g scaled u withcolor blue; > > > > > >\stopMPcode > > > ___ > > 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 > > > ___ > > — > Taco Hoekwater E: t...@bittext.nl > genderfluid (all pronouns) > > > > ___ > 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: last page number for a list
Hi, Bruce— This does not quite work—the page numbers are those of the first page of the chapter, not the last. But thanks for the tip about \writetolist. Perhaps I can get that to work. What I need are ToC entries like AuthorName ShortTitle 1–6 I need this pagination because one of the requirements of continuous publication on the OJS is that once an item is published changes are not permitted. So I cannot go with normal continuous publication since, for us anyway, items are not processed in strict sequential order (e,g., we may have, paper+paper+ review+paper...) If it helps: I currently have \startFMTitle[reference=\Reference, title={}][itemAuthor=AuthorName, itemTitle=ShortTitle,...] \setuplist[FMTitle][state=start, alternative=startendfmpages, criterium=all,] (\Reference is defined at the in the preamble to input of the file/component.) \definelistalternative[startendfmpages][renderingsetup=list:startendfmpages] \startsetups[list:startendfmpages] \structurelistuservariable{itemAuthor}\crlf \structurelistuservariable{itemTitle}\hfill% \at[\currentlistentrypagenumber]–\at[\lastpagenumber] \vglue1pc \stopsetups where I have \reference[\lastpagenumber]{} at the end of the file. But this gives me ??–viii (the viii is correct and interactive) for the FMTitle. Sadly the entries for all my other Titles (SourceTitle, StudyTitle...) is ??–viii. (Each title is a modified chapter.) Curiously, \at[\Reference]–\convertnumber{r}{\lastpagenumber} and \at[\Reference]–\at[\lastpagenumber] work properly in the body text. The overall structure is project-product sort with many components in the product. This is probably TMI. The bottom line is that I am truly stumped. All best, Alan On Wed, Apr 3, 2024 at 6:56 AM Bruce Horrocks wrote: > > > > On 30 Mar 2024, at 19:59, Alan Bowen wrote: > > > > How can I get the last page number of a chapter for a list (ToC)? > > > > Outside of a list, I use \lastpagenumber. > > But that does not work in a list such as the ToC. > > > > Any tips or pointers will be gladly received. > > > I'm not quite sure what you want to do with these numbers: something like > printing out a contents page but instead of the start page of a chapter it > shows the last page of the chapter? > > If so then try creating a custom list and use \writetolist immediately > before each \stopchapter command? > > \definelist[LastPages][criterium=all] > \starttext > \completecontent > \page > \completelist[LastPages] > \page > \dorecurse{10}{ > \startchapter[title={This is my chapter}] > This is a chapter\par \dorecurse{6}{\input knuth } \input > math-kontinuitet-sv > > \writetolist[LastPages]{3.}{\namedstructurevariable{chapter}{title}} > \stopchapter > } > \stoptext > > But I can't get the number option of \writetolist to work - the "3." above > is ignored. :-( > > — > Bruce Horrocks > Hampshire, UK > > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > https://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 > > ___ > ___ 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: Why LuaMetaTex is so slow?
On 1/18/2024 11:15 PM, Bruce Horrocks wrote: On 18 Jan 2024, at 18:56, Shiv Shankar Dayal wrote: I understand that why it is slow, but the problem is that the difference is too high. My book has lots of math, so perhaps that is the reason. Option 1: Buy or borrow a faster computer. You'll get your desired speed-up far faster than waiting for Hans to make changes, even assuming there is something that can be changed. I'd recommend a Mac M3 :-) As tex is a single core process (ok, the os might delegate some file handling to other cores) it benefits from jump in core speed. I use a 2017 laptop with a reasonable fast intel xeon. I have a few docks spread round with different resolution monitors (1920x1200, 2560×1440, 4096×2160) and performance also depends on the connected monitor. I'd be curious to know how much these new processors impact performance over time because the ages of dohbling performance every year are past. There are several factors that impact performance: tex engine : quite a bit faster in luametatex mp engine : quite a bit faster in luametatex lua engine : not much we can do about but inefficient macros and usage can offset any gain in engine. One thing to keep in mind is that tex is an interpreter and all gets tokenized which is more costly in a 32 bit engine than in an 8 bit one (like pdftex). And although luametatex is more efficient than luatex that gets offset by more features that come at a price, but we still win. It helps a bit to know what tex does and what macros add to that. Simple timing operations is useless as in practice we have less cache hits than with a simple loop test: tex is jumping all over memory. Bottlenecks are often noe where one expects them. Anyway, if one can choose: go for a few high perfotmance cores over dozens of so called efficient cores. (that said: luametatex runs fine on my mobile phone) Option 2: Split your book into a project with each chapter, or even part of a chapter as a separate component and compile only the chapter you are working on. Set up a nighttime (or lunchtime) run to regenerate the entire book while you're away from the computer and speed doesn't matter. Indeed. That's the natural way to deal with large documents. 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 / 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: Why LuaMetaTex is so slow?
On 18 Jan 2024, at 18:56, Shiv Shankar Dayal wrote: > > I understand that why it is slow, but the problem is that the difference is > too high. > My book has lots of math, so perhaps that is the reason. Option 1: Buy or borrow a faster computer. You'll get your desired speed-up far faster than waiting for Hans to make changes, even assuming there is something that can be changed. I'd recommend a Mac M3 :-) Option 2: Split your book into a project with each chapter, or even part of a chapter as a separate component and compile only the chapter you are working on. Set up a nighttime (or lunchtime) run to regenerate the entire book while you're away from the computer and speed doesn't matter. — Bruce Horrocks Hampshire, UK ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://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: Why LuaMetaTex is so slow?
Hi Shiv, ConTeXt’s project structure has many benefits. One is speed. See https://wiki.contextgarden.net/Project_structure. My books and long papers are products, each containing many components (chapters or sections). When I’m working, I have both the product and a component open. I frequently typeset the component as I’m working. This is very quick. I only typeset the entire product if I intend print or send it, or when I need to check some product-wide element like references. Components can be nested, so take this approach to whatever extreme you desire. You can also use buffers if there are specific parts of your book (like diagrams) that demand significant processing. Buffers can save the typeset version of the contents. These will only be typeset again if you change the buffer contents (or if you are typesetting with a different version of ConTeXt.) See https://wiki.contextgarden.net/Command/typesetbuffer My biggest book is about 200 pages. It takes 4 minutes to fully typeset on an M1 Mac. (I saw this time after downloading a new ConTeXt version.) This is mostly due to the 100+ complex TikZ diagrams. However, all of those diagrams are buffered, and when I’m working I only typeset the component. A typical chapter typesets in 1.6 seconds if I haven’t changed the diagrams. (I just did one to check.) That’s fast enough for me. Hope that helps, Gavin > On Jan 18, 2024, at 10:24 AM, Shiv Shankar Dayal > wrote: > > I can process TeXBook in almost an instant using PDFTeX which is about 450+ > pages but my math book takes around 30 seconds averaging ~40 pages/second. > > Why LuaMetaTeX is so slow? How can I speed it up? > -- > Respect, > Shiv Shankar Dayal > ___ > 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 > ___ ___ 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: LMTX schema for poster
Am 11.01.24 um 22:04 schrieb Bruce Horrocks: 1. "ConTeXt" should be the biggest word - or as an obvious title for the poster, away from the actual drawing. This will be only a part of the poster. I imagine a 3x3 grid with a title above and some information (website etc.) below. The 9 elements of the grid will be - such a diagram that explains the building blocks / general workflow – the diagram of the layout areas – the project structure (environment, product, component) – some examples of code and results I wanted to use the “christmas card” squares for borders around and inbetween. 2. Don't add the "MkXL" bit - it's a distracting detail that no one needs to know at this stage. Also it looks like "Mk 40" in Roman numerals, or extra large. ok. But “extra large” is intentional, I guess. 3. I though Hans had stopped using the TeX style capitalisation now i.e. just "Context"? Hans uses different versions. We use “context group”, but I keep ConTeXt; esp. in the context of LaTeX (DANTE booth!), I’d like to stress that it’s still TeX. 4. It's not clear whether the intersecting boxes are simply decorative or meant to present some sort of logical structure. I'm happy for it to be decorative, in which case fewer labels might be better. ConTeXt “wraps” the LuaMetaTeX binary, since it handles the input as well as the output. I wasn’t sure how to show what controls what. 5. Similar to the box structure comment is that it's not clear which words I should be looking at. Ask yourself: what word(s) do I want the viewer to remember when they walk away? 6. Consider swapping the TeX and MetaPost circles so that Lua, MetaPost and TeX are read left to right as they appear in the acronym LMTX. Perhaps invert the "triangle" so that there are two circles at the top. My first idea was to show that TeX and MP are under Lua control, but Hans disagreed. So while the 3 subsystems interact, I wanted to keep TeX on top. 7. It doesn't really tell the viewer that Context is a typesetting system - it looks like it is a system for producing XMLs and PDFs. (Which is what it is but... much more) I’ll show some typography on the poster, and there will be books around. 8. Don't forget space for a URL and/or a QR code to the Contextgarden website. See above. Sorry if the above sounds harsh - not meant to be - just brain storming. No problem, thank you! I have a suggestion though. Use the Christmas card code / memory game code to produce patterns to use as the dots in the QR code? If the QR is large enough for people to distinguish the individual dots then it would provide a talking point? Or maybe have a copy of the card game to hand and challenge them to find a randomly drawn card in the QR code? I don’t think I understand your intention. I wouldn’t construct a QR code out of other stuff, it would become too big. Hraban ___ 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] Problem with dataset not being populated
I produce a small magazine where the source files are organised into a product and component structure. For each issue, I have a main file with \startproduct and then, inside that, several \component[filename] statements, one per article. Each article starts in a standard way, including adding some information to a dataset. At the end of the issue, the dataset information is retrieved to be printed and this is where strange things start to happen. Sometimes the whole issue will compile without problems and the dataset information is retrieved perfectly. I can make edits to both the product file and/or any of the component files and it all recompiles to produce a PDF each time. But at othertimes, something "breaks" and the dataset can't be retrieved or isn't created. Everything else compiles fine but there is simply no data being retrieved from the dataset so nothing to print. If I go back to the product file and comment out most of the components then it will (99% of the time) 'unbreak' itself and the dataset gets created. Once it has started working again I can then uncomment the rest of the components and it will recompile with all the dataset data present ... until the next time. Has anyone seen anything like this? I'm using Lua to retrieve the dataset info and, when it goes wrong, the dataset returned by Lua is a nil value. But the .tua file (not a .tuc) has the full dataset structure included. I can't produce an MWE as I have no idea what to remove and include - it doesn't seem to matter which components are left or removed in order to fix the problem just as long as several ar removed. In other words, it's not one component file causing the problem. And sometimes commenting out just two components will fix it, othertimes I have to do most of them. It could be a caching issue - when it goes wrong, reprocessing the product file causes much less to scroll past on the TeXShop log display. And when it is fixed, the first successful run has a much longer log, suggesting that more is being processed. So, unless someone else has seen the above and has the solution, the first question is: does LMTX cache the result of previous runs to save reprocessing if nothing has changed? If so, how can I force a full reprocess or remove those cache files? I'm using TeXShop to edit and compile, but running "context product_filename.tex" from the command line makes no difference. Version is 2023.09.26 18:19. — Bruce Horrocks Hampshire, UK ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://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 ___
Re: [NTG-context] setuphead page=right and blank even page.
Alan Braslau schrieb am 11.06.2023 um 20:12: On 10/06/23 10/06/23, 12:42, Wolfgang Schuster via ntg-context wrote: Alan Braslau via ntg-context schrieb am 10.06.2023 um 12:28: Hello, \setuphead [part,chapter,title] [page=right] will start a part, chapter, or title on an odd page (right), inserting a "blank" even page if necessary. How can I get this blank even page to be truely blank, that is with no headers nor footers? I tried several thinks and must be missing something really simple and obvious. \setuphead [...] [page={yes,header,footer,right}] Wolfgang Thank you for this hint. It works (almost) as expected: Strangely, I had to add, explicitly, \startfrontmatter \component FrontMatterStuff \page[yes,header,footer,right] \stopfrontmatter \startbodymatter ... \stopbodymatter In order to get the frontmatter end with a totally blank page before a right Chapter 1 header. Using just the setuphead resulted in headers and footers on the "blank" left page. No problems for Chapters 2, etc. Section block force by default a page break which can produce unexpected headers/footers on the first chapter etc. You can fix this by disabling the page break at the start/end of the section block with \setupsectionblock [bodypart] [page=] 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] setuphead page=right and blank even page.
On 10/06/23 10/06/23, 12:42, Wolfgang Schuster via ntg-context wrote: Alan Braslau via ntg-context schrieb am 10.06.2023 um 12:28: Hello, \setuphead [part,chapter,title] [page=right] will start a part, chapter, or title on an odd page (right), inserting a "blank" even page if necessary. How can I get this blank even page to be truely blank, that is with no headers nor footers? I tried several thinks and must be missing something really simple and obvious. \setuphead [...] [page={yes,header,footer,right}] Wolfgang Thank you for this hint. It works (almost) as expected: Strangely, I had to add, explicitly, \startfrontmatter \component FrontMatterStuff \page[yes,header,footer,right] \stopfrontmatter \startbodymatter ... \stopbodymatter In order to get the frontmatter end with a totally blank page before a right Chapter 1 header. Using just the setuphead resulted in headers and footers on the "blank" left page. No problems for Chapters 2, 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] Table of contents not appearing.
It's chapter_5 that's the problem, but how do you know what's causing the table of contents not to appear ? Le ven. 21 avr. 2023 à 14:42, Fabrice Couvreur a écrit : > Hi Hans, > Alright, I'll compile by integrating one component at a time to figure out > which one is causing the problem. > Thanks. > Fabrice > > Le jeu. 20 avr. 2023 à 15:52, Hans Hagen via ntg-context < > ntg-context@ntg.nl> a écrit : > >> On 4/20/2023 6:59 PM, Fabrice Couvreur via ntg-context wrote: >> > Hi, >> > I don't see why the table of contents does not appear. On the other >> > hand, the 12 chapters are present. >> >> \startproduct[terminale-manual] >> >> \startfrontmatter >> \starttitle[title=Table des matières] >> \placelist >> [chapter,section,subsection,subsubsection] >> [criterium=all, >> interaction=all, >> alternative=c] >> \stoptitle >> \stopfrontmatter >> >> \startbodymatter >> \chapter{xxx} >> \stopbodymatter >> >> \stopproduct >> >> shows a table of contents so it must be something in your components >> >> > Fabrice >> > >> > >> > \startproduct[terminale-manual] >> > >> >\project[terminale-environment] >> >\startfrontmatter >> > >> > \setuppagenumbering >> > [location=] >> > >> > \definefont >> >[ChapterTextStyle] >> >[SansBold*default sa 2.2] >> > >> > \setuphead >> >[title] >> >[style=ChapterTextStyle, >> > align=flushright] >> > >> > \setuplist >> > [chapter] >> > [style=bold, >> > alternative=b, >> > width=1em] >> > >> > \setuplist >> > [section] >> > [margin=1em, >> > width=1.75em] >> > >> > \setuplist >> > [subsection] >> > [margin=2.75em, >> > width=2.25em, >> > distance=\spaceamount] >> > >> > >> > \starttitle[title=Table des matières] >> > >> > \placelist >> > [chapter,section,subsection,subsubsection] >> > [criterium=all, >> > interaction=all, >> > alternative=c] >> > >> >\stoptitle >> > >> > \stopfrontmatter >> > >> > \startbodymatter >> >\component[chapitre_1] >> >\component[chapitre_2] >> >\component[chapitre_3] >> >\component[chapitre_4] >> >\component[chapitre_5] >> >\component[chapitre_6] >> >\component[chapitre_7] >> >\component[chapitre_8] >> >\component[chapitre_9] >> >\component[chapitre_10] >> >\component[chapitre_11] >> >\component[chapitre_12] >> > \stopbodymatter >> > >> > \stopproduct >> > >> > >> > >> ___ >> > 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 >> > >> ___ >> >> -- >> >> - >>Hans Hagen | PRAGMA ADE >>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands >> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl >> - >> >> >> ___ >> If your question is of interest to others as well, please add an entry to >> the Wiki! >> >> maillist : ntg-context@ntg.nl / >> https://www.ntg.nl/mailman/listinfo/ntg-context >> webpage : https://www.pragma-ade.nl / http://context.aanhet.net >> archive : https://bitbucket.org/phg/context-mirror/commits/ >> wiki : https://contextgarden.net >> >> ___ >> > ___ 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] Table of contents not appearing.
Hi Hans, Alright, I'll compile by integrating one component at a time to figure out which one is causing the problem. Thanks. Fabrice Le jeu. 20 avr. 2023 à 15:52, Hans Hagen via ntg-context a écrit : > On 4/20/2023 6:59 PM, Fabrice Couvreur via ntg-context wrote: > > Hi, > > I don't see why the table of contents does not appear. On the other > > hand, the 12 chapters are present. > > \startproduct[terminale-manual] > > \startfrontmatter > \starttitle[title=Table des matières] > \placelist > [chapter,section,subsection,subsubsection] > [criterium=all, > interaction=all, > alternative=c] > \stoptitle > \stopfrontmatter > > \startbodymatter > \chapter{xxx} > \stopbodymatter > > \stopproduct > > shows a table of contents so it must be something in your components > > > Fabrice > > > > > > \startproduct[terminale-manual] > > > >\project[terminale-environment] > >\startfrontmatter > > > > \setuppagenumbering > > [location=] > > > > \definefont > >[ChapterTextStyle] > >[SansBold*default sa 2.2] > > > > \setuphead > >[title] > >[style=ChapterTextStyle, > > align=flushright] > > > > \setuplist > > [chapter] > > [style=bold, > > alternative=b, > > width=1em] > > > > \setuplist > > [section] > > [margin=1em, > > width=1.75em] > > > > \setuplist > > [subsection] > > [margin=2.75em, > > width=2.25em, > > distance=\spaceamount] > > > > > > \starttitle[title=Table des matières] > > > > \placelist > > [chapter,section,subsection,subsubsection] > > [criterium=all, > > interaction=all, > > alternative=c] > > > > \stoptitle > > > > \stopfrontmatter > > > > \startbodymatter > >\component[chapitre_1] > >\component[chapitre_2] > >\component[chapitre_3] > >\component[chapitre_4] > >\component[chapitre_5] > >\component[chapitre_6] > >\component[chapitre_7] > >\component[chapitre_8] > >\component[chapitre_9] > >\component[chapitre_10] > >\component[chapitre_11] > >\component[chapitre_12] > > \stopbodymatter > > > > \stopproduct > > > > > > > ___ > > 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 > > > ___ > > -- > > - >Hans Hagen | PRAGMA ADE >Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > - > > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > https://www.ntg.nl/mailman/listinfo/ntg-context > webpage : https://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : https://contextgarden.net > > ___ > ___ 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] Table of contents not appearing.
On 4/20/2023 6:59 PM, Fabrice Couvreur via ntg-context wrote: Hi, I don't see why the table of contents does not appear. On the other hand, the 12 chapters are present. \startproduct[terminale-manual] \startfrontmatter \starttitle[title=Table des matières] \placelist [chapter,section,subsection,subsubsection] [criterium=all, interaction=all, alternative=c] \stoptitle \stopfrontmatter \startbodymatter \chapter{xxx} \stopbodymatter \stopproduct shows a table of contents so it must be something in your components Fabrice \startproduct[terminale-manual] \project[terminale-environment] \startfrontmatter \setuppagenumbering [location=] \definefont [ChapterTextStyle] [SansBold*default sa 2.2] \setuphead [title] [style=ChapterTextStyle, align=flushright] \setuplist [chapter] [style=bold, alternative=b, width=1em] \setuplist [section] [margin=1em, width=1.75em] \setuplist [subsection] [margin=2.75em, width=2.25em, distance=\spaceamount] \starttitle[title=Table des matières] \placelist [chapter,section,subsection,subsubsection] [criterium=all, interaction=all, alternative=c] \stoptitle \stopfrontmatter \startbodymatter \component[chapitre_1] \component[chapitre_2] \component[chapitre_3] \component[chapitre_4] \component[chapitre_5] \component[chapitre_6] \component[chapitre_7] \component[chapitre_8] \component[chapitre_9] \component[chapitre_10] \component[chapitre_11] \component[chapitre_12] \stopbodymatter \stopproduct ___ 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 ___ -- - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Table of contents not appearing.
Hi, I don't see why the table of contents does not appear. On the other hand, the 12 chapters are present. Thanks Fabrice \startproduct[terminale-manual] \project[terminale-environment] \startfrontmatter \setuppagenumbering [location=] \definefont [ChapterTextStyle] [SansBold*default sa 2.2] \setuphead [title] [style=ChapterTextStyle, align=flushright] \setuplist [chapter] [style=bold, alternative=b, width=1em] \setuplist [section] [margin=1em, width=1.75em] \setuplist [subsection] [margin=2.75em, width=2.25em, distance=\spaceamount] \starttitle[title=Table des matières] \placelist [chapter,section,subsection,subsubsection] [criterium=all, interaction=all, alternative=c] \stoptitle \stopfrontmatter \startbodymatter \component[chapitre_1] \component[chapitre_2] \component[chapitre_3] \component[chapitre_4] \component[chapitre_5] \component[chapitre_6] \component[chapitre_7] \component[chapitre_8] \component[chapitre_9] \component[chapitre_10] \component[chapitre_11] \component[chapitre_12] \stopbodymatter \stopproduct ___ 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] Wrong prefix in cross references to formulas in external document
Dear Hans, Thank you for the nice and straightforward solution. I have tested it locally and it works. I hope it will be in the next release (should I do anything?). By the way, I have a couple of other small issues. I will describe them in detail in other threads of this mailing list if it is the right place to do so. Best regards, Yaroslav пн, 30 янв. 2023 г. в 12:52, Hans Hagen via ntg-context : > On 1/29/2023 5:03 PM, Yaroslav Beltukov via ntg-context wrote: > > Dear Hans and all contributors, > > > > I really appreciate ConTeXt for the right way to obtain high quality > > documents. I'm a theoretical physicist and I'm going to write a book. I > > think ConTeXt is the right choice to work with a number of formulas, > > figures and cross-references. The visual quality of formulas is better > > than in regular LaTeX. The new feature with formula autosplitting looks > > also very promising. For me it is important to obtain the high quality > > without a lot of manual tweaks of each formula for each given document > > format and figure placement. > > > > However, I have found a problem with references if I compile one > > component only. The references to formulas in other components have > > wrong prefixes, e.g. (2.1) instead of (3.1). Needless to say, the right > > formula references are very important. > > > > I started looking into this issue. The references to other components > > are taken from the whole product as from an external document. It turned > > out that this is a general problem with references with prefixes to > > external documents. The prefix is stored in a tuc file as a reference to > > a section as a sequential number of the header in the document. As a > > result, the prefix from the external document is calculated using the > > structure of the current document. > > > > Here is the MWE, which consists of two files: > > foo.tex: > > > > \defineenumeration[remark][prefix=yes, prefixsegments=chapter:section] > > > > \starttext > > > > Equations: \in[eq1], \in[eq2], \in[eq3], \in[eq4] > > > > Sections: \in[sec1], \in[sec2], \in[sec3], \in[sec4] > > > > Chapters: \in[chap1], \in[chap2], \in[chap3], \in[chap4] > > > > Remarks: \in[remark1], \in[remark2] > > > > \startbodymatter > > > > \chapter[chap1]{Chapter} > > \placeformula[eq1]\startformula x = y\stopformula > > \chapter[chap2]{Chapter} > > \section[sec1]{Section} > > \section[sec2]{Section} > > \placeformula[eq1]\startformula x = y\stopformula > > \placeformula[eq2]\startformula x = y\stopformula > > > > \stopbodymatter > > > > \startappendices > > > > \chapter[chap3]{Chapter} > > \section[sec3]{Section} > > \placeformula[eq3]\startformula x = y\stopformula > > \section[sec4]{Section} > > \startremark[remark1]\stopremark > > \placeformula[eq4]\startformula x = y\stopformula > > \startremark[remark2]\stopremark > > \chapter[chap4]{Chapter} > > > > \stopappendices > > > > \stoptext > > > > > > bar.tex: > > > > \starttext > > > > Equations: \in[foo::eq1], \in[foo::eq2], \in[foo::eq3], \in[foo::eq4] > > > > Sections: \in[foo::sec1], \in[foo::sec2], \in[foo::sec3], \in[foo::sec4] > > > > Chapters: \in[foo::chap1], \in[foo::chap2], \in[foo::chap3], > \in[foo::chap4] > > > > Remarks: \in[foo::remark1], \in[foo::remark2] > > > > % any chapters and sections here > > > > \stoptext > > > > It is expected to have the same first page on these documents: > > > > Equations: 1.1, 2.2, A.1, A.2 > > Sections: 2.1, 2.2, A.1, A.2 > > Chapters: 1, 2, A, B > > Remarks: A.2.1, A.2.2 > > > > However, the bar.tex produces wrong prefixes to formulas and remarks. > > The output depends on the document structure of bar.tex, not foo.tex. > > > > I started looking into the source code. Thanks to lua, it is not a big > > deal to track the problem. The prefixdata is complemented by the > > sectiondata after the loading the tuc file. So, the question is: is it > > possible to store the full prefixdata with all necessary prefix numbers > > in the tuc file? Here is my proposal to change the source code: > > > > --- strc-lst-old.lmt2023-01-29 11:30:15.610309948 +0300 > > +++ strc-lst.lmt2023-01-29 12:10:08.864228923 +0300 > > @@ -266,6 +266,16 @@ > > if r and not r.section then > > r.section = structures.sections.currentid() > > end > > +-- store sectiondata in prefixdata (necessary for extern
Re: [NTG-context] Wrong prefix in cross references to formulas in external document
On 1/29/2023 5:03 PM, Yaroslav Beltukov via ntg-context wrote: Dear Hans and all contributors, I really appreciate ConTeXt for the right way to obtain high quality documents. I'm a theoretical physicist and I'm going to write a book. I think ConTeXt is the right choice to work with a number of formulas, figures and cross-references. The visual quality of formulas is better than in regular LaTeX. The new feature with formula autosplitting looks also very promising. For me it is important to obtain the high quality without a lot of manual tweaks of each formula for each given document format and figure placement. However, I have found a problem with references if I compile one component only. The references to formulas in other components have wrong prefixes, e.g. (2.1) instead of (3.1). Needless to say, the right formula references are very important. I started looking into this issue. The references to other components are taken from the whole product as from an external document. It turned out that this is a general problem with references with prefixes to external documents. The prefix is stored in a tuc file as a reference to a section as a sequential number of the header in the document. As a result, the prefix from the external document is calculated using the structure of the current document. Here is the MWE, which consists of two files: foo.tex: \defineenumeration[remark][prefix=yes, prefixsegments=chapter:section] \starttext Equations: \in[eq1], \in[eq2], \in[eq3], \in[eq4] Sections: \in[sec1], \in[sec2], \in[sec3], \in[sec4] Chapters: \in[chap1], \in[chap2], \in[chap3], \in[chap4] Remarks: \in[remark1], \in[remark2] \startbodymatter \chapter[chap1]{Chapter} \placeformula[eq1]\startformula x = y\stopformula \chapter[chap2]{Chapter} \section[sec1]{Section} \section[sec2]{Section} \placeformula[eq1]\startformula x = y\stopformula \placeformula[eq2]\startformula x = y\stopformula \stopbodymatter \startappendices \chapter[chap3]{Chapter} \section[sec3]{Section} \placeformula[eq3]\startformula x = y\stopformula \section[sec4]{Section} \startremark[remark1]\stopremark \placeformula[eq4]\startformula x = y\stopformula \startremark[remark2]\stopremark \chapter[chap4]{Chapter} \stopappendices \stoptext bar.tex: \starttext Equations: \in[foo::eq1], \in[foo::eq2], \in[foo::eq3], \in[foo::eq4] Sections: \in[foo::sec1], \in[foo::sec2], \in[foo::sec3], \in[foo::sec4] Chapters: \in[foo::chap1], \in[foo::chap2], \in[foo::chap3], \in[foo::chap4] Remarks: \in[foo::remark1], \in[foo::remark2] % any chapters and sections here \stoptext It is expected to have the same first page on these documents: Equations: 1.1, 2.2, A.1, A.2 Sections: 2.1, 2.2, A.1, A.2 Chapters: 1, 2, A, B Remarks: A.2.1, A.2.2 However, the bar.tex produces wrong prefixes to formulas and remarks. The output depends on the document structure of bar.tex, not foo.tex. I started looking into the source code. Thanks to lua, it is not a big deal to track the problem. The prefixdata is complemented by the sectiondata after the loading the tuc file. So, the question is: is it possible to store the full prefixdata with all necessary prefix numbers in the tuc file? Here is my proposal to change the source code: --- strc-lst-old.lmt 2023-01-29 11:30:15.610309948 +0300 +++ strc-lst.lmt 2023-01-29 12:10:08.864228923 +0300 @@ -266,6 +266,16 @@ if r and not r.section then r.section = structures.sections.currentid() end + -- store sectiondata in prefixdata (necessary for external files) + if t.prefixdata and r.section then + local sectiondata = structures.sections.collected[r.section] + if sectiondata then + for k, v in next, sectiondata do + t.prefixdata[k] = v + end + end + end + -- local b = r and t.block if r and not b then local s = r.section --- strc-ref-old.lmt 2023-01-29 11:30:15.823643904 +0300 +++ strc-ref.lmt 2023-01-29 12:07:45.697109862 +0300 @@ -2318,7 +2318,17 @@ if data then numberdata = lists.reordered(data) -- data.numberdata if numberdata then - helpers.prefix(data,prefixspec) + -- helpers.prefix(data,prefixspec) + -- use the actual numbers from prefixdata + local prefixdata = data.prefixdata + if prefixdata then + -- adapted from helpers.prefix (not sure) + if (prefixspec and prefixspec == no) or prefixdata.prefix == no then + prefixdata = false + end + sections.typesetnumber(prefixdata,"prefix", prefixspec or false, prefixdata) + end + -- sections.typesetnumber(numberdata,"number",numberspec,numberdata) else local useddata = data.useddata After this small change, all the references are correct. How
Re: [NTG-context] Wrong prefix in cross references to formulas in external document
I, too, am struggling with external (and internal) references. I have created (and sent to Hans) a MWE that seems to identify two bugs: 1) External references: in a single product, some of these work, and *some* do not render the numbers (using \in{} [ref], for example). They are, however, identified as known or "verified". 2) Internal references: all render but *some* get "missing link target" errors (in the PDF viewer). I have not been able to get anywhere with the (lua) code, myself. Alan On Sun, 29 Jan 2023 19:03:32 +0300 Yaroslav Beltukov via ntg-context wrote: > Dear Hans and all contributors, > > I really appreciate ConTeXt for the right way to obtain high quality > documents. I'm a theoretical physicist and I'm going to write a book. > I think ConTeXt is the right choice to work with a number of formulas, > figures and cross-references. The visual quality of formulas is > better than in regular LaTeX. The new feature with formula > autosplitting looks also very promising. For me it is important to > obtain the high quality without a lot of manual tweaks of each > formula for each given document format and figure placement. > > However, I have found a problem with references if I compile one > component only. The references to formulas in other components have > wrong prefixes, e.g. (2.1) instead of (3.1). Needless to say, the > right formula references are very important. > > I started looking into this issue. The references to other components > are taken from the whole product as from an external document. It > turned out that this is a general problem with references with > prefixes to external documents. The prefix is stored in a tuc file as > a reference to a section as a sequential number of the header in the > document. As a result, the prefix from the external document is > calculated using the structure of the current document. > > Here is the MWE, which consists of two files: > foo.tex: > > \defineenumeration[remark][prefix=yes, prefixsegments=chapter:section] > > \starttext > > Equations: \in[eq1], \in[eq2], \in[eq3], \in[eq4] > > Sections: \in[sec1], \in[sec2], \in[sec3], \in[sec4] > > Chapters: \in[chap1], \in[chap2], \in[chap3], \in[chap4] > > Remarks: \in[remark1], \in[remark2] > > \startbodymatter > > \chapter[chap1]{Chapter} > \placeformula[eq1]\startformula x = y\stopformula > \chapter[chap2]{Chapter} > \section[sec1]{Section} > \section[sec2]{Section} > \placeformula[eq1]\startformula x = y\stopformula > \placeformula[eq2]\startformula x = y\stopformula > > \stopbodymatter > > \startappendices > > \chapter[chap3]{Chapter} > \section[sec3]{Section} > \placeformula[eq3]\startformula x = y\stopformula > \section[sec4]{Section} > \startremark[remark1]\stopremark > \placeformula[eq4]\startformula x = y\stopformula > \startremark[remark2]\stopremark > \chapter[chap4]{Chapter} > > \stopappendices > > \stoptext > > > bar.tex: > > \starttext > > Equations: \in[foo::eq1], \in[foo::eq2], \in[foo::eq3], \in[foo::eq4] > > Sections: \in[foo::sec1], \in[foo::sec2], \in[foo::sec3], > \in[foo::sec4] > > Chapters: \in[foo::chap1], \in[foo::chap2], \in[foo::chap3], > \in[foo::chap4] > > Remarks: \in[foo::remark1], \in[foo::remark2] > > % any chapters and sections here > > \stoptext > > It is expected to have the same first page on these documents: > > Equations: 1.1, 2.2, A.1, A.2 > Sections: 2.1, 2.2, A.1, A.2 > Chapters: 1, 2, A, B > Remarks: A.2.1, A.2.2 > > However, the bar.tex produces wrong prefixes to formulas and remarks. > The output depends on the document structure of bar.tex, not foo.tex. > > I started looking into the source code. Thanks to lua, it is not a > big deal to track the problem. The prefixdata is complemented by the > sectiondata after the loading the tuc file. So, the question is: is > it possible to store the full prefixdata with all necessary prefix > numbers in the tuc file? Here is my proposal to change the source > code: > > --- strc-lst-old.lmt2023-01-29 11:30:15.610309948 +0300 > +++ strc-lst.lmt2023-01-29 12:10:08.864228923 +0300 > @@ -266,6 +266,16 @@ > if r and not r.section then > r.section = structures.sections.currentid() > end > +-- store sectiondata in prefixdata (necessary for external files) > +if t.prefixdata and r.section then > +local sectiondata = structures.sections.collected[r.section] > +if sectiondata then > +for k, v in next, sectiondata do > +t.prefixdata[k] = v > +end > +end > +end > +-- > local b = r and t
[NTG-context] Wrong prefix in cross references to formulas in external document
Dear Hans and all contributors, I really appreciate ConTeXt for the right way to obtain high quality documents. I'm a theoretical physicist and I'm going to write a book. I think ConTeXt is the right choice to work with a number of formulas, figures and cross-references. The visual quality of formulas is better than in regular LaTeX. The new feature with formula autosplitting looks also very promising. For me it is important to obtain the high quality without a lot of manual tweaks of each formula for each given document format and figure placement. However, I have found a problem with references if I compile one component only. The references to formulas in other components have wrong prefixes, e.g. (2.1) instead of (3.1). Needless to say, the right formula references are very important. I started looking into this issue. The references to other components are taken from the whole product as from an external document. It turned out that this is a general problem with references with prefixes to external documents. The prefix is stored in a tuc file as a reference to a section as a sequential number of the header in the document. As a result, the prefix from the external document is calculated using the structure of the current document. Here is the MWE, which consists of two files: foo.tex: \defineenumeration[remark][prefix=yes, prefixsegments=chapter:section] \starttext Equations: \in[eq1], \in[eq2], \in[eq3], \in[eq4] Sections: \in[sec1], \in[sec2], \in[sec3], \in[sec4] Chapters: \in[chap1], \in[chap2], \in[chap3], \in[chap4] Remarks: \in[remark1], \in[remark2] \startbodymatter \chapter[chap1]{Chapter} \placeformula[eq1]\startformula x = y\stopformula \chapter[chap2]{Chapter} \section[sec1]{Section} \section[sec2]{Section} \placeformula[eq1]\startformula x = y\stopformula \placeformula[eq2]\startformula x = y\stopformula \stopbodymatter \startappendices \chapter[chap3]{Chapter} \section[sec3]{Section} \placeformula[eq3]\startformula x = y\stopformula \section[sec4]{Section} \startremark[remark1]\stopremark \placeformula[eq4]\startformula x = y\stopformula \startremark[remark2]\stopremark \chapter[chap4]{Chapter} \stopappendices \stoptext bar.tex: \starttext Equations: \in[foo::eq1], \in[foo::eq2], \in[foo::eq3], \in[foo::eq4] Sections: \in[foo::sec1], \in[foo::sec2], \in[foo::sec3], \in[foo::sec4] Chapters: \in[foo::chap1], \in[foo::chap2], \in[foo::chap3], \in[foo::chap4] Remarks: \in[foo::remark1], \in[foo::remark2] % any chapters and sections here \stoptext It is expected to have the same first page on these documents: Equations: 1.1, 2.2, A.1, A.2 Sections: 2.1, 2.2, A.1, A.2 Chapters: 1, 2, A, B Remarks: A.2.1, A.2.2 However, the bar.tex produces wrong prefixes to formulas and remarks. The output depends on the document structure of bar.tex, not foo.tex. I started looking into the source code. Thanks to lua, it is not a big deal to track the problem. The prefixdata is complemented by the sectiondata after the loading the tuc file. So, the question is: is it possible to store the full prefixdata with all necessary prefix numbers in the tuc file? Here is my proposal to change the source code: --- strc-lst-old.lmt2023-01-29 11:30:15.610309948 +0300 +++ strc-lst.lmt2023-01-29 12:10:08.864228923 +0300 @@ -266,6 +266,16 @@ if r and not r.section then r.section = structures.sections.currentid() end +-- store sectiondata in prefixdata (necessary for external files) +if t.prefixdata and r.section then +local sectiondata = structures.sections.collected[r.section] +if sectiondata then +for k, v in next, sectiondata do +t.prefixdata[k] = v +end +end +end +-- local b = r and t.block if r and not b then local s = r.section --- strc-ref-old.lmt2023-01-29 11:30:15.823643904 +0300 +++ strc-ref.lmt2023-01-29 12:07:45.697109862 +0300 @@ -2318,7 +2318,17 @@ if data then numberdata = lists.reordered(data) -- data.numberdata if numberdata then -helpers.prefix(data,prefixspec) +-- helpers.prefix(data,prefixspec) +-- use the actual numbers from prefixdata +local prefixdata = data.prefixdata +if prefixdata then +-- adapted from helpers.prefix (not sure) +if (prefixspec and prefixspec == no) or prefixdata.prefix == no then +prefixdata = false +end +sections.typesetnumber(prefixdata,"prefix", prefixspec or false, prefixdata) +end +-- sections.typesetnumber(numberdata,"number",numberspec,numberdata) else local useddata = data.useddata After this small change, all the references are correct. However, I'm quite new to ConTeXt, so maybe here are some caveats. It would be great to fix the references to formulas, especially
Re: [NTG-context] Structure: multi-volume products
Alan, I'm attaching the two master files used for the following (also ran cross refs between each vol.): Murugaiyan, Appasamy & Parlier-Renault, Édith (2021) (Eds) Whispering of Inscriptions: South Indian Epigraphy and Art History: Papers from an International Symposium in memory of Professor Noboru Karashima (Paris, 12–13 October 2017). Oxford: Indica et Buddhica. (2 vols) https://indica-et-buddhica.com/publications/murugaiyan-appasamy-parlier-renault-edith/whispering-of-inscriptions-south-indian-epigraphy-and-art-history Best, Richard -- T +6433121699 M +64210640216 rmaho...@indica-et-buddhica.org https://indica-et-buddhica.com/ Indica et Buddhica Littledene Bay Road Oxford NZ NZBN: 9429041761809 -Original Message- From: Alan Braslau via ntg-context Reply-To: mailing list for ConTeXt users To: mailing list for ConTeXt users Cc: Alan Braslau Subject: [NTG-context] Structure: multi-volume products Date: Thu, 15 Dec 2022 20:23:36 -0700 Mailer: Claws Mail 3.19.0 (GTK+ 2.24.33; amd64-portbld-freebsd13.1) X-Spam-Score: 0.0 Hello, I have a book project that is being cut into two volumes (because it is too long and will be sold as a boxed set). Each volume is presently a separate *product* in the project structure. I presently set the counters in the second volume using: \setupheadnumber [part] [2] \setupheadnumber [chapter] [5] (I have multiple [5] parts in the project, and the first volume ends with part 2 and chapter 5.) 1) Is this the right way to be handling this? 2) Any suggestions on how I can put a Table of Contents for the first volume in the second volume? Thanks! 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 __ _ % master000.tex – ConTeXt MkIV Module \startproduct master000 \project iebpmonographs \environment ieb-c-layout-000 \environment monograph-local-layout \usemodule[statistical-charts] % \enabletrackers[typesetters.suspects] % \showbodyfont % \showbodyfontenvironment \useexternaldocument[m001][master001][Whispering of Inscriptions, Vol.~{\sc ii}] \startfrontmatter \component tlpg000 { \setupheadtext[content=Contents of Vol.~i.] \setupheadertexts[Contents of Vol.~i.][pagenumber][pagenumber][Contents of Vol.~i.] \noheaderandfooterlines \completecontent \PY \PB } { \setupheadtext[tables=Tables of Vol.~i.] \setupheadertexts[Tables of Vol.~i.][pagenumber][pagenumber][Tables of Vol.~i.] \noheaderandfooterlines \completelistoftables \PY \PB } { \setupheadtext[figures=Figures of Vol.~i.] \setupheadertexts[Figures of Vol.~i.][pagenumber][pagenumber][Figures of Vol.~i.] \noheaderandfooterlines \completelistoffigures \PY } \component ackn % A. Murugaiyan & E. Parlier-Renault \component pref % A. Murugaiyan & E. Parlier-Renault \component intr % Y. Subbarayalu \stopfrontmatter \startbodymatter \setcounter[userpage][1] \component chp02 % Y. Subbarayalu \component chp01 % V. Gillet \component chp03 % G. Vijayavenugopal \component chp04 % E. Francis \component chp05 % N. Athiyaman \component chp06 % V. Selvakumar \component chp07 % S. Rajavelu \component chp08 % A. Murugaiyan \component chp09 % S. Brocquet \stopbodymatter % \startbackmatter % \component indx % \stopbackmatter \stopproduct % master001.tex – ConTeXt MkIV Module \startproduct master001 \project iebpmonographs \environment ieb-c-layout-001 \environment monograph-local-layout % \enabletrackers[typesetters.suspects] % \showbodyfont % \showbodyfontenvironment \useexternaldocument[m000][master000][Whispering of Inscriptions, Vol.~{\sc i}] \startfrontmatter \component tlpg001 { \setupheadtext[content=Contents of Vol.~ii.] \setupheadertexts[Contents of Vol.~ii.][pagenumber][pagenumber][Contents of Vol.~ii.] \noheaderandfooterlines \completecontent \PY \PB } { \setupheadtext[tables=Tables of Vol.~ii.] \setupheadertexts[Tables of Vol.~ii.][pagenumber][pagenumber][Tables of Vol.~ii.] \noheaderandfooterlines \completelistoftables \PY \PB } { \setupheadtext[figures=Figures of Vol.~ii.] \setupheadertexts[Figures of Vol.~ii.][pagenumber][pagenumber][Figures of Vol.~ii.] \noheaderandfooterlines \completelistoffigures \PY } \stopfrontmatter \startbodymatter \setcounter[userpage][1] \component chp10 % P. Estienne \component chp11 % V. Renganathan \component chp12 % C. Schmid \component chp13 % K. Rajan \component chp14 % A. Davrinche \component chp15 % M. Le Sauce-Carnis \component chp16 % V. Olivier \component chp17 % K. Ladrech \component chp18 % E. Par
Re: [NTG-context] Command line arguments on context project
Jethro Djan via ntg-context schrieb am 16.12.2022 um 17:14: Dear list, I am using the project structure to typeset my thesis. This is how the directory looks like: chapters/chapter1.tex chapters/chapter2.tex … output/ env_thesis.tex prd_main.tex ref.bib I didn’t use the project. 1. How do I specify output directory? context --runpath=output ... I have already seen the following thread: https://www.mail-archive.com/ntg-context@ntg.nl/msg101654.html It doesn’t seem to work on a project. So for example when I run mtxrun —path=output --script context ../prd_main, I get this error: tex error on line 5 in file /usr/local/texlive/2022/texmf-dist/doc/latex/buctthesis/chapter1.tex: ! Undefined control sequence How do you load the chapter file in your product file? The error message above appears because ConTeXt can't find the chapter file of your document and uses one with the same name from a documentation of a LaTeX class which has the same name. 2. How do I get CoTeXt to recognise the ref.bib file when I run the components not the product? For context, I don’t want the references printed at the end of each chapter but I would like the in-text citation to work (if that is possible). If not, is it possible compile the whole product but only output a certain page range? You need a reference to the environment file from within the component file, otherwise ConTeXt has no knowledge of the bib file. 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] synctex problem
Hi Alan, I have an almost identical set-up (M1, MacOS12.6, TexShop, useAlternatePath, useConTeXtSyncParser). One important difference, I use sync method: SyncTeX (TeX ≥ 2010) I’d recommend trying that. There are some other differences in my setup that probably are not important. At the beginning of my files (products and components)I only use the two lines % !TEX useAlternatePath % !TEX useConTeXtSyncParser not the root and TS-program lines, but I don’t think that matters for your SynchTeX issue. Here is the engine I use for LMTX, just in case it has something helpful for you. #!/bin/zsh # # This engine uses TeXShop's "Alternate Path", which is the variable "$3" below. # Set the TeXShop's alternate path to your ConTeXt installation in # TeXShop's Preferences -> Engine -> Alternate Path # Start ConTeXt source files with the lines: # % !TEX useAlternatePath # % !TEX useConTeXtSyncParser export OSFONTDIR=/Library/Fonts/:/System/Library/Fonts:$HOME/Library/Fonts export PATH="$3":$PATH mtxrun --autogenerate --script context --synctex "$1” I put that long comment in the engine because I share it with collaborators. Hope that helps! Gavin > On Oct 15, 2022, at 12:00 PM, Alan Bowen via ntg-context > wrote: > > At the top of a single source file, I have the lines: > % !TEX root = prd_Aestimatio-0301.tex % the root file > % !TEX TS-program = ConTeXt2021 > % !TEX useAlternatePath > % !TEX useConTeXtSyncParser >\setupsynctex[state=start, method=max] > > Syncing works well enough—though I can see no difference between method =min > and method=max, both highlight only a few words and not the entire text to be > synced, but perhaps my expectations are out of line. > > When I have these lines at the top of a component file and typeset the > product file, I get a rootfile.synctex file, but syncing itself goes awry. > Nothing happens when I sync from the PDf file to the component file, and when > I sync from the component file to the product PDF, I get the correct page but > no highlighting. > > I am using TeXShop ver. 5.03— > sync method: Both Pdf Sync and Search > Alternative Path: > /Users/bowen1/Applications/LuaMetaTeX/tex/texmf-osx-arm64/bin > > and also the latest ConteXt (ver. 2022.10.15 10:37 LMTX) under macOS 12.6 > (Apple M1 Pro chip) > > Note: the product file has only one component file for now. > > I suspect that I am missing something but am not sure where to look or what > to do now. Any guidance will be much appreciated. > > 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 > ___ ___ 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] synctex problem
At the top of a single source file, I have the lines: % !TEX root = prd_Aestimatio-0301.tex % the root file % !TEX TS-program = ConTeXt2021 % !TEX useAlternatePath % !TEX useConTeXtSyncParser \setupsynctex[state=start, method=max] Syncing works well enough—though I can see no difference between method =min and method=max, both highlight only a few words and not the entire text to be synced, but perhaps my expectations are out of line. When I have these lines at the top of a component file and typeset the product file, I get a rootfile.synctex file, but syncing itself goes awry. Nothing happens when I sync from the PDf file to the component file, and when I sync from the component file to the product PDF, I get the correct page but no highlighting. I am using TeXShop ver. 5.03— sync method: Both Pdf Sync and Search Alternative Path: /Users/bowen1/Applications/LuaMetaTeX/tex/texmf-osx-arm64/bin and also the latest ConteXt (ver. 2022.10.15 10:37 LMTX) under macOS 12.6 (Apple M1 Pro chip) Note: the product file has only one component file for now. I suspect that I am missing something but am not sure where to look or what to do now. Any guidance will be much appreciated. 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 ___
[NTG-context] \placelistofabbreviations - solved
The setup I offered in the previous email was all correct, but in a large project like a dictionary with 26 or more components there can always be something else that goes wrong! Component 'D' had an extra { in it, but oddly enough the component was compiling, except that I picked up an error message despite the fact it had compiled correctly. That one error was enough to throw things out of kilter, including the \placelistofabbreviations in an earlier component. Sorry for the noise Julian ___ 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] \placelistofabbreviations in project structure?
Hi, I wonder what I might be doing wrong for \placelistofabbreviations not to work in a project. Everything else about \definesysnonyms and indeed the project is working, but I seem unable to place the list correctly in the component that is intended to list all abbreviations. The main environment file for the project contains the definitions. e.g. \definesynonyms[abbreviation][abbreviations][\infull] \setupsynonyms[abbreviation][synonymstyle=\em] \abbreviation[adjp] {adjp.} {adjectival phrase} All dictionary components (A-Z) call on the main environment file where the above is defined and give me the correct result if I write \adjp\ or \infull{adjp} in any one of them. My MWE below for the (as yet not working) abbreviations component that contains the placelist command: \startcomponent 04_abbreviations \project project_Dictionary \startchapter[title={Abbreviations}] \placelistofabbreviations[criterium=all] \stopchapter \stopcomponent According to me that should work, but all I get is the chapter title. I also tried adding a state=start in case that was needed, but it did nothing. Julian ___ 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] new upload
(it is a bit of a pity that support for indic scripts is such a weird mix of font technology and engine dependent reshuffling ... probably also driven by limitations of open type at that time)> When using these fonts regularly, one notices very erratic formatting phenomena that must have to do with the Devanagarī font, or its interaction with (Xe)TeX. Perhaps this is the same phenomenon seen from the user side. In my case things improved when I switched to Adishila (in XeTeX): \newfontfamily\sanskritfont[Script=Devanagari,Mapping=RomDev,Scale=1.45]{AdishilaSan} This is, to my taste, the nicest Sanskrit font, but it is difficult to decide between Adishila and Shobhika. The Murty font is also quite good, but it is commercial and cannot be used for book production. I asked whether there was a way to get a licence, but at the time this was impossible. But the font team there recommended ``Sanskrit Text'' (Sansk.ttf) which is one of their products that made it into a Microsoft Windows Standard font (I am not using Windows). It is also very good, but Adishila works better for me. I cannot say how thrilled I am about the Indic support, thanks a lot to Kaushika! Best Jürgen - Nachricht von kauśika via ntg-context - Datum: Sat, 22 Jan 2022 16:08:10 +0530 Von: kauśika via ntg-context Antwort an: mailing list for ConTeXt users Betreff: Re: [NTG-context] new upload An: mailing list for ConTeXt users Cc: kauśika On Saturday, January 22, 2022 3:55:12 PM IST Hans Hagen via ntg-context wrote: Is there a font out there that supports all these scripts in one font? Shobhika font is a free font that has some of the largest number of glyphs (i.e has many conjuncts) for the Devanagari script. https://github.com/Sandhi-IITBombay/Shobhika The font also has a good Latin component based on PT Serif. This Latin part has good support for the roman (IAST) transliteration for Sanskrit. But strictly only the IAST spec character for Sanskrit are available. It also has glyphs for some commonly used mathematical symbols. Noto Serif Devanagari is also decent for just Devanagari (not sure of the IAST part). As for Sans typefaces, Mukta Devanagari is a free font: https://github.com/EkType/Mukta Of these, Shobhika has the best conjunct coverage. I will shortly update the wiki with a much more exhaustive list and report here. 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 ___ - Ende der Nachricht von kauśika via ntg-context - --- 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 ___
Re: [NTG-context] new upload
On Saturday, January 22, 2022 3:55:12 PM IST Hans Hagen via ntg-context wrote: > Is there a font out there that supports all these scripts in one font? Shobhika font is a free font that has some of the largest number of glyphs (i.e has many conjuncts) for the Devanagari script. https://github.com/Sandhi-IITBombay/Shobhika The font also has a good Latin component based on PT Serif. This Latin part has good support for the roman (IAST) transliteration for Sanskrit. But strictly only the IAST spec character for Sanskrit are available. It also has glyphs for some commonly used mathematical symbols. Noto Serif Devanagari is also decent for just Devanagari (not sure of the IAST part). As for Sans typefaces, Mukta Devanagari is a free font: https://github.com/EkType/Mukta Of these, Shobhika has the best conjunct coverage. I will shortly update the wiki with a much more exhaustive list and report here. 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] Malayalam conjuncts
On Sat, 01 Jan 2022 09:48:53 +0530 kauśika wrote: > On Friday, December 31, 2021 6:22:15 PM IST Ajith R via ntg-context > wrote: > > The conjuncts that are not formed > > correctly are those where the second component is ര U+0D30, > > followed by a symbol that is shown on the right side of the > > conjunct viz ാ U+0D3E, ി U+0D3F, ീ U+0D40, ു U+0D41, ൂ U+0D42. If > > no symbols follow, or symbols follow on the left or on both sides, > > the conjunct is well formed.In the minimum working example given 5 > > is well formed, while the first conjunct in 6 is well formed and > > second ill formed conjunct. > > I have been using ConTeXt to typeset documents in several Indic > languages and have run into similar issues (in many languages). > Please see this for a similar issue in some conjuncts for Devanagari: > https://www.mail-archive.com/ntg-context@ntg.nl/msg99691.html > > For what its worth, I have not had issues with some fonts while > issues with others persist. Some of these issues we can work around > as I have pointed out in the above posting. > > In almost all cases I encountered no issues while using Xe(La)Tex. > Based on some advise from Hans and reading about these OTF features > and their implementations in Indic fonts, I think these issues might > be due to differences in implementation. [Not entirely sure since I > am a novice]. My guess is that Harfbuzz (which is what Xe(La)TeX uses > by default) uses some heuristics to work out these conjuncts (?!). > > To answer your specific question regarding the conjuncts in the given > words you have to use some Unicode hacking to get what you want in > ConTeXt. > > In each of the following ZWS refers to the Unicode character > (zero-width space U+200B) > > 1. ശ്രീ > This is typeset correctly by writing > ശ്ര + > ZWS (U+200B) + > ീ > > 2. അശ്രു > Typeset correctly with > അശ്ര + > ZWS (U+200B) + > ൂ > > 3. ശുശ്രൂഷ > Typeset correctly with > ശുശ്ര + > ZWS (U+200B) + > ൂ + > ഷ > > 4. പ്രാസം > Typeset correctly with > പ്ര + > ZWS (U+200B) + > ാ + > സം > > 5. പ്രേയസി (rendered correctly as entered; no hacks necessary) > > 6. പ്രോഗ്രാം > Typeset correctly with > പ്രൊ + > ഗ്ര + > ZWS (U+200B) + > ാ + > ം > where the last character is the Malayalam Anusvara. > > Consider yet another example: > സാന്ദ്രാനന്ദാഅവബൊധാത്മകമ് > > Here the 'ന്ദ്രാ' conjunct is not typeset in ConTeXt. To fix this I > do ന്ദ്ര + > ZWS (U+200B) + > ാ > > This is what I have been doing to ensure correct typesetting of > Malayalam and other Indic languages in ConTeXt. Honestly, it is > inconvenient since the .tex files containing Unicode are no longer > sanitary. However, ConTeXt has so many remarkable features that the > very thought of having to go back to (Xe)LaTeX (just for harfbuzz > rendering) causes me immense pain. As far as I am concerned, in every > other way ConTeXt simply has no match in the (Xe)LaTeX world. In my > usage of ConTeXt for my academic work (in English with lots of > mathematics) I have encountered no issues. Even if I did there was > always some legitimate (non-hacky) fix for it. For me personally, the > rendering in Indic languages is the only pain point with ConTeXt > (which I am willing to live with). > > So I am willing to live with the drawbacks till the day they are > hopefully fixed. Anyway, I hope you can use these fixes temporarily. > For example, if your editor supports it, you can replace all glyphs > with this issue with the corresponding recipe involving ZWS. > > Dear Hans and other developers of ConTeXt, LuaTeX, > If you happen to see this please look into the font system (where it > concerns Indic systems). The present issue is very similar to the one > I posted about earlier: > https://www.mail-archive.com/ntg-context@ntg.nl/msg99691.html > I have described the issue and the hacks to fix it the best I can. In > case there is any other information that I can provide please let me > know. > > Best, > kauśika > > Hi Kausika, Your workaround seems to help, though it entails adding the ZWS throughout. Anyway, I agree with you in that even with this anomaly, Context is worth sticking to. Dear Hans and other developers of ConTeXt, LuaTeX, If a novice can help in any way to resolve this issue, please guide us how we can contribute. Thanks, 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] Malayalam conjuncts
On Friday, December 31, 2021 6:22:15 PM IST Ajith R via ntg-context wrote: > The conjuncts that are not formed > correctly are those where the second component is ര U+0D30, followed by > a symbol that is shown on the right side of the conjunct viz ാ U+0D3E, > ി U+0D3F, ീ U+0D40, ു U+0D41, ൂ U+0D42. If no symbols follow, or > symbols follow on the left or on both sides, the conjunct is well > formed.In the minimum working example given 5 is well formed, while the > first conjunct in 6 is well formed and second ill formed conjunct. I have been using ConTeXt to typeset documents in several Indic languages and have run into similar issues (in many languages). Please see this for a similar issue in some conjuncts for Devanagari: https://www.mail-archive.com/ntg-context@ntg.nl/msg99691.html For what its worth, I have not had issues with some fonts while issues with others persist. Some of these issues we can work around as I have pointed out in the above posting. In almost all cases I encountered no issues while using Xe(La)Tex. Based on some advise from Hans and reading about these OTF features and their implementations in Indic fonts, I think these issues might be due to differences in implementation. [Not entirely sure since I am a novice]. My guess is that Harfbuzz (which is what Xe(La)TeX uses by default) uses some heuristics to work out these conjuncts (?!). To answer your specific question regarding the conjuncts in the given words you have to use some Unicode hacking to get what you want in ConTeXt. In each of the following ZWS refers to the Unicode character (zero-width space U+200B) 1. ശ്രീ This is typeset correctly by writing ശ്ര + ZWS (U+200B) + ീ 2. അശ്രു Typeset correctly with അശ്ര + ZWS (U+200B) + ൂ 3. ശുശ്രൂഷ Typeset correctly with ശുശ്ര + ZWS (U+200B) + ൂ + ഷ 4. പ്രാസം Typeset correctly with പ്ര + ZWS (U+200B) + ാ + സം 5. പ്രേയസി (rendered correctly as entered; no hacks necessary) 6. പ്രോഗ്രാം Typeset correctly with പ്രൊ + ഗ്ര + ZWS (U+200B) + ാ + ം where the last character is the Malayalam Anusvara. Consider yet another example: സാന്ദ്രാനന്ദാഅവബൊധാത്മകമ് Here the 'ന്ദ്രാ' conjunct is not typeset in ConTeXt. To fix this I do ന്ദ്ര + ZWS (U+200B) + ാ This is what I have been doing to ensure correct typesetting of Malayalam and other Indic languages in ConTeXt. Honestly, it is inconvenient since the .tex files containing Unicode are no longer sanitary. However, ConTeXt has so many remarkable features that the very thought of having to go back to (Xe)LaTeX (just for harfbuzz rendering) causes me immense pain. As far as I am concerned, in every other way ConTeXt simply has no match in the (Xe)LaTeX world. In my usage of ConTeXt for my academic work (in English with lots of mathematics) I have encountered no issues. Even if I did there was always some legitimate (non-hacky) fix for it. For me personally, the rendering in Indic languages is the only pain point with ConTeXt (which I am willing to live with). So I am willing to live with the drawbacks till the day they are hopefully fixed. Anyway, I hope you can use these fixes temporarily. For example, if your editor supports it, you can replace all glyphs with this issue with the corresponding recipe involving ZWS. Dear Hans and other developers of ConTeXt, LuaTeX, If you happen to see this please look into the font system (where it concerns Indic systems). The present issue is very similar to the one I posted about earlier: https://www.mail-archive.com/ntg-context@ntg.nl/msg99691.html I have described the issue and the hacks to fix it the best I can. In case there is any other information that I can provide please let me know. Best, 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 ___
[NTG-context] Malayalam conjuncts
Hi, I am trying to prepare a moderate sized document in Malayalam using Context. Overall I have been successful. However, there are a few rough edges for which I need help. This is the first problem I face. When I use the font RIT-Rachana from https://rachana.org.in/, my preferred font, one set of conjuncts are not formed correctly, while the rest are formed properly. The conjuncts that are not formed correctly are those where the second component is ര U+0D30, followed by a symbol that is shown on the right side of the conjunct viz ാ U+0D3E, ി U+0D3F, ീ U+0D40, ു U+0D41, ൂ U+0D42. If no symbols follow, or symbols follow on the left or on both sides, the conjunct is well formed.In the minimum working example given 5 is well formed, while the first conjunct in 6 is well formed and second ill formed conjunct. The conjuncts are well formed when used in Libre Office with the same font. Also, other fonts, for example, those from smc.org don't have this problem. Unfortunately, they don't support all symbols. One of the developers of the font thinks that this is probably a bug in Context. Hence, the reason for posting here. \definefontfamily [malayalam] [rm] [RIT-Rachana] [features=malayalam-two] \setupbodyfont [malayalam] \starttext 1. ശ്രീ 2. അശ്രു 3. ശുശ്രൂഷ 4. പ്രാസം 5. പ്രേയസി 6. പ്രോഗ്രാം \stoptext I am working on Debian 11. The font version is the latest 1.3. The command context --version gives mtx-context | ConTeXt Process Management 1.04 mtx-context | mtx-context | main context file: /home/ajith/Downloads/context-linux-64/tex/texmf-context/tex/context/base/mkiv/context.mkiv mtx-context | current version: 2021.12.25 00:58 mtx-context | main context file: /home/ajith/Downloads/context-linux-64/tex/texmf-context/tex/context/base/mkxl/context.mkxl mtx-context | current version: 2021.12.25 00:58 Thanks, 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] Strange behavior with \startbodymatter ... \stopbodymatter
Fabrice Couvreur via ntg-context schrieb am 28.12.2021 um 15:34: Hi, In my file cours_premiere.tex if I indicate \startbodymatter \component[probabilites.tex] \stopbodymatter I get the following error message tex error > tex error on line 49 in file ./cours_premiere.tex: Undefined control sequence \pgfmath@settrigformat \pgfmath@settrigformat \pgfmath@settrigformat \pgfmath@settrigformat \stopbodymatter 39 [criterium=all, 40 interaction=all, 41 alternative=c] 42 43 \stoptitle 44 45 \stopfrontmatter 46 47 \startbodymatter 48 \component[probabilites.tex] 49 >> \stopbodymatter 50 51 52 \stopproduct The control sequence at the end of the top line of your error message was never \def'ed. You can just continue as I'll forget about whatever was undefined. mtx-context | fatal error: return code: 1 TeX Output exited abnormally with code 1 at Tue Dec 28 15:31:31 On the other hand, if I indicate \component[probabilites.tex] the file compiles without error. The error is about tikz/pgf and the mentioned command comes from pgfplots. To investigate further you have to create a minimal (non) working example. 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] Strange behavior with \startbodymatter ... \stopbodymatter
Hi, In my file cours_premiere.tex if I indicate \startbodymatter \component[probabilites.tex] \stopbodymatter I get the following error message tex error > tex error on line 49 in file ./cours_premiere.tex: Undefined control sequence \pgfmath@settrigformat \pgfmath@settrigformat \pgfmath@settrigformat \pgfmath@settrigformat \stopbodymatter 39[criterium=all, 40interaction=all, 41 alternative=c] 42 43 \stoptitle 44 45 \stopfrontmatter 46 47 \startbodymatter 48 \component[probabilites.tex] 49 >> \stopbodymatter 50 51 52 \stopproduct The control sequence at the end of the top line of your error message was never \def'ed. You can just continue as I'll forget about whatever was undefined. mtx-context | fatal error: return code: 1 TeX Output exited abnormally with code 1 at Tue Dec 28 15:31:31 On the other hand, if I indicate \component[probabilites.tex] the file compiles without error. Thanks Fabrice ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Solved: Book setup with LHS-side quotes before chapters/parts, header/footer issues, TOC, etc.
Thanks to Wolfgang Schuster and Bruce Horrocks I have now a working solution. I ended up following Bruce’s suggestion of doing a left hand side (LHS) page opposite the first (RHS) chapter or part page differently than using after/before modifications of the \chapter and \part setups as I had been doing years ago (but that book did not have parts and was done in mkii) The modification of \chapter and \part setups with before= and after= never worked in the \component setup in LMTX. Creating a separate command to run immediately before a \chapter or \part, as suggested by Bruce, was simpler and and turned out to be more robust. So, this single file example also works when \components are used. The only issues I have now left are very minimal. In the table of contents, the abstract for a part has some extra whitespace above, which the chapter abstracts don’t have. But that is not really a problem. And getting the part title somewhere more centred on its page is also left as an issue for later. Example file. In a project/component setup: everything before the \starttext goes into the environment file, the rest in the product file. %%% %%% Sections that have a LHS preface with a quote %%% \startsetups SectionLHSPageSetup \page[left] \setupheader[state=empty] \start \startalignment[left,nothyphenated] \startnarrower[4*left] \tf\it \stopsetups \definestartstop [SectionLHSPage] [ before={\setups{SectionLHSPageSetup}}, after={\stopnarrower \stopalignment\stop}] \define[1]\SectionPrequote{\startSectionLHSPage #1\stopSectionLHSPage} %%% %%% part is managed here %%% \defineconversionset [part] [Romannumerals] [numbers] \setuplabeltext[en][partlabel=Part~] \setuphead [part] [sectionsegments=part, bodypartlabel=partlabel, appendixlabel=, sectionconversionset=part, page=yes, header=empty, footer=empty, placehead=yes] \definelist[parttext] \setuplist[parttext][margin=1.3em,pagecommand=\gobbleoneargument] \define[1]\PartAbstract{\writetolist[parttext]{}{\start\itx#1\stop}} %%% %%% chapter is managed here %%% \definetext [chapterfooter] % name [footer]% vertical location [pagenumber]% content \setuplabeltext[en][appendixchapterlabel=Appendix~] \setuphead [chapter] [page=yes, header=empty, bodypartlabel=, appendixlabel=appendixchapterlabel, footer=chapterfooter, sectionsegments=chapter, before={\blank[force,2*big]}, after={\blank[3*big]}] \definelist[chaptertext] \setuplist[chaptertext][margin=1.3em,pagecommand=\gobbleoneargument] \define[1]\ChapterAbstract{\writetolist[chaptertext]{}{\start\itx#1\stop}} \defineresetset [default] [0,0] [1] \setupcombinedlist [content] [list={part,parttext,chapter,chaptertext}] \starttext \startfrontmatter \completecontent \SectionPrequote{If you think good architecture is expensive, try bad architecture\crlf {\tf Brian Foote and Joseph Yoder}} \startchapter[title={One}] \dorecurse{7}{\input tufte \par \input knuth} \stopchapter \stopfrontmatter \startbodymatter \dorecurse{3}{ \SectionPrequote{The world is not \rationals, it is \reals\crlf {\tf Gerben Wierda}} \part{Title title title} \PartAbstract{This is a part abstract.} \dorecurse{2}{ \SectionPrequote{If you think good architecture is expensive, try bad architecture\crlf {\tf Brian Foote and Joseph Yoder}} \startchapter[title={Two}] \ChapterAbstract{This is a chapter abstract.} \dorecurse{5}{\input tufte \par \input knuth} \stopchapter } } \stopbodymatter \startappendices \defineresetset[default][0,1][1] %% reset , chapter, but not part \setuphead[part][number=no] \SectionPrequote{The world is not \rationals, it is \reals\crlf {\tf Gerben Wierda}} \part{Title title title} \PartAbstract{This is a part abstract.} \dorecurse{2}{ \SectionPrequote{If you think good architecture is expensive, try bad architecture\crlf {\tf Brian Foote and Joseph Yoder}} \startchapter[title={Two}] \ChapterAbstract{This is a chapter abstract.} \dorecurse{5}{\input tufte \par \input knuth} \stopchapter } \stopappendices \stoptext In a component setup, a part component may look like this: \startcomponent p_partone \product prd_book \project project_book \SectionPrequote{The world is not \rationals, it is \reals\crlf {\tf Gerben Wierda}} \part{Title title title} \PartAbstract{This is a part abstract for a normal part.} \component c_chapter \component c_chapter \stopcomponent and a chapter component like this: \startcomponent c_chapter \product prd_book \project project_book \starttext \SectionPrequote{If you think good architecture is expensive, try bad architecture\crlf {\tf Brian Foote and Joseph Yoder}} \chapter{An Inconvenient Truth} \ChapterAbstract{This is a chapter abstract.} \setupindenting[next] \placeinitial I{\kap{\bf n the half}} century or so that human kind has had IT, the IT sector has increasingly wrestled with the fact that IT projects often fail in one
Re: [NTG-context] Compilation error with the new version of lmtx
On 10/16/2021 7:34 PM, Fabrice Couvreur via ntg-context wrote: Hi, The latest version of lmtx does not allow me to compile the following file although there was no problem before. Thank you Fabrice \startproduct[expertes-manual] \startfrontmatter \setuppagenumbering [location=] \definefont [ChapterTextStyle] [SansBold*default sa 2.2] \setuphead [title] [style=ChapterTextStyle, align=flushright] \setuplist [chapter] [style=bold, alternative=b, width=1em] \setuplist [section] [margin=1em, width=1.75em] \setuplist [subsection] [margin=2.75em, width=2em, distance=\spaceamount] \starttitle[title=Table des matières] \placelist [chapter,section,subsection] [criterium=all, interaction=all, alternative=c] \stoptitle \stopfrontmatter \startbodymatter \component[chapter_1] \component[chapter_2] \stopbodymatter \stopproduct ## tex error > tex error on line 1 in file ./expertes.tex: Undefined control sequence \undefined i need a better example - 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] Compilation error with the new version of lmtx
Hi, The latest version of lmtx does not allow me to compile the following file although there was no problem before. Thank you Fabrice \startproduct[expertes-manual] \startfrontmatter \setuppagenumbering [location=] \definefont [ChapterTextStyle] [SansBold*default sa 2.2] \setuphead [title] [style=ChapterTextStyle, align=flushright] \setuplist [chapter] [style=bold, alternative=b, width=1em] \setuplist [section] [margin=1em, width=1.75em] \setuplist [subsection] [margin=2.75em, width=2em, distance=\spaceamount] \starttitle[title=Table des matières] \placelist [chapter,section,subsection] [criterium=all, interaction=all, alternative=c] \stoptitle \stopfrontmatter \startbodymatter \component[chapter_1] \component[chapter_2] \stopbodymatter \stopproduct ## tex error > tex error on line 1 in file ./expertes.tex: Undefined control sequence \undefined \relax \p_maxwidth \dostarttagged \t!listcontent \empty \clf_listtitle {\currentlist }\currentlistindex \relax \dostoptagged \strc_lists_limitated_text #1->\edef \p_maxwidth {\listparameter \c!maxwidth }\ifempty \p_maxwidth \listparameter \c!textcommand {#1} \else \listparameter \c!textcommand {\limitatetext {#1}\p_maxwidth {\splitsymbol {\listparameter \c!limittext }}}\fi \22>:140>:abc ...rence_attribute \v!text \strc_lists_set_style_color \c!textstyle \c!textcolor \v!text \the \t_lists_every_renderingtext \the \t_lists_every_renderingsynchronize \setstrut \begstrut \strc_lists_limitated_text \currentlistentrytitle \endstrut \en ... \currentlistextra ...\begingroup \ifempty \m_strc_list_alternative \edef \currentlistalternative {\listparameter \c!alternative }\else \let \currentlistalternative \m_strc_list_alternative \fi \directsetup {\listalternativeparameter \c!renderingsetup } \relax \endgr ... ... alternative=c] 1 >> \startproduct[expertes-manual] 2 3 \startfrontmatter 4 5 \setuppagenumbering 6[location=] 7 8 \definefont 9 [ChapterTextStyle] 10 [SansBold*default sa 2.2] 11 The control sequence at the end of the top line of your error message was never \def'ed. You can just continue as I'll forget about whatever was undefined. mtx-context | fatal error: return code: 256 TeX Output exited abnormally with code 1 at Sat Oct 16 19:28:21 ___ 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 upload
Hi, This midweek upload has something new. There has been some discussion about footnotes and one thing I noticed when playing with some new possibilities is that the stretch in topskip (we use a default amount that long ago was derived from plain tex and is relative to the body font size) influences the pagebreaks in relation to inserts (footnotes) in a more significant way than one would expect. I also noticed that this stretch component is one of the reasons why sometimes a side float shape will carry over to a next page in spite of there being room. This relates to \brokenpenalty. At the end of this mail are some tests that demonstrate this. As a consequence we now have a "ntop" parameter as well as a shaping related penalty primitives (parameters): \shapingpenaltiesmode"FF% set all (future) bits (currently 4) \shapingpenalty\plushundred % don't go too high which is currently not enabled by default but might be in upcoming versions; this also depends on user feedback. It's a non intrusive extension the LuaMetaTeX engine. I have this setting in my local preferences file. Hans % test code (for Massimiliano and Hraban to play with) \starttext \showframe % this is the current default behaviour; we have a topskip with % quite some stretch and that stretch is taken into account % when tex calculates the badness; watch the next page \dorecurse{4}{ \bgroup \shapingpenaltiesmode\zerocount \showmakeup[penalty] \placefigure[left]{}{} \input tufte \par \egroup } \page EMPTY \page % the ntop is new and when >= 0 it is a multiplier for the number % of lines stretch, here we have one line; watch the next page \dorecurse{4}{ \bgroup \shapingpenaltiesmode\zerocount \setupinterlinespace[ntop=1] \showmakeup[penalty] \placefigure[left]{}{} \input tufte \par \egroup } \page EMPTY \page % these shaping parameters will discourage a linebreak within a % shape; the placement macro checked available space but that % doesn't mean that there can be no linebreak \dorecurse{4}{ \bgroup \showmakeup[penalty] \shapingpenaltiesmode"FF\relax \shapingpenalty\plushundred \placefigure[left]{}{} \input tufte \par \egroup } \page EMPTY \page % the next pages show the effect of changed topskip on page breaks % with footnotes \dorecurse{10}{ [#1] \input tufte \footnote{\input{tufte}} \par } \page EMPTY \page \setupinterlinespace[ntop=2] \dorecurse{10}{ [#1] \input tufte \footnote{\input{tufte}} \par } \page EMPTY \page \setupinterlinespace[ntop=0] \dorecurse{10}{ [#1] \input tufte \footnote{\input{tufte}} \par } \stoptext - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] How not to display the header of the chapter page on the page with the table of contents ?
Fabrice Couvreur via ntg-context schrieb am 16.08.2021 um 12:18: Hi Wolfgang, Pablo's solution works, but I tried yours without success. Here are the main lines of my project begin project \startproject[terminale-environment] \environment[terminale-style] ... \stopproject end project Do you need a project file? begin component \project[terminale-environment] \startcomponent[terminale_recurrence] ... \endcomponent end component You ignored the order for \startcomponent and \project. The environment (or project) file has to be loaded *after* \startcomponent, otherwise the *component mode is set after the style is already loaded. Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] How not to display the header of the chapter page on the page with the table of contents ?
Hi Wolfgang, Pablo's solution works, but I tried yours without success. Here are the main lines of my project begin product \startproduct[terminale-manual] \project[terminale-environment] \startdocument \startfrontmatter ... \stopfrontmatter \startbodymatter \component[terminale_recurrence] ... \stopbodymatter \stopdocument \stopproduct end product begin project \startproject[terminale-environment] \environment[terminale-style] ... \stopproject end project begin component \project[terminale-environment] \startcomponent[terminale_recurrence] ... \endcomponent end component begin environment \startenvironment[terminale-style] ... \startsetups [section:chapter] \setuphead [chapter] [align=flushright, textcommand=\groupedcommand{\blank[medium]}{}, numbercolor=darkgray, textstyle=ChapterTextStyle, numberstyle=ChapterNumberStyle, before=\startChapterFrame, after=\stopChapterFrame, header=high] \stopsetups \startsectionblockenvironment [bodypart] \directsetup{section:chapter} \stopsectionblockenvironment \doifmode{*component}{\directsetup{section:chapter}} ... \endenvironment end environment Le dim. 15 août 2021 à 19:03, Wolfgang Schuster via ntg-context < ntg-context@ntg.nl> a écrit : > Pablo Rodriguez via ntg-context schrieb am 15.08.2021 um 18:33: > > On 8/15/21 6:02 PM, Fabrice Couvreur via ntg-context wrote: > >> A small note : this method works if I compile the project but if I > >> compile only one chapter, the header no longer appears. > > Hi Fabrice, > > > > I have never used projects and chapters (or whatever the right name is). > > > > I’m not sure I get what you’re experiencing: with a single chapter, do > > you have the fancy layout or not? > > > > It would make sense that the fancy chapter doesn’t appear only compiling > > a chapter. I guess there is no \startbodymatter...\stopbodymatter > > wrapping it. > > > > Another approach would be: > > > > [...] > > Setting values for \title is a way to avoid the chapter setup for the > table of contents etc. > but there is a way to set values which are used only when you process a > component file. > > To make it work one has to load the environment file after > \startcomponent because you > can use the *component mode to check whether the parent file is a > product or a component. > > begin product > \startproduct [*] > > \environment [...] > > \startfrontmatter > ... > \stopfrontmatter > > \startbodymatter > \component [...] > \stopbodymatter > > \stopproduct > end product > > begin component > \startcomponent [*] > > \environment [...] > > ... > > \stopcomponent > end component > > begin environment > \startenvironment [*] > > \startsetups [section:chapter] > > \setuphead > [chapter] > [...] > > \stopsetups > > \startsectionblockenvironment [bodypart] > \directsetup{section:chapter} > \stopsectionblockenvironment > > \doifmode{*component}{\directsetup{section:chapter}} > > \stopenvironment > end environment > > Wolfgang > > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] How not to display the header of the chapter page on the page with the table of contents ?
Pablo Rodriguez via ntg-context schrieb am 15.08.2021 um 18:33: On 8/15/21 6:02 PM, Fabrice Couvreur via ntg-context wrote: A small note : this method works if I compile the project but if I compile only one chapter, the header no longer appears. Hi Fabrice, I have never used projects and chapters (or whatever the right name is). I’m not sure I get what you’re experiencing: with a single chapter, do you have the fancy layout or not? It would make sense that the fancy chapter doesn’t appear only compiling a chapter. I guess there is no \startbodymatter...\stopbodymatter wrapping it. Another approach would be: [...] Setting values for \title is a way to avoid the chapter setup for the table of contents etc. but there is a way to set values which are used only when you process a component file. To make it work one has to load the environment file after \startcomponent because you can use the *component mode to check whether the parent file is a product or a component. begin product \startproduct [*] \environment [...] \startfrontmatter ... \stopfrontmatter \startbodymatter \component [...] \stopbodymatter \stopproduct end product begin component \startcomponent [*] \environment [...] ... \stopcomponent end component begin environment \startenvironment [*] \startsetups [section:chapter] \setuphead [chapter] [...] \stopsetups \startsectionblockenvironment [bodypart] \directsetup{section:chapter} \stopsectionblockenvironment \doifmode{*component}{\directsetup{section:chapter}} \stopenvironment end environment Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Referencing fonts by path within ConTeXt
Joey McCollum via ntg-context schrieb am 07.08.2021 um 22:29: Hi, I'm interested in packaging a ConTeXt project in a self-contained way, so that the environment/component/project .tex files, the bibliography .bib file(s), and fonts used for typesetting are all provided in one place. (The goal is that others can generate the PDFs themselves from the source files as long as they have a sufficiently recent version of ConTeXt installed.) The usual ConTeXt directory structure makes sense for most of this, but it doesn't address the possibility of accessing fonts locally. I think I could do this with a script that temporarily sets the OSFONTDIR variable to the local fonts directory and then invokes ConTeXt to typeset the project-level file, but I was wondering if there is an easier way to do this from within ConTeXt. Specifically, is there a way to specify a font via a local path with font setup commands in an environment file? You can use \usefontpath[...] to set a directory where ConTeXt searches for fonts but this works only when you use a typescript and not for \definefontfamily. 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] Referencing fonts by path within ConTeXt
> Am 07.08.2021 um 22:29 schrieb Joey McCollum via ntg-context > : > > Hi, > > I'm interested in packaging a ConTeXt project in a self-contained way, so > that the environment/component/project .tex files, the bibliography .bib > file(s), and fonts used for typesetting are all provided in one place. (The > goal is that others can generate the PDFs themselves from the source files as > long as they have a sufficiently recent version of ConTeXt installed.) The > usual ConTeXt directory structure makes sense for most of this, but it > doesn't address the possibility of accessing fonts locally. I think I could > do this with a script that temporarily sets the OSFONTDIR variable to the > local fonts directory and then invokes ConTeXt to typeset the project-level > file, but I was wondering if there is an easier way to do this from within > ConTeXt. Specifically, is there a way to specify a font via a local path with > font setup commands in an environment file? You can just specify your fonts in the typescript as [file:relative_path/fontname.otf]. OSFONTDIR isn’t as reliable as you need "mtxrun --script fonts --reload" after changing it (and sometimes "mtxrun --generate" before). Hraban ___ 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] Referencing fonts by path within ConTeXt
Hi, I'm interested in packaging a ConTeXt project in a self-contained way, so that the environment/component/project .tex files, the bibliography .bib file(s), and fonts used for typesetting are all provided in one place. (The goal is that others can generate the PDFs themselves from the source files as long as they have a sufficiently recent version of ConTeXt installed.) The usual ConTeXt directory structure makes sense for most of this, but it doesn't address the possibility of accessing fonts locally. I think I could do this with a script that temporarily sets the OSFONTDIR variable to the local fonts directory and then invokes ConTeXt to typeset the project-level file, but I was wondering if there is an easier way to do this from within ConTeXt. Specifically, is there a way to specify a font via a local path with font setup commands in an environment file? Thank you! Joey ___ 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] Moving the old book-structure to a recent ConTeXt
Gerben Wierda schrieb am 16.07.2021 um 15:51: Is there a new template I can download somewhere to start from scratch? There is no template but show below a example for a document which uses the project structure. The examples are just my own preference and there are many ways to change them to fit your own style. 1. File names In the example all sub files (style + chapters) start with the name of the main file and append a sub name. Another popular naming scheme is to prefix the files with c_ (component), p_ (product) or s_ (style/environment). To avoid problems should also try to use only ASCII characters for the file names and avoid anything which is special in TeX, using spaces or extra periods should be avoided as well. 2. Arguments for \component etc. In my example I passed the argument to \component, \startproduct etc. in square brackets but this is only a alternative form to older way, where you passed it without the brackets. Both \component document-xxx and \component [document-xxx] are valid and you can use whatever you prefer. 3. Position of \environment In my example I load the environment-file after \startproduct and \startcomponent but it's also possible to load it before them. There are reasons for both positions and when you choose one you should keep it for all files. 4. \startdocument In my product file I added a document-environment, while it isn't necessary in this case it provides a nice hook to insert a title page for your document. begin document.tex \startproduct [*] \environment [document-environment] \startdocument % \startfrontmatter % % load components with table of contents, introduction etc. % % \stopfrontmatter \startbodymatter \component [document-xxx] \stopbodymatter \stopdocument \stopproduct end document.tex begin document-environment.tex \startenvironment [*] % sub directory for images % % \setupexternalfigures % [directory=...] % % sub directories for components % % \usepath % [...] % put you setups here \stopenvironment end document-environment.tex begin document-xxx.tex \startcomponent [*] \environment [document-environment] % put your content here \stopcomponent end document-xxx.tex 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] Project structure: Specifying environment in component
I’ll look into this, and post to the list once I’ve made the changes so others can comment. Denis Von: ntg-context Im Auftrag von jethro Reuel Gesendet: Mittwoch, 9. Juni 2021 14:49 An: mailing list for ConTeXt users Betreff: Re: [NTG-context] Project structure: Specifying environment in component Thanks. Maybe a change of how the wiki is worded is needed. On 9 Jun 2021, at 12:07 PM, denis.ma...@unibe.ch<mailto:denis.ma...@unibe.ch> wrote: I’ve also struggled with this before as you can see if you search the mailing list. My question: https://www.mail-archive.com/ntg-context@ntg.nl/msg97763.html Wolfgang’s answer : https://www.mail-archive.com/ntg-context@ntg.nl/msg97775.html We should probably change the wiki to make it clear that no inheritance of environments happens here. Denis Von: ntg-context mailto:ntg-context-boun...@ntg.nl>> Im Auftrag von mastermind_ x Gesendet: Mittwoch, 9. Juni 2021 13:36 An: ntg-context@ntg.nl<mailto:ntg-context@ntg.nl> Betreff: [NTG-context] Project structure: Specifying environment in component Hello everyone, I am creating a project of notes across different areas of mathematics I am studying and the structure looks like this: env_notes.tex project_notes.tex geogroups/groups-prd_geometry-groups.tex geogroups/groups-c_chapter1.tex I am following this wiki: https://wiki.contextgarden.net/Project_structure My question is: Why do I need to specify \environment env_notes before It works at the component level? The wiki didn’t say that. Plus it is already specified at the product level. Thanks. ~Jethro ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl<mailto: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] Project structure: Specifying environment in component
Thanks. Maybe a change of how the wiki is worded is needed. > On 9 Jun 2021, at 12:07 PM, denis.ma...@unibe.ch wrote: > > > I’ve also struggled with this before as you can see if you search the mailing > list. > My question: https://www.mail-archive.com/ntg-context@ntg.nl/msg97763.html > Wolfgang’s answer : > https://www.mail-archive.com/ntg-context@ntg.nl/msg97775.html > > We should probably change the wiki to make it clear that no inheritance of > environments happens here. > > Denis > > Von: ntg-context Im Auftrag von mastermind_ x > Gesendet: Mittwoch, 9. Juni 2021 13:36 > An: ntg-context@ntg.nl > Betreff: [NTG-context] Project structure: Specifying environment in component > > Hello everyone, > > I am creating a project of notes across different areas of mathematics I am > studying and the structure looks like this: > > env_notes.tex > project_notes.tex > geogroups/groups-prd_geometry-groups.tex > geogroups/groups-c_chapter1.tex > > > I am following this wiki: https://wiki.contextgarden.net/Project_structure > > > My question is: Why do I need to specify > \environment env_notes > before It works at the component level? The wiki didn’t say that. Plus it is > already specified at the product level. Thanks. > > > ~Jethro > ___ > 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] Project structure: Specifying environment in component
I’ve also struggled with this before as you can see if you search the mailing list. My question: https://www.mail-archive.com/ntg-context@ntg.nl/msg97763.html Wolfgang’s answer : https://www.mail-archive.com/ntg-context@ntg.nl/msg97775.html We should probably change the wiki to make it clear that no inheritance of environments happens here. Denis Von: ntg-context Im Auftrag von mastermind_ x Gesendet: Mittwoch, 9. Juni 2021 13:36 An: ntg-context@ntg.nl Betreff: [NTG-context] Project structure: Specifying environment in component Hello everyone, I am creating a project of notes across different areas of mathematics I am studying and the structure looks like this: env_notes.tex project_notes.tex geogroups/groups-prd_geometry-groups.tex geogroups/groups-c_chapter1.tex I am following this wiki: https://wiki.contextgarden.net/Project_structure My question is: Why do I need to specify \environment env_notes before It works at the component level? The wiki didn’t say that. Plus it is already specified at the product level. Thanks. ~Jethro ___ 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] Project structure: Specifying environment in component
Hello everyone, I am creating a project of notes across different areas of mathematics I am studying and the structure looks like this: env_notes.tex project_notes.tex geogroups/groups-prd_geometry-groups.tex geogroups/groups-c_chapter1.tex I am following this wiki: https://wiki.contextgarden.net/Project_structure My question is: Why do I need to specify \environment env_notes before It works at the component level? The wiki didn’t say that. Plus it is already specified at the product level. Thanks. ~Jethro___ 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] \setcharacterspacing
Hi, Wolgang— The mwe files in a product/component structure are attached. Everything works as desired with the current env file. If one comments out the startsetups...\stopsetups, the guillemets are not properly spaced in the body text, while those in the footnote are fine. If one comments out the \setup line, the guillemets are not properly placed anywhere. Please let me know if this is expected behavior— and I will try troubleshooting my own files to see why my env file has to have the \startsetups...\stopsetups line and the component file, the \setup line if I am to get what I need. Alan On Mon, May 17, 2021 at 4:00 PM Wolfgang Schuster < wolfgang.schuster.li...@gmail.com> wrote: > Alan Bowen schrieb am 17.05.2021 um 21:50: > > That is very good to know and it works in simple cases. But I am finding > that in a product/component structure, I get the proper spacing only when > • the environment file has the \startsetups...\stopsetups > • either \setup[test] or \setuplanguage[fr][setups=test] is in the > component file. > > Is this expected behavior? > > (Before I just \setcharacterspacing[test] in the env file but now it only > works when in the component file) > > > Can you make a simple example, it's possible there is a reset somewhere > which disables the feature at the end of the environment or the start of > the component file. > > 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 > > ___ > c_CharSpTest.tex Description: TeX document prd_CharSpTest.tex Description: TeX document env_CharSpTest.tex Description: TeX 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] \setcharacterspacing
Alan Bowen schrieb am 17.05.2021 um 21:50: That is very good to know and it works in simple cases. But I am finding that in a product/component structure, I get the proper spacing only when • the environment file has the \startsetups...\stopsetups • either \setup[test] or \setuplanguage[fr][setups=test] is in the component file. Is this expected behavior? (Before I just \setcharacterspacing[test] in the env file but now it only works when in the component file) Can you make a simple example, it's possible there is a reset somewhere which disables the feature at the end of the environment or the start of the component file. 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] \setcharacterspacing
That is very good to know and it works in simple cases. But I am finding that in a product/component structure, I get the proper spacing only when • the environment file has the \startsetups...\stopsetups • either \setup[test] or \setuplanguage[fr][setups=test] is in the component file. Is this expected behavior? (Before I just \setcharacterspacing[test] in the env file but now it only works when in the component file) Alan On Mon, May 17, 2021 at 3:11 PM Wolfgang Schuster < wolfgang.schuster.li...@gmail.com> wrote: > Alan Bowen schrieb am 17.05.2021 um 20:57: > > Wolfgang—Thank you. That works very nicely! > > You can also remove the \startsetups and \stopsetups commands to enable > the spacing. > > When you want the spacing only for certain languages you can use > \setuplanguage to load the setups-block for them: > > \setuplanguage >[fr] >[setups=test] > > \starttext > > «anyword» > > {\fr «anyword»} > > \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 > > ___ > ___ 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 running ConTeXt from TeX Live 2019 on Alpine Linux 3.12
= "0", -- 0 1 2 3 -- In an edit cycle it can be handy to launch an editor. The -- preferred one can be set here. -- ["pdfview.method"] = "okular", -- default (often acrobat) xpdf okular }, experiments = { ["fonts.autorscale"] = "yes", }, trackers = { }, }, } ~ # find / -name texmf.cnf /usr/share/texmf-dist/web2c/texmf.cnf ~ # cat /usr/share/texmf-dist/web2c/texmf.cnf % original texmf.cnf -- runtime path configuration file for kpathsea. % Public domain. % % If you modify this original file, YOUR CHANGES WILL BE LOST when it is % updated. Instead, put your changes -- and only your changes, not an % entire copy! -- in ../../texmf.cnf. That is, if this file is % installed in /some/path/to/texlive/2020/texmf-dist/web2c/texmf.cnf, % add your custom settings to /some/path/to/texlive/2020/texmf.cnf. % (Below, we use in place of the specific year.) % % What follows is a super-summary of what this .cnf file can % contain. Please read the Kpathsea manual for more information. % % Each statement in this file boils down to: % [.] [=] % % Neither the nor the may be empty. % Any identifier (sticking to A-Za-z_ for names is safest) can be assigned. % The `=' (and surrounding spaces) is optional. % $foo (or ${foo}) in a value expands to the envvar or cnf value of foo. % Lines can be continued with a \; no whitespace removal is done. % % Earlier entries (in the same or another file) override later ones, and % an environment variable foo overrides any texmf.cnf definition of foo. % % All definitions are read before anything is expanded, so you can use % variables before they are defined. % % If a variable assignment is qualified with `.PROGRAM', it is ignored % unless the current executable (last filename component of argv[0]) is % named PROGRAM. This foo.PROGRAM construct is not recognized on the % right-hand side. For environment variables, use FOO_PROGRAM. % % Which file formats use which paths for searches is described in the % various programs' and the Kpathsea documentation (http://tug.org/kpathsea). % % // means to search subdirectories (recursively). % A leading !! means to look only in the ls-R db, never on the disk. % In this file, either ; or : can be used to separate path components. % A leading/trailing/doubled path separator in the paths will be % expanded into the compile-time default. Probably not what you want. % % Brace notation is supported, for example: /usr/local/{mytex,othertex} % expands to /usr/local/mytex:/usr/local/othertex. % Part 1: Search paths and directories. % This is the parent directory of our several trees, i.e., % /usr/local/texlive/ in the original TeX Live distribution. % % The path definitions here assume the directories are organized % according to the TeX Directory Structure (http://tug.org/tds). % % Redistributors will probably want $SELFAUTODIR/share, i.e., /usr/share. % Kpathsea sets (in kpathsea/progname.c): % SELFAUTOLOC (directory of the binary=/usr/local/texlive//bin/i386-linux), % SELFAUTODIR (its parent = /usr/local/texlive//bin), % SELFAUTOPARENT (its grandparent = /usr/local/texlive/), and % SELFAUTOGRANDPARENT (its great-grandparent = /usr/local/texlive). % Sorry for the off-by-one-generation names. TEXMFROOT = /usr/share % The main tree of distributed packages and programs: TEXMFDIST = $TEXMFROOT/texmf-dist % We used to have a separate /texmf tree with some core programs and files. % Keep the variable name. TEXMFMAIN = $TEXMFDIST % Local additions to the distribution trees. TEXMFLOCAL = $SELFAUTOGRANDPARENT/texmf-local % TEXMFSYSVAR, where *-sys store cached runtime data. TEXMFSYSVAR = $TEXMFROOT/texmf-var % TEXMFSYSCONFIG, where *-sys store configuration data. TEXMFSYSCONFIG = $TEXMFROOT/texmf-config % Per-user texmf tree(s) -- organized per the TDS, as usual. To define % more than one per-user tree, set this to a list of directories in % braces, as described above. (This used to be HOMETEXMF.) ~ expands % to %USERPROFILE% on Windows, $HOME otherwise. TEXMFHOME = ~/texmf % TEXMFVAR, where texconfig/updmap/fmtutil store cached runtime data. TEXMFVAR = ~/.texlive2020/texmf-var % TEXMFCONFIG, where texconfig/updmap/fmtutil store configuration data. TEXMFCONFIG = ~/.texlive2020/texmf-config % This is the value manipulated by tlmgr's auxtrees subcommand in the % root texmf.cnf. Kpathsea warns about a literally empty string for a % value, hence the empty braces. TEXMFAUXTREES = {} % List all the texmf trees. For an explanation of what they are, see the % TeX Live manual. % % For texconfig to work properly, TEXMFCONFIG and TEXMFVAR should be named % explicitly and before other trees. % % TEXMFLOCAL precedes TEXMFDIST because locally-installed versions % should take precedence over distributio
Re: [NTG-context] font message?
On 4/26/2021 12:37 PM, Hans van der Meer wrote: I get the following message in the log (latest beta): fonts > ! fonts > ! check count_components with mkiv ! fonts > ! These are my font settings: \definefontfeature [default] [default] [itlc=yes] \setupbodyfont[schola,10pt] \setupitaliccorrection [text] What does it mean? Is there something I should do? it's more for myself ... component lists done differently ... when you nothing strange, just ignore it Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ 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] Suppressing headers and footers on blank pages before pagebreak at the end of a chapter.
rh...@t-online.de schrieb am 07.04.2021 um 20:20: Hi list, I typeset my first project with ConTeXt, a small booklet with some chapters, frontmatter, no headers, but pagenumbers in the middle of the footers. I use two environment files. The text is split into component TeX-files. All is structured by a project and a product file. Now I have run in some problems, I couldn’t solve with the garden and the archives of this and stackexchange’s list. But I’m sure that it is almost too simple for you experts. Let’s start with one. As intended, a new chapter starts on a right/odd page. If the chapter before ends on a right page, too, there should be a blank left/even page. But in my case there is the pagenumber in the footer – which looks more horrible than an orphan line. A. Which setting in which setup or definition gives a command like: suppress/skip/hide the header, footer and margin of last page of a chapter, if the text area is empty. B. More elaborate, a set of commands could – distinguish between headers, footers, an margins and – extend the commands on those pages at the end of the chapters – that do not show any text within the last line of the text area, i. e. the very last page of a chapter (even, but whith some text) – or the second last page (odd, with some text, before a complete blank even page). A book design according to (A) is standard. I’m sure there is a solution in ConTeXt. (B) can be found often, at least in books from pre-computer times. You have to change the argument of the page-setting for chapters. \setuppagenumbering [alternative=doublesided] \setuphead [chapter] [page={yes,header,footer,right}] \starttext \startchapter[title=Knuth] \dorecurse{10}{\samplefile{knuth}} \stopchapter \startchapter[title=Zapf] \dorecurse{10}{\samplefile{zapf}} \stopchapter \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] Suppressing headers and footers on blank pages before pagebreak at the end of a chapter.
Hi list, I typeset my first project with ConTeXt, a small booklet with some chapters, frontmatter, no headers, but pagenumbers in the middle of the footers. I use two environment files. The text is split into component TeX-files. All is structured by a project and a product file. Now I have run in some problems, I couldn’t solve with the garden and the archives of this and stackexchange’s list. But I’m sure that it is almost too simple for you experts. Let’s start with one. As intended, a new chapter starts on a right/odd page. If the chapter before ends on a right page, too, there should be a blank left/even page. But in my case there is the pagenumber in the footer – which looks more horrible than an orphan line. A. Which setting in which setup or definition gives a command like: suppress/skip/hide the header, footer and margin of last page of a chapter, if the text area is empty. B. More elaborate, a set of commands could – distinguish between headers, footers, an margins and – extend the commands on those pages at the end of the chapters – that do not show any text within the last line of the text area, i. e. the very last page of a chapter (even, but whith some text) – or the second last page (odd, with some text, before a complete blank even page). A book design according to (A) is standard. I’m sure there is a solution in ConTeXt. (B) can be found often, at least in books from pre-computer times. Ralf ___ 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] Nested structure of files loaded by input
> Am 30.03.2021 um 10:23 schrieb > : >> BTW I’d strongly suggest to use the project structure (environment, >> products, components) in such cases, but that doesn’t change this. > > I use environments, but in that particular case there's no need for products > and components. (OTOH, with components I probably wouldn't have noticed that > things go off the rails here as \component doesn't complain about missing > files...) You’re right, that’s a common trap. Got me recently when I typeset a novel and missed one chapter (component) because the filename had a typo that I didn’t copy to the product... Hraban ___ 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] Nested structure of files loaded by input
> -Ursprüngliche Nachricht- > Von: ntg-context Im Auftrag von Henning > Hraban Ramm > Gesendet: Dienstag, 30. März 2021 10:14 > An: mailing list for ConTeXt users > Betreff: Re: [NTG-context] Nested structure of files loaded by input > > > > > Am 30.03.2021 um 09:43 schrieb denis.ma...@ub.unibe.ch: > > What am I missing ? Does \input resolve filenames according to the CWD, > not to the location itself is located ? > > Nothing. You need to decide from where you want to run your files. Ok, thank you. > > BTW I’d strongly suggest to use the project structure (environment, > products, components) in such cases, but that doesn’t change this. I use environments, but in that particular case there's no need for products and components. (OTOH, with components I probably wouldn't have noticed that things go off the rails here as \component doesn't complain about missing files...) Denis ___ 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] filter module / externalizing TikZ graphics
Finally coming back to this. > Am 31.01.2021 um 07:39 schrieb Aditya Mahajan : > >> I’m not yet sure what would make the most sense for this project (at least >> sorting by chapter/component would), but I have an use case with LilyPond >> where I could save several LilyPond compile runs if I could influence the >> naming: >> >> I got ~500 songs in their own component files, and I use them in different >> songbooklets with the same layout. E.g. there’s one containing all the songs >> and several with a subject (e.g. winter & christmas, children, medieval & >> fantasy, some author...). >> They all use [name=\currentcomponent]. If I could avoid the JOBNAME part of >> the file name, all booklets would use the same note PDFs. Now, the temp >> directory contains literally thousands of files. >> Since this is just for fun, the additional space and compile time is just a >> bit annoying and doesn’t affect others, but I like to streamline my >> workflows... > > This is a relatively simple feature to add. I have pushed a new branch with > this feature: https://github.com/adityam/filter/tree/prefix > > I have added a new `prefix` option: you can use > > \defineexternalfilter[][prefix=whatever] > > and then the filter module will write the temp name as `whateverfilter0.ext` > `whateverfilter1.ext`. The default value of prefix is \jobname-temp- (note > trailing dash), so there should be no difference in the default output, but > now you can configure the prefix if you want. That’s good, so if I set "prefix=,", I get "FILTER-COMPONENT.*", e.g. "lilypond-mysong-1.pdf" (LilyPond adds the number for each system). In the rare cases where component names collide or I need more than one filter environment per component, I can fix that manually. > I am also open to making filter name as part of the prefix, so that you can > have the ability to remove it if you wish. But I am hesitant to do so because > it can lead to hard to debug errors if there is a clash in the prefix of two > different filters. Not needed IMO. > I haven't tested it beyond simple tests to make sure that nothing breaks. > You can copy t-filter.mkiv from > https://raw.githubusercontent.com/adityam/filter/prefix/t-filter.mkiv to your > working directory and test if works for your situation. Works for me. Thank you very much! For the TikZ setup I’ll copy some of your code and sacrifice most of the configurability. Will report back... Hraban ___ 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] Fwd: Re: LMTX 2021.03.02 | cross reference to an external file | \pagereference
Wolfgang [and Hans ], I'm attaching a minimal(ish) example of a project structure with a call to \pagereference. One can see from the output of master000.tex that the cross references to an external file all work, *apart* from the call to \pagereference. (This is the same issue that I am having with my two volume proceedings.) I'd be grateful for suggestions. Best, Richard % testproject.tex -- LMTX 2021.03.02 \startproject testproject \product testproduct000 \product testproduct001 \stopproject % master000.tex -- LMTX 2021.03.02 \startproduct testproduct000 \project testproject \startbodymatter \component boo.tex \stopbodymatter \stopproduct % master001.tex -- LMTX 2021.03.02 \startproduct testproduct001 \project testproject \startbodymatter \component foo.tex \stopbodymatter \stopproduct % boo.tex -- LMTX 2021.03.02 \startcomponent boo \project testproject \product testproduct000 \useexternaldocument[m001][master001][Test Product, Vol.~{\sc ii}] \chapter[oeps]{oeps} test \from[m001], \in{Ch.~}[m001::one], \at{page}[m001::one] {[}test page one{]} test \from[m001], \in{Ch.~}[m001::one], \at{page}[m001::page- reference] {[}test {\bf pagereference}{]} test \from[m001], \in{Ch.~}[m001::two], \at{page}[m001::two] {[}test page two{]} \stopcomponent % foo.tex -- LMTX 2021.03.02 \startcomponent foo \project testproject \product testproduct001 \chapter[one]{one} \pagereference[page-reference]foo \chapter[two]{two} foo \stopcomponent Forwarded Message From: Richard Mahoney Reply-To: Richard Mahoney , mailing list for ConTeXt users To: ntg-context@ntg.nl Subject: Re: [NTG-context] LMTX 2021.03.02 | cross reference to an external file | \pagereference Date: Fri, 05 Mar 2021 12:02:54 +1300 Mailer: Evolution 3.36.5 Organization: Indica et Buddhica X-Spam-Score: 0.0 Thanks Wolfgang, Hans kindly sent me a simple minimal. I've adjusted it to include a call to \pagereference and it works. I'm currently trying to test my project to see why my own calls to \pagereference do not result in any output, despite the fact that all the calls to the reference ids in chapters work as expected. I'm imagining at this point that it has something to do with using two master files --one for each volume-- with multiple includes (\components) for each chapter -- the \pagereference code appears in a number of the components. I'll try to set up a simple example replicating the file structure I'm using and then send it through. Best, Richard -- T +6433121699 M +64210640216 E rmaho...@indica-et-buddhica.org IM https://t.me/rmahoney W https://indica-et-buddhica.org/ Indica et Buddhica Littledene Bay Road Oxford NZ -Original Message- From: Wolfgang Schuster Reply-To: mailing list for ConTeXt users To: mailing list for ConTeXt users Subject: Re: [NTG-context] LMTX 2021.03.02 | cross reference to an external file | \pagereference Date: Thu, 4 Mar 2021 22:35:46 +0100 Mailer: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 PostboxApp/7.0.47 X-Spam-Score: 0.0 Richard Mahoney schrieb am 04.03.2021 um 09:04: > > Readers, > > > I'm working on a couple of volumes of papers set up and generated > separately (though within the same project). Some of the papers > in > the second volume make cross references to papers in the first. > Now this is working well so long as the reference is to the > details > associated with, say, a chapter, using \about, \in, and \at. Its > doesn't > seem to work though with \pagereference: no page number appears > in the PDF whatsoever. I have been following the material here: > > > > https://wiki.contextgarden.net/References#References_to_an_external_file > > > I'm wondering then ... do cross references to an external file > work > with \pagereference? > > Hi Richard, I just tested \pagereference in a simple example and had no problem to get the page numbers from the other document. Without a minimal example there is no way to tell what's missing in your document. 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 a
Re: [NTG-context] outputting components in their own PDFs
What exactly do you need? You can just process each component on its own. With a makefile or shell script, batch file, that should be easy enough. Or, do you need to have correct cross references, page numbers, etc.? I was asking a similar question two days ago, and Hans showed me how to add information to the log file: \writestatus{!}{SPLIT HERE: \the\realpageno} You should be then able to extract the split points from the log file and extract the components from the complete PDF. Or, if you know that you will need to split your document at certain structure elements (chapters, sections or so), it's even simpler. The lua script below will split your PDF at each chapter. It uses pdftk for splitting, but it should be easy to adapt this to context's own mechanism mentioned by Hans in the other thread. Denis -- mit welchen Dateien arbeiten wir? local base = assert(arg[1], "Keine Datei angegeben") local pdf = base .. ".pdf" local tuc = base .. ".tuc" -- import .tuc-file /extension lua local utilitydata = dofile(tuc) local breakpoints = {} local last_page = utilitydata.structures.counters.collected["realpage"][1][1] print ("Letzte Seite: " .. last_page) -- iterate over .tuc => get breakpoints for index, content in pairs(utilitydata.structures.lists.collected) do if (content["titledata"]["label"] == "chapter") then table.insert(breakpoints,content["references"]["realpage"]) end end -- welches sind die Breakpoints? print("Wir haben folgende Breakpoints:") for index, content in pairs(breakpoints) do print (content) end -- wie viele Breakpoint haben wir? function tablelength(T) local count = 0 for _ in pairs(T) do count = count + 1 end return count end local breakpoints_length = tablelength(breakpoints) print ("Wir haben " .. breakpoints_length .. " Breakpoints.") -- Extraktionsbereiche festlegen local extractions = {} for index, breakpoint in pairs(breakpoints) do region = {} local startregion = breakpoint local nextstartregion = breakpoints[index + 1] local stopregion; if (nextstartregion == nil) then stopregion = last_page else stopregion = nextstartregion - 1 end region["start"] = startregion region["stop"] = stopregion table.insert(extractions,region) end print ("Wir extrahieren ...") for index, region in pairs(extractions) do print("von " .. region["start"] .. " bis " .. region["stop"]) local outputfile = "article" .. index .. ".pdf" local extract_command = "pdftk " .. pdf .. " cat " .. region["start"] .. "-" .. region["stop"] .. " output " .. outputfile os.execute(extract_command) end Von: ntg-context Im Auftrag von Alan Bowen Gesendet: Montag, 1. März 2021 22:38 An: mailing list for ConTeXt users Betreff: [NTG-context] outputting components in their own PDFs I have a project-component setup and need to produce a single PDF file containing all the components as well as a PDF file for each component. The single file is easy. Is there a way to automate the generation of the PDF files for the individual components? Alan ___ 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] outputting components in their own PDFs
I have a project-component setup and need to produce a single PDF file containing all the components as well as a PDF file for each component. The single file is easy. Is there a way to automate the generation of the PDF files for the individual components? Alan ___ 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] Project Structure - inheritance rules for environments
denis.ma...@ub.unibe.ch schrieb am 28.02.2021 um 23:09: Hi, I’m just having a look a project structure again. I am using the example given in the wiki: https://wiki.contextgarden.net/Project_structure, i.e., in my component I’m linking to the product, but not to the project. Now I was expecting that the component inherits the environment set in the project via the product. The wiki currently explains: “If you tex (compile) one single component (e.g. a chapter of a book) or product (e.g. one volume of a magazine), the environment file of the project is used.” That does not seem to be the case here. Can anyone confirm this? Is this a bug or does the wiki needs to be revised? The \product command doesn't load any files because it doesn't make any sense. Let us take a look at the following example. When you process only a single component and \product would load the parent file you're running in a problem because the parent file is now loading the previous component file etc. This would end in a loop and to prevent this \product lines are ignored. There are ways to avoid this by redefining \component etc. when the parent file is loaded but it's a mess to take care about all combinations in which files are loaded. The best thing you can do here is to load the environment file in each product and component because the file is only loaded once on the first call. When you use multiple environment files you can collect them in a project file and use \project to load only one file but this is seldom needed. begin product.tex \startproduct * \environment environment \component component_1 \component component_2 \stopproduct end product.tex begin component_1.tex \startcomponent * \environment environment ... \stopcomponent end component_1.tex 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] Project structure light
denis.ma...@ub.unibe.ch schrieb am 01.03.2021 um 17:54: Hi, another question regarding project structure. I want to put each chapter of a book in a component or a distinct file loaded with \input, but I don’t want to have a full project structure. Just a main file and the chapters. Nevertheless, I want to load the environment file in each subfile. Is that possible or will that cause problems? There is no problem with this method because environment files are loaded only once, all further attempts to load the same file are ignored. Even though replacing \input with \component can be useful because \component doesn't generate a error when the given file doesn't exist. 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] Project structure light
On 3/1/2021 5:54 PM, denis.ma...@ub.unibe.ch wrote: Hi, another question regarding project structure. I want to put each chapter of a book in a component or a distinct file loaded with \input, but I don’t want to have a full project structure. Just a main file and the chapters. Nevertheless, I want to load the environment file in each subfile. Is that possible or will that cause problems? Best, Denis main.tex -- \environment test \starttext \input chapter1 \stoptext -- chapter1.tex -- \environment test \starttext Some text. \stoptext many of the manuals are that way, just look in the doc subtree for examples Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Project structure light
Hi, another question regarding project structure. I want to put each chapter of a book in a component or a distinct file loaded with \input, but I don't want to have a full project structure. Just a main file and the chapters. Nevertheless, I want to load the environment file in each subfile. Is that possible or will that cause problems? Best, Denis main.tex -- \environment test \starttext \input chapter1 \stoptext -- chapter1.tex -- \environment test \starttext Some text. \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] Project Structure - inheritance rules for environments
Hi, I'm just having a look a project structure again. I am using the example given in the wiki: https://wiki.contextgarden.net/Project_structure, i.e., in my component I'm linking to the product, but not to the project. Now I was expecting that the component inherits the environment set in the project via the product. The wiki currently explains: "If you tex (compile) one single component (e.g. a chapter of a book) or product (e.g. one volume of a magazine), the environment file of the project is used." That does not seem to be the case here. Can anyone confirm this? Is this a bug or does the wiki needs to be revised? Best, Denis ___ 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] midi
> Am 04.02.2021 um 15:55 schrieb Mojca Miklavec > : > > I kept misusing Lilypond for generating the MIDIs, and either Timidity (and > something else that I forgot the name of, even though I think I packaged it > for MacPorts) fluidsynth, I guess. > Lilypond was a good-enough approximation / similar user experience as what > ConTeXt provides for typesetting text, which is why I never requested support > for music in ConTeXt. A good support for > \startlily > c d e f > \stoplily > and passing the work to lilypond should be more than enough (I have an > impression that I've already seen some code doing exactly that). see https://wiki.contextgarden.net/LilyPond That’s what I’m using for my songbooklets. I don’t create MIDI this way, even if it would be easy, because I keep pure LilyPond files that include MIDI setup – if I copy or compose a song, it’s much easier and faster to work in Frescobaldi and compile only LilyPond. If it’s complete, I copy the melody into a ConTeXt component – not a perfekt workflow. > I always used full-page scores, so I didn't really need support for short > snippets either. Since LilyPond can create single-system PDFs, I leave page breaking to ConTeXt. > Anyway, reading midi is probably straightforward, but it really sounds like a > too limited feature unless one could use video/audio output or music > typesetting (which is hard enough and outside of scope of ConTeXt, I would > say). It usually makes no sense to typeset music directly from a MIDI file, there’s too much information missing (e.g. time, measures, repeats) or subject to individual interpretation. There’s midi2ly.py included with LilyPond, but it usually makes more sense to re-type the music. Hraban ___ 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] filter module / externalizing TikZ graphics
On Sat, 30 Jan 2021, Henning Hraban Ramm wrote: > >> If I use \starttikz[name=example], I get > >> "JOBNAME-temp-tikzThick-example.tmp". > >> I’d like to get something like "COMPONENTNAME-##-example.tmp" or a path > >> like "COMPONENTNAME/example_##.tmp". > >> Is there a configuration hook in the module to change name generation? > > > > No. I don't quite understand the concern. How do you plan to use a > > `name=value` option? > > The current auto-generated file names are uncomfortably long, and I’d like to > know which contains what. The idea was to avoid clash of names. That is why the file name starts with \jobname. I also want to avoid clash if you use multiple filters in the same file (a common use case for my projects), hence there is filtername. The -temp- is there because at some point context used to delete \jobname-temp-.tmp files if you passed the --purge option, but I see that it is no longer the case. Maybe that can be removed from the default name. The last part are the numbers, which are needed when caching results. > I’m not yet sure what would make the most sense for this project (at least > sorting by chapter/component would), but I have an use case with LilyPond > where I could save several LilyPond compile runs if I could influence the > naming: > > I got ~500 songs in their own component files, and I use them in different > songbooklets with the same layout. E.g. there’s one containing all the songs > and several with a subject (e.g. winter & christmas, children, medieval & > fantasy, some author...). > They all use [name=\currentcomponent]. If I could avoid the JOBNAME part of > the file name, all booklets would use the same note PDFs. Now, the temp > directory contains literally thousands of files. > Since this is just for fun, the additional space and compile time is just a > bit annoying and doesn’t affect others, but I like to streamline my > workflows... This is a relatively simple feature to add. I have pushed a new branch with this feature: https://github.com/adityam/filter/tree/prefix I have added a new `prefix` option: you can use \defineexternalfilter[][prefix=whatever] and then the filter module will write the temp name as `whateverfilter0.ext` `whateverfilter1.ext`. The default value of prefix is \jobname-temp- (note trailing dash), so there should be no difference in the default output, but now you can configure the prefix if you want. I am also open to making filter name as part of the prefix, so that you can have the ability to remove it if you wish. But I am hesitant to do so because it can lead to hard to debug errors if there is a clash in the prefix of two different filters. I haven't tested it beyond simple tests to make sure that nothing breaks. You can copy t-filter.mkiv from https://raw.githubusercontent.com/adityam/filter/prefix/t-filter.mkiv to your working directory and test if works for your situation. 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] filter module / externalizing TikZ graphics
> Am 30.01.2021 um 00:13 schrieb Aditya Mahajan : > > For \processFILTER, t-filter does not even read the file... so it has to do > with how the filtercommand is defined. > >> Since this fails already, I don’t know if \processFILTERfile also uses >> bufferbefore/-after (it should). > > It does not. As I said, for processing external files, t-filter does not even > read the file and just takes care of caching the result. It is assumed that > the filter command can process the external file. A pity. I didn’t understand that from the documentation. That means I need to setup different filters for internal and external graphics with the same content. > I can see if it is possible to active before and after filters while > processing external files. That would solve this problem for me and would make the behavior of filter commands more consistent. OTOH I can understand you don’t want to bloat your module. > Another option is to write the external files as valid tex file (i.e., with a > \startTEXpage .. \stopTEXpage wrapper), and when defining the filtercommand, > use something like `context --environment=env filename`, where env is the > environment file with all the settings for fonts etc. I don’t see this as an option, as we try to avoid code duplication over hundreds of graphics snippets. The \start/stop environment, as well as external files, should just contain the TikZ commands. All common setup/teardown code belongs in extra files/buffers. >> (2) working directory >> >> Since ConTeXt can’t put generated (temporary) files into a directory and >> --result also only renames afterwards, the directory key doesn’t help, I had >> to add "mv" and "cd" to my filtercommand. >> I didn’t check yet if caching works. > > Caching should work if \definefilter is configured correctly. Thanks. > From the point of view of t-filter module, this is a bug in the external > program and you should contact upstream for a fix :-) Yes. There were already several requests about ConTeXt using work/temp directories and changing the behavior of "--result". > Most (all?) other programs are happy to write a file in any directory (modulo > write permissions, etc.). > I do not want to increase the complexity of the module to handle such corner > cases. I can understand that. I should probably let filter call an external script, or fork t-filter for my needs. >> If I use \starttikz[name=example], I get >> "JOBNAME-temp-tikzThick-example.tmp". >> I’d like to get something like "COMPONENTNAME-##-example.tmp" or a path like >> "COMPONENTNAME/example_##.tmp". >> Is there a configuration hook in the module to change name generation? > > No. I don't quite understand the concern. How do you plan to use a > `name=value` option? The current auto-generated file names are uncomfortably long, and I’d like to know which contains what. I’m not yet sure what would make the most sense for this project (at least sorting by chapter/component would), but I have an use case with LilyPond where I could save several LilyPond compile runs if I could influence the naming: I got ~500 songs in their own component files, and I use them in different songbooklets with the same layout. E.g. there’s one containing all the songs and several with a subject (e.g. winter & christmas, children, medieval & fantasy, some author...). They all use [name=\currentcomponent]. If I could avoid the JOBNAME part of the file name, all booklets would use the same note PDFs. Now, the temp directory contains literally thousands of files. Since this is just for fun, the additional space and compile time is just a bit annoying and doesn’t affect others, but I like to streamline my workflows... >> (4) subprocess parameters >> >> I’d like to forward some parameters from \starttikz to the temp buffer, e.g. >> \starttikz[name=example][mystyle=thick] >> (using the same syntax as \startsection with a second pair of brackets for >> custom parameters). >> And then have >> \starttikzpicture[\filterusersetupvariable{mystyle}] >> in the buffer. >> >> My workaround so far is a copy of the filter setup (tikz/tikzThick), since >> we have only a few different configurations. > > The code that I had posted already handles this, provided that the options > start on the line after \startfilter: Ah, I didn’t look closely enough. Thank you, that’s an usable workaround. Best, Hraban ___ 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] externalizing TikZ graphics
On Mon, 2021-01-25 at 16:42 +0100, Henning Hraban Ramm wrote: > Hi, > > did anyone succeed in externalizing TikZ graphics with ConTeXt? The external library is LaTeX-only and that unfortunately won't change because it heavily relies on implementation detail of LaTeX's output routine. > It’s about a project with hundreds of diagrams that (in the current state) > clutter the main directory with cryptically-named PDFs (at least sorted by > component name) and that on each ConTeXt run take a lot of runtime (I guess > also the many log lines slow the process). > > In 2013, Aditya said it wasn’t possible to externalize pgf/TikZ graphics as > documented in the pgf manual, and "perhaps" it would make sense to use his > filter module: filter is your best bet, in my opinion. > https://mailman.ntg.nl/pipermail/ntg-context/2013/071162.html > > Did anyone try to do that? I didn’t find anything in this list’s archives. > > The original pgf way is two-pass, and you’d need to call LaTeX with the > intended graphics name as --jobname; that’s far too much of a hassle for that > many graphics. > > I generally like how the filter module works, as you can also define the name > of every buffer, but my only experience with that is my LilyPond setup. > > If nobody has better advice, I’ll try to come up with a filter setup. That > would mean we’d avoid the tikz module, every TikZ diagram will get written to > a buffer of configurable name, and that (with preamble setup) will get run > through LaTeX. I read pgf had some restrictions in plain TeX mode, but perhaps > we can also use LuaTeX in plain mode to avoid the LaTeX dependency. > > Best, Hraban > __ > _ > 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] externalizing TikZ graphics
On 1/25/2021 4:42 PM, Henning Hraban Ramm wrote: Hi, did anyone succeed in externalizing TikZ graphics with ConTeXt? It’s about a project with hundreds of diagrams that (in the current state) clutter the main directory with cryptically-named PDFs (at least sorted by component name) and that on each ConTeXt run take a lot of runtime (I guess also the many log lines slow the process). In 2013, Aditya said it wasn’t possible to externalize pgf/TikZ graphics as documented in the pgf manual, and "perhaps" it would make sense to use his filter module: https://mailman.ntg.nl/pipermail/ntg-context/2013/071162.html Did anyone try to do that? I didn’t find anything in this list’s archives. The original pgf way is two-pass, and you’d need to call LaTeX with the intended graphics name as --jobname; that’s far too much of a hassle for that many graphics. I generally like how the filter module works, as you can also define the name of every buffer, but my only experience with that is my LilyPond setup. If nobody has better advice, I’ll try to come up with a filter setup. That would mean we’d avoid the tikz module, every TikZ diagram will get written to a buffer of configurable name, and that (with preamble setup) will get run through LaTeX. I read pgf had some restrictions in plain TeX mode, but perhaps we can also use LuaTeX in plain mode to avoid the LaTeX dependency. In the following case the buffer only gets typeset when it changes: \starttext \startbuffer[foo] % maybe include a style / enviroment \usemodule[tikz] \usetikzlibrary[patterns] \startTEXpage \starttikzpicture \draw[pattern color=red,pattern=bricks] (0,0) circle (1cm); \stoptikzpicture \stopTEXpage \stopbuffer \framed[offset=overlay]{\typesetbuffer[foo]} \stoptext Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] externalizing TikZ graphics
Hi, did anyone succeed in externalizing TikZ graphics with ConTeXt? It’s about a project with hundreds of diagrams that (in the current state) clutter the main directory with cryptically-named PDFs (at least sorted by component name) and that on each ConTeXt run take a lot of runtime (I guess also the many log lines slow the process). In 2013, Aditya said it wasn’t possible to externalize pgf/TikZ graphics as documented in the pgf manual, and "perhaps" it would make sense to use his filter module: https://mailman.ntg.nl/pipermail/ntg-context/2013/071162.html Did anyone try to do that? I didn’t find anything in this list’s archives. The original pgf way is two-pass, and you’d need to call LaTeX with the intended graphics name as --jobname; that’s far too much of a hassle for that many graphics. I generally like how the filter module works, as you can also define the name of every buffer, but my only experience with that is my LilyPond setup. If nobody has better advice, I’ll try to come up with a filter setup. That would mean we’d avoid the tikz module, every TikZ diagram will get written to a buffer of configurable name, and that (with preamble setup) will get run through LaTeX. I read pgf had some restrictions in plain TeX mode, but perhaps we can also use LuaTeX in plain mode to avoid the LaTeX dependency. Best, Hraban ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] LMTX problem with \input
Another LMTX/MkIV difference: In a component, I include another file with \input, that starts with \page in the first line. With LMTX I get an error: """ I can't figure out why you would want to use a tab mark here. If some right brace up above has ended a previous alignment prematurely, you're probably due for more error messages. """ It works if I insert a blank line, and it works in MkIV. Sorry, I can’t reproduce this apparent edge case in a MWE yet. Hraban ___ 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] repeated chapter in LMTX Reference Manual?
On 12/4/2020 9:06 PM, Pablo Rodriguez wrote: Hi Hans, many thanks for your new upload that fixes the issue with scaled external figures. I have just accidentally realized: \startbodymatter \component luametatex-preamble \component luametatex-differences [...] \stopbodymatter \startbackmatter [...] \component luametatex-differences \component luametatex-statistics \stopbackmatter I mean, “Differences with LuaTeX” is the second chapter and the second appendix (sort of) in the “LuaMetaTEX Reference Manual”. I wonder whether this is intended. no, it used to be an appendic (list only) - 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] repeated chapter in LMTX Reference Manual?
Hi Hans, many thanks for your new upload that fixes the issue with scaled external figures. I have just accidentally realized: \startbodymatter \component luametatex-preamble \component luametatex-differences [...] \stopbodymatter \startbackmatter [...] \component luametatex-differences \component luametatex-statistics \stopbackmatter I mean, “Differences with LuaTeX” is the second chapter and the second appendix (sort of) in the “LuaMetaTEX Reference Manual”. I wonder whether this is intended. Just in case it might help, Pablo -- http://www.ousia.tk ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Getting the filename which is being typeset
Hi Wolfgang, Thank you for your explanations: I am wondering whether this kind of information could go into the wiki, and if yes what would be an appropriate title for that page (of course I'll do it). However the two commands \inputfilesuffix \jobfilesuffix put inside the file « myfile.tex » do not give the suffix « tex »: shoul dthey give « tex » or am I misintrepreting these commands? Best regards: Otared > On 1 Dec 2020, at 18:23, Wolfgang Schuster > wrote: > > Otared Kavian schrieb am 01.12.2020 um 18:10: >> Thanks Hraban, this might be also useful and I'll keep it somewhere on my >> mind, but for the project I was asking my question \jobname is enough. >> >> Best regards: Otared >>> On 1 Dec 2020, at 17:33, Henning Hraban Ramm wrote: >>>> Am 01.12.2020 um 16:20 schrieb Otared Kavian : >>>> >>>> Thanks Tomás! Indeed \jobname does the job :-) >>> In case you need the current component file in a project environment: >>> \currentcomponent > > In some case \inputfilename is the better choice, e.g. when you process xml > files with a environment file for the style and processing settings. > > context --environment=myxmlstyle myfile.xml > > The following example shows the output of all commands: > > \starttext > \starttabulate [|T|T|] > \NC \type{\jobname} \NC \jobname \NC\NR > \NC \type{\jobfilename} \NC \jobfilename \NC\NR > \NC \type{\jobfilesuffix} \NC \jobfilesuffix \NC\NR > \NC \type{\inputfilename} \NC \inputfilename \NC\NR > \NC \type{\inputfilebarename} \NC \inputfilebarename \NC\NR > \NC \type{\inputfilesuffix} \NC \inputfilesuffix \NC\NR > \NC \type{\outputfilename}\NC \outputfilename\NC\NR > \NC \type{\operatingsystem} \NC \operatingsystem \NC\NR > \stoptabulate > \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 > ___ ___ 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] Getting the filename which is being typeset
Otared Kavian schrieb am 01.12.2020 um 18:10: Thanks Hraban, this might be also useful and I'll keep it somewhere on my mind, but for the project I was asking my question \jobname is enough. Best regards: Otared On 1 Dec 2020, at 17:33, Henning Hraban Ramm wrote: Am 01.12.2020 um 16:20 schrieb Otared Kavian : Thanks Tomás! Indeed \jobname does the job :-) In case you need the current component file in a project environment: \currentcomponent In some case \inputfilename is the better choice, e.g. when you process xml files with a environment file for the style and processing settings. context --environment=myxmlstyle myfile.xml The following example shows the output of all commands: \starttext \starttabulate [|T|T|] \NC \type{\jobname} \NC \jobname \NC\NR \NC \type{\jobfilename} \NC \jobfilename \NC\NR \NC \type{\jobfilesuffix} \NC \jobfilesuffix \NC\NR \NC \type{\inputfilename} \NC \inputfilename \NC\NR \NC \type{\inputfilebarename} \NC \inputfilebarename \NC\NR \NC \type{\inputfilesuffix} \NC \inputfilesuffix \NC\NR \NC \type{\outputfilename} \NC \outputfilename \NC\NR \NC \type{\operatingsystem} \NC \operatingsystem \NC\NR \stoptabulate \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] Getting the filename which is being typeset
Thanks Hraban, this might be also useful and I'll keep it somewhere on my mind, but for the project I was asking my question \jobname is enough. Best regards: Otared > On 1 Dec 2020, at 17:33, Henning Hraban Ramm wrote: > > > >> Am 01.12.2020 um 16:20 schrieb Otared Kavian : >> >> Thanks Tomás! Indeed \jobname does the job :-) > > In case you need the current component file in a project environment: > \currentcomponent > > Hraban > ___ > 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] Getting the filename which is being typeset
> Am 01.12.2020 um 16:20 schrieb Otared Kavian : > > Thanks Tomás! Indeed \jobname does the job :-) In case you need the current component file in a project environment: \currentcomponent Hraban ___ 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] Error with spaces in Argument of \startproduct
> Am 24.11.2020 um 22:38 schrieb Wolfgang Schuster > : > > Jannik Voges schrieb am 24.11.2020 um 22:24: >> Hello, >> as the title suggested, I get an error when using spaces in the argument of >> \startproduct. For example typesetting >> \startproduct{foo bar} > > You can have a filename with a space use > >\startproduct [foo bar] > > but you don't even need the filename when you replace it with *, e.g. > >\startproduct * > > or > >\startproduct [*] Since I learned about *, I used it extensively, but then I recognized, I can’t refer to the component filename with \currentcomponent any more. (I use it for filter-generated contents like LilyPond music.) Just as a warning, in case you stumble upon that. Hraban ___ 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] embed metapost figure into document
On Mon, 9 Nov 2020 at 23:40, Jairo A. del Rio wrote: > Hi, Sylvain. > > LuaMetaTeX and LuaTeX, the engines used by ConTeXt nowadays, use an > embedded library, so external compilations/files are not necessary. Just > out of curiosity, wouldn't it be easier to use a ConTeXt environment? E.g.: > > \starttext > \startMPcode %\startuseMPgraphic{} if you want to reuse your graphic > with \useMPgraphic{} > draw fullcircle scaled cm > %withcolor black % black is default > ; > \stopMPcode %\stopuseMPgraphic > \stoptext > > More info here: > https://wiki.contextgarden.net/MetaFun_-_MetaPost_in_ConTeXt > To actually answer your question, if you actually want to load a Metapost > graphic externally generated, you should have something like: > > %nice.mp > %"begin ... endfig", as well as "end" are important > beginfig (1); > draw fullcircle scaled cm > %withcolor black > ; > endfig; > end > > so when you compile it via > > mpost nice.mp > > (obviously supposing you have Metapost installed) you'll get a file called > nice.1 and > > \starttext > > \externalfigure[nice.1][width=4cm] > > \stoptext > > will work. However, as you can see, ConTeXt deals with such minutiae for > you and extends Metapost capabilities too, so the second alternative is not > the ConTeXt way to go. > > I hope it helps. > > Jairo :) > Hi Jairo, Thank you very much for the suggestion and the thorough explanation. I extracted the metapost code to a new file because I felt it would be a bit lengthy and noisy to stay with the text content. But you're right, an extra compilation step is not any better. I should probably use \component figure.tex, in place of \externalfigure[figure.1] Sylvain ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] numbering pages included by \copypages
Aditya Mahajan schrieb am 24.09.2020 um 23:48: On Thu, 24 Sep 2020, Alan Bowen wrote: I need to include several documents in a single paginated file. Treating the source file (.tex) of each document as a component file in a .prd file is one way to go. But I was wondering if it might be possible to do get the same result using the .pdf files of each document instead. \copypages is promising: it includes the. pdf files and the counter in the resultant .prd file is correct. But what I still have to get is the page number on all pages of the included .pdf files except the first page in each. I looked at \startpagefigure but that would be a very cumbersome way to go since there over 350 pages to include, given that it handles only one page at a time. I hope that this makes sense. I don't completely understand the question I guess something like this: \setupexternalfigures[location=default] \starttext ... \page \getfiguredimensions[texit.pdf] \noheaderandfooterlines \dorecurse{\noffigurepages} {\vbox to \vsize {\vskip-\dimexpr\headerheight+\topspace\relax \hbox to \hsize {\hskip-\backspace \externalfigure[texit.pdf][page=\recurselevel]% \hss}% \vss}} \page ... \stoptext Any suggestions or pointers will be most welcome. See if this gives you any ideas https://adityam.github.io/context-blog/post/include-multi-page-pdf/ When both document have the same size you can replace TeXpage with a "page" layout. \startlayout[page] \dorecurse{\noffigurepages}{\externalfigure[...][page=\recurselevel]} \stoplayout 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] numbering pages included by \copypages
On Thu, 24 Sep 2020, Alan Bowen wrote: > I need to include several documents in a single paginated file. Treating > the source file (.tex) of each document as a component file in a .prd file > is one way to go. But I was wondering if it might be possible to do get the > same result using the .pdf files of each document instead. > > \copypages is promising: it includes the. pdf files and the counter in the > resultant .prd file is correct. But what I still have to get is the page > number on all pages of the included .pdf files except the first page in > each. > > I looked at \startpagefigure but that would be a very cumbersome way to go > since there over 350 pages to include, given that it handles only one page > at a time. > > I hope that this makes sense. I don't completely understand the question > Any suggestions or pointers will be most welcome. See if this gives you any ideas https://adityam.github.io/context-blog/post/include-multi-page-pdf/ Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] numbering pages included by \copypages
I need to include several documents in a single paginated file. Treating the source file (.tex) of each document as a component file in a .prd file is one way to go. But I was wondering if it might be possible to do get the same result using the .pdf files of each document instead. \copypages is promising: it includes the. pdf files and the counter in the resultant .prd file is correct. But what I still have to get is the page number on all pages of the included .pdf files except the first page in each. I looked at \startpagefigure but that would be a very cumbersome way to go since there over 350 pages to include, given that it handles only one page at a time. I hope that this makes sense. Any suggestions or pointers will be most welcome. Alan ___ 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] \setupuserpagenumber not working as expected
Dear Wolfgang, Thank you for taking the time to go through the example and indicating these improvements. I will definitely evaluate and start applying this to my own code. Kind regards,Jan WillemFrom: Wolfgang SchusterSent: Friday, 4 September 2020 10:47To: mailing list for ConTeXt users; Jan Willem FlammaSubject: Re: [NTG-context] \setupuserpagenumber not working as expected Jan Willem Flamma schrieb am 03.09.2020 um 10:29:> Dear Julian,> > I use something similar using a main product file, an environment file > that contain the styling and several components that build up the > frontmatter, the manual and the appendices.> > Below my setup where I start the roman numbering on the table of > contents page (page 5 or v in roman)> > Once the bodymatter starts the pagenumber is set to the arabic 1 (see > below in the main product file)> > You should be able to copy and adapt to your needs. There are lot of things which can be improved in your example. 1. Pass the filename of the component/product to \startcomponent and not some dummy name (or just use *), this allows you to print the filename with \currentcomponent or \currentproduct 2. Use \setvariables or \setupdocument to set the document title, revision etc. 3. Use \startsectionblockenvironment to move setups from the document content into the environment file. 4. Use pagestate=start to increase the page counter with \startstandardmakeup. 5. Set search path for figures (\copypages use the figure mechanism) with \setupexternalfigure[location=...]. Below is a modified (but untested) version of your sample document. Wolfgang begin product\startproduct product \environment env-WA % \setvariables% [document]% [ manual={Course Manual},% title={Title},% subtitleone={Subtitle 1},% subtitletwo={Subtitle 2},% revnumber={Revision number}] \setupdocument [ manual={Course Manual}, title={Title}, subtitleone={Subtitle 1}, subtitletwo={Subtitle 2}, revnumber={Revision number}] \startfrontmatter \component fm-frontpage \component fm-titlepage \component fm-tableofcontents \stopfrontmatter \startbodymatter \component co-01 \component co-02 \stopbodymatter \startappendices \component co-ap-01 \component co-ap-02 \stopappendices \startbackmatter \copypages[app1.pdf][n=4] \stopbackmatter \stopproduct end product begin environment\startenvironment env-WA \setuppagenumbering [alternative=doublesided, location=right] \defineconversionset [frontpart:pagenumber] [] [romannumerals] \setupexternalfigures [directory={External PDF}] \startsectionblockenvironment [frontpart] \setupbackgrounds [leftpage] [setups=pagenumber:left] \setupbackgrounds [rightpage] [setups=pagenumber:right] \stopsectionblockenvironment \startsectionblockenvironment [bodypart] \setupbackgrounds [leftpage] [setups=pagenumber:left] \setupbackgrounds [rightpage] [setups=pagenumber:right] \setuppagenumber [number=1] \stopsectionblockenvironment \startsectionblockenvironment [appendix] \setupbackgrounds [leftpage] [setups=pagenumber:left] \setupbackgrounds [rightpage] [setups=pagenumber:right] \stopsectionblockenvironment \startsectionblockenvironment [backpart] \setuppagenumber[state=stop] \stopsectionblockenvironment \stopenvironment%%%% end environment begin component\startcomponent fm-frontpage \product product \startstandardmakeup [top=,pagestate=start,align=middle,color=Modu_Blue] % \dontleavehmode\externalfigure[frontpage-logo.png][width=12cm] \framed [height=5cm,width=broad,frame=off] {\externalfigure[frontpage-logo.png][width=12cm]} \blank[6*big] {\bfc \documentvariable{manual}} \blank[4*big] {\tfc \documentvariable{title}} \blank[2*big] {\tfc \documentvariable{subtitleone}} \blank[2*big] {\tfc \documentvariable{subtitletwo}} \stopstandardmakeup \stopcomponent end component begin component\startcomponent fm-titlepage \product product \startstandardmakeup [top=,pagestate=start,align=middle,color=Modu_Blue] {\tfb \documentvariable{manual}} \blank[2*big] {\tfb \documentvariable{title}} \blank[2*big] {\tfb \documentvariable{subtitleone}} \blank[2*big] {\tfb \documentvariable{subtitletwo}} \blank[10*big] {\tfb \documentvariable{revnumber}} \blank {\tfb \currentdate[month,year]} \blank[10*big] {\tfb Written by:} \blank {\tfb Company name} \blank {\tfb City, Country} \stopstandardmakeup \stopcomponent end component begin component\startcomponent fm-tableofcontents \product product \starttitle [title=Table of Contents] \placecontent \stoptitle \stopcomponent end component ___ 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 / htt
Re: [NTG-context] \setupuserpagenumber not working as expected
Jan Willem Flamma schrieb am 03.09.2020 um 10:29: Dear Julian, I use something similar using a main product file, an environment file that contain the styling and several components that build up the frontmatter, the manual and the appendices. Below my setup where I start the roman numbering on the table of contents page (page 5 or v in roman) Once the bodymatter starts the pagenumber is set to the arabic 1 (see below in the main product file) You should be able to copy and adapt to your needs. There are lot of things which can be improved in your example. 1. Pass the filename of the component/product to \startcomponent and not some dummy name (or just use *), this allows you to print the filename with \currentcomponent or \currentproduct 2. Use \setvariables or \setupdocument to set the document title, revision etc. 3. Use \startsectionblockenvironment to move setups from the document content into the environment file. 4. Use pagestate=start to increase the page counter with \startstandardmakeup. 5. Set search path for figures (\copypages use the figure mechanism) with \setupexternalfigure[location=...]. Below is a modified (but untested) version of your sample document. Wolfgang begin product \startproduct product \environment env-WA % \setvariables % [document] % [ manual={Course Manual}, % title={Title}, %subtitleone={Subtitle 1}, %subtitletwo={Subtitle 2}, % revnumber={Revision number}] \setupdocument [ manual={Course Manual}, title={Title}, subtitleone={Subtitle 1}, subtitletwo={Subtitle 2}, revnumber={Revision number}] \startfrontmatter \component fm-frontpage \component fm-titlepage \component fm-tableofcontents \stopfrontmatter \startbodymatter \component co-01 \component co-02 \stopbodymatter \startappendices \component co-ap-01 \component co-ap-02 \stopappendices \startbackmatter \copypages[app1.pdf][n=4] \stopbackmatter \stopproduct end product begin environment \startenvironment env-WA \setuppagenumbering [alternative=doublesided, location=right] \defineconversionset [frontpart:pagenumber] [] [romannumerals] \setupexternalfigures [directory={External PDF}] \startsectionblockenvironment [frontpart] \setupbackgrounds [leftpage] [setups=pagenumber:left] \setupbackgrounds [rightpage] [setups=pagenumber:right] \stopsectionblockenvironment \startsectionblockenvironment [bodypart] \setupbackgrounds [leftpage] [setups=pagenumber:left] \setupbackgrounds [rightpage] [setups=pagenumber:right] \setuppagenumber [number=1] \stopsectionblockenvironment \startsectionblockenvironment [appendix] \setupbackgrounds [leftpage] [setups=pagenumber:left] \setupbackgrounds [rightpage] [setups=pagenumber:right] \stopsectionblockenvironment \startsectionblockenvironment [backpart] \setuppagenumber[state=stop] \stopsectionblockenvironment \stopenvironment end environment begin component \startcomponent fm-frontpage \product product \startstandardmakeup [top=,pagestate=start,align=middle,color=Modu_Blue] % \dontleavehmode\externalfigure[frontpage-logo.png][width=12cm] \framed [height=5cm,width=broad,frame=off] {\externalfigure[frontpage-logo.png][width=12cm]} \blank[6*big] {\bfc \documentvariable{manual}} \blank[4*big] {\tfc \documentvariable{title}} \blank[2*big] {\tfc \documentvariable{subtitleone}} \blank[2*big] {\tfc \documentvariable{subtitletwo}} \stopstandardmakeup \stopcomponent end component begin component \startcomponent fm-titlepage \product product \startstandardmakeup [top=,pagestate=start,align=middle,color=Modu_Blue] {\tfb \documentvariable{manual}} \blank[2*big] {\tfb \documentvariable{title}} \blank[2*big] {\tfb \documentvariable{subtitleone}} \blank[2*big] {\tfb \documentvariable{subtitletwo}} \blank[10*big] {\tfb \documentvariable{revnumber}} \blank {\tfb \currentdate[month,year]} \blank[10*big] {\tfb Written by:} \blank {\tfb Company name} \blank {\tfb City, Country} \stopstandardmakeup \stopcomponent end component begin component \startcomponent fm-tableofcontents \product product \starttitle [title=Table of Contents] \placecontent \stoptitle \stopcomponent end component ___ 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] \setupuserpagenumber not working as expected
Credits to Pragma who helped me to set this up a few years ago. From: jbfSent: Friday, 4 September 2020 00:20To: Jan Willem FlammaCc: ntg >> mailing list for ConTeXt usersSubject: Re: [NTG-context] \setupuserpagenumber not working as expected Thanks Jan, that is an extensive bit of work below! Might take me a while to digest, but I'll explore it carefully.JulianOn 3/9/20 6:29 pm, Jan Willem Flamma wrote:Dear Julian, I use something similar using a main product file, an environment file that contain the styling and several components that build up the frontmatter, the manual and the appendices. Below my setup where I start the roman numbering on the table of contents page (page 5 or v in roman) Once the bodymatter starts the pagenumber is set to the arabic 1 (see below in the main product file) You should be able to copy and adapt to your needs. Kind regards,Jan Willem Flamma The main product file==\environment env-WA \startproduct currentproduct % Document definitions\define\MyManual{Course Manual}\define\MyTitle{Title}\define\MySubtitleOne{Subtitle 1}\define\MySubtitleTwo{Subtitle 2}\define\MyRevnumber{Revision number} % Load frontmatter files\startfrontmatter \component fm-frontpage \component fm-titlepage \component fm-tableofcontents\stopfrontmatter % Load bodymatter file\startbodymatter\setupbackgrounds [leftpage] [setups=pagenumber:left]\setupbackgrounds [rightpage] [setups=pagenumber:right]\setuppagenumber[number=1] \component co-01 \component co-02\stopbodymatter % Load backmatter files\startbackmatter\setupbackgrounds [leftpage] [setups=pagenumber:left]\setupbackgrounds [rightpage] [setups=pagenumber:right]\startappendices \component co-ap-01 \component co-ap-02\stopappendices\stopbackmatter % Load external PDF documents\setuppagenumber[state=stop]\copypages[External PDF/app1.pdf][n=4] \stopproduct= The env-WA.tex file (below is about pagenumbering only)=% Start chapter on right (odd) page, pagenumber = bottom right\setuppagenumbering [alternative=doublesided, location=right] % Pagenumbering style\definestructureconversionset [frontpart:pagenumber][][romannumerals]\definestructureconversionset [bodypart:pagenumber] [][numbers]\definestructureconversionset [appendix:pagenumber] [][numbers]= The fm-frontpage.tex file\startcomponent currentcomponent \product product % Front page layout\startstandardmakeup % Place logo centered on page\framed[height=5cm,width=broad,frame=off]{\externalfigure[frontpage-logo.png][width=12cm]} % Place course titles\blank[6*big]\color[Modu_Blue]{\midaligned{\bfc \MyManual}} \blank[4*big]\color[Modu_Blue]{\midaligned{\tfc \MyTitle}} \blank[2*big]\color[Modu_Blue]{\midaligned{\tfc \MySubtitleOne}} \blank[2*big]\color[Modu_Blue]{\midaligned{\tfc \MySubtitleTwo}} \vfill \stopstandardmakeup \stopcomponent The fm-titlepage.tex file\startcomponent currentcomponent \product product \startstandardmakeup \color[Modu_Blue]{\midaligned{\tfb \MyManual}} \blank[2*big] \color[Modu_Blue]{\midaligned{\tfb \MyTitle}} \blank[2*big] \color[Modu_Blue]{\midaligned{\tfb \MySubtitleOne}} \blank[2*big] \color[Modu_Blue]{\midaligned{\tfb \MySubtitleTwo}} \blank[10*big] \color[Modu_Blue]{\midaligned{\tfb \MyRevnumber}} \blank \midaligned{\color[Modu_Blue]{\tfb \currentdate[month,year]}} \blank[10*big] \midaligned{\color[Modu_Blue]{\tfb Written by:}} \blank \midaligned{\color[Modu_Blue]{\tfb Company name}} \blank \midaligned{\color[Modu_Blue]{\tfb City, Country}} \vfill \stopstandardmakeup \stopcomponent The fm-tableofcontents.tex file\startcomponent currentcomponent \product product \setupbackgrounds [leftpage] [setups=pagenumber:left]\setupbackgrounds [rightpage] [setups=pagenumber:right] % This is where I want the roman numbering to start\setuppagenumber[number=5] \starttitle[title=Table of Contents]\placecontent\stoptitle \stopcomponent From: jbfSent: Thursday, 3 September 2020 06:05To: mailing list for ConTeXt usersSubject: [NTG-context] \setupuserpagenumber not working as expected Am seeking to have frontmatter pages in roman numerals and from Chapter 1 onwards in arabic numerals. I have achieved something of the kind, but page 1 (arabic) is appearing on the last page of the frontmatter and not the first page of Chapter 1. I do not know why this is happening. My setup for page numbering is as follows (something I found somewhere - wiki? elsewhere? Not sure. I didn't make it up!):\definestructureconversionset[frontpart:pagenumber][][romannumerals]\definestructureconversionset[bodypart:pagenumber] [][numbers]\startsectionblockenvironment[frontpart]\setupuserpagenumber[numberconv
Re: [NTG-context] \setupuserpagenumber not working as expected
Thanks Jan, that is an extensive bit of work below! Might take me a while to digest, but I'll explore it carefully. Julian On 3/9/20 6:29 pm, Jan Willem Flamma wrote: Dear Julian, I use something similar using a main product file, an environment file that contain the styling and several components that build up the frontmatter, the manual and the appendices. Below my setup where I start the roman numbering on the table of contents page (page 5 or v in roman) Once the bodymatter starts the pagenumber is set to the arabic 1 (see below in the main product file) You should be able to copy and adapt to your needs. Kind regards, Jan Willem Flamma *The main product file* == \environment env-WA \startproduct currentproduct % Document definitions \define\MyManual{Course Manual} \define\MyTitle{Title} \define\MySubtitleOne{Subtitle 1} \define\MySubtitleTwo{Subtitle 2} \define\MyRevnumber{Revision number} % Load frontmatter files \startfrontmatter \component fm-frontpage \component fm-titlepage \component fm-tableofcontents \stopfrontmatter % Load bodymatter file \startbodymatter \setupbackgrounds [leftpage] [setups=pagenumber:left] \setupbackgrounds [rightpage] [setups=pagenumber:right] \setuppagenumber[number=1] \component co-01 \component co-02 \stopbodymatter % Load backmatter files \startbackmatter \setupbackgrounds [leftpage] [setups=pagenumber:left] \setupbackgrounds [rightpage] [setups=pagenumber:right] \startappendices \component co-ap-01 \component co-ap-02 \stopappendices \stopbackmatter % Load external PDF documents \setuppagenumber[state=stop] \copypages[External PDF/app1.pdf][n=4] \stopproduct = *The env-WA.tex file (below is about pagenumbering only)* = % Start chapter on right (odd) page, pagenumber = bottom right \setuppagenumbering [alternative=doublesided, location=right] % Pagenumbering style \definestructureconversionset [frontpart:pagenumber][][romannumerals] \definestructureconversionset [bodypart:pagenumber] [][numbers] \definestructureconversionset [appendix:pagenumber] [][numbers] = *The fm-frontpage.tex file* \startcomponent currentcomponent \product product % Front page layout \startstandardmakeup % Place logo centered on page \framed[height=5cm,width=broad,frame=off] {\externalfigure[frontpage-logo.png][width=12cm]} % Place course titles \blank[6*big] \color[Modu_Blue]{\midaligned{\bfc \MyManual}} \blank[4*big] \color[Modu_Blue]{\midaligned{\tfc \MyTitle}} \blank[2*big] \color[Modu_Blue]{\midaligned{\tfc \MySubtitleOne}} \blank[2*big] \color[Modu_Blue]{\midaligned{\tfc \MySubtitleTwo}} \vfill \stopstandardmakeup \stopcomponent *The fm-titlepage.tex file* \startcomponent currentcomponent \product product \startstandardmakeup \color[Modu_Blue]{\midaligned{\tfb \MyManual}} \blank[2*big] \color[Modu_Blue]{\midaligned{\tfb \MyTitle}} \blank[2*big] \color[Modu_Blue]{\midaligned{\tfb \MySubtitleOne}} \blank[2*big] \color[Modu_Blue]{\midaligned{\tfb \MySubtitleTwo}} \blank[10*big] \color[Modu_Blue]{\midaligned{\tfb \MyRevnumber}} \blank \midaligned{\color[Modu_Blue]{\tfb \currentdate[month,year]}} \blank[10*big] \midaligned{\color[Modu_Blue]{\tfb Written by:}} \blank \midaligned{\color[Modu_Blue]{\tfb Company name}} \blank \midaligned{\color[Modu_Blue]{\tfb City, Country}} \vfill \stopstandardmakeup \stopcomponent *The fm-tableofcontents.tex file* \startcomponent currentcomponent \product product \setupbackgrounds [leftpage] [setups=pagenumber:left] \setupbackgrounds [rightpage] [setups=pagenumber:right] % This is where I want the roman numbering to start \setuppagenumber[number=5] \starttitle[title=Table of Contents] \placecontent \stoptitle \stopcomponent *From: *jbf <mailto:roma83...@gmail.com> *Sent: *Thursday, 3 September 2020 06:05 *To: *mailing list for ConTeXt users <mailto:ntg-context@ntg.nl> *Subject: *[NTG-context] \setupuserpagenumber not working as expected Am seeking to have frontmatter pages in roman numerals and from Chapter 1 onwards in arabic numerals. I have achieved something of the kind, but page 1 (arabic) is appearing on the last page of the frontmatter and not the first page of Chapter 1. I do not know why this is happening. My setup for page numbering is as follows (something I found somewhere - wiki? elsewhere? Not sure. I didn't make it up!): \definestructureconversionset[frontpart:pagenumber][][romannumerals] \definestructureconversionset[bodypart:pagenumber] [][numbers] \startsectionblockenvironment[frontpart] \setupuserpagenumber[numberconversion=romannumerals] \setuplist[chapter][pageconversionset=pagenumber] \setuppagenumber[number=1] \stopsectionblockenvironment \startsectionblockenvironment[bodypart] \setuppagenumber[number=1] \stopsectionblockenvironment The frontma
Re: [NTG-context] \setupuserpagenumber not working as expected
Dear Julian, I use something similar using a main product file, an environment file that contain the styling and several components that build up the frontmatter, the manual and the appendices. Below my setup where I start the roman numbering on the table of contents page (page 5 or v in roman) Once the bodymatter starts the pagenumber is set to the arabic 1 (see below in the main product file) You should be able to copy and adapt to your needs. Kind regards,Jan Willem Flamma The main product file==\environment env-WA \startproduct currentproduct % Document definitions\define\MyManual{Course Manual}\define\MyTitle{Title}\define\MySubtitleOne{Subtitle 1}\define\MySubtitleTwo{Subtitle 2}\define\MyRevnumber{Revision number} % Load frontmatter files\startfrontmatter \component fm-frontpage \component fm-titlepage \component fm-tableofcontents\stopfrontmatter % Load bodymatter file\startbodymatter\setupbackgrounds [leftpage] [setups=pagenumber:left]\setupbackgrounds [rightpage] [setups=pagenumber:right]\setuppagenumber[number=1] \component co-01 \component co-02\stopbodymatter % Load backmatter files\startbackmatter\setupbackgrounds [leftpage] [setups=pagenumber:left]\setupbackgrounds [rightpage] [setups=pagenumber:right]\startappendices \component co-ap-01 \component co-ap-02\stopappendices\stopbackmatter % Load external PDF documents\setuppagenumber[state=stop]\copypages[External PDF/app1.pdf][n=4] \stopproduct= The env-WA.tex file (below is about pagenumbering only)=% Start chapter on right (odd) page, pagenumber = bottom right\setuppagenumbering [alternative=doublesided, location=right] % Pagenumbering style\definestructureconversionset [frontpart:pagenumber][][romannumerals]\definestructureconversionset [bodypart:pagenumber] [][numbers]\definestructureconversionset [appendix:pagenumber] [][numbers]= The fm-frontpage.tex file\startcomponent currentcomponent \product product % Front page layout\startstandardmakeup % Place logo centered on page \framed[height=5cm,width=broad,frame=off] {\externalfigure[frontpage-logo.png][width=12cm]} % Place course titles\blank[6*big]\color[Modu_Blue]{\midaligned{\bfc \MyManual}} \blank[4*big]\color[Modu_Blue]{\midaligned{\tfc \MyTitle}} \blank[2*big]\color[Modu_Blue]{\midaligned{\tfc \MySubtitleOne}} \blank[2*big]\color[Modu_Blue]{\midaligned{\tfc \MySubtitleTwo}} \vfill \stopstandardmakeup \stopcomponent The fm-titlepage.tex file\startcomponent currentcomponent \product product \startstandardmakeup \color[Modu_Blue]{\midaligned{\tfb \MyManual}} \blank[2*big] \color[Modu_Blue]{\midaligned{\tfb \MyTitle}} \blank[2*big] \color[Modu_Blue]{\midaligned{\tfb \MySubtitleOne}} \blank[2*big] \color[Modu_Blue]{\midaligned{\tfb \MySubtitleTwo}} \blank[10*big] \color[Modu_Blue]{\midaligned{\tfb \MyRevnumber}} \blank \midaligned{\color[Modu_Blue]{\tfb \currentdate[month,year]}} \blank[10*big] \midaligned{\color[Modu_Blue]{\tfb Written by:}} \blank \midaligned{\color[Modu_Blue]{\tfb Company name}} \blank \midaligned{\color[Modu_Blue]{\tfb City, Country}} \vfill \stopstandardmakeup \stopcomponent The fm-tableofcontents.tex file\startcomponent currentcomponent \product product \setupbackgrounds [leftpage] [setups=pagenumber:left]\setupbackgrounds [rightpage] [setups=pagenumber:right] % This is where I want the roman numbering to start\setuppagenumber[number=5] \starttitle[title=Table of Contents]\placecontent\stoptitle \stopcomponent From: jbfSent: Thursday, 3 September 2020 06:05To: mailing list for ConTeXt usersSubject: [NTG-context] \setupuserpagenumber not working as expected Am seeking to have frontmatter pages in roman numerals and from Chapter 1 onwards in arabic numerals. I have achieved something of the kind, but page 1 (arabic) is appearing on the last page of the frontmatter and not the first page of Chapter 1. I do not know why this is happening. My setup for page numbering is as follows (something I found somewhere - wiki? elsewhere? Not sure. I didn't make it up!):\definestructureconversionset[frontpart:pagenumber][][romannumerals]\definestructureconversionset[bodypart:pagenumber] [][numbers]\startsectionblockenvironment[frontpart]\setupuserpagenumber[numberconversion=romannumerals]\setuplist[chapter][pageconversionset=pagenumber]\setuppagenumber[number=1]\stopsectionblockenvironment\startsectionblockenvironment[bodypart]\setuppagenumber[number=1]\stopsectionblockenvironmentThe frontmatter is some 16 pages worth (ends on a verso page but that verso carries the arabic number 1 instead of page xvi which it should be, since the final paragraph on that page ends
[NTG-context] \doublehyphendemerits in project environment
Hi, I'm having an issue where \doublehyphendemerits=2 doesn't seem to have an effect when I put it in the environment file, only when it's in the component file. What's going on? I would prefer to not have to repeat this line in every component.. Thank you, Marc Trius ___ 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] output file name query
> Am 23.05.2020 um 14:43 schrieb Wolfgang Schuster > : > >>> 1. Drop the weird (sorry Hraban) naming system and use myfilename for your >>> product. >> I force nobody to use that. > No and everybody has to find a system which fits best for him, prefixes can > be useful (e.g. to avoid component and style files with the same name) but > aren't necessary. Usually my project and environment have the same name, but different prefix (in my weird nomenclature). >>> 2. Use the result option on the command line, e.g. "context >>> --result=myfilename prd_filename.tex". >> But that still produces a "prd_filename.*" first and then renames it, making >> it impossible to keep a "prd_filename.pdf". Or did that change recently? >> >> My workflows are adapted to that behaviour: "prd_*.pdf" is just the >> temporary version, none of those leaves my computer, but only nicely named >> PDFs (usually MyProductName_-mm-dd.pdf). > Having a simple name doesn't mean it's the final name of the document. Of course. But in most of my projects I have several products (e.g. magazine issues, books of a series), and with a prefix I can keep all the products together and list them like `ls prd_*.tex`. Not only my contextproject.py but also my call scripts relay on my naming scheme. And since I use it in my main projects, I use it everywhere (if I use the project structure at all). >> That contradicts the mode approach. It would be nice if we could set (or can >> we?) the result from within the product, depending on a mode – since the >> product is renamed only later anyway, that could be viable. > This addition is easy because already reads the first line of the document > for special setting (e.g. the engine) but anything which is set in the > document requires more work because you don't know the new name *before* > LuaTeX or LuaMetaTeX create the PDF. You don’t need to know the name before ConTeXt creates the PDF, because it uses the original filename and only renames the files (pdf, tuc, log) afterwards. Or misunderstood I something? Hraban ___ 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] output file name query
> On 23 May 2020, at 14:46, Wolfgang Schuster > wrote: > > Henning Hraban Ramm schrieb am 22.05.2020 um 17:39: >>>> Am 22.05.2020 um 15:09 schrieb Wolfgang Schuster >>>> : >>> >>> Alan Bowen schrieb am 22.05.2020 um 14:33: >>>> In my project, I process a single product file by enabling various modes. >>>> What I would like to do is to vary the name of the output PDF file in each >>>> instance. >>>> So, in processing a file, how does one go directly from prd_filename.tex >>>> to myfilename.pdf rather than to prd_filename.pdf—assuming that it is >>>> possible? >>>> Any tips or pointers to what I should be reading will be greatly >>>> appreciated. >>> 1. Drop the weird (sorry Hraban) naming system and use myfilename for your >>> product. >> I force nobody to use that. > No and everybody has to find a system which fits best for him, prefixes can > be useful (e.g. to avoid component and style files with the same name) but > aren't necessary. >>> 2. Use the result option on the command line, e.g. "context >>> --result=myfilename prd_filename.tex". >> But that still produces a "prd_filename.*" first and then renames it, making >> it impossible to keep a "prd_filename.pdf". Or did that change recently? >> >> My workflows are adapted to that behaviour: "prd_*.pdf" is just the >> temporary version, none of those leaves my computer, but only nicely named >> PDFs (usually MyProductName_-mm-dd.pdf). > Having a simple name doesn't mean it's the final name of the document. >>> 3. Ask Hans to add the result option to the first line of the document >>> which is read by the context script before it creates the PDF. >>> >>> % result="myfilename" >>> \starttext >>> ... >>> \stoptext >> That contradicts the mode approach. It would be nice if we could set (or can >> we?) the result from within the product, depending on a mode – since the >> product is renamed only later anyway, that could be viable. > This addition is easy because already reads the first line of the document > for special setting (e.g. the engine) but anything which is set in the > document requires more work because you don't know the new name *before* > LuaTeX or LuaMetaTeX create the PDF. > Just curious: wouldn’t it theoretically be possible to delay opening the output file until the first \stattext? Or is there already stuff going out before that, such as preliminaries that go into the PDF? I think being able to name the output file in the preliminaries in the TeX file would come in handy and prevent more complex workarounds with scripts. But it is not essential as workarounds are possible. Gerben > 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] output file name query
Henning Hraban Ramm schrieb am 22.05.2020 um 17:39: Am 22.05.2020 um 15:09 schrieb Wolfgang Schuster : Alan Bowen schrieb am 22.05.2020 um 14:33: In my project, I process a single product file by enabling various modes. What I would like to do is to vary the name of the output PDF file in each instance. So, in processing a file, how does one go directly from prd_filename.tex to myfilename.pdf rather than to prd_filename.pdf—assuming that it is possible? Any tips or pointers to what I should be reading will be greatly appreciated. 1. Drop the weird (sorry Hraban) naming system and use myfilename for your product. I force nobody to use that. No and everybody has to find a system which fits best for him, prefixes can be useful (e.g. to avoid component and style files with the same name) but aren't necessary. 2. Use the result option on the command line, e.g. "context --result=myfilename prd_filename.tex". But that still produces a "prd_filename.*" first and then renames it, making it impossible to keep a "prd_filename.pdf". Or did that change recently? My workflows are adapted to that behaviour: "prd_*.pdf" is just the temporary version, none of those leaves my computer, but only nicely named PDFs (usually MyProductName_-mm-dd.pdf). Having a simple name doesn't mean it's the final name of the document. 3. Ask Hans to add the result option to the first line of the document which is read by the context script before it creates the PDF. % result="myfilename" \starttext ... \stoptext That contradicts the mode approach. It would be nice if we could set (or can we?) the result from within the product, depending on a mode – since the product is renamed only later anyway, that could be viable. This addition is easy because already reads the first line of the document for special setting (e.g. the engine) but anything which is set in the document requires more work because you don't know the new name *before* LuaTeX or LuaMetaTeX create the PDF. 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] Compile only one new component in a project
Denis Maier schrieb am 08.05.2020 um 11:49: Hi Am 07.05.2020 um 16:01 schrieb Aditya Mahajan: On Thu, 7 May 2020, Fabrice Couvreur wrote: context chapter-4-seconde There is a MyWay which shows how you can share cross-refs etc. Aditya Where is that? I would be very interested in learning about this. But couldn't find the mentioned My Way... Look into the documentation folder of your ConTeXt installation. ...\tex\texmf-context\doc\context\documents\general\magazines Project structure: mag-1101-mkiv.pdf Cross references: mag-1103-mkiv.pdf 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] Compile only one new component in a project
Hi Am 07.05.2020 um 16:01 schrieb Aditya Mahajan: On Thu, 7 May 2020, Fabrice Couvreur wrote: context chapter-4-seconde There is a MyWay which shows how you can share cross-refs etc. Aditya Where is that? I would be very interested in learning about this. But couldn't find the mentioned My Way... Best, Denis ___ 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] Compile only one new component in a project
Fabrice Couvreur schrieb am 07.05.2020 um 17:21: Hi Aditya, It does not work ; the compilation encounters errors with each command that I created. I guess it comes from the components. You have to load all environment files in your components. In your case where you use multiple files you can use a project file where you load all environments and load then the project file in your product and component files. ##chapter-4-seconde.tex## \startcomponent chapter-4-seconde Add here \environment ... or \project ... \startchapter[title=] ... \stopchapter \stopcomponent 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] Compile only one new component in a project
Hi Aditya, It does not work ; the compilation encounters errors with each command that I created. I guess it comes from the components. Fabrice ##chapter-4-seconde.tex## \startcomponent chapter-4-seconde \startchapter[title=] ... \stopchapter \stopcomponent Le jeu. 7 mai 2020 à 16:01, Aditya Mahajan a écrit : > On Thu, 7 May 2020, Fabrice Couvreur wrote: > > > Hi, > > Here is part of a project that is starting to be heavy ; when i add a > > chapter i do context seconde.tex > > How do I compile only the chapter I just added ? > > Thank you. > > Fabrice > > > > \startproduct Seconde > > > > \environment modules > > \environment specialite-style > > \environment specialite-macros > > > > \startfrontmatter > > \component specialite-titlepage > > \component specialite-contents > > \stopfrontmatter > > > > \startbodymatter > >\component chapter-1-seconde > >\component chapter-2-seconde > >\component chapter-3-seconde > >\component chapter-4-seconde > > \stopbodymatter > > \stopproduct > > context chapter-4-seconde > > There is a MyWay which shows how you can share cross-refs etc. > > 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] Compile only one new component in a project
On Thu, 7 May 2020, Fabrice Couvreur wrote: Hi, Here is part of a project that is starting to be heavy ; when i add a chapter i do context seconde.tex How do I compile only the chapter I just added ? Thank you. Fabrice \startproduct Seconde \environment modules \environment specialite-style \environment specialite-macros \startfrontmatter \component specialite-titlepage \component specialite-contents \stopfrontmatter \startbodymatter \component chapter-1-seconde \component chapter-2-seconde \component chapter-3-seconde \component chapter-4-seconde \stopbodymatter \stopproduct context chapter-4-seconde There is a MyWay which shows how you can share cross-refs etc. 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 ___