ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* texexec+mpost cmr10 vs CMR10 trouble using dvips backend
@ 2007-04-15  4:43 Sanjoy Mahajan
  2007-04-15  4:55 ` Aditya Mahajan
  2007-04-15  6:49 ` Taco Hoekwater
  0 siblings, 2 replies; 11+ messages in thread
From: Sanjoy Mahajan @ 2007-04-15  4:43 UTC (permalink / raw)
  To: ntg-context

A font-embedding issue puzzles me.  First I make a metapost figure that
uses plain tex for the label, so it uses cmr10.  Then I include it in a
context document to get a .ps file.  The problem is that the label shows
up in Courier (which ghostscript uses when it cannot find the font, I
think).

Here is the test.tex 

  \starttext
  \externalfigure[fig.1]
  \stoptext

and this fig.mp

  beginfig(1)
  label(btex hello etex, origin);
  endfig;
  end

The commands are:

  mpost fig
  texexec --ps test
  gv test.ps

The resulting fig.1 has these lines:

  %*Font: cmr10 9.96265 9.96265 65:912
  ...
  (hello) cmr10 9.96265 fshow

and test.ps has

  %%DocumentFonts: LMRoman12-Regular CMR10

But there's no cmr10 (lowercase) embedded in test.ps.  If I generate
test.pdf directly (with texexec test), then all is well.

Is there a magic option or map file line that I need?

[ConTeXt  ver: 2007.03.19 11:20 MKII  fmt: 2007.4.12]

Thanks for any suggestions!  The reason I'm using dvi and ps is that
arxiv.org cannot handle ConTeXt submissions directly.  A workaround
recommended by the arxiv.org maintainers is to submit document.ps with
all the source files in a separate directory (but it won't let you
submit document.pdf with all the source files, a behavior that the
admins say is a bug or 'oddity' but not one that they'll fix soon).

-Sanjoy

`Intellectual property is intellectual theft.'

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: texexec+mpost cmr10 vs CMR10 trouble using dvips backend
  2007-04-15  4:43 texexec+mpost cmr10 vs CMR10 trouble using dvips backend Sanjoy Mahajan
@ 2007-04-15  4:55 ` Aditya Mahajan
  2007-04-15 16:45   ` Sanjoy Mahajan
  2007-04-15  6:49 ` Taco Hoekwater
  1 sibling, 1 reply; 11+ messages in thread
From: Aditya Mahajan @ 2007-04-15  4:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, 15 Apr 2007, Sanjoy Mahajan wrote:

> A font-embedding issue puzzles me.  First I make a metapost figure that
> uses plain tex for the label, so it uses cmr10.  Then I include it in a
> context document to get a .ps file.  The problem is that the label shows
> up in Courier (which ghostscript uses when it cannot find the font, I
> think).

I get this all the time when I try to preview my mp figures in 
ghostview. I thought that this was because my system was misconfigured 
and never really bothered to go into the details.


> Thanks for any suggestions!  The reason I'm using dvi and ps is that
> arxiv.org cannot handle ConTeXt submissions directly.  A workaround
> recommended by the arxiv.org maintainers is to submit document.ps with
> all the source files in a separate directory (but it won't let you
> submit document.pdf with all the source files, a behavior that the
> admins say is a bug or 'oddity' but not one that they'll fix soon).

Since they are not going to process the source, how about generating a 
pdf and then converting the pdf into ps.

Aditya

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: texexec+mpost cmr10 vs CMR10 trouble using dvips backend
  2007-04-15  4:43 texexec+mpost cmr10 vs CMR10 trouble using dvips backend Sanjoy Mahajan
  2007-04-15  4:55 ` Aditya Mahajan
@ 2007-04-15  6:49 ` Taco Hoekwater
  2007-04-15 15:23   ` Sanjoy Mahajan
  1 sibling, 1 reply; 11+ messages in thread
From: Taco Hoekwater @ 2007-04-15  6:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Sanjoy Mahajan wrote:
> A font-embedding issue puzzles me.  First I make a metapost figure that
> uses plain tex for the label, so it uses cmr10.  Then I include it in a
> context document to get a .ps file.  The problem is that the label shows
> up in Courier (which ghostscript uses when it cannot find the font, I
> think).
> 
> Here is the test.tex 
> 
>   \starttext
>   \externalfigure[fig.1]
>   \stoptext
> 
> and this fig.mp
> 
>   beginfig(1)
>   label(btex hello etex, origin);
>   endfig;
>   end
> 
> The commands are:
> 
>   mpost fig
>   texexec --ps test
>   gv test.ps

If you set prologues := 1 in the mp file, that should help.

In a new metapost (texlive2007) you can even generate an
image with the font included by using prologues := 3.

Best, Taco

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: texexec+mpost cmr10 vs CMR10 trouble using dvips backend
  2007-04-15  6:49 ` Taco Hoekwater
@ 2007-04-15 15:23   ` Sanjoy Mahajan
  2007-04-15 16:56     ` George N. White III
  2007-04-15 16:58     ` Wolfgang Schuster
  0 siblings, 2 replies; 11+ messages in thread
From: Sanjoy Mahajan @ 2007-04-15 15:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> If you set prologues := 1 in the mp file, that should help.

That still gave Courier fonts after including fig.1 in test.ps.

> In a new metapost (texlive2007) you can even generate an
> image with the font included by using prologues := 3.

That worked.  [I'm using MetaPost 0.993 (Web2C 7.5.6) from the Debian
texlive2007-2 packages.]

>From p.24 of the corresponding mpman.pdf manual:

   It is worth noting that the default value prologues:=0 is
   sufficient for graphics included in TEX-based documents.

Does that need a slight exception added to it?  Or have I
misconfigured something in the toolchain from .tex + .mp to .ps?  By
the way, the figure works fine with prologues := 0 if I include it
(using epsf.tex) in a plain-TeX document.

So I think there's something slightly off about what ConTeXt is doing.

-Sanjoy

`Not all those who wander are lost.' (J.R.R. Tolkien)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: texexec+mpost cmr10 vs CMR10 trouble using dvips backend
  2007-04-15  4:55 ` Aditya Mahajan
@ 2007-04-15 16:45   ` Sanjoy Mahajan
  0 siblings, 0 replies; 11+ messages in thread
From: Sanjoy Mahajan @ 2007-04-15 16:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> Since they are not going to process the source, how about generating a 
> pdf and then converting the pdf into ps.

That's a good idea.  I'll do that or set prologues := 3 if I cannot
figure out what change I need to make in the ConTeXt configuration.
I'd like to figure out what's wrong with the dvi->ps route, especially
if someday arxiv.org supports ConTeXt.

By the way, if enough arxiv.org users request ConTeXt support, they
might provide it...

-Sanjoy

`Not all those who wander are lost.' (J.R.R. Tolkien)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: texexec+mpost cmr10 vs CMR10 trouble using dvips backend
  2007-04-15 15:23   ` Sanjoy Mahajan
@ 2007-04-15 16:56     ` George N. White III
  2007-04-17  2:03       ` Sanjoy Mahajan
  2007-04-15 16:58     ` Wolfgang Schuster
  1 sibling, 1 reply; 11+ messages in thread
From: George N. White III @ 2007-04-15 16:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 4/15/07, Sanjoy Mahajan <sanjoy@mrao.cam.ac.uk> wrote:

> > If you set prologues := 1 in the mp file, that should help.
>
> That still gave Courier fonts after including fig.1 in test.ps.
>
> > In a new metapost (texlive2007) you can even generate an
> > image with the font included by using prologues := 3.
>
> That worked.  [I'm using MetaPost 0.993 (Web2C 7.5.6) from the Debian
> texlive2007-2 packages.]
>
> >From p.24 of the corresponding mpman.pdf manual:
>
>    It is worth noting that the default value prologues:=0 is
>    sufficient for graphics included in TEX-based documents.
>
> Does that need a slight exception added to it?  Or have I
> misconfigured something in the toolchain from .tex + .mp to .ps?  By
> the way, the figure works fine with prologues := 0 if I include it
> (using epsf.tex) in a plain-TeX document.

Your ConTeXt example is using the default latin modern fonts.  The reason
the mpost files work with plain TeX is that the cm fonts are being
used by plain tex, so
the fonts are already defined in the .ps file when the font commands
in the figure file
are found.

> So I think there's something slightly off about what ConTeXt is doing.

On my systems I have modified the map files to use the lm-rep map
files (so cm fonts are replaced by lm fonts).  Your example works for
me with TL2007 on FC5 in both plain tex and context.  In context, I
see:

TeXUtil | tuo file saved
This is dvips(k) 5.96 Copyright 2005 Radical Eye Software (www.radicaleye.com)
' TeX output 2007.04.15:1332' -> t.ps
<tex.pro><lm-ec.enc><lm-rep-cmrm.enc><finclude.pro><texps.pro><special.pro>.
<lmr10.pfb><lmr12.pfb>[1<./fig.1>]
TeXExec | runtime: 6.214806

The resulting .ps file has:

%%BeginFont: CMR10
%!PS-AdobeFont-1.0: LMRoman10-Regular 1.010

while for plain tex (using dvips -P pdf ...):
This is dvips(k) 5.96 Copyright 2005 Radical Eye Software (www.radicaleye.com)
' TeX output 2007.04.15:1327' -> pt.ps
<tex.pro><alt-rule.pro><lm-rep-cmrm.enc><finclude.pro><texps.pro>
<special.pro>. <lmr10.pfb>[1<fig.1>]

For debian, the procedure for changing updmap.cnf has been debianized,
but it is mentioned in the README for the lmodern package (watch out
for a typo in the example entry:  "test" --> "text").   If you do
this, you might want to include the following:

$ cat lm-subset-ams.map
# AMS fonts not provided by lm-rep
# needed with the lm-rep maps to avoid duplicate entries from the ams maps
# msbm
msbm5 MSBM5 <msbm5.pfb
msbm6 MSBM7 <msbm7.pfb
msbm7 MSBM7 <msbm7.pfb
msbm8 MSBM7 <msbm7.pfb
msbm9 MSBM10 <msbm10.pfb
msbm10 MSBM10 <msbm10.pfb

-- 
George N. White III <aa056@chebucto.ns.ca>
Head of St. Margarets Bay, Nova Scotia

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: texexec+mpost cmr10 vs CMR10 trouble using dvips backend
  2007-04-15 15:23   ` Sanjoy Mahajan
  2007-04-15 16:56     ` George N. White III
@ 2007-04-15 16:58     ` Wolfgang Schuster
  2007-04-16  5:02       ` Sanjoy Mahajan
  1 sibling, 1 reply; 11+ messages in thread
From: Wolfgang Schuster @ 2007-04-15 16:58 UTC (permalink / raw)
  To: ntg-context

On Sun, 15 Apr 2007 16:23:35 +0100
Sanjoy Mahajan <sanjoy@mrao.cam.ac.uk> wrote:

> > If you set prologues := 1 in the mp file, that should help.
> 
> That still gave Courier fonts after including fig.1 in test.ps.
> 
> > In a new metapost (texlive2007) you can even generate an
> > image with the font included by using prologues := 3.
> 
> That worked.  [I'm using MetaPost 0.993 (Web2C 7.5.6) from the Debian
> texlive2007-2 packages.]
> 
> >From p.24 of the corresponding mpman.pdf manual:
> 
>    It is worth noting that the default value prologues:=0 is
>    sufficient for graphics included in TEX-based documents.
> 
> Does that need a slight exception added to it?  Or have I
> misconfigured something in the toolchain from .tex + .mp to .ps?  By
> the way, the figure works fine with prologues := 0 if I include it
> (using epsf.tex) in a plain-TeX document.
> 
> So I think there's something slightly off about what ConTeXt is doing.
> 
> -Sanjoy
> 

Hi Sanjoy,

can also try to create the pd file by hand with "dvips -Ppdf test",
that gave a correct output on my system.

The texexec way used Courier in the PS-File, the dvips use cmr10 in the
PS-File.

Wolfgang

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: texexec+mpost cmr10 vs CMR10 trouble using dvips backend
  2007-04-15 16:58     ` Wolfgang Schuster
@ 2007-04-16  5:02       ` Sanjoy Mahajan
  2007-04-16 14:21         ` George N. White III
  0 siblings, 1 reply; 11+ messages in thread
From: Sanjoy Mahajan @ 2007-04-16  5:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> can also try to create the pd file by hand with "dvips -Ppdf test",
> that gave a correct output on my system.

Thanks, that works.  I guess -Ppdf tells it to use map files that find
the type1 fonts, so cmr in the metapost figures is replaced by the
lmodern .pfb.  Oh, that's not what happens: it instead finds the
cmr10.pfb and includes it correctly.  So the final document uses
lmodern for the page number (from the ConTeXt src file) and cmr10 for
the 'hello' from the metapost figure.

Though I'm a bit scared of -Ppdf from years ago when I think it caused
encoding problems.  A few characters didn't show up correctly in the
pdf file, but only when using non-cmr fonts.

-Sanjoy

`Not all those who wander are lost.' (J.R.R. Tolkien)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: texexec+mpost cmr10 vs CMR10 trouble using dvips backend
  2007-04-16  5:02       ` Sanjoy Mahajan
@ 2007-04-16 14:21         ` George N. White III
  2007-04-17  2:12           ` Sanjoy Mahajan
  0 siblings, 1 reply; 11+ messages in thread
From: George N. White III @ 2007-04-16 14:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 4/16/07, Sanjoy Mahajan <sanjoy@mrao.cam.ac.uk> wrote:

> > can also try to create the pd file by hand with "dvips -Ppdf test",
> > that gave a correct output on my system.
>
> Thanks, that works.  I guess -Ppdf tells it to use map files that find
> the type1 fonts, so cmr in the metapost figures is replaced by the
> lmodern .pfb.  Oh, that's not what happens: it instead finds the
> cmr10.pfb and includes it correctly.  So the final document uses
> lmodern for the page number (from the ConTeXt src file) and cmr10 for
> the 'hello' from the metapost figure.

This is a hint that the underlying problem is related to map files.  With the
lm-rep maps the cm "hello" should become lmodern.

> Though I'm a bit scared of -Ppdf from years ago when I think it caused
> encoding problems.  A few characters didn't show up correctly in the
> pdf file, but only when using non-cmr fonts.

I think that was fixed long ago, but I rarely use .dvi anymore.

-- 
George N. White III <aa056@chebucto.ns.ca>
Head of St. Margarets Bay, Nova Scotia

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: texexec+mpost cmr10 vs CMR10 trouble using dvips backend
  2007-04-15 16:56     ` George N. White III
@ 2007-04-17  2:03       ` Sanjoy Mahajan
  0 siblings, 0 replies; 11+ messages in thread
From: Sanjoy Mahajan @ 2007-04-17  2:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users

"George N. White III" <gnwiii@gmail.com> wrote:
> Your ConTeXt example is using the default latin modern fonts.  The
> reason the mpost files work with plain TeX is that the cm fonts are
> being used by plain tex, so the fonts are already defined in the .ps
> file when the font commands in the figure file are found.

That's 95% of the story, but I think with a small addendum.  e.g. If
the .tex file uses only cmr10 but fig.1 file uses cmsy7 for a
subscript, dvips will handle it correctly and download cmsy7 into the
.ps file.  So it's not only that the fonts are defined in the .ps
file, but that dvips knows how to handle the inclusion correctly when
the font is listed in a fig.1 embedded by plain TeX.

> For debian, the procedure for changing updmap.cnf has been debianized,
> but it is mentioned in the README for the lmodern package

Thanks, I didn't know about that.  The directions are easy enough to
do, esp. on an Ubuntu system.

Though I prefer to use the vanilla system, so that I can test the
distributions to see what works and breaks, and try to get the
upstream folks to fix it.  Although, I'm not sure who is the relevant
upstream here.  Mojca (off-list) suggested trying an older ConText and
I'll try that.

Meanwhile I'll put the 'dvips -Ppdf' workaround into my Makefiles.

-Sanjoy

`Not all those who wander are lost.' (J.R.R. Tolkien)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: texexec+mpost cmr10 vs CMR10 trouble using dvips backend
  2007-04-16 14:21         ` George N. White III
@ 2007-04-17  2:12           ` Sanjoy Mahajan
  0 siblings, 0 replies; 11+ messages in thread
From: Sanjoy Mahajan @ 2007-04-17  2:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> I think that was fixed long ago, but I rarely use .dvi anymore.

Nor me except for arxiv.org.  By the way, the next email will have
directions on how to submit ConText documents to arxiv.org.

-Sanjoy

`Not all those who wander are lost.' (J.R.R. Tolkien)

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-04-17  2:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-15  4:43 texexec+mpost cmr10 vs CMR10 trouble using dvips backend Sanjoy Mahajan
2007-04-15  4:55 ` Aditya Mahajan
2007-04-15 16:45   ` Sanjoy Mahajan
2007-04-15  6:49 ` Taco Hoekwater
2007-04-15 15:23   ` Sanjoy Mahajan
2007-04-15 16:56     ` George N. White III
2007-04-17  2:03       ` Sanjoy Mahajan
2007-04-15 16:58     ` Wolfgang Schuster
2007-04-16  5:02       ` Sanjoy Mahajan
2007-04-16 14:21         ` George N. White III
2007-04-17  2:12           ` Sanjoy Mahajan

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).