* Changing font size
@ 2006-03-19 5:52 David Arnold
2006-03-19 17:41 ` Aditya Mahajan
2006-03-19 17:53 ` Mojca Miklavec
0 siblings, 2 replies; 3+ messages in thread
From: David Arnold @ 2006-03-19 5:52 UTC (permalink / raw)
All,
I have this:
\startMPpage %figure library name: sec3q1
%initialize window parameters
numeric xmin, xmax, xscl, ymin, ymax, yscl;
xmin:=-10;
xmax:=10;
xscl:=1;
ymin:=-200;
ymax:=200;
yscl:=20;
%initialize number of points
numeric num_points;
num_points:=200;
%initialize dimensions of image
numeric width, height;
width=1.5in;
height=1.5in;
%create the grid
create_grid(xmin,xmax,xscl,ymin,ymax,yscl,width,height);
boolean lbl_scl; lbl_scl:=false;
%create the axes
create_axes(xmin,xmax,ymin,ymax,width,height,lbl_scl)("$x$")("$y$");
%draw the function
drawfcn("x","(x+6)*(x-1)*
(x-5)",xmin,xmax,ymin,ymax,width,height,num_points,xmin,xmax)
withcolor blue ;
%initialize scale
numeric ux, uy;
(xmax-xmin)*ux=width;
(ymax-ymin)*uy=height;
%define polynomial
vardef f(expr x)=
(x+6)*(x-1)*(x-5)
enddef;
%label extrema
dotlabel.top(btex Local Maximum etex, (-3.2,f(-3.2)) xyscaled (ux,uy));
dotlabel.bot(btex Local Minimum etex, (3.2,f(3.2)) xyscaled (ux,uy));
\stopMPpage
What I'd like to do is typeset those "Local Maximum" and "Local
Minimum" in the defaultfont at a size 2 pts smaller than the default.
Any easy way to do this?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Changing font size
2006-03-19 5:52 Changing font size David Arnold
@ 2006-03-19 17:41 ` Aditya Mahajan
2006-03-19 17:53 ` Mojca Miklavec
1 sibling, 0 replies; 3+ messages in thread
From: Aditya Mahajan @ 2006-03-19 17:41 UTC (permalink / raw)
<--- On Mar 18, David Arnold wrote --->
> %label extrema
> dotlabel.top(btex Local Maximum etex, (-3.2,f(-3.2)) xyscaled (ux,uy));
> dotlabel.bot(btex Local Minimum etex, (3.2,f(3.2)) xyscaled (ux,uy));
>
> \stopMPpage
>
> What I'd like to do is typeset those "Local Maximum" and "Local
> Minimum" in the defaultfont at a size 2 pts smaller than the default.
> Any easy way to do this?
I usually add a \tfx or \tfxx inside the btex ... etex
Aditya
--
Aditya Mahajan, EECS Systems, University of Michigan
http://www.eecs.umich.edu/~adityam || Ph: 7342624008
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Changing font size
2006-03-19 5:52 Changing font size David Arnold
2006-03-19 17:41 ` Aditya Mahajan
@ 2006-03-19 17:53 ` Mojca Miklavec
1 sibling, 0 replies; 3+ messages in thread
From: Mojca Miklavec @ 2006-03-19 17:53 UTC (permalink / raw)
On 3/19/06, David Arnold wrote:
> All,
>
> I have this:
>
> \startMPpage %figure library name: sec3q1
> ...
> %label extrema
> dotlabel.top(btex Local Maximum etex, (-3.2,f(-3.2)) xyscaled (ux,uy));
> dotlabel.bot(btex Local Minimum etex, (3.2,f(3.2)) xyscaled (ux,uy));
>
> \stopMPpage
>
> What I'd like to do is typeset those "Local Maximum" and "Local
> Minimum" in the defaultfont at a size 2 pts smaller than the default.
> Any easy way to do this?
I would use either
btex \tfx Local Maximum etex
or
btex Local Maximum etex scaled 0.9
This scales down the font, although not for 2 points. (Do you really
need exaclty two points?)
Perhaps it is possible to figure out the default font size and use
something like
btex \switchtobodyfont["some strange expression meaning
<currentbodyfont - 2pt>"] etex
or to (mis)use the "infont" command in metapost or to write the proper
magic expression as the argument to "scaled", but I'm only guesing
here.
Mojca
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-03-19 17:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-19 5:52 Changing font size David Arnold
2006-03-19 17:41 ` Aditya Mahajan
2006-03-19 17:53 ` Mojca Miklavec
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).