From - Tue Aug 21 23:33:04 2001
Return-Path: <walter.kehowski@gcmail.maricopa.edu>
Received: from email2.dist.maricopa.edu (email2.dist.maricopa.edu
    [140.198.8.39]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id
    f7LLWum83551 for <metafont@ens.fr>; Tue, 21 Aug 2001 23:32:56 +0200 (CEST)
Received: from gcmail.maricopa.edu (140.198.35.44) by
    email2.dist.maricopa.edu (5.5.034) (authenticated as
    walter.kehowski@gcmail.maricopa.edu) id 3B7F8ED3000061F1 for
    metafont@ens.fr; Tue, 21 Aug 2001 14:32:51 -0700
Message-Id: <3B82D37C.CCB6E41D@gcmail.maricopa.edu>
Date: Tue, 21 Aug 2001 14:32:44 -0700
From: walter kehowski <walter.kehowski@gcmail.maricopa.edu>
Organization: Glendale Community College
X-Mailer: Mozilla 4.72 [en] (Win95; U)
X-Accept-Language: en
Mime-Version: 1.0
To: metafont@ens.fr
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 474
Precedence: list
Subject: [metafont] metapost: plotting sin(x^2)

MetaPost,

I've been using MetaPost to plot functions and was defining my functions
like

def f(expr x) =
  sind(x^2*180/pi);
enddef

and kept getting some error message about missing parentheses if I tried
something like (x,f(x)). The problem is the instinctual semicolon in the
body of the definition. So now I always define my functions as follows

def f(expr x) =
  sind(((x)**2)*180/pi)
  % no semicolon!
enddef

so that the pair (x,f(x)) now makes sense. This technicality is not
given the attention it deserves!

Walter Kehowski


From - Wed Aug 22 17:01:01 2001
Return-Path: <luecking@uark.edu>
Received: from mail.uark.edu (mail.uark.edu [130.184.5.107]) by nef.ens.fr
    (8.10.1/1.01.28121999) with ESMTP id f7MF0rm48924 for <metafont@ens.fr>;
    Wed, 22 Aug 2001 17:00:54 +0200 (CEST)
Received: from comp.uark.edu ([130.184.5.197]) by mail.uark.edu (Netscape
    Messaging Server 4.15) with ESMTP id GIH5PG03.15O; Wed, 22 Aug 2001
    10:00:52 -0500
Received: (from luecking@localhost) by comp.uark.edu (8.11.2/8.10.2) id
    f7MF0ml19164; Wed, 22 Aug 2001 10:00:48 -0500 (CDT)
Date: Wed, 22 Aug 2001 10:00:48 -0500 (CDT)
From: "Daniel Luecking" <luecking@uark.edu>
To: walter kehowski <walter.kehowski@gcmail.maricopa.edu>
Cc: <metafont@ens.fr>
Subject: Re: [metafont] metapost: plotting sin(x^2)
In-Reply-To: <3B82D37C.CCB6E41D@gcmail.maricopa.edu>
Message-Id: <Pine.SOL.4.33.0108220938540.15212-100000@comp.uark.edu>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 475
Precedence: list

On Tue, 21 Aug 2001, walter kehowski wrote:

> MetaPost,
>
> I've been using MetaPost to plot functions and was defining my functions
> like
>
> def f(expr x) =
>   sind(x^2*180/pi);
> enddef
>
> and kept getting some error message about missing parentheses if I tried
> something like (x,f(x)). The problem is the instinctual semicolon in the
> body of the definition. So now I always define my functions as follows
>
> def f(expr x) =
>   sind(((x)**2)*180/pi)
>   % no semicolon!
> enddef

I almost always use vardef for this type of thing. For that the MFbook
definitely stresses that there is a returned value: the value of the
expression that follows all the statements. If there are only statements
(lines terminated by ";") it has no return value. In my mind, def's are
macros (tokens are substituted verbatim), vardefs are functions. The
last line, without the semicolon, functions as the "return" statement.

Don't forget to follow the enddef with a semicolon. (My most common
syntax error, so I now routinely search for enddef at the end of a line
before I save my file and run MF.)

You might also consider (where appropriate) writing your defs as
vardef sinsq primary x =
  sind (x**2*180/pi)
enddef;

This gives sinsq the same syntax as sind. (x, sinsq(3x)) makes sense, of
course, but so does (x, sinsq 3x) since 3x is a primary. This is what
I've done in the MF/MP support files for mfpic, for the extra trig
functions tand, cotd, secd and cscd not found in plain MF.

-- 
Dan Luecking                           Dept. of Mathematical Sciences
luecking@comp.uark.edu                 University of Arkansas
http://comp.uark.edu/~luecking/        Fayetteville, AR 72101


