[texworks] latex->dvips->ps2pdf on Windows

T T t34www at googlemail.com
Thu Jun 11 09:44:39 CEST 2009

On 11/06/2009, Arthur Reutenauer <arthur.reutenauer at normalesup.org> wrote:
>> One remark to this. Passing arguments from TW to the batch with100%
>> reliability might be very tricky. The problem is that TW detects and
>> quotes arguments with spaces, otherwise they are passed as is. This is
>> not sufficient for batch scripts, because e.g. name,with,commas.tex
>> will be split into 3 batch arguments (comma and several other
>> characters are treated as whitespace by cmd.exe). Special characters
>> like & will also cause troubles. Some workarounds might be possible
>> but nothing particularly elegant springs to mind.
>   Should that not best be fixed in the Windows version of TeXworks then?
> It could escape the comma, the ampersand, etc. in addition to the space
> character.

This is not so simple either. When I said that TW detects and quotes
arguments with spaces, I wasn't entirely correct. It looks like this
is done automatically by the underlying Qt framework, because I don't
see anything specific for that in the TW code. I don't know if this
can be controlled.

Then, there is a problem that cmd.exe does its own argument parsing,
which uses different quoting/escaping rules than those used in APIs
for process creation. And Qt seems to be geared towards APIs rules.
For example, if I specify in TW tools:
  Arguments: "a b c"
it will be passed as:
  "\"a b c\""
This would really confuse cmd.exe, so direct quoting in the tools
config doesn't seem to be an option, at least not if Qt is allowed to
escape it.

I would have to spend some time to find a reasonable solution. If TW
team is interested in sorting this out, I can assist.



More information about the texworks mailing list