Oliver Buerschaper | 4 Aug 2008 17:42
Picon
Favicon

Problem with defaultscale

Dear MetaPost wizards,

I'm trying to change the default font size MetaPost uses for labels  
but the following code keeps giving me trouble:

---
beginfig(1);
     defaultscale := 6;
     label(btex Hallo $\sum$ etex, origin);
endfig;

end
---

Whatever the value of "defaultscale" the font size of the label  
doesn't seem to be affected :-( My typesetting command is

mptopdf labels.mp

What am I missing?

Oliver
--
http://tug.org/metapost/

Oliver Buerschaper | 4 Aug 2008 19:05
Picon
Favicon

Size of arrow heads

Dear wizards,

is it possible to influence the size of the arrow heads that are used  
by the command drawarrow? If yes, how?

Thanks in advance,
Oliver
--
http://tug.org/metapost/

Laurence Finston | 4 Aug 2008 19:19
Picon
Favicon

Re: Size of arrow heads

> is it possible to influence the size of the arrow heads that are used  
> by the command drawarrow? If yes, how?

Yes.  There are parameters that you can set for this purpose.  They are 
called `ahlength' and `ahangle' and are documented in the manual.  In 
the version for the program version 1.005 from May of this year, it's on 
page 43.

Laurence Finston

On Mon, 4 Aug 2008, Oliver Buerschaper wrote:

> Dear wizards,
> 
> is it possible to influence the size of the arrow heads that are used  
> by the command drawarrow? If yes, how?
> 
> Thanks in advance,
> Oliver
> --
> http://tug.org/metapost/
> 
--
http://tug.org/metapost/

Laurence Finston | 4 Aug 2008 19:32
Picon
Favicon

Re: Problem with defaultscale

> Whatever the value of "defaultscale" the font size of the label  
> doesn't seem to be affected :-( My typesetting command is

Perhaps `defaultscale' must be set outside of a figure?  Just a guess.

I use this (or similar commands) sometimes:

verbatimtex \magnification=\magstep1 etex

Put it at the beginning of your input file, or at least before any 
`label' commands.

You can also do things like this:

verbatimtex \magnification=\magstep5 \font\large=cmr12 etex

or scale specific fonts.  Please note that merely changing a font will not 
affect anything typeset in math mode, but `\magnification' and presumably 
defaultscale will.

I just noticed that you want a smaller magnfication.  I'm not sure how to 
go about this.  If you can't get `defaultscale' to work, it would probably 
be easiest to just not use math mode.  However, if you need it, it should 
work to redefine the fonts used in in (`scriptfont', `scriptscriptfont', 
etc.) and put the code in `verbatimtex ... etex'.  You can find it 
`plain.tex' and just change the numbers used;  it isn't difficult.  

Perhaps someone will come along with a better answer.

Laurence Finston
(Continue reading)

Taco Hoekwater | 4 Aug 2008 19:39
Gravatar

Re: Problem with defaultscale

Oliver Buerschaper wrote:
> Dear MetaPost wizards,
> 
> I'm trying to change the default font size MetaPost uses for labels  
> but the following code keeps giving me trouble:
> 
> ---
> beginfig(1);
>      defaultscale := 6;
>      label(btex Hallo $\sum$ etex, origin);
> endfig;
> 
> end
> ---
> 
> Whatever the value of "defaultscale" the font size of the label  
> doesn't seem to be affected :-( My typesetting command is

Defaultscale only works for string labels, not for btex ... etex
labels. But the good news is that scaling a btex ... etex label
is really simple also:

    label(btex Hallo $\sum$ etex scaled 6, origin);

Best wishes,
Taco

--
http://tug.org/metapost/

(Continue reading)

John Kitzmiller | 4 Aug 2008 19:03
Picon

Re: Problem with defaultscale

----- Original Message -----
From: "Oliver Buerschaper" <oliver.buerschaper <at> mpq.mpg.de>

> I'm trying to change the default font size MetaPost uses for labels 
> but the following code keeps giving me trouble:
>
> ---
> beginfig(1);
>     defaultscale := 6;
>     label(btex Hallo $\sum$ etex, origin);
> endfig;
>
defaultscale sets the size of the metapost font. It does not affect typeset labels.
 
Try this to see:
 
beginfig(1);
     defaultscale := 6;
     label(btex Hallo $\sum$ etex, origin);
     label.bot("Hallo",origin);
endfig;
But I cannot be much help on how to change the size of typeset labels as I have trouble there too.  Seems like putting latex commands inside btex ... etex should work, I have seen files where it does, but it does not (yet) for my installation.
 
 
Also, if you make a preamble like...
 
prologues:=3;
filenametemplate "%j%c.mps";
verbatimtex
%&latex
\documentclass{minimal}
\usepackage{charter}
\begin{document}
etex
 
...you can change the font of typeset labels by using a package.
 
I think some of this is involved in the changes the team are making.
 
--John
--
http://tug.org/metapost/
John Kitzmiller | 4 Aug 2008 20:13
Picon

Re: Size of arrow heads

Oliver,

You might also look at 

http://tex.loria.fr/prod-graph/zoonekynd/metapost/metapost.html

somewhere around fig(180) for coding examples.

--john
--
http://tug.org/metapost/

John Kitzmiller | 4 Aug 2008 21:09
Picon

Re: Problem with defaultscale

----- Original Message ----- 
From: "Taco Hoekwater" <taco <at> elvenkind.com>
Subject: Re: [metapost] Problem with defaultscale

> But the good news is that scaling a btex ... etex label
> is really simple also:
> 
>    label(btex Hallo $\sum$ etex scaled 6, origin);

Doh! I will crawl back into my hole now.

But what about making changes within btex ... etex?

Any help with why:

label(btex \sffamily Hallo etex, origin);

works when:

label(btex \large Hallo etex, origin);

does not?
(No file mpx314.aux.
 !Undefined control sequence.)

(Apologies for usurping the thread.)

--
http://tug.org/metapost/

Laurence Finston | 4 Aug 2008 21:18
Picon
Favicon

Re: Problem with defaultscale


> Any help with why:
> 
> label(btex \sffamily Hallo etex, origin);
> 
> works when:
> 
> label(btex \large Hallo etex, origin);
> 
> does not?
> (No file mpx314.aux.
>  !Undefined control sequence.)

Presumably because `\large' is undefined.  You can define it in a 
`verbatimtex ... etex' block.

Laurence Finston

On Mon, 4 Aug 2008, John Kitzmiller wrote:

> ----- Original Message ----- 
> From: "Taco Hoekwater" <taco <at> elvenkind.com>
> Subject: Re: [metapost] Problem with defaultscale
> 
> 
> > But the good news is that scaling a btex ... etex label
> > is really simple also:
> > 
> >    label(btex Hallo $\sum$ etex scaled 6, origin);
> 
> 
> Doh! I will crawl back into my hole now.
> 
> 
> But what about making changes within btex ... etex?
> 
> Any help with why:
> 
> label(btex \sffamily Hallo etex, origin);
> 
> works when:
> 
> label(btex \large Hallo etex, origin);
> 
> does not?
> (No file mpx314.aux.
>  !Undefined control sequence.)
> 
> (Apologies for usurping the thread.)
> 
> --
> http://tug.org/metapost/
> 
--
http://tug.org/metapost/

John Kitzmiller | 4 Aug 2008 22:51
Picon

Re: Problem with defaultscale


>> Any help with why:
>>
>> label(btex \sffamily Hallo etex, origin);
>>
>> works when:
>>
>> label(btex \large Hallo etex, origin);
>>
>> does not?
>> (No file mpx314.aux.
>>  !Undefined control sequence.)
>
> Presumably because `\large' is undefined.  You can define it in a
> `verbatimtex ... etex' block.
>
> Laurence Finston
>

Thank you, Laurence.

Do you have time to provide a brief example? Or point me to where I might
find an example?

I am trying things like:

verbatimtex
%&latex
\def\large#1{\large{#1}}
\begin{document}
etex

with no positive result.

A further question is why \sffamily is defined and \large is not? They both
work in a latex file.

Thanks,

John

--
http://tug.org/metapost/


Gmane