[NTG-context] Re: Text in Margin
Am 19.02.24 um 14:14 schrieb Jeroen: In a textbook I am looking to place a large left margin at every page of each chapter. At left printed pages a left margin and at right printed pages a right margin, so like a double sided construction. In this margin I would like to place: 1. Keywords and small descriptions to emphasize some text from the textflow 2. Figures 3. An expansion of a table that is placed in the main textflow but that needs to cover a wider range then the text area so it expands into the margin What is the the easiest way to achieve this? Generally, you use \inmargin, \inouter etc. Additional to Wolfgang’s suggestions: If you need sidefloats that cover not only the margin but should decrease the text width, you can move sidefloats into the margin like: \startplacefigure[title={},location=outer] \offset[rightoffset=-\marginwidth]{\externalfigure[cow][width=0.5\textwidth]} \stopplacefigure Beware: it doesn’t work well with captions (I’ve still no solution that always works), and \offset understands only rightoffset and leftoffset, not outeroffset. The example is on a right page; you must “pull” the image into the margin (rightmargin with negative value), if you try „pushing“ with leftoffset=\marginwidth, the text flow is wrong. 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] Re: Text in Margin
There is a package on github https://github.com/andythomas/TeX-sidenotes that can help you with that. Check the "context" folder on that repo. Also, you can find an example of its use at https://github.com/zvonkok/perf-panacea Caveat emptor: It has not been updated in 12 years. It should work for the most part, I tried to do something with it a while ago but that project was cancelled. I have not tested it myself but maybe later in the week I can take a look at it. -- Andrés Conrado Montoya Andi Kú andresconr...@gmail.com http://sesentaycuatro.com http://messier87.com http://chiquitico.org Los fines no justifican los medios, porque la medida verdadera de nuestro carácter está dada por los medios que estamos dispuestos a utilizar, no por los fines que proclamamos. “You develop an instant global consciousness, a people orientation, an intense dissatisfaction with the state of the world, and a compulsion to do something about it. From out there on the moon, international politics look so petty. You want to grab a politician by the scruff of the neck and drag him a quarter of a million miles out and say, ‘Look at that, you son of a bitch.’” — Apollo 14 astronaut Edgar Mitchell ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / 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: using an end of line as parameter
On 2/19/2024 1:49 PM, Miguel Diaz wrote: Dear list, I want to format some language tests that different people are preparing. Each one uses different software and there are always problems in format that i want to solve. for a a/b/c questions I receive text that I will format to a list (comments are mine) In den Büchereien gibt es auch … %the question … Kuchen. %option a … Theater. %option b … Workshops. %option c I need to detect \par or whatever sign marks the newline character as an argument delimiter so that I dont have to paste hundreds of times braces for each argument. For the example, I use this macro definition (which does no work!) \long\def\prueba #1\par#2\par#3\par#4ñ{\framed[frame=off,width=0.8\textwidth,corner=round,offset=1em,align=flushleft]% {{\bf Beispiel}: #1\\ \qquad a) #2\\ \qquad b) {\bf #3}\\ \qquad c) #4 } I get: tex error on line 493 in file ./prueba.tex: The file ended when scanning an argument. the macro seems to read to the end of file not detecting \par; I know its the \par that causes the problem; I used ^^M also which I read is a sinonym for return but it also does not work. Help would be appreciated (my computer keyboard would appreciate it too...) better start thinking something: \starttext \def\foo#1{<<<#1\par} \startluacode local s = [[ line 1 line 2 line 3 line 4 ]] -- local s - io.loaddata("yourfile.txt") local lines = string.splitlines(s) for i=1,#lines do if lines[i] ~= "" then context.foo(lines[i]) end end \stopluacode \stoptext - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://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: MetaPost lines in tables?
Henning Hraban Ramm schrieb am 19.02.2024 um 22:39: I guess I asked this a while ago, but I can’t find an answer: Is it possible to replace the lines of a TABLE with my own MetaPost graphics? ATM I’m trying to place my MP lines behind a frame-less TABLE; it will probably work, but it’s a crutch… The example below draws a custom border for the whole cell but you're free to draw only certain sides (leftboundary etc. helps) but don't forget to set the boundary box for the graphic (OverlayBox is the size of the cell). begin example \startuseMPgraphic{dottedborder} draw OverlayBox withpen pencircle scaled 2 dashed withdots withcolor "red"; \stopuseMPgraphic \defineoverlay[dottedborder][\useMPgraphic{dottedborder}] \starttext \bTABLE[frame=off,background=dottedborder] \bTR \bTD Hello Table! \eTD \eTR \eTABLE \stoptext end example Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] MetaPost lines in tables?
I guess I asked this a while ago, but I can’t find an answer: Is it possible to replace the lines of a TABLE with my own MetaPost graphics? ATM I’m trying to place my MP lines behind a frame-less TABLE; it will probably work, but it’s a crutch… 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] Re: Text in Margin
Jeroen schrieb am 19.02.2024 um 14:14: In a textbook I am looking to place a large left margin at every page of each chapter. At left printed pages a left margin and at right printed pages a right margin, so like a double sided construction. In this margin I would like to place: You can use a custom layout with a narrow text block and a wide rightmargin area. 1. Keywords and small descriptions to emphasize some text from the textflow Use the \inright etc. commands or create your own commands based on \inright, look at the margindata mechanism for more information. 2. Figures You can change the default location of figures from the text block to the margin area. 3. An expansion of a table that is placed in the main textflow but that needs to cover a wider range then the text area so it expands into the margin In the example below I added a check to the table float to either center the small tables or align wide tables on the inner margin which extend into the margin area. While this method works in a simple example for a real document I suggest to create a clone of the table float (e.g. widetable) because the method in the example can lead to problems/limitations. What is the the easiest way to achieve this? begin example \setuppagenumbering [alternative=doublesided] \setuplayout [width=10cm, rightmargin=6cm] \showframe \def\FloatTableALignment {\dowithnextbox {\ifdim\nextboxwd>\textwidth \doalignedline{inner}{\flushnextbox}% \else \flushnextbox \fi} \hbox} \setupfloat[table][command=\FloatTableALignment] \setupfloat[figure][default=rightmargin] \starttext \inright{Lorem ipsum \unknown}\samplefile{lorem} \startplacefigure \externalfigure[dummy][width=\rightmarginwidth] \stopplacefigure \samplefile{lorem} \startplacetable \bTABLE \bTR \bTD one \eTD \bTD two \eTD \bTD three \eTD \eTR \eTABLE \stopplacetable \samplefile{lorem} \startplacetable \bTABLE[textwidth=\dimexpr\textwidth+\rightmarginwidth+\rightmargindistance\relax,option=stretch] \bTR \bTD one \eTD \bTD two \eTD \bTD three \eTD \eTR \eTABLE \stopplacetable \samplefile{lorem} \stoptext %%% end example Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: lmt_shade fails
On 2/19/2024 7:10 PM, Keith McKay wrote: Thanks for the reply Fabrice. Looks like something changed in the recent update. I'm sure Hans will pick it up. next upload (when mid cycles were introduced we lost an end one in some cases) 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: Fwd: Re: Working with layer sets with Metapost
Thanks Mikael. This helped indeed. I updated my example on the Metapost page in the wiki accordingly. The`pagestate=start` functionality is not documented in the wiki. It's not clear for which context commands it can or should be used. Who is willing to help out here? Best regards Emanuel On Feb. 19 2024, at 2:39 pm, Mikael Sundqvist wrote: > Hi, > > Try > \startTEXpage[pagestate=start] > /Mikael > On Mon, Feb 19, 2024 at 2:31 PM Emanuel Han via ntg-context > wrote: > > > > I just made a strange observation in the output pdf of the attached > > layer_set.tex, which is that when opening it with a pdf viewer like skim or > > macos preview and showing miniatures, all pages except the last one show > > page number 1 (the last showing page number 2). > > > > Which was not the case with the output pdf of the attached > > multipage_metapost_mwe-very_simple.tex. > > > > How can I change my code to have proper consecutive page numbering in a pdf > > viewer? > > > > On Feb. 17 2024, at 11:03 am, Emanuel Han via ntg-context > > wrote: > > > > I think I could solve all the problems. Attached the finalized working > > example. I created the > > https://wiki.contextgarden.net/MetaPost#Layer_sets_as_individual_pages > > entry with it. Feel free to modify. > > > > Cheers > > Emanuel > > > > On Feb. 16 2024, at 7:56 am, Mikael Sundqvist wrote: > > > > Hi, > > > > not sure I get what you are missing. But you can try > > > > setbounds currentpicture to (fullsquare scaled 200) ; > > > > in base. And then do > > > > \dorecurse{5}{ > > \startTEXpage[offset=1DK] > > \useMPgraphic{layerset#1} > > \stopTEXpage > > } > > > > if that is the looping you are after. > > > > /Mikael > > > > On Fri, Feb 16, 2024 at 6:54 AM Emanuel Han via ntg-context > > wrote: > > > > > > Resp. the solution should be such that each generated PDF page has the > > > same dimension, the same background colour and a page number and the > > > metapost content on each page has the same scaling factor. > > > > > > On Feb. 15 2024, at 11:10 pm, Emanuel Han via ntg-context > > > wrote: > > > > > > Dear Mikael, > > > > > > I actually need to keep the \dorecurse mechanism of the mwe (from line 44 > > > on), because I need the "setbounds currentpicture to TheFrame" and also > > > because I need page numbering inside the MPpage, as done with draw > > > textext(decimal(currentime)). > > > > > > So, how can I use the \useMPgraphic{layerset1} etc. inside the > > > \dorecurse, assuming I name my layersets "layerset1", "layerset2", > > > "layerset3" etc.? > > > > > > Emanuel > > > > > > On Feb. 15 2024, at 10:07 pm, Emanuel Han via ntg-context > > > wrote: > > > > > > Dear Mikael, > > > thanks a lot! > > > this seems to be the solution! And it looks beatiful enough to me > > > I'll try to port all my layers to this new method and see if I run into > > > new problems again > > > > > > Emanuel > > > > > > > > > On Feb. 15 2024, at 8:19 am, Mikael Sundqvist wrote: > > > > > > Hi > > > > > > On Thu, Feb 15, 2024 at 1:03 AM Emanuel Han via ntg-context > > > wrote: > > > > > > > > Dear list, > > > > > > > > the attached .tex file is the minimal working example we discussed > > > > today in the online meeting. > > > > > > > > I realized that the approach of looping through k of p[k] is not > > > > fitting my needs, because it's not flexible enough. > > > > > > > > I need another approach, one which works with layer sets. > > > > > > > > I would stop using p as an array, because with the layer sets approach > > > > we don't have a fixed order of the layers. > > > > > > > > So the definition of the layers would be something like > > > > > > > > picture layerA; > > > > layerA:=image( > > > > label("Word 1", z1); > > > > ); > > > > > > > > picture layerW; > > > > layerW:=image( > > > > label("Mot 2", z2); > > > > ); > > > > > > > > picture layerM; > > > > layerM:=image( > > > > label("Parola 3", z3); > > > > ); > > > > > > > > picture layerC; > > > > layerC:=image( > > > > label("Wort 4", z3+z1); > > > > ); > > > > > > > > picture layerY; > > > > layerY:=image( > > > > label("Nummer 5", z2+z3); > > > > ); > > > > > > > > picture layerU; > > > > layerU:=image( > > > > label("number 6", z2+z1); > > > > ); > > > > > > > > After that, I would define layer sets and layer subsets. This will be > > > > done manually for each layer set and each layer subset. > > > > I don't know the proper syntax to do that. Let's assume we could use a > > > > variable type called "myset". > > > > > > > > myset layersubsetGamma; > > > > layersubsetGamma:={layerU,layerM}; > > > > > > > > In my logic, the layers will be drawn in the order of their appearance > > > > within the {}. In the example, drawn content of layerM might cover > > > > drawn content of layerU. > > > > > > > > Contrary to a layer subset, each layer set will result in a PDF page, > > > > and thus the layer sets are related to each other by an inner order. > > > > That's why I would use an
[NTG-context] Re: lmt_shade fails
Thanks for the reply Fabrice. Looks like something changed in the recent update. I'm sure Hans will pick it up. Best wishes Keith McKay On Mon, 19 Feb 2024, 13:21 Fabrice L, wrote: > Dear Keith, > > Le 18 févr. 2024 à 11:44, Keith McKay a écrit : > > Hi all > > I went to use the lmt_shade function and it fails with two error messages. > the first one is: > *metafun > log > error: Not a cycle* > followed by lots of trace messages, then: > *metafun > log > That contour should have ended with '.. cycle' or '& > cycle'. So I'll not change* > *anything just now.* > The MWE I used is as follows: > \starttext > \startMPpage > definecolor [ name = "MyColor3", r = uniformdeviate(1), g = > uniformdeviate(1), b = uniformdeviate(1) ] ; > definecolor [ name = "MyColor4", r = uniformdeviate(1), g = > uniformdeviate(1), b = uniformdeviate(1) ] ; > draw lmt_shade [ > path = fullsquare scaled 5cm, > direction = "up", > alternative = "linear", > colors = { "red", "green" }, > ]; > \stopMPpage > \stoptext > > I'm using: > > *system > ConTeXt ver: 2024.02.14 13:38 LMTX fmt: 2024.2.15 > int: english/english* > > on a mac mini M1. > > Any thougths? > > > On an Mac running ConTeXt ver: 2023.09.26 18:19 LMTX fmt: 2023.12.11 , > this works perfectly. > > Best wishes > > Keith McKay > > Fabrice. > > > ___ > 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 > > ___ > ___ 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: Sorry for once more asking, i am at Work
Dear Pablo, I shell try it. Many thanks. Uschi -Ursprüngliche Nachricht- Von: Pablo Rodriguez via ntg-context Gesendet: Montag, 19. Februar 2024 14:31 An: ntg-context@ntg.nl Cc: Pablo Rodriguez Betreff: [NTG-context] Re: Sorry for once more asking, i am at Work On 2/19/24 13:06, Ursula Hermann wrote: > Dear List, > > I have done the new download at Work. After compiling is always the same: > > Command Line: context.exe --synctex=-1 "context-test.tex" > […] > startup error : no format file given, quitting Dear Uschi, it is really hard to know what is wrong with your installation (other than it ConTeXt is not able to find your format file). Sorry if this message is painfully verbose, but I will try not to take anything for granted (so I don’t overlook anything relevant). Could you save a new "test-doc.tex" file in your desktop directory (which would be named "%USERPROFILE%\Desktop\test-doc.tex" [including its full path])? "%USERPROFILE%\Desktop\test-doc.tex" should contain: \starttext \input zapf \stoptext Please, compile it by simply invoking ("cd %USEPROFILE%\Desktop\" might be required before): context test-doc If you get the same error message: > startup error : no format file given, quitting You might try (to make the format file): context --make --all Then, try compiling again (run "context test-doc"). If you get the same error message, let’s try a brand-new installation (not removing any existing one). Get http://lmtx.pragma-ade.nl/install-lmtx/context-mswin.zip (if you use Windows 32bt) or http://lmtx.pragma-ade.nl/install-lmtx/context-win64.zip (for Windows 64bit) into "%USERPROFILE%\Desktop\". Unzip the downloaded file to a newly created folder in your desktop ("%USERPROFILE%\Desktop\context"). Double-click on "install.bat" that you just uncompressed. You have to add the new path, so that Windows may find your executables. Open a new terminal (I guess it is called “command prompt” [or »Eingabeaufforderung«] in Windows-parlance) and paste (if you have ConTeXt for 32bit): set PATH=%PATH%;%USERPROFILE%\Desktop\context\tex\texmf-mswin\bin Or this (if you use ConTeXt for 64bit): set PATH=%PATH%;%USERPROFILE%\Desktop\context\tex\texmf-win64\bin Then, on the same window (since this only sets paths for the current session), run: mtxrun --generate && cd %USERPROFILE%\Desktop\ && context test-doc.tex Just in case you wonder, the first command is required for any brand-new install. The second command sets the desktop as your current directory (where you should have "test.doc.tex"). And the third command compiles that source document. If none of all my previous suggestions works, sorry but I cannot figure out what might be preventing ConTeXt from finding the format files. Just in case it might help, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://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: Fwd: Re: Working with layer sets with Metapost
Hi, Try \startTEXpage[pagestate=start] /Mikael On Mon, Feb 19, 2024 at 2:31 PM Emanuel Han via ntg-context wrote: > > I just made a strange observation in the output pdf of the attached > layer_set.tex, which is that when opening it with a pdf viewer like skim or > macos preview and showing miniatures, all pages except the last one show page > number 1 (the last showing page number 2). > > Which was not the case with the output pdf of the attached > multipage_metapost_mwe-very_simple.tex. > > How can I change my code to have proper consecutive page numbering in a pdf > viewer? > > On Feb. 17 2024, at 11:03 am, Emanuel Han via ntg-context > wrote: > > I think I could solve all the problems. Attached the finalized working > example. I created the > https://wiki.contextgarden.net/MetaPost#Layer_sets_as_individual_pages entry > with it. Feel free to modify. > > Cheers > Emanuel > > On Feb. 16 2024, at 7:56 am, Mikael Sundqvist wrote: > > Hi, > > not sure I get what you are missing. But you can try > > setbounds currentpicture to (fullsquare scaled 200) ; > > in base. And then do > > \dorecurse{5}{ > \startTEXpage[offset=1DK] > \useMPgraphic{layerset#1} > \stopTEXpage > } > > if that is the looping you are after. > > /Mikael > > On Fri, Feb 16, 2024 at 6:54 AM Emanuel Han via ntg-context > wrote: > > > > Resp. the solution should be such that each generated PDF page has the same > > dimension, the same background colour and a page number and the metapost > > content on each page has the same scaling factor. > > > > On Feb. 15 2024, at 11:10 pm, Emanuel Han via ntg-context > > wrote: > > > > Dear Mikael, > > > > I actually need to keep the \dorecurse mechanism of the mwe (from line 44 > > on), because I need the "setbounds currentpicture to TheFrame" and also > > because I need page numbering inside the MPpage, as done with draw > > textext(decimal(currentime)). > > > > So, how can I use the \useMPgraphic{layerset1} etc. inside the \dorecurse, > > assuming I name my layersets "layerset1", "layerset2", "layerset3" etc.? > > > > Emanuel > > > > On Feb. 15 2024, at 10:07 pm, Emanuel Han via ntg-context > > wrote: > > > > Dear Mikael, > > thanks a lot! > > this seems to be the solution! And it looks beatiful enough to me > > I'll try to port all my layers to this new method and see if I run into new > > problems again > > > > Emanuel > > > > > > On Feb. 15 2024, at 8:19 am, Mikael Sundqvist wrote: > > > > Hi > > > > On Thu, Feb 15, 2024 at 1:03 AM Emanuel Han via ntg-context > > wrote: > > > > > > Dear list, > > > > > > the attached .tex file is the minimal working example we discussed today > > > in the online meeting. > > > > > > I realized that the approach of looping through k of p[k] is not fitting > > > my needs, because it's not flexible enough. > > > > > > I need another approach, one which works with layer sets. > > > > > > I would stop using p as an array, because with the layer sets approach we > > > don't have a fixed order of the layers. > > > > > > So the definition of the layers would be something like > > > > > > picture layerA; > > > layerA:=image( > > > label("Word 1", z1); > > > ); > > > > > > picture layerW; > > > layerW:=image( > > > label("Mot 2", z2); > > > ); > > > > > > picture layerM; > > > layerM:=image( > > > label("Parola 3", z3); > > > ); > > > > > > picture layerC; > > > layerC:=image( > > > label("Wort 4", z3+z1); > > > ); > > > > > > picture layerY; > > > layerY:=image( > > > label("Nummer 5", z2+z3); > > > ); > > > > > > picture layerU; > > > layerU:=image( > > > label("number 6", z2+z1); > > > ); > > > > > > After that, I would define layer sets and layer subsets. This will be > > > done manually for each layer set and each layer subset. > > > I don't know the proper syntax to do that. Let's assume we could use a > > > variable type called "myset". > > > > > > myset layersubsetGamma; > > > layersubsetGamma:={layerU,layerM}; > > > > > > In my logic, the layers will be drawn in the order of their appearance > > > within the {}. In the example, drawn content of layerM might cover drawn > > > content of layerU. > > > > > > Contrary to a layer subset, each layer set will result in a PDF page, and > > > thus the layer sets are related to each other by an inner order. That's > > > why I would use an array variable here with []. > > > > > > I don't know how to append a set. In the following example, I assumed > > > there would be a function myappend(, > > initial set should be appended with>) > > > > > > myset layerset[]; > > > layerset1 := {layerW,layerA}; > > > layerset2 := myappend{layerset1, layerY}; > > > layerset3 := myappend{layerset2, layersubsetGamma}; > > > layerset4 := myappend{layerset2, layerU}; > > > layerset5 := myappend{layerset4, layersubsetGamma}; > > > > > > Finally, I would need each layerset[k] typeset on its own pdf page. And > > > of course on each page k, only the layers which appear in the definition > > > of the
[NTG-context] Re: Sorry for once more asking, i am at Work
On 2/19/24 13:06, Ursula Hermann wrote: > Dear List, > > I have done the new download at Work. After compiling is always the same: > > Command Line: context.exe --synctex=-1 "context-test.tex" > […] > startup error : no format file given, quitting Dear Uschi, it is really hard to know what is wrong with your installation (other than it ConTeXt is not able to find your format file). Sorry if this message is painfully verbose, but I will try not to take anything for granted (so I don’t overlook anything relevant). Could you save a new "test-doc.tex" file in your desktop directory (which would be named "%USERPROFILE%\Desktop\test-doc.tex" [including its full path])? "%USERPROFILE%\Desktop\test-doc.tex" should contain: \starttext \input zapf \stoptext Please, compile it by simply invoking ("cd %USEPROFILE%\Desktop\" might be required before): context test-doc If you get the same error message: > startup error : no format file given, quitting You might try (to make the format file): context --make --all Then, try compiling again (run "context test-doc"). If you get the same error message, let’s try a brand-new installation (not removing any existing one). Get http://lmtx.pragma-ade.nl/install-lmtx/context-mswin.zip (if you use Windows 32bt) or http://lmtx.pragma-ade.nl/install-lmtx/context-win64.zip (for Windows 64bit) into "%USERPROFILE%\Desktop\". Unzip the downloaded file to a newly created folder in your desktop ("%USERPROFILE%\Desktop\context"). Double-click on "install.bat" that you just uncompressed. You have to add the new path, so that Windows may find your executables. Open a new terminal (I guess it is called “command prompt” [or »Eingabeaufforderung«] in Windows-parlance) and paste (if you have ConTeXt for 32bit): set PATH=%PATH%;%USERPROFILE%\Desktop\context\tex\texmf-mswin\bin Or this (if you use ConTeXt for 64bit): set PATH=%PATH%;%USERPROFILE%\Desktop\context\tex\texmf-win64\bin Then, on the same window (since this only sets paths for the current session), run: mtxrun --generate && cd %USERPROFILE%\Desktop\ && context test-doc.tex Just in case you wonder, the first command is required for any brand-new install. The second command sets the desktop as your current directory (where you should have "test.doc.tex"). And the third command compiles that source document. If none of all my previous suggestions works, sorry but I cannot figure out what might be preventing ConTeXt from finding the format files. Just in case it might help, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://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] Fwd: Re: Working with layer sets with Metapost
I just made a strange observation in the output pdf of the attached layer_set.tex, which is that when opening it with a pdf viewer like skim or macos preview and showing miniatures, all pages except the last one show page number 1 (the last showing page number 2). Which was not the case with the output pdf of the attached multipage_metapost_mwe-very_simple.tex. How can I change my code to have proper consecutive page numbering in a pdf viewer?On Feb. 17 2024, at 11:03 am, Emanuel Han via ntg-context wrote:I think I could solve all the problems. Attached the finalized working example. I created the https://wiki.contextgarden.net/MetaPost#Layer_sets_as_individual_pages entry with it. Feel free to modify.CheersEmanuelOn Feb. 16 2024, at 7:56 am, Mikael Sundqvist wrote:Hi,not sure I get what you are missing. But you can trysetbounds currentpicture to (fullsquare scaled 200) ;in base. And then do\dorecurse{5}{\startTEXpage[offset=1DK]\useMPgraphic{layerset#1}\stopTEXpage}if that is the looping you are after./MikaelOn Fri, Feb 16, 2024 at 6:54 AM Emanuel Han via ntg-context wrote:>> Resp. the solution should be such that each generated PDF page has the same dimension, the same background colour and a page number and the metapost content on each page has the same scaling factor.>> On Feb. 15 2024, at 11:10 pm, Emanuel Han via ntg-context wrote:>> Dear Mikael,>> I actually need to keep the \dorecurse mechanism of the mwe (from line 44 on), because I need the "setbounds currentpicture to TheFrame" and also because I need page numbering inside the MPpage, as done with draw textext(decimal(currentime)).>> So, how can I use the \useMPgraphic{layerset1} etc. inside the \dorecurse, assuming I name my layersets "layerset1", "layerset2", "layerset3" etc.?>> Emanuel>> On Feb. 15 2024, at 10:07 pm, Emanuel Han via ntg-context wrote:>> Dear Mikael,> thanks a lot!> this seems to be the solution! And it looks beatiful enough to me > I'll try to port all my layers to this new method and see if I run into new problems again >> Emanuel>>> On Feb. 15 2024, at 8:19 am, Mikael Sundqvist wrote:>> Hi>> On Thu, Feb 15, 2024 at 1:03 AM Emanuel Han via ntg-context> wrote:> >> > Dear list,> >> > the attached .tex file is the minimal working example we discussed today in the online meeting.> >> > I realized that the approach of looping through k of p[k] is not fitting my needs, because it's not flexible enough.> >> > I need another approach, one which works with layer sets.> >> > I would stop using p as an array, because with the layer sets approach we don't have a fixed order of the layers.> >> > So the definition of the layers would be something like> >> > picture layerA;> > layerA:=image(> > label("Word 1", z1);> > );> >> > picture layerW;> > layerW:=image(> > label("Mot 2", z2);> > );> >> > picture layerM;> > layerM:=image(> > label("Parola 3", z3);> > );> >> > picture layerC;> > layerC:=image(> > label("Wort 4", z3+z1);> > );> >> > picture layerY;> > layerY:=image(> > label("Nummer 5", z2+z3);> > );> >> > picture layerU;> > layerU:=image(> > label("number 6", z2+z1);> > );> >> > After that, I would define layer sets and layer subsets. This will be done manually for each layer set and each layer subset.> > I don't know the proper syntax to do that. Let's assume we could use a variable type called "myset".> >> > myset layersubsetGamma;> > layersubsetGamma:={layerU,layerM};> >> > In my logic, the layers will be drawn in the order of their appearance within the {}. In the example, drawn content of layerM might cover drawn content of layerU.> >> > Contrary to a layer subset, each layer set will result in a PDF page, and thus the layer sets are related to each other by an inner order. That's why I would use an array variable here with [].> >> > I don't know how to append a set. In the following example, I assumed there would be a function myappend(, )> >> > myset layerset[];> > layerset1 := {layerW,layerA};> > layerset2 := myappend{layerset1, layerY};> > layerset3 := myappend{layerset2, layersubsetGamma};> > layerset4 := myappend{layerset2, layerU};> > layerset5 := myappend{layerset4, layersubsetGamma};> >> > Finally, I would need each layerset[k] typeset on its own pdf page. And of course on each page k, only the layers which appear in the definition of the layerset[k] should be drawn on top of each other in the order as they appear in that definition.> >> > I'm very curious to hear your suggestions.> >>> Not beautiful, perhaps, but maybe something like this could work? I> think there is no way out of doing some manual work to tell what you> want included on each page.>> \startuseMPgraphic{base}> z1 = origin ;> z2 = (10,50) ;> z3 = (40,30) ;>> picture layerA;> layerA:=image(> label("Word 1", z1);> );>> picture layerW;> layerW:=image(> label("Mot 2", z2);> );>> picture layerM;> layerM:=image(> label("Parola 3", z3);> );>> picture layerC;> layerC:=image(> label("Wort 4", z3+z1);> );>> picture layerY;> layerY:=image(> label("Nummer
[NTG-context] Re: Sorry for once more asking, i am at Work
Hi Uschi, The log file is certainly helpful. It tells me two things. First, you have TeX Live 2023 installed. TeX Live 2023 has a good version of ConTeXt. Unless you need specific, newer ConTeXt features, you can use the ConTeXt version in TeX Live that you already have. Second, when you tried to typeset your file, context-test.tex, your computer attempted to use pdftex rather than ConTeXt. To figure out why it did that, we need to know how you are doing the typesetting. Do you use a command on the command line? Are use using an editor that has a “typeset” button? Something in that part of the process needs to be changed so the typesetting uses ConTeXt rather than pdftex. Gavin > On Feb 19, 2024, at 5:06 AM, Ursula Hermann > wrote: > > Dear List, > I have done the new download at Work. After compiling is always the same: > Command Line: context.exe --synctex=-1 "context-test.tex" > Startup Folder: > C:\Users\Hermann\Downloads\context-mswin\tex\texmf-context\tex\context\test\mkiv > startup error : no format file given, quitting > I wrote on Wednesday last week. I also did an download of cont- lmt and cont- > tmf. Don’t know if there is a mistake which is my fault? > I don’t know, maybe important: > The log file says: > This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded > format=pdflatex 2024.2.6) 19 FEB 2024 12:41 > entering extended mode > restricted \write18 enabled. > %&-line parsing enabled. > **context-test.tex > (./context-test.tex > LaTeX2e <2023-11-01> patch level 1 > L3 programming layer <2024-01-22> > ! Undefined control sequence. > l.1 \starttext > ? ! Emergency stop. > l.1 >End of file on the terminal! > Here is how much of TeX's memory you used: > 16 strings out of 474221 > 403 string characters out of 5750189 > 1922978 words of memory out of 500 > 22371 multiletter control sequences out of 15000+60 > 558069 words of font info for 36 fonts, out of 800 for 9000 > 1141 hyphenation exceptions out of 8191 > 12i,0n,13p,58b,8s stack positions out of 1i,1000n,2p,20b,20s > ! ==> Fatal error occurred, no output PDF file produced! > Uschi > Von: Ursula Hermann > Gesendet: Mittwoch, 14. Februar 2024 14:16 > An: 'mailing list for ConTeXt users' > Betreff: AW: Sorry for once more asking, i am at Work > Dear Hans, > This was before you wrote, that you did an new upload, but i saw it in the > installation. Because there were more files. > Uschi > Von: Ursula Hermann > Gesendet: Mittwoch, 14. Februar 2024 13:42 > An: 'mailing list for ConTeXt users' > Betreff: Sorry for once more asking, i am at Work > So after a new update on my Computer at Work, I did once more download the > installation. After compiling with context-mswin I got this file > Command Line: context.exe --synctex=-1 "context-test.tex" > Startup Folder: > C:\Users\Hermann\Downloads\context-mswin\tex\texmf-context\tex\context\test\mkiv > startup error : no format file given, quitting > > ConTeXt Compilation Report (Pages: 0) > Errors: 0 Warnings: 0 Bad Boxes: 0 > Did I something wrong? > Uschi > ___ > 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: lmt_shade fails
Dear Keith, > Le 18 févr. 2024 à 11:44, Keith McKay a écrit : > > Hi all > I went to use the lmt_shade function and it fails with two error messages. > the first one is: > > metafun > log > error: Not a cycle > > followed by lots of trace messages, then: > > metafun > log > That contour should have ended with '.. cycle' or '& > cycle'. So I'll not change > anything just now. > > The MWE I used is as follows: > > \starttext > \startMPpage > definecolor [ name = "MyColor3", r = uniformdeviate(1), g = > uniformdeviate(1), b = uniformdeviate(1) ] ; > definecolor [ name = "MyColor4", r = uniformdeviate(1), g = > uniformdeviate(1), b = uniformdeviate(1) ] ; > draw lmt_shade [ > path = fullsquare scaled 5cm, > direction = "up", > alternative = "linear", > colors = { "red", "green" }, > ]; > \stopMPpage > \stoptext > I'm using: > > system > ConTeXt ver: 2024.02.14 13:38 LMTX fmt: 2024.2.15 int: > english/english > > on a mac mini M1. > > Any thougths? > On an Mac running ConTeXt ver: 2023.09.26 18:19 LMTX fmt: 2023.12.11 , this works perfectly. > Best wishes > > Keith McKay > Fabrice. > ___ > 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] Text in Margin
In a textbook I am looking to place a large left margin at every page of each chapter. At left printed pages a left margin and at right printed pages a right margin, so like a double sided construction. In this margin I would like to place: 1. Keywords and small descriptions to emphasize some text from the textflow 2. Figures 3. An expansion of a table that is placed in the main textflow but that needs to cover a wider range then the text area so it expands into the margin What is the the easiest way to achieve this? Jeroen ___ 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] using an end of line as parameter
Dear list, I want to format some language tests that different people are preparing. Each one uses different software and there are always problems in format that i want to solve. for a a/b/c questions I receive text that I will format to a list (comments are mine) In den Büchereien gibt es auch … %the question … Kuchen. %option a … Theater. %option b … Workshops. %option c I need to detect \par or whatever sign marks the newline character as an argument delimiter so that I dont have to paste hundreds of times braces for each argument. For the example, I use this macro definition (which does no work!) \long\def\prueba #1\par#2\par#3\par#4ñ{\framed[frame=off,width=0.8\textwidth,corner=round,offset=1em,align=flushleft]% {{\bf Beispiel}: #1\\ \qquad a) #2\\ \qquad b) {\bf #3}\\ \qquad c) #4 } I get: tex error on line 493 in file ./prueba.tex: The file ended when scanning an argument. the macro seems to read to the end of file not detecting \par; I know its the \par that causes the problem; I used ^^M also which I read is a sinonym for return but it also does not work. Help would be appreciated (my computer keyboard would appreciate it too...) ___ 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: Sorry for once more asking, i am at Work
Dear List, I have done the new download at Work. After compiling is always the same: Command Line: context.exe --synctex=-1 "context-test.tex" Startup Folder: C:\Users\Hermann\Downloads\context-mswin\tex\texmf-context\tex\context\test\mkiv startup error : no format file given, quitting I wrote on Wednesday last week. I also did an download of cont- lmt and cont- tmf. Don't know if there is a mistake which is my fault? I don't know, maybe important: The log file says: This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=pdflatex 2024.2.6) 19 FEB 2024 12:41 entering extended mode restricted \write18 enabled. %&-line parsing enabled. **context-test.tex (./context-test.tex LaTeX2e <2023-11-01> patch level 1 L3 programming layer <2024-01-22> ! Undefined control sequence. l.1 \starttext ? ! Emergency stop. l.1 End of file on the terminal! Here is how much of TeX's memory you used: 16 strings out of 474221 403 string characters out of 5750189 1922978 words of memory out of 500 22371 multiletter control sequences out of 15000+60 558069 words of font info for 36 fonts, out of 800 for 9000 1141 hyphenation exceptions out of 8191 12i,0n,13p,58b,8s stack positions out of 1i,1000n,2p,20b,20s ! ==> Fatal error occurred, no output PDF file produced! Uschi Von: Ursula Hermann Gesendet: Mittwoch, 14. Februar 2024 14:16 An: 'mailing list for ConTeXt users' Betreff: AW: Sorry for once more asking, i am at Work Dear Hans, This was before you wrote, that you did an new upload, but i saw it in the installation. Because there were more files. Uschi Von: Ursula Hermann Gesendet: Mittwoch, 14. Februar 2024 13:42 An: 'mailing list for ConTeXt users' mailto:ntg-context@ntg.nl>> Betreff: Sorry for once more asking, i am at Work So after a new update on my Computer at Work, I did once more download the installation. After compiling with context-mswin I got this file Command Line: context.exe --synctex=-1 "context-test.tex" Startup Folder: C:\Users\Hermann\Downloads\context-mswin\tex\texmf-context\tex\context\test\mkiv startup error : no format file given, quitting ConTeXt Compilation Report (Pages: 0) Errors: 0 Warnings: 0 Bad Boxes: 0 Did I something wrong? Uschi ___ 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 ___