[NTG-context] Re: margin bigger than backspace pushes it outside the edge
Thanks Wolfgang. Is this expected behavior? I'm very much confused with my second example: \setuppapersize[A5][A4] %\setuplayout[location=middle] \setuplayout[location=middle,width=middle] %\setuplayout[location=middle,width=middle,backspace=2.5cm] \usemodule[ipsum] \starttext \showframe Hello \stoptext With just \setuplayout[location=middle] the left margin gets outside the left edge, there's also a gap to the right of the right margin and, to the eye, it seems that the sum leftmargin+leftmargindistance+textwidth+rightmargindistance+rightmargin doesn not match the page width. With \setuplayout[location=middle,width=middle] all is symmetrical but the two margins go outside the edges. With e.g. \setuplayout[location=middle,width=middle,backspace=2.5cm] I can fit everything by manually adjusting the backspace to I'm not sure what the right value. I couldn't adjust the page layout on some more complex document, so I'm going back to the most basic layout and trying to make it work on the simplest document possible. JG Le dimanche 10 décembre 2023 à 11:53:07 UTC+1, Wolfgang Schuster a écrit : Jigé via ntg-context schrieb am 10.12.2023 um 11:30: > Hi all, > I've been struggling with basic page layout. > > The left margin extends outside the left edge of the page. > Example (from the wiki): > > \setuppapersize[A4][A4] % this is the default and may be omitted > \setuplayout[backspace=20mm, leftmargin=10mm, leftmargindistance=5mm, > width=110mm, > topspace=20mm, > header=0mm, > footer=0mm, > height=250mm] > \starttext > \showlayout > \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://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] margin bigger than backspace pushes it outside the edge
Hi all, I've been struggling with basic page layout. The left margin extends outside the left edge of the page. Example (from the wiki): \setuppapersize[A4][A4] % this is the default and may be omitted \setuplayout[backspace=20mm, width=110mm, topspace=20mm, header=0mm, footer=0mm, height=250mm] \starttext \showlayout \stoptext Another example: \setuppapersize[A5][A4] \setuplayout[location=middle] \usemodule[ipsum] \starttext \showframe \ipsum \stoptext Thanks, Jean-Guillaume mise_en_page-layout.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://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] TiKz with LMTX
Thanks a lot Aditya. The very simple TikZ example with the cross works. The more complex example with the trigonometric circle from the pgf manual, quoted in https://wiki.contextgarden.net/TikZ , does not compile unless you also comment out or find(n,"pdftex") in line 181 of the mtx-install-modules.lua file before doing mtxrun --script install-modules --install tikz but I could guess that from a: Driver file ``pgfsys-pdftex.def'' not found.. message Thanks again Jean-Guillaume Le jeudi 8 juin 2023 à 12:28:34 UTC+2, a écrit : Date: Mon, 5 Jun 2023 22:32:37 -0400 (EDT) From: Aditya Mahajan To: Aditya Mahajan via ntg-context Subject: Re: [NTG-context] TiKz with LMTX Message-ID: Content-Type: text/plain; charset="iso-8859-15" On Mon, 5 Jun 2023, Aditya Mahajan via ntg-context wrote: > On Sun, 4 Jun 2023, Jig? via ntg-context wrote: > > > > $ mkdir ~/.local/share/context > > $ cd ~/.local/share/context > > $ wget https://lmtx.pragma-ade.com/install-lmtx/context-linux-64.zip > > $ unzip context-linux-64.zip > > $ sh install.sh > > $ rm context-linux-64.zip > > $ cd ~/.local/share/context/tex > > $ mtxrun --script install-modules --list > > $ mtxrun --script install-modules --install tikz > > (And for good measure, I later did `mtxrun --script install-modules > > --install all`) > > > > $ cd my-working-directory > > $ vi some-sample-context-file.tex > > $ export PATH=/home/myname/.local/share/context/tex/texmf-linux-64/bin:$PATH > > $ context some-sample-context-file.tex > > > > Did I miss anything? It works just fine. > > On a new machine and pgfsys-luatex.def is missing for me as well. I'll try to > check what is going on. This was a bit crazy to track down. Here is the fix: In line 180 of mtx-install-modules.lua, comment the line or find(n,"luatex") Otherwise, the file tex/generic/pgf/systemlayer/pgfsys-luatex.def is not extracted from the tikz.zip! I don't know why OP and I (both on archlinux) were the only ones who had pgfsys-luatex.def missing. Everyone should have been affected by this. Aditya PS: Also on line 103, it may be a good idea to change the curl call to curl --ssl --location mirros.ctan.org will also do a HTTP 302 redirect and without the --location flag, curl will not follow the redirect. ___ 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] TiKz with LMTX
When I asked about the fresh install, I think I was asking to Mikael who can compile the sample file. Sorry Floris, this was not clear enough because I've been answering to the mailing-list digest and not to invidual messages. Mikael, maybe you have in your $PATH some remembrances of past installation / files? Jean-Guillaume Le lundi 5 juin 2023 à 15:15:46 UTC+2, a écrit : For whatever it is worth, I just tried to install tikz with mtxrun --script install-modules --install tikz and then your example in your first mail did compile here (and gave a cross, and that looks right from the source). /Mikael On 05/06/2023 12:33, Jig? via ntg-context wrote: > Did you do that in a fresh install? yes ___ 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] TiKz with LMTX
Did you do that in a fresh install? Le lundi 5 juin 2023 à 08:26:15 UTC+2, a écrit : For whatever it is worth, I just tried to install tikz with mtxrun --script install-modules --install tikz and then your example in your first mail did compile here (and gave a cross, and that looks right from the source). /Mikael ___ 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] TiKz with LMTX
I tried: $ mtxrun --generate and also commenting out "source/generic/**" in mtx-install-imp-tikz.lua but with no success. Same error: Driver file ``pgfsys-luatex.def'' not found. This file does not exist in my installation. $ find ~/.local/share/context -iname "*.def" /home/myname/.local/share/context/tex/texmf-modules/tex/generic/pgf/systemlayer/pgfsys-vtex.def /home/myname/.local/share/context/tex/texmf-modules/tex/generic/pgf/systemlayer/pgfsys-textures.def /home/myname/.local/share/context/tex/texmf-modules/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def /home/myname/.local/share/context/tex/texmf-modules/tex/generic/pgf/systemlayer/pgfsys-dvisvgm4ht.def /home/myname/.local/share/context/tex/texmf-modules/tex/generic/pgf/systemlayer/pgfsys-dvipdfm.def /home/myname/.local/share/context/tex/texmf-modules/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def /home/myname/.local/share/context/tex/texmf-modules/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def /home/myname/.local/share/context/tex/texmf-modules/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def /home/myname/.local/share/context/tex/texmf-modules/tex/generic/pgf/systemlayer/pgfsys-tex4ht.def /home/myname/.local/share/context/tex/texmf-modules/tex/generic/pgf/systemlayer/pgfsys-dvisvgm.def /home/myname/.local/share/context/tex/texmf-modules/tex/generic/pgf/systemlayer/pgfsys-dvi.def /home/myname/.local/share/context/tex/texmf-modules/tex/generic/pgf/systemlayer/pgfsys-common-svg.def /home/myname/.local/share/context/tex/texmf-modules/tex/generic/pgf/systemlayer/pgfsys-xetex.def /home/myname/.local/share/context/tex/texmf-modules/tex/generic/pgf/systemlayer/pgfsys-dvips.def /home/myname/.local/share/context/tex/texmf-modules/tex/generic/pgf/utilities/pgfutil-context.def /home/myname/.local/share/context/tex/texmf-modules/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-xetex.def /home/myname/.local/share/context/tex/texmf-modules/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-dvips.def /home/myname/.local/share/context/tex/texmf-modules/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-dvipdfmx.def Il tried using some of these files by writing them in context/tex/texmf-modules/tex/generic/pgf/systemlayer/pgf.cfg , by the way, but it either doesn't compile or produces a bad picture. Here are some quotes from the online pgf/tikz manual ( https://tikz.dev/drivers#section-formats ) : > 10.2.1 Selecting the Backend Driver > > When TEX typesets your document, it does not know which program you are going > to use to transform the .dvi-file. If your .dvi-file does not contain any > special commands, > this would be fine; but these days almost all .dvi-files contain lots of > special commands. > It is thus necessary to tell TEX which program you are going to use later on. > > Unfortunately, there is no “standard” way of telling this to TEX. > For the LATEX format a sophisticated mechanism exists inside the graphics > package > and pgf plugs into this mechanism. For other formats and when this plugging > does not work > as expected, it is necessary to tell pgf directly which program you are going > to use. > This is done by redefining the macro \pgfsysdriver to an appropriate value > before you load pgf. > If you are going to use the dvips program, you set this macro to the value > pgfsys-dvips.def; > if you use pdftex or pdflatex, you set it to pgfsys-pdftex.def; and so on. > In the following, details of the support of the different programs are > discussed. > > 10.2.2 Producing PDF Output > > pgf supports three programs that produce pdf output [...]: > dvipdfm, pdftex, and vtex. The pdflatex program is the same as the pdftex > program: > it uses a different input format, but the output is exactly the same. > > File pgfsys-pdftex.def > This is the driver file for use with pdfTEX, that is, with the pdftex or > pdflatex command. > It includes pgfsys-common-pdf.def. > > This driver has a lot of functionality. > (Almost) everything pgf “can do at all” is implemented in this driver. > > File [...] [...] (And so on with pgfsys-dvipdfm.def pgfsys-xetex.def pgfsys-vtex.def... Basicaly all the other drivers cited have serious shortcomings in processing TiKz pictures.) So, we need the driver: pgfsys-luatex.def . Or do we? The name of this driver is guessed at compile time. ___ 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] TiKz with LMTX
Hi all. I'm trying to use TiKz inside ConTeXt. It has not been working for some time... I checked the messages from last month on the mailing list (late april, early may). Il didn't quit actually understand what was going on but I read that some files had to be updated. Maybe as a workaround, while waiting for a new LMTX format? Users reported it to work after some file updates. So, because I was using a TeXlive package on Gnu/Archlinux, which might be updated only after a few months or a year, I followed the wiki and did a personal fresh install like this : $ mkdir ~/.local/share/context $ cd ~/.local/share/context $ wget https://lmtx.pragma-ade.com/install-lmtx/context-linux-64.zip $ unzip context-linux-64.zip $ sh install.sh $ rm context-linux-64.zip $ cd ~/.local/share/context/tex $ mtxrun --script install-modules --list $ mtxrun --script install-modules --install tikz (And for good measure, I later did `mtxrun --script install-modules --install all`) $ cd my-working-directory $ vi some-sample-context-file.tex $ export PATH=/home/myname/.local/share/context/tex/texmf-linux-64/bin:$PATH $ context some-sample-context-file.tex Did I miss anything? It works just fine. But with a TiKz picture included, a very simple one like this: \usemodule[tikz] \starttext We are working on \starttikzpicture \draw (-1.5,0) -- (1.5,0); \draw (0,-1.5) -- (0,1.5); \stoptikzpicture. \stoptext It doesn't compile. The output begins with: resolvers | formats | executing runner 'run luametatex format': [...] and ends with: [...] open source > level 4, order 11, name 'pgf.cfg' close source> level 4, order 11, name 'pgf.cfg' Driver file for pgf: pgfsys-luatex.def tex error > tex error on line 1757 in file pgfsys.code.tex: Package pgf Error: Driver file ``pgfsys-luatex.def'' not found. \pgfutil@packageerror #1#2#3->\errhelp {#3}\errmessage {Package #1 Error: #2} \pgfutil@IfFileExists #1#2#3->\openin \pgfutil@inputcheck =#1 \ifeof \pgfutil@inputcheck #3 \relax \else #2\relax \fi \closein \pgfutil@inputcheck \pgferror{Driver file ``\pgfsysdriver'' not found.}} This error message was generated by an \errmessage command, so I can't give any explicit help. Pretend that you're Hercule Poirot: Examine all clues, and deduce the truth by order and method. mtx-context | fatal error: return code: 1 The PATH is set correctly, this is not the output from using the regular TeXlive package which uses luatex, terminates because it doesn't understand \pgfsetxvec{\pgfpoint{1cm}{0cm}} and makes no reference to Hercule Poirot. I ingenuously tried to explicitly set some formats in the file ~/.local/share/context/tex/texmf-modules/tex/generic/pgf/systemlayer/pgf.cfg but with no success. Is it related to this issue: https://github.com/pgf-tikz/pgf/issues/990 ? Thanks in advance!... Best regards Jean-Guillaume ___ 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] \installpagearrangement doublesided stickers
Thanks a lot Willi, Sorry for the late reply. Actually, for a while I couldn't make it work. But It seems it was just my \dosetuparrangement that was wrong. Now it works. Here it is, cleaned-up: \installpagearrangement 2*5*double*2*5 {\dosetuparrangement{2}{5}{10}{3}{6} % number of pages on the x axis, % number of pages on the y axis, % total (?), % number of cutmarks on the x axis, % number of cutmarks on the y axis, \pusharrangedpageTWOFIVEDOUBLESIDED\poparrangedpagesAB\relax} \def\pusharrangedpageTWOFIVEDOUBLESIDED#1% {\advancearrangedpageN \reportarrangedpage\arrangedpageN \ifcase\arrangedpageN \or \handlearrangedpageXandY{#1}000\arrangedpageA % 1 % Numbers starting from 0: % rotation state, % horizontal placement, % vertical placement. \\or \handlearrangedpageXandY{#1}010\arrangedpageB % 2 \or \handlearrangedpageXandY{#1}010\arrangedpageA % 3 \or \handlearrangedpageXandY{#1}000\arrangedpageB % 4 \or \handlearrangedpageXandY{#1}001\arrangedpageA % 5 \or \handlearrangedpageXandY{#1}011\arrangedpageB % 6 \or \handlearrangedpageXandY{#1}011\arrangedpageA % 7 \or \handlearrangedpageXandY{#1}001\arrangedpageB % 8 \or \handlearrangedpageXandY{#1}002\arrangedpageA % 9 \or \handlearrangedpageXandY{#1}012\arrangedpageB % 10 \or \handlearrangedpageXandY{#1}012\arrangedpageA % ... \or \handlearrangedpageXandY{#1}002\arrangedpageB % \or \handlearrangedpageXandY{#1}003\arrangedpageA % \or \handlearrangedpageXandY{#1}013\arrangedpageB % \or \handlearrangedpageXandY{#1}013\arrangedpageA % \or \handlearrangedpageXandY{#1}003\arrangedpageB % \or \handlearrangedpageXandY{#1}004\arrangedpageA % \or \handlearrangedpageXandY{#1}014\arrangedpageB % \or \handlearrangedpageXandY{#1}014\arrangedpageA % \or \handlearrangedpageXandY{#1}004\arrangedpageB % \poparrangedpages \fi} \definepapersize[Vignette][width=80.0mm,height=50.0mm] \setuppapersize [Vignette][A4] \setuparranging [2*5*double*2*5] \setuplayout [margin=0pt, location=middle, marking=on] \showframe \starttext \dorecurse{20}{\vbox to \textheight{\vfill\midaligned{\tfd ABC}\vfill}\page} \stoptext My aim is to have something as plain as possible so I can modify it quickly to print double-sided cards, more likely from an image, instead of using some clumsy wysiwyg editor. Next thing is to find a sensible name for the layout. I'm not sure about the 2*5*double*2*5 name. Thanks again. > Date: Sat, 22 Jan 2022 22:20:36 +0100 > From: Willi Egger > To: mailing list for ConTeXt users > Subject: Re: [NTG-context] \installpagearrangement doublesided > stickers > Message-ID: <6a631259-75dc-4b7f-be10-a0584908b...@boede.nl> > Content-Type: text/plain; charset=utf-8 > > Hello Jigé, > > Adapt your layout to the following and it works. > > \setuplayout > [%] > margin=0mm, > topspace=0mm, > backspace=1mm, > width=80mm, > height=50mm, > nx=2, > ny=5, > dx=0mm, > dy=0mm, > location=middle, > marking=on, > ] > > Kind regards > Willi > >> On 16 Jan 2022, at 15:18, Jigé via ntg-context wrote: >> >> Greetings everyone. >> >> Well, it's not exactly about double-sided stickers but sort of. Imagine >> printing a double-sided sheet and using a so-called plastifying device to >> make tokens. >> I began with the File Card and Labels examples from the wiki, then tried to >> change the \installpagearrangement example from the 'imposition' wiki page. >> >> My question is: >> how to position everything in the middle of the sheet, so that double-siding >> actually works? >> As is, it's all in the top left corner. Changing the location argument for >> "location=middle" in \setuplayout doesn't work here. What should it be? >> >> By the way, I'm not sure about the 3rd, 4th and 6th arguments in the >> dosetuparrangement command. >> >> Thanks a lot! >> >> Here it is: >> >> \installpagearrangement 2*5*double*2*5 >> {\dosetuparrangement{5}{2}{10}{3}{6}% X,Y,Total,hcutmarks,vcutmarks >> \pusharrangedpageTWOFIVEDOUBLESIDED\poparrangedpagesAB\relax} >> >> \def\pusharrangedpageTWOFIVEDOUBLESIDED#1% >> {\advancearrangedpageN >> \reportarrangedpage\arrangedpageN >> \ifcase\arrangedpageN >> \or \handlearrangedpageXandY{#1}000\arrangedpageA % 1 rot,hskip,vskip >> \or \handlearrangedpageXandY{#1}010\arrangedpageB % 2 >> \or \handlearrangedpageXandY{#1}010\arrangedpageA % 3 >> \or \handlearrangedpageXandY{#1}000\arrangedpageB % 4 >> \or \handlearrangedpageXandY{#1}001\arrangedpageA % 5 >> \or \handlearrangedpageXandY{#1}011\arrangedpageB % 6 >> \or \handlearrangedpageXandY{#1}011\arrangedpageA % 7 >> \or \handlearrangedpageXandY{#1}001\arrangedpageB % 8 >> \or \handlearrangedpageXandY{#1}002\arrangedpage
[NTG-context] \installpagearrangement doublesided stickers
Greetings everyone. Well, it's not exactly about double-sided stickers but sort of. Imagine printing a double-sided sheet and using a so-called plastifying device to make tokens. I began with the File Card and Labels examples from the wiki, then tried to change the \installpagearrangement example from the 'imposition' wiki page. My question is: how to position everything in the middle of the sheet, so that double-siding actually works? As is, it's all in the top left corner. Changing the location argument for "location=middle" in \setuplayout doesn't work here. What should it be? By the way, I'm not sure about the 3rd, 4th and 6th arguments in the dosetuparrangement command. Thanks a lot! Here it is: \installpagearrangement 2*5*double*2*5 {\dosetuparrangement{5}{2}{10}{3}{6}% X,Y,Total,hcutmarks,vcutmarks \pusharrangedpageTWOFIVEDOUBLESIDED\poparrangedpagesAB\relax} \def\pusharrangedpageTWOFIVEDOUBLESIDED#1% {\advancearrangedpageN \reportarrangedpage\arrangedpageN \ifcase\arrangedpageN \or \handlearrangedpageXandY{#1}000\arrangedpageA % 1 rot,hskip,vskip \or \handlearrangedpageXandY{#1}010\arrangedpageB % 2 \or \handlearrangedpageXandY{#1}010\arrangedpageA % 3 \or \handlearrangedpageXandY{#1}000\arrangedpageB % 4 \or \handlearrangedpageXandY{#1}001\arrangedpageA % 5 \or \handlearrangedpageXandY{#1}011\arrangedpageB % 6 \or \handlearrangedpageXandY{#1}011\arrangedpageA % 7 \or \handlearrangedpageXandY{#1}001\arrangedpageB % 8 \or \handlearrangedpageXandY{#1}002\arrangedpageA % 9 \or \handlearrangedpageXandY{#1}012\arrangedpageB % 10 \or \handlearrangedpageXandY{#1}012\arrangedpageA % ... \or \handlearrangedpageXandY{#1}002\arrangedpageB % \or \handlearrangedpageXandY{#1}003\arrangedpageA % \or \handlearrangedpageXandY{#1}013\arrangedpageB % \or \handlearrangedpageXandY{#1}013\arrangedpageA % \or \handlearrangedpageXandY{#1}003\arrangedpageB % \or \handlearrangedpageXandY{#1}004\arrangedpageA % \or \handlearrangedpageXandY{#1}014\arrangedpageB % \or \handlearrangedpageXandY{#1}014\arrangedpageA % \or \handlearrangedpageXandY{#1}004\arrangedpageB % \poparrangedpages \fi} \definepapersize[Etiquette][width=80.0mm,height=50.0mm] \setuppapersize [Etiquette][A4] \setuparranging [2*5*double*2*5] %\setuplayout [margin=0pt, width=fit] \setuplayout[ %location=middle,%nx=2,ny=5, %location=middle, location=left, marking=on, margin=0mm, topspace=0mm, backspace=0mm, width=fit, %header=0mm, %footer=0mm, %align=middle, ] \showframe %\setuppagenumbering[state=stop] \setuppagenumbering[alternative=doublesided] \starttext \dorecurse{20}{\vbox to \textheight{\vfill\midaligned{\tfd ABC}\vfill}\page} \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] placefigure, usetikzlibrary and readfile
Hello all. It seems that \usetikzlibrary is sometimes read, sometimes not, and I don't understand why. Rationale: I would like, using one file, to use it to produce a picture, as with LaTeX's Standalone class, but to be able to include it in a calling document as well, for better management of fonts, etc. Thus this is most convenient. I have everything in the main document and I can quickly reuse any figure elsewhere. What I did: I use \readfile in a main ConTeXt file document.tex to include the file included.tex . The file included.tex should contain *just* the TikZ picture and what is needed to compile it "standalone". The issue: It seems I can call the file with the TikZ picture description multiple times, with \readfile, from within the very same \placefigure. However, if I call it by using two successive \placefigure commands, the \usetikzlibrary[blabla] in the included file doesn't seem to be recognised. E.g. with the provided example below, the key "right angle" is not understood, as if \usetikzlibrary[angles] was not there. One workaround would be to use \usetikzlibrary[allTheLibrariesISupposeMightEverBeNeeded] in the calling file. But I don't like it. I would rather have only the TikZ libraries relevant to some picture included in the corresponding file. I'm quite startled by the fact that : > \placefigure[here][]{This is a figure}{ >\readfile{included}{}{File not found.} >\readfile{included}{}{File not found.} > } compiles but > \placefigure[here][]{This is a figure}{ >\readfile{included}{}{File not found.} > } > \placefigure[here][]{This is a figure}{ >\readfile{included}{}{File not found.} > } does not. All the best! Example: Begin document.tex \usemodule[tikz] \starttext \usetikzlibrary[angles] % Doesn't compile if this is commented out. %\placefigure[here][]{This is a figure}{ % \readfile{included}{}{File not found.} % \readfile{included}{}{File not found.} %} \placefigure[here][]{This is a figure}{ \ReadFile{included}{} } \placefigure[here][]{This is a figure}{ \ReadFile{included}{} } \stoptext End document.tex Begin included.tex \usemodule[tikz] \usetikzlibrary[angles] %\doifnotmode{*text,*bodypart}{ \startTEXpage[fit] } \doifnotmode{*text,*bodypart}{ \startTEXpage[fit] \usemodule[tikz] \usetikzlibrary[angles] } \hbox{\starttikzpicture[] \draw[] (0,0) coordinate (A) node[left] {$A$} -- (4,0) coordinate (B) node[right] {$B$} -- (0,3) coordinate (C) node[left] {$C$} -- cycle pic [draw, angle radius=0.5cm] {right angle = B--A--C} ; \stoptikzpicture} \doifnotmode{*text,*bodypart}{ \stopTEXpage } End included.tex ___ 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 ___