Rif: Re: [NTG-context] dotted line for \framed ?
With Metapost you can put in background almost anything you want, so it's not complex make a dotted line for frame; Metafun is a great tutorial for these things. A nice solution should be dotted line for \framed WITHOUT use metapost, something like \framed[rulestyle={dot},...] [OT] Can XYpic be used under Context ? I will try . luigi
Luigi Scarso wrote:
[OT] Can XYpic be used under Context ? I will try .
At least for me this works: \input xy \xyoption{frame} \starttext \framed[offset=10pt]{% \xy (0,0) *++=\hbox{text} *\frm{--} ; (50,0) *++=\hbox{text} *\frm{..} ; (100,0) *++=\hbox{text} *\frm{=} ; \endxy} \stoptext It can be a way to add some frame style without using metapost. luigi
Am 26.04.2005 um 17:35 schrieb luigi.scarso:
[OT] Can XYpic be used under Context ? I will try . At least for me this works: \input xy \xyoption{frame} \starttext \framed[offset=10pt]{% \xy (0,0) *++=\hbox{text} *\frm{--} ; (50,0) *++=\hbox{text} *\frm{..} ; (100,0) *++=\hbox{text} *\frm{=} ; \endxy} \stoptext It can be a way to add some frame style without using metapost.
I don't know XYpic, but it looks interesting. Would you write a wiki page about it? Grüßlis vom Hraban! --- http://www.fiee.net/texnique/ http://contextgarden.net
Henning Hraban Ramm wrote:
Am 26.04.2005 um 17:35 schrieb luigi.scarso:
[OT] Can XYpic be used under Context ? I will try .
At least for me this works: \input xy \xyoption{frame} \starttext \framed[offset=10pt]{% \xy (0,0) *++=\hbox{text} *\frm{--} ; (50,0) *++=\hbox{text} *\frm{..} ; (100,0) *++=\hbox{text} *\frm{=} ; \endxy} \stoptext It can be a way to add some frame style without using metapost.
I don't know XYpic, but it looks interesting. Would you write a wiki page about it?
Dear Henning, before I started to use context I had prepared some diagrams in xypic. It was the only way I knew for creating vector graphics for both tex and pdftex with text and graphics interaction possibility. For that experience I strongly discourage for using it with context: 1) Xypic has the most obscure syntax I have ever seen. 2) Nobody knows if there are not some name-space problems (redefinitions). 3) Metapost is naturaly incorporated to context, strongly supported, higher possibilities and (my opinion) much more intuitive. So I think that such a contextgarden xypic page would be only confusing. vit P.S. If you are still interesting google for xypic manual.
Vit Zyka wrote:
before I started to use context I had prepared some diagrams in xypic.
Me too, for some notes on a course on commutative algebra when I was student at university.
It was the only way I knew for creating vector graphics for both tex and pdftex with text and graphics interaction possibility.
I try xfig with poor results.
For that experience I strongly discourage for using it with context: 1) Xypic has the most obscure syntax I have ever seen.
After writing some commutative algebra exercises, xy code is not so obscure :)
2) Nobody knows if there are not some name-space problems (redefinitions).
Big problem not only with xypic. (after grep-ing xp package and context base I found some possibles names collisions in core-pos.tex,page-lyr.tex,xtag-ini.tex)
3) Metapost is naturaly incorporated to context, strongly supported, higher possibilities and (my opinion) much more intuitive.
Yes, I love metafun. But a mp graphic must be preprocessed by mpost for inclusion, and I can do it only if I can execute sysytems commands; this open a security and performance issues. So: "Can I typeset a framedbox with a rulestyle WITHOUT using MetaPost ?" I have posted an idea with XYPic; but \leaders can be used too.
So I think that such a contextgarden xypic page would be only confusing.
ok, I follow your suggestion.
P.S. If you are still interesting google for xypic manual.
Better: http://www.tug.org/applications/Xy-pic/ luigi
luigi.scarso wrote:
Vit Zyka wrote:
before I started to use context I had prepared some diagrams in xypic.
Me too, for some notes on a course on commutative algebra when I was student at university.
It was the only way I knew for creating vector graphics for both tex and pdftex with text and graphics interaction possibility.
I try xfig with poor results.
With 'interaction possibilitity' I meant e.g. text labeling with the same fonts and possibilities as in the main text (math...), length parametrization. It is not possile in xfig.
3) Metapost is naturaly incorporated to context, strongly supported, higher possibilities and (my opinion) much more intuitive.
Yes, I love metafun. But a mp graphic must be preprocessed by mpost for inclusion, and I can do it only if I can execute sysytems commands; this open a security and performance issues.
It is true only for very advanced features like text along line, AFAIK. For framed text it is possible to run mpost manually with several passes of tex.
So: "Can I typeset a framedbox with a rulestyle WITHOUT using MetaPost ?"
(Rulestyle?) Frames with only plain \hrule and \vrule is of course possible even with plain TeX. But it is probably not what you mean. vit
Vit Zyka wrote:
But a mp graphic must be preprocessed by mpost for inclusion, and I can do it only if I can execute sysytems commands; this open a security and performance issues.
It is true only for very advanced features like text along line, AFAIK. For framed text it is possible to run mpost manually with several passes of tex.
Ok, it seem I've missed something important because I don't understand when you say "For framed text it is possible to run mpost manually with several passes of tex. ". This seem in contrast with preprocessing as I write before. Can you give me a simple example ? Thanks luigi
luigi.scarso wrote:
Vit Zyka wrote:
But a mp graphic must be preprocessed by mpost for inclusion, and I can do it only if I can execute sysytems commands; this open a security and performance issues.
It is true only for very advanced features like text along line, AFAIK. For framed text it is possible to run mpost manually with several passes of tex.
Ok, it seem I've missed something important because I don't understand when you say "For framed text it is possible to run mpost manually with several passes of tex. ". This seem in contrast with preprocessing as I write before.
Can you give me a simple example ?
Of course. 1. For a moment I set shell_escape = f in `kpsewhich texmf.cnf' 2. Input file f.tex: \startuseMPgraphic{A} draw unitcircle scaled\overlaywidth; \stopuseMPgraphic \defineoverlay [B] [\uniqueMPgraphic{A}] \starttext \framed[background=B]{Hallo frame!} \stoptext 3a. classical run texexec --pdf f 3b. step by step texexec --pdf --nomp f mpost f-mpgraph texexec --pdf --nomp f vit
Vit, many thanks for your answer. Vit Zyka wrote:
1. For a moment I set shell_escape = f in `kpsewhich texmf.cnf'
ok, done
2. Input file f.tex: \startuseMPgraphic{A} draw unitcircle scaled\overlaywidth; \stopuseMPgraphic
\defineoverlay [B] [\uniqueMPgraphic{A}]
\starttext \framed[background=B]{Hallo frame!} \stoptext
3a. classical run texexec --pdf f
No circle under frame, right? If not, I have a bad installation; please discard the rest (and some hints to repair will be really appreciate :) ).
3b. step by step texexec --pdf --nomp f mpost f-mpgraph texexec --pdf --nomp f
A circle appear under the frame. But I have 3 runs ( texexec, mpost, texexec). Now, what is my goal ? To achieve a circle under the frame as quick as possible. For 3.a, in f.log I find mpost -progname=mpost -mem=metafun f-mpgraph system()...disabled. An attempt to run mpost failed: no circle, goal unsatisfied. For 3.b, I run manually mpost (and then again texexec): goal satisfied. With shell_export=t, 3.a) is ok, but f.log says system(mpost -progname=mpost -mem=metafun f-mpgraph)...executed. So it seems that my goal can be achieved only with a run of mpost. With XYPic, a similar result can be achieved without mpost: %% %% WARNING:: deprecated example %% Don't use it ! %% \input xy \xyoption{frame} \starttext \xy (0,0) *++=\hbox{\framed{Hallo frame}} *\frm{o} ; \endxy \stoptext Of course this doesn't mean that XY is better/worse than mpost, nor that using mpost coupled with context will be always slow than others ways; but sometimes a faster alternative may be required. Sure for XYPic, name spaces collisions, cpu/memory required, syntax are (some) items to consider: but it also comes with a bunch of features and may be faster than mpost in some circumstances. [OT] XFIG: fig2dev can be export to metapost and in multi-metapost. Hence, from the moon, I see that xfig can be used with context. luigi
luigi.scarso wrote:
Vit, many thanks for your answer.
Vit Zyka wrote:
1. For a moment I set shell_escape = f in `kpsewhich texmf.cnf'
ok, done
2. Input file f.tex: \startuseMPgraphic{A} draw unitcircle scaled\overlaywidth; \stopuseMPgraphic
\defineoverlay [B] [\uniqueMPgraphic{A}]
\starttext \framed[background=B]{Hallo frame!} \stoptext
3a. classical run texexec --pdf f
No circle under frame, right? If not, I have a bad installation; please discard the rest (and some hints to repair will be really appreciate :) ).
?? I obtained both a frame and a circle.
3b. step by step texexec --pdf --nomp f mpost f-mpgraph texexec --pdf --nomp f
A circle appear under the frame. But I have 3 runs ( texexec, mpost, texexec).
Yes, the cases 3a = 3b should have at least 3 runs. With shell_escape=t only 2 are needed. You are right.
With XYPic, a similar result can be achieved without mpost: %% %% WARNING:: deprecated example %% Don't use it ! %% \input xy \xyoption{frame} \starttext \xy (0,0) *++=\hbox{\framed{Hallo frame}} *\frm{o} ; \endxy \stoptext
Of course this doesn't mean that XY is better/worse than mpost, nor that using mpost coupled with context will be always slow than others ways; but sometimes a faster alternative may be required.
All right, I agree for somebody and sometimes xypic might be use with advantage. I was thinkink about general recommendation.
Sure for XYPic, name spaces collisions, cpu/memory required, syntax are
+ limitation by substance: drawing is mostly done via fonts
(some) items to consider: but it also comes with a bunch of features and may be faster than mpost in some circumstances.
[OT] XFIG: fig2dev can be export to metapost and in multi-metapost. Hence, from the moon, I see that xfig can be used with context.
Export to context is good news. But still no parametrization possible :-( vit
+ limitation by substance: drawing is mostly done via fonts Yes, I forget to write it. [XFIG]..Export to context is good news. But still no parametrization
Vit, the last things. After that I consider this topic closed. possible :-( ..maybe something to play this summer... Now for metapost: shell_escape= f in texmf.cnf so \write18 is disabled. $>texexec --pdf f No circle; it seems right, because f.log says systems : randomizer starts with 797065300 mpost -progname=mpost -mem=metafun f-mpgraph system()...disabled. $> shell_escape=x ; texutil --purgeall; texexec --pdf f As before. $> shell_escape= ; texutil --purgeall; texexec --pdf f As before. $> shell_escape=t ; texutil --purgeall; texexec --pdf f Circle ok; again it's right, f.log says systems : randomizer starts with 800565448 system(mpost -progname=mpost -mem=metafun f-mpgraph)...executed. $> shell_escape=f ; texutil --purgeall; texexec --pdf f Strange:circle again. I found into texexec.pl if (($ENV{shell_escape} eq 'f') || ($ENV{SHELL_ESCAPE} eq 'f')) { $AutoMPRun = 1 ; } Hence texexec/texutil has called mpost instead of \write18; it's like shell_escape=t (for this task, not in general sense, of course) Hmm, it's not crystal clear: shell_escape=f means "shell_escape is False" shell_escape=t means "shell_escape is True" but for processing f.tex 'True and False are the same' $>shell_escape=; texutil --purge; texexec --pdf --automprun f Circle ok; it seems right, because I force execution of mpost. Again, many thanks luigi
participants (4)
-
Henning Hraban Ramm
-
Luigi Scarso
-
luigi.scarso
-
Vit Zyka