[metapost] Problem with defaultscale

Laurence Finston lfinsto1 at gwdg.de
Wed Aug 6 18:05:43 CEST 2008

On Tue, 5 Aug 2008, Oliver Buerschaper wrote:

> One more thing perhaps … I just realized that this scales the text  
> *after* TeX typeset it, doesn't it? Now how can I make TeX itself  
> typeset the text at the right font size (especially math) such that I  
> get the opticals right? Would I have to use a preamble like the one  
> Laurence suggested?

The following text is an example.  It's not so very difficult after all, 
and the TeX code for setting the fonts can be included using `\include', 
which avoids cluttering up your MetaPost input file.


%% Divide the following text into the files `ttemp.tex', `atemp.mp'
%% and `ctemp.tex'.  
%% Then call `mpost', `tex' and `dvips' like this:
%% mpost atemp.mp && tex ctemp && dvips -o ctemp.ps ctemp

%% ttemp.tex




\newdimen\z@ \z@=0pt % can be used both for 0pt and 0

% To make the plain macros more efficient in time and space,
% several constant values are declared here as control sequences.
% If they were changed, anything could happen; so they are private symbols.

\textfont0=\twelverm \scriptfont0=\ninerm \scriptscriptfont0=\sevenrm
\textfont1=\twelvei \scriptfont1=\ninei \scriptscriptfont1=\seveni
\def\mit{\fam\@ne} \def\oldstyle{\fam\@ne\twelvei}
\textfont2=\twelvesy \scriptfont2=\ninesy \scriptscriptfont2=\sevensy
\textfont3=\twelveex \scriptfont3=\twelveex \scriptscriptfont3=\twelveex
\newfam\itfam \def\it{\fam\itfam\twelveit} % \it is family 4
\newfam\slfam \def\sl{\fam\slfam\twelvesl} % \sl is family 5
\newfam\bffam \def\bf{\fam\bffam\twelvebf} % \bf is family 6
\textfont\bffam=\twelvebf \scriptfont\bffam=\ninebf
\newfam\ttfam \def\tt{\fam\ttfam\twelvett} % \tt is family 7

\catcode`@=12 % at signs are no longer letters


%% End of ttemp.tex

%% atemp.mp


label(btex $\sqrt{2} = (x_0^{32} + 24) \times 33$  etex, (0, 0));


verbatimtex \input ttemp.tex etex


label(btex $\sqrt{2} = (x_0^{32} + 24) \times 33$  etex, (0, 0));



%% End of atemp.mp

%% ctemp.tex

%% \input epsf



%% End of ctemp.tex

More information about the metapost mailing list