* Greek characters in metapost
@ 2002-09-12 11:15 Ron van Ostayen
2002-09-12 14:19 ` Jens-Uwe Morawski
0 siblings, 1 reply; 7+ messages in thread
From: Ron van Ostayen @ 2002-09-12 11:15 UTC (permalink / raw)
For my PhD thesis I'm experimenting with MetaPost figures (or actually
gnuplot pictures on the MP terminal).
However, I've found that some characters, for example the greek
characters, do not show in the generated postscript.
A minimal example (test.mp):
beginfig(0);
u = 1cm;
draw (1u,0)..(0,1u)..(-1u,0)..(0,-1u)..cycle;
label.top( btex $\alpha$ etex, (0,0));
endfig;
texexec --mptex test.mp
should produce a postscript file test.0 showing a circle with an alpha
in the center.
The circle is there, the alpha isn't.
Instead, the postscript file prints a \013 character (which isn't
visible on screen) from the CMMI-font.
I'm using the latest TexLive CD (v7).
Does anyone recognize this behaviour and knows how to solve it?
Thanks for any suggestions.
Ron van Ostayen
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Greek characters in metapost
2002-09-12 11:15 Greek characters in metapost Ron van Ostayen
@ 2002-09-12 14:19 ` Jens-Uwe Morawski
2002-09-12 20:27 ` Ron van Ostayen
0 siblings, 1 reply; 7+ messages in thread
From: Jens-Uwe Morawski @ 2002-09-12 14:19 UTC (permalink / raw)
On Thu, 12 Sep 2002 13:15:16 +0200
Ron van Ostayen <R.A.J.vanOstayen@WbMT.TUDelft.NL> wrote:
> For my PhD thesis I'm experimenting with MetaPost figures (or actually
> gnuplot pictures on the MP terminal).
> However, I've found that some characters, for example the greek
> characters, do not show in the generated postscript.
The PostScript file is not self-contained, i.e. no fonts
are included. Therefore the figure has to be embedded in
a ConTeXt document (\externalfigure).
> A minimal example (test.mp):
>
> beginfig(0);
> u = 1cm;
> draw (1u,0)..(0,1u)..(-1u,0)..(0,-1u)..cycle;
> label.top( btex $\alpha$ etex, (0,0));
> endfig;
>
> texexec --mptex test.mp
In order to pre-view your MP file you can use mptopdf.
texexec --mptex test.mp
mptopdf test
should give test-0.pdf. Here the \alpha should be visible.
Jens
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Greek characters in metapost
2002-09-12 14:19 ` Jens-Uwe Morawski
@ 2002-09-12 20:27 ` Ron van Ostayen
2002-09-13 0:12 ` Jens-Uwe Morawski
0 siblings, 1 reply; 7+ messages in thread
From: Ron van Ostayen @ 2002-09-12 20:27 UTC (permalink / raw)
Jens-Uwe Morawski wrote:
> On Thu, 12 Sep 2002 13:15:16 +0200
> Ron van Ostayen <R.A.J.vanOstayen@WbMT.TUDelft.NL> wrote:
>
>
>>For my PhD thesis I'm experimenting with MetaPost figures (or actually
>>gnuplot pictures on the MP terminal).
>>However, I've found that some characters, for example the greek
>>characters, do not show in the generated postscript.
>>
>
> The PostScript file is not self-contained, i.e. no fonts
> are included. Therefore the figure has to be embedded in
> a ConTeXt document (\externalfigure)
Thanks Jens,
This is true, however, I want to have a self-contained postscript file,
or rather, a postscript file I can include in a *LaTeX* document. (I
know this is the ConTeXt-list but I expected to find a lot of MetaPost
experts on this list. :-))
I have tried to add prologues:=2 to the file (which should produce a
self-contained postscript file), but the resulting PS-file still doesn't
show the alpha.
BTW, if I replace the $\alpha$ with $x$ I get a postscript file which
shows the x without running it through mptopdf.
>
>
>>A minimal example (test.mp):
>>
>>beginfig(0);
>>u = 1cm;
>>draw (1u,0)..(0,1u)..(-1u,0)..(0,-1u)..cycle;
>>label.top( btex $\alpha$ etex, (0,0));
>>endfig;
>>
>>texexec --mptex test.mp
>>
>
> In order to pre-view your MP file you can use mptopdf.
>
> texexec --mptex test.mp
> mptopdf test
>
> should give test-0.pdf. Here the \alpha should be visible.
>
> Jens
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Greek characters in metapost
2002-09-12 20:27 ` Ron van Ostayen
@ 2002-09-13 0:12 ` Jens-Uwe Morawski
2002-09-13 7:32 ` Ron van Ostayen
0 siblings, 1 reply; 7+ messages in thread
From: Jens-Uwe Morawski @ 2002-09-13 0:12 UTC (permalink / raw)
On Thu, 12 Sep 2002 22:27:35 +0200
Ron van Ostayen <R.A.J.vanOstayen@WbMT.TUDelft.NL> wrote:
> Jens-Uwe Morawski wrote:
> > The PostScript file is not self-contained, i.e. no fonts
> > are included. Therefore the figure has to be embedded in
> > a ConTeXt document (\externalfigure)
>
>
> This is true, however, I want to have a self-contained postscript file,
> or rather, a postscript file I can include in a *LaTeX* document. (I
> know this is the ConTeXt-list but I expected to find a lot of MetaPost
> experts on this list. :-))
If you embed the MP-output test.0 in your LaTeX document using
\includegraphics of the graphicx package, then the output
should show the \alpha. Depending, whether you are using pdflatex
or latex, pdflatex itself or dvips include the appropriate fonts
and encodings.
Try the following LaTeX file with pdflatex. It should show the \alpha.
%---snip---(mp-include.tex)
\documentclass{article}
\usepackage[pdftex]{graphicx}
\DeclareGraphicsRule{*}{mps}{*}{}
\begin{document}
\includegraphics{test.0}
\end{document}
%---snap----
If you really need a self-contained EPS stand-alone then the
best way is to use mptopdf and convert the resulting PDF back
to EPS using GhostScript.
Jens
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Greek characters in metapost
2002-09-13 0:12 ` Jens-Uwe Morawski
@ 2002-09-13 7:32 ` Ron van Ostayen
2002-09-14 7:35 ` Henning Hraban Ramm
0 siblings, 1 reply; 7+ messages in thread
From: Ron van Ostayen @ 2002-09-13 7:32 UTC (permalink / raw)
Jens-Uwe Morawski wrote:
> On Thu, 12 Sep 2002 22:27:35 +0200
> Ron van Ostayen <R.A.J.vanOstayen@WbMT.TUDelft.NL> wrote:
>
>
>>Jens-Uwe Morawski wrote:
>>
>>>The PostScript file is not self-contained, i.e. no fonts
>>>are included. Therefore the figure has to be embedded in
>>>a ConTeXt document (\externalfigure)
>>>
>>
>>This is true, however, I want to have a self-contained postscript file,
>>or rather, a postscript file I can include in a *LaTeX* document. (I
>>know this is the ConTeXt-list but I expected to find a lot of MetaPost
>>experts on this list. :-))
>>
>
> If you embed the MP-output test.0 in your LaTeX document using
> \includegraphics of the graphicx package, then the output
> should show the \alpha. Depending, whether you are using pdflatex
> or latex, pdflatex itself or dvips include the appropriate fonts
> and encodings.
>
> Try the following LaTeX file with pdflatex. It should show the \alpha.
It does. Thanks Jens.
There is a small difference in the header between the PS-files produced by:
mpost --tex=latex test.mp
and
texexec --mptex test.mp
If I include the PS-picture from the 1st command in a latex file and
produce a PS file using:
latex test
dvips test -o test.ps
then the resulting PS-file *doesn't* show the \alpha
The PS-picture from the 2nd command *does*.
Any idea what causes this difference?
Ron
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Greek characters in metapost
2002-09-13 7:32 ` Ron van Ostayen
@ 2002-09-14 7:35 ` Henning Hraban Ramm
2002-09-14 9:15 ` Greek characters in metapost (solution) Ron van Ostayen
0 siblings, 1 reply; 7+ messages in thread
From: Henning Hraban Ramm @ 2002-09-14 7:35 UTC (permalink / raw)
Am Freitag, 13. September 2002 09:32 schrieb Ron van Ostayen:
> There is a small difference in the header between the PS-files produced by:
> mpost --tex=latex test.mp
> and
> texexec --mptex test.mp
> then the resulting PS-file *doesn't* show the \alpha
> The PS-picture from the 2nd command *does*.
> Any idea what causes this difference?
Because texexec is nice and does everything for you! ;-)
Grüßlis vom Hraban!
--
http://www.fiee.net
http://www.ramm.ch
---
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Greek characters in metapost (solution)
2002-09-14 7:35 ` Henning Hraban Ramm
@ 2002-09-14 9:15 ` Ron van Ostayen
0 siblings, 0 replies; 7+ messages in thread
From: Ron van Ostayen @ 2002-09-14 9:15 UTC (permalink / raw)
I've finally found what was causing the disappearance of the $\alpha$ in
the MP-figure.
RECAP:
This is a LaTeX and MP problem, but I think it could be a ConTeXt
problem if you take the long way to your PDF-result.
(context, dvips, ps2pdf)
MP-file 'test.mp'
===================
% BEGPRE
verbatimtex
\documentclass{article}
\begin{document}
etex
% ENDPRE
beginfig(0);
label( btex $x-\alpha-x$ etex, (0,0));
endfig;
% BEGPOST
verbatimtex
\end{document}
etex
% ENDPOST
end.
===================
LaTeX-file 'test.tex'
===================
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics{test.0}
$x-\alpha-x$
\end{document}
===================
Now, if we run:
mpost --tex=latex test
latex test
dvips -Ppdf test -o test.ps
ps2pdf test.ps test.pdf
the resulting test.pdf doesn't show the -\alpha- in the MP-figure
This is caused by the settings (at least for the texlive distribution)
in config.pdf which is called by the -Ppdf option.
In this file the option G is set which means:
% Character shifting. You want to do this using the BlueSky/AMS/Y&Y fonts.
% It remaps certain ``control character'' positions to an another range
% where these characters are repeated. This character shifting works wround
% bugs in some tools such as older versions of the Acrobat Reader.
Apparently, there is a conflict between the shifted characters in the
text and the non-shifted characters in the MP-figure.
So, I have turned this option off (hopefully without any repercussions),
and all is well.
Thanks for all your help.
Ron
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2002-09-14 9:15 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-12 11:15 Greek characters in metapost Ron van Ostayen
2002-09-12 14:19 ` Jens-Uwe Morawski
2002-09-12 20:27 ` Ron van Ostayen
2002-09-13 0:12 ` Jens-Uwe Morawski
2002-09-13 7:32 ` Ron van Ostayen
2002-09-14 7:35 ` Henning Hraban Ramm
2002-09-14 9:15 ` Greek characters in metapost (solution) Ron van Ostayen
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).