[metapost] generic TeX interface?

Steve MC Han hmc0907 at yahoo.com
Fri Jan 5 22:17:19 CET 2007


When we do 
     <<mpost --tex=latex file.mp>>
  is there anyway, just type only
    <<mpost file.mp>>
  instead of whole text? It is very cumbersome to type all these everytime.
   
  Thank you in advance.
  

Stephan Hennig <mailing_list at arcor.de> 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:


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


 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/metapost/attachments/20070105/a047bfdd/attachment.html 


More information about the metapost mailing list