[metapost] generic TeX interface?

Hans Hagen pragma at wxs.nl
Fri Jan 5 20:36:52 CET 2007


Stephan Hennig wrote:
> Stephan Hennig schrieb:
>
>   
>> Instead, I tried to collect some features I'd like to see for a new
>> TeX interface. Here's the unsorted list:
>>     
>
>   
just as one can implement a textext (which basically does a btex etex) 
one can implement a preamble mechanism,

texpreamble("...")

Hans 



> I would like to add one additional feature:
>
> * The new TeX interface should provide means to declare different TeX
> preambles for TeXing different text pictures inside one MetaPost source
> file.  In a current application I would like to call LaTeX with
> preambles that are basically the same, but differ in document class and
> package options.
>
> I can think of two alternative ways to support this:
>
> (a) TeX is called with the (La)TeX preamble declared last:
>
> beginfig(1);
> texpreamble
> \documentclass{article}
> \usepackage{mathptmx}
> \begin{document}
> endpreamble
> draw textext("Times");
>
> texpreamble
> \documentclass{article}
> \usepackage[sc]{mathpazo}
> \begin{document}
> endpreamble
> draw textext("Palatino");
> endfig;
>
> (Macro names are chosen arbitrarily.)
>
>
> (b) Or one can setup different "TeX profiles" (in the MetaPost preamble)
> and switch them in the document:
>
> deftexprofile(1);
> \documentclass{article}
> \usepackage{mathptmx}
> \begin{document}
> endprofile;
>
> deftexprofile(2);
> \documentclass{article}
> \usepackage[sc]{mathpazo}
> \begin{document}
> endprofile;
>
> beginfig(1);
> usetexpreamble(1);
> draw textext("Times");
> usetexpreamble(2);
> draw textext("Palatino");
> usetexpreamble(1);
> draw textext("Times again");
> endfig;
>
> What do you think?
>
> Best regards,
> Stephan Hennig
>
> _______________________________________________
> metapost mailing list
> http://tug.org/mailman/listinfo/metapost
>   


-- 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------



More information about the metapost mailing list