From - Fri Aug 31 15:37:49 2001
Return-Path: <esben@haabendal.dk>
Received: from ford.lan.haabendal.dk (pc160054.stofanet.dk [212.10.95.54])
    by nef.ens.fr (8.10.1/1.01.28121999) with SMTP id f7VDbam76856 for
    <metafont@ens.fr>; Fri, 31 Aug 2001 15:37:36 +0200 (CEST)
Received: (qmail 6408 invoked by uid 1000); 31 Aug 2001 13:37:35 -0000
Sender: bart@ford.lan.haabendal.dk
To: pdftex@tug.org
Cc: metafont@ens.fr
From: Esben Haabendal Soerensen <esben@haabendal.dk>
Date: 31 Aug 2001 15:37:35 +0200
Message-Id: <878zg02vvk.fsf@ford.lan.haabendal.dk>
Lines: 31
User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/20.7
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 476
Precedence: list
Subject: [metafont] Margin error with pdflatex when using ps files from
    metapost

--=-=-=

Hi

I have a strange problem when compiling documents with figures using
the MetaPost macros from boxes.mp.

If I use either drawboxed or drawunboxed, that is when boxes.mp put some
text in the output, the margin gets corrupted after the figure.  It is
shifted to the left.

First I used the emp LaTeX package, but I have now reproduced the
problem without this package.

I attach two small LaTex and MetaPost files to reproduce the error.
Can someone suggest me what I might be doing wrong, or if this is a
real bug, and if so where to look (metapost or pdflatex).


--=-=-=
Content-Type: text/x-tex
Content-Disposition: attachment; filename=bug2.tex
Content-Description: bug.tex

\documentclass{article}

% Prepare \ifpdf variable for special handling of pdflatex
%
\newif\ifpdf
\pdffalse
\ifx\pdfoutput\undefined
\else
  \ifx\pdfoutput\relax
    \let\pdfoutput\undefined
  \else
    \ifcase\pdfoutput
    \else
      \pdftrue
    \fi
  \fi
\fi
\ifpdf
  \usepackage[pdftex]{graphicx}
  \DeclareGraphicsRule{*}{mps}{*}{}
\else
  \usepackage[dvips]{graphicx}
\fi

\begin{document}

blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah

blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah

\begin{figure}[htbp]
  \begin{center}
    \includegraphics{bug.1}
    \caption{Buggy figure which f*cks up the left margin in some strange way.}
  \end{center}
\end{figure}

blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah

\end{document}

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: 

--=-=-=
Content-Type: application/octet-stream
Content-Disposition: attachment; filename=bug.mp
Content-Description: bug.mp

verbatimtex
\documentclass [10pt]{article}
\begin {document}
etex;

prologues:=2;
input boxes;;
beginfig(1);
LaTeX_unitlength := 1.0pt;
w := 10*LaTeX_unitlength;
h := 10*LaTeX_unitlength;
  boxit.bb("Buggy Box");
  bb.c = (0,0);
  drawboxed(bb);
endfig;
verbatimtex
\end{document}
etex;
%%% the end.
end.
endinput;

--=-=-=


I just tried compiling it with latex->dvips->ps2pdf and the margin
error is gone.  It does indeed look like a bug in pdflatex to me.

The error shows in both acroread, xpdf, and gv.

It would be a shame to drop using pdflatex/pdftex because I want to
use metapost...

/Esben

--=-=-=--


From - Fri Aug 31 15:59:29 2001
Return-Path: <wyart@iie.cnam.fr>
Received: from smtp.noos.fr (zola.noos.net [212.198.2.76]) by nef.ens.fr
    (8.10.1/1.01.28121999) with ESMTP id f7VDxMm79204 for <metafont@ens.fr>;
    Fri, 31 Aug 2001 15:59:22 +0200 (CEST)
Received: (qmail 32633004 invoked by uid 0); 31 Aug 2001 13:59:21 -0000
Received: from unknown (HELO localhost.localdomain) ([195.132.64.219])
    (envelope-sender <wyart@iie.cnam.fr>) by 212.198.2.76 (qmail-ldap-1.03)
    with SMTP for <metafont@ens.fr>; 31 Aug 2001 13:59:21 -0000
Received: (from chlick@localhost) by localhost.localdomain (8.10.0/8.10.0)
    id f7VDxLG06713 for metafont@ens.fr; Fri, 31 Aug 2001 15:59:21 +0200
Date: Fri, 31 Aug 2001 15:59:21 +0200
From: Damien WYART <dwyart@noos.fr>
To: metafont@ens.fr
Message-Id: <20010831155921.A6708@gauss.noos.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.3.22.1i
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 477
Precedence: list
Subject: [metafont] Re: strange bug with pdfLaTeX

Well, I deleted the original message too quickly, but tested the
attached files. No problem for me, with latest pdfTeX and latest
ConTeXt macros. I get the same thing with LaTeX and pdfLaTeX.

Maybe you should check your versions...
-- 
Damien WYART


From - Fri Aug 31 16:38:26 2001
Return-Path: <uhlmann@pik-potsdam.de>
Received: from s8.pik-potsdam.de (s8.pik-potsdam.de [193.174.19.132]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f7VEcEm83593 for
    <metafont@ens.fr>; Fri, 31 Aug 2001 16:38:14 +0200 (CEST)
Received: from pik-potsdam.de (ws79.pik-potsdam.de [193.174.18.134]) by
    s8.pik-potsdam.de (8.9.1a/8.9.1) with ESMTP id QAA23756 for
    <metafont@ens.fr>; Fri, 31 Aug 2001 16:38:32 +0100
Received: (from uhlmann@localhost) by pik-potsdam.de (AIX4.2/UCB 8.7/8.7)
    id QAA15476; Fri, 31 Aug 2001 16:38:31 +0100 (NFT)
X-Authentication-Warning: ws79.pik-potsdam.de: uhlmann set sender to
    uhlmann@pik-potsdam.de using -f
From: Markus Uhlmann <uhlmann@pik-potsdam.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-Id: <15247.44919.538179.180157@ws79.pik-potsdam.de>
Date: Fri, 31 Aug 2001 16:38:31 +0100 (NFT)
To: metafont@ens.fr
X-Mailer: VM 6.75 under Emacs 20.6.1
Content-Transfer-Encoding: 7bit
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 478
Precedence: list
Subject: [metafont] using gnu fontutils for converting a metafont to type1

i am using the gnu fontutils package (version 0.7) to convert some
self-made metafont to type1 postscript format. works
reasonably. however, the ligatures do not seem to get across the
conversion step.
to be specific, i run the following shell script on a given font, say
myfont.mf: 

#!/bin/sh
font=$1
echo '-----------creating GF with high resolution (proof mode)-----------'
mf $font
#
echo '-----------creating TFM--------------------------------------------'
mf '\mode=ljfour' input $font
#
echo '-----------creating BZR outline------------------------------------'
/home.local/fontutils/bin/limn -verbose $font.2602
#
echo '-----------wrting to adobe GSF (=PFA) format-----------------------'
/home.local/fontutils/bin/bzrto -pstype1 -ps-font-info FontName:$font -verbose -output-file $font.gsf $font
#
echo '-----------typeseting a test document (DVI)------------------------'
tex test
#
echo '-----------creating PS with outline bound--------------------------'
dvips -Pscale -otest.ps test
#
echo '-----------creating PDF (--> test.pdf)-----------------------------'
ps2pdf test.ps
#-----end_of_script------------------------------------------------------

although myfont.mf has classical ligtables, e.g.

  ligtable "f": "i"=:oct"014", "f"=:oct"013", 
    "'" kern itc#, "?" kern itc#, "!" kern itc#, ")" kern itc#, "]" kern itc#;
  ligtable oct"013": "i"=:oct"016", 
    "'" kern itc#, "?" kern itc#, "!" kern itc#, ")" kern itc#, "]" kern itc#;

the 'ff's do not show up in the final output (i.e. ps/pdf document). 
i would appreciate any advice/pointers.

markus uhlmann


From - Fri Aug 31 16:43:42 2001
Return-Path: <esben@haabendal.dk>
Received: from ford.lan.haabendal.dk (pc160054.stofanet.dk [212.10.95.54])
    by nef.ens.fr (8.10.1/1.01.28121999) with SMTP id f7VEhZm84358 for
    <metafont@ens.fr>; Fri, 31 Aug 2001 16:43:35 +0200 (CEST)
Received: (qmail 6435 invoked by uid 1000); 31 Aug 2001 14:43:34 -0000
Sender: bart@ford.lan.haabendal.dk
To: pdftex@tug.org
Cc: metafont@ens.fr
Subject: Re: [metafont] Margin error with pdflatex when using ps files
    from metapost
References: <878zg02vvk.fsf@ford.lan.haabendal.dk>
From: Esben Haabendal Soerensen <esben@haabendal.dk>
Date: 31 Aug 2001 16:43:34 +0200
In-Reply-To: <878zg02vvk.fsf@ford.lan.haabendal.dk> (Esben Haabendal
    Soerensen's message of
    "31 Aug 2001 15:37:35 +0200")
Message-Id: <873d682stl.fsf@ford.lan.haabendal.dk>
Lines: 10
User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/20.7
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 479
Precedence: list

In case you need to know.  My versions of various commands are:

MetaPost (Web2C 7.3.1) 0.641
kpathsea version 3.3.1
TeX, Version 3.14159 (Web2C 7.3.1)
pdfTeX, Version 3.14159-13d (Web2C 7.3.1)
dvips(k) 5.86

/Esben
 


