Hi all! Lets consider the following situation. There are 3 catalogs; ./lofo1, ./lofo2, ./lofo3, each of them contains files 'aqq.xml' and 'cow.png' for example. Filenames are the same, but they may have different content. I need to include all these files into one PDF document WITHOUT giving absolute paths in TeX code. I tried something like \usepath[lofo1] \processXMLfilegrouped{aqq.xml} \usepath[lofo2] \processXMLfilegrouped{aqq.xml} \usepath[lofo3] \processXMLfilegrouped{aqq.xml} but in this example the same file (./lofo1/aqq.xml) will be processed 3 times and that is not what I need. Actually the situation is even more complicated; I have quite big XML tree with hunderts of files and images, with dozens of catalogs. I wrote a perl script which change current directory for each process and run texexec in changed one. And it works OK since I want to have separate PDF document from each `lofo?' catalog. But how to make one PDF document in such situation using \use[sub]path texnique? In other words, how to reset settings from \usepath and \usesubpath commands? And how to do the same for externalfigures? Thanks in advance, Pawe/l
problem: reseting input paths Hi Hans At 20:12 03/11/2003, Pawel wrote:
In other words, how to reset settings from \usepath and \usesubpath commands? And how to do the same for externalfigures?
From: "Hans Hagen"
\usesubpath[reset]
Thanks a lot but I still can't get it. After inspecting core-job.tex file and tried 'reset' option. Also without expected results. So what is wrong in the following code? \starttext \usesubpath[lofo1] \processXMLfilegrouped{aqq.xml} \usesubpath[reset] \usesubpath[lofo2] \processXMLfilegrouped{aqq.xml} \usesubpath[reset] \write16{\allinputpaths} \stoptext In this example \allinputpaths comma-list written to log looks like this: lofo1,lofo1/reset,lofo1/lofo2,lofo1/reset/lofo2,lofo1/reset/reset,lofo1/lofo 2/reset,lofo1/reset/lofo2/reset So 'reset' is treated as a directory name. Why? What am I doing wrong? Pawe/l
Hi,
From: "Hans Hagen"
\usesubpath[reset]
Hans, are you sure about that? (\use*sub*path)
Also without expected results. So what is wrong in the following code?
\starttext \usesubpath[lofo1] \processXMLfilegrouped{aqq.xml} \usesubpath[reset]
try: \usepath[reset] Patrick -- You are your own rainbow!
At 17:37 10/11/2003, you wrote:
Hi,
From: "Hans Hagen"
\usesubpath[reset]
Hans, are you sure about that? (\use*sub*path)
Also without expected results. So what is wrong in the following code?
\starttext \usesubpath[lofo1] \processXMLfilegrouped{aqq.xml} \usesubpath[reset]
try: \usepath[reset]
indeed reset only works for usepath (has to do with the fact that any \usesubpath triggers extension of the path list) Hans
Problem: reset path
Also without expected results. So what is wrong in the following code?
\starttext \usesubpath[lofo1] \processXMLfilegrouped{aqq.xml} \usesubpath[reset]
try: \usepath[reset]
I did so. I've noticed that 'reset' option works for \usepath only but I still get the solution. Please consider the following example (attached). We have './lofo1' and './lofo2' directories, each contains 'x.xml' file (the same filename but different content). ConTeXt code is as following: \starttext \usepath[lofo1] \processXMLfilegrouped{x.xml} \usepath[reset] \usepath[lofo2] \processXMLfilegrouped{x.xml} \stoptext In this case 'reset' option works probably OK, since \allinputpaths variable IS redefined to \empty (lines 99 to 104 of core-job.tex). So I expect that the first processed XML file should be './lofo1/x.xml' and the second -- './lofo2/x.xml'. But './lofo1/x.xml' file is processed twice instead. What construction should I use to process two or more XML files, which have the same name but different localization? I'm aware that my problem is not common but... Thanks for Your help, Pawe/l
Hello again,
I did so. I've noticed that 'reset' option works for \usepath only but I still get the solution. Please consider the following example (attached).
OK, I had a close look at it and digged into deeper mechanisms of path handling in ConTeXt. ConTeXt stores the exact location of a file just by the filename. Once you read x.xml, ConTeXt remembers where it is. You get a hint when saying \tracefilestrue in your tex source. Next time you read x.xml, ConTeXt looks into its internal macros (fn..x.xml in this case) and reads the full path. And this is lofo1 in your case. I don't have a solution for you. Sorry. Patrick -- You are your own rainbow!
Problem: paths in ConTeXt
OK, I had a close look at it and digged into deeper mechanisms of path handling in ConTeXt.
ConTeXt stores the exact location of a file just by the filename. Once you read x.xml, ConTeXt remembers where it is. You get a hint when saying \tracefilestrue in your tex source. Next time you read x.xml, ConTeXt looks into its internal macros (fn..x.xml in this case) and reads the full path. And this is lofo1 in your case.
I don't have a solution for you. Sorry.
Thanks anyway. No solution at this point is also some kinf of hint -) Regards, Pawe/l
These are my first forays into the unknown territories of Metapost. The following code is copied verbatim from the matafun-manual: \startuniqueMPgraphic{copyright} picture p ; p := btex COPYRIGHT etex rotated 90 ; setbounds p to boundingbox p enlarged 1pt ; draw p withcolor .8white ; currentpicture := currentpicture xysized (\overlaywidth,\overlayheight) ; \stopuniqueMPgraphic \defineoverlay[copyright][\uniqueMPgraphic{copyright}] \setupbackgrounds[text][rightmargin][background=copyright] But I don't see anything. The log shows that metapost calculated a background, but I don't see anything. What am I doing wrong? Best Thomas
Let me provide an answer myself: the btex ... etex doesn't seem to work. This code: \startuseMPgraphic{draft} draw "DRAFT" infont "phvb" scaled 9 rotated 57 withcolor .85white ; currentpicture := currentpicture ysized (\overlayheight-3cm) ; \stopuseMPgraphic \defineoverlay[draft][\uniqueMPgraphic{draft}] \setupbackgrounds[page][background=draft] will do what I want: provide a "watermark" for my document (or, as Hans writes, an "annoying text"). However, when I try the same with draw btex draft etex I don't get any output. Could you please verify if this is the case in your version of ConTeXt as well? Here's what I have (it's a vanilla teTeX implementation): ConTeXt ver: 2003.9.19 fmt: 2003.9.30 int: english mes: english MetaPost (Web2C 7.5.2) 0.641 Best Thomas
On Monday, November 17, 2003, at 10:59 AM, Patrick Gundlach wrote:
make sure \protectbufferstrue is set in cont-sys.tex
Thanks, Patrick. \protectbufferstrue is uncommented (I guess that's the default, isn't it?). Does the btex...etex work on your box? Could anyone running Mac OS X (10.2 for the time being) verify if it works on their systems? Best Thomas
On Monday, November 17, 2003, at 10:59 AM, Patrick Gundlach wrote:
make sure \protectbufferstrue is set in cont-sys.tex
Thanks, Patrick. \protectbufferstrue is uncommented (I guess that's the default, isn't it?). Does the btex...etex work on your box? Could anyone running Mac OS X (10.2 for the time being) verify if it works on their systems?
Best
Thomas
Hi Thomas, I use Mac OS X (10.3 since today... but the following is independent of whether you use 10.2 or 10.3) together with TeXShop and Gerben Wierda's distribution of TeX. The first example you sent, that is: %% first example \startuniqueMPgraphic{copyright} picture p ; p := btex COPYRIGHT etex rotated 90 ; setbounds p to boundingbox p enlarged 1pt ; draw p withcolor .8white ; currentpicture := currentpicture xysized (\overlaywidth,\overlayheight) ; \stopuniqueMPgraphic \defineoverlay[copyright][\uniqueMPgraphic{copyright}] \setupbackgrounds[text][rightmargin][background=copyright] \starttext \input knuth.tex \stoptext %% end first example does not produce what is expected. The second example you sent, that is: %% second example \startuseMPgraphic{draft} draw "draft" infont "phvb" scaled 9 rotated 65 withcolor .95white ; currentpicture := currentpicture ysized (\overlayheight-3cm) ; \stopuseMPgraphic \defineoverlay[draft][\uniqueMPgraphic{draft}] \setupbackgrounds[page][background=draft] \starttext \input knuth.tex \stoptext %% end second example does produce the watermark "draft". The third example %% third example \startuseMPgraphic{brouillon} draw btex brouillon etex ; % draw "brouillon" infont "phvb" scaled 6 rotated 70 withcolor .95white ; currentpicture := currentpicture ysized (\overlayheight-3cm) ; \stopuseMPgraphic \defineoverlay[brouillon][\uniqueMPgraphic{brouillon}] \setupbackgrounds[page][background=brouillon] \starttext \input knuth.tex \stoptext %% end third example does not produce what is expected. I should say that I am not enough self-confidence to change the file cont-sys.tex as suggested by Patrick... Best regards: OK
Otared Kavian
The third example does not produce what is expected.
what did you expect?
\startuseMPgraphic{brouillon} draw btex brouillon etex ; currentpicture := currentpicture ysized (\overlayheight-3cm) ;
this command scales (vertically) the brouillon to \overlayheight -3 cm. This is very large
\stopuseMPgraphic \defineoverlay[brouillon][\uniqueMPgraphic{brouillon}] \setupbackgrounds[page][background=brouillon]
and this one centers your graphic (the large brouillon) on the page.
I should say that I am not enough self-confidence to change the file cont-sys.tex as suggested by Patrick...
If you get some results from btex...etex, you don't have to. Patrick -- You are your own rainbow!
Hello,
Thanks, Patrick. \protectbufferstrue is uncommented (I guess that's the default, isn't it?).
Right, I just checked. It was a common error in the past.
Does the btex...etex work on your box? Could anyone running Mac OS X (10.2 for the time being) verify if it works on their systems?
Yes, it does work here on OS X (Jaguar). I tried your example from yesterday (slightly patched, though because there was no \starttext...) Please post your complete logfile. Patrick
Thomas A. Schmitz said this at Mon, 17 Nov 2003 14:09:45 +0100:
On Monday, November 17, 2003, at 10:59 AM, Patrick Gundlach wrote:
make sure \protectbufferstrue is set in cont-sys.tex
Thanks, Patrick. \protectbufferstrue is uncommented (I guess that's the default, isn't it?). Does the btex...etex work on your box? Could anyone running Mac OS X (10.2 for the time being) verify if it works on their systems?
After verifying configuration on my machines, it works. The TeXLive2003 on MacOSX install (main computer) worked fine, without anything extra. I have a gwTeX install on a second computer, and it took a bit of work to get it going: enabled \write18 by changing shell_escape to 't' in texmf.cnf Copied user/cont-sys.rme to user/cont-sys.tex. Did a 'sudo texhash' to be sure changes are made. Edited cont-sys.tex and uncommented the following lines: \runMPgraphicstrue \runMPTEXgraphicstrue \useMETAFUNformattrue % make sure you have a format! In short, I followed the suggestions in minstall.pdf! After all that, I was able to run both the "copyright" and "draft" examples without any problem. The down-side is that it takes a bit of confidence at the command line to find all these files. I have to wonder if it would help to ship and configure gwTeX/ConTeXt with better defaults for the Mac... Otared, I would suggest making the changes recommended in pages 8-9... they unlock a lot of functionality that seems to be "hidden" in ConTeXt! adam -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Adam T. Lindsay atl@comp.lancs.ac.uk Computing Dept, Lancaster University +44(0)1524/594.537 Lancaster, LA1 4YR, UK Fax:+44(0)1524/593.608 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Hello Thomas,
These are my first forays into the unknown territories of Metapost.
You'll enjoy your journey once you get MP working.
The following code is copied verbatim from the matafun-manual:
[...]
But I don't see anything. The log shows that metapost calculated a background, but I don't see anything. What am I doing wrong?
Your complete log might be interesting. Did you enable the write18 feature in texmf.cnf (not necessary, but nice since it lets tex generate the MP graphics on the fly)? Did you put any text between \starttext and \stoptext? Do you have \protectbufferstrue in cont-sys.tex? Patrick
participants (7)
-
Adam Lindsay
-
Hans Hagen
-
Otared Kavian
-
Patrick Gundlach
-
Pawel Jackowski na Onet
-
Thomas A. Schmitz
-
Thomas A.Schmitz