texexec+mpost cmr10 vs CMR10 trouble using dvips backend
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.'
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
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)
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
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)
On 4/15/07, Sanjoy Mahajan
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
"George N. White III"
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)
On Sun, 15 Apr 2007 16:23:35 +0100
Sanjoy Mahajan
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
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)
On 4/16/07, Sanjoy Mahajan
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
participants (5)
-
Aditya Mahajan
-
George N. White III
-
Sanjoy Mahajan
-
Taco Hoekwater
-
Wolfgang Schuster