[texworks] Embed fonts with ps2pdf - argument parsing problem

Brandon Kuczenski brandon.kuczenski at 301south.net
Tue Jul 24 21:49:04 CEST 2012

On 7/23/2012 12:35 AM, Siep Kroonenberg wrote:
> On Mon, Jul 23, 2012 at 07:50:26AM +0200, Stefan Löffler wrote:
>> Hi,
>> On 2012-07-21 01:07, Brandon Kuczenski wrote:
>>> I know this question has been "answered" on this list before, namely here:
>>> http://tug.org/pipermail/texworks/2009q2/000822.html
>>> However, the solution included there does not embed fonts, which is
>>> clearly not acceptable.  Because of the byzantine argument parsing that
>>> happens between the batch file and Tw, I cannot for the life of me
>>> figure out how to pass the options "-dEmbedAllFonts=true
>>> -dPDFSETTINGS=/prepress -dCompatibilityLevel=1.4" to ps2pdf from within
>>> TexWorks.
>> Assuming the batch file cited above works for you (I don't have Windows
>> w/ TeX available at the moment to test), you can modify it to
>> @latex %1 && dvips "%~dpn1.dvi" && ps2pdf -dEmbedAllFonts=true -dPDFSETTINGS=/prepress -dCompatibilityLevel=1.4 "%~dpn1.ps"
>> to pass additional parameters to ps2pdf. Note that this has to be done
>> in the batch file, the TeXworks configuration is unchanged.
> Or replace '=' with '#'. I recall that that may be needed for
> Windows batchfiles when invoking Ghostscript.

Sorry, it does not work. 

Without quotes, with equal signs and not hashmarks, GS chokes with the

MiKTeX GPL Ghostscript 8.60 (2007-08-01)

Copyright (C) 2007 Artifex Software, Inc. All rights reserved.

This software comes with NO WARRANTY: see the file PUBLIC for details.

Error: /undefinedfilename in (true)

Operand stack:

Execution stack:

%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2
%stopped_push --nostringval-- --nostringval-- --nostringval-- false 1

Dictionary stack:

--dict:1146/1684(ro)(G)-- --dict:0/20(G)-- --dict:70/200(L)--

Current allocation mode is local

Last OS error: No such file or directory

MiKTeX GPL Ghostscript 8.60: Unrecoverable error, exit code 1

Making the entirely obvious and simple, not at all unconventional,
substitution of hash marks for equal signs, howver, also doesn't work. 
Strangely, the PS file is no longer correctly built (or maybe it gets
written over).  TW completes without errors, but I wind up with an
incorrect ps file (which has no content) and no PDF.  The DVI file
builds correctly.  If I remove the switches, then the ps and pdf do
build correctly, but fonts are not embedded.

Quoting the command switches individually has no effect.

Minimal example attached with tex file, batch file, and resulting ps
file (batch file extension changed to bXt because gmail won't let me
email .bat)

I'm as mystified as you.

Thanks for your time and insight,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: TW-test.zip
Type: application/x-zip-compressed
Size: 1793 bytes
Desc: not available
URL: <http://tug.org/pipermail/texworks/attachments/20120724/a77aff64/attachment.bin>

More information about the texworks mailing list