[texworks] New version 302/303

T T t34www at googlemail.com
Thu Jun 4 12:26:19 CEST 2009

2009/6/4 Jonathan Kew <jfkthame at googlemail.com>:
> On 4 Jun 2009, at 07:56, Alain Delmotte wrote:
> That's odd; could you confirm exactly what your working and non-working
> versions of defaultbinpaths look like?
>> What do you mean by "on the very first element of defaultbinpaths"?
>> TeXworks is in "C:\Program Files\texworks" and my "texworks-setup.ini" is
>> =================
>> defaultbinpaths = C:/Program Files/MiKTeX 2.7/miktex/bin
>> inipath = C:/adel/TeXworks/
>> libpath = C:/adel/TeXworks/
>> =================
>> and it doesn't work (if I erase the typesetting info in Preferences and
>> restart TeXworks).
> I wonder if this is because there are spaces in the path; perhaps it is not
> being quoted properly at some stage. I'll try to look into this; or if you'd
> be able to do a test and confirm this (e.g., temporarily copy the entire
> miktex tree to C:/miktex, and try defaultbinpaths = C:/miktex/bin) I'd be
> interested to know what happens.

Working settings on XP:

defaultbinpaths=C:/Program Files/MiKTeX

Working settings on Vista:

Files/MiKTeX 2.7/miktex/bin;

The second path in defaultbinpaths is not necessary (TeX bin dir is on
the first one).

As you can see spaces seem to be of no consequence. Also, on Vista I
have MiKTeX in non-standard location and it still works. If I swap the
above settings with each other, then it doesn't work any more. This
suggest that there is a problem with how the defaultbinpaths is
handled, more on that below.

The good news is that redirection through TW_INIPATH and TW_LIBPATH
env vars works as planned :-), i.e. these vars override their
counterparts from texworks-setup.ini.

Also, PATH var searching works now :-) but *only* if defaultbinpaths
is not defined in texworks-setup.ini. This brings me to this pesky
defaultbinpaths. In the source of TWApp.cpp (current rev.) I find

void TWApp::setDefaultPaths()
        QDir appDir(applicationDirPath());
        if (binaryPaths == NULL)
                binaryPaths = new QStringList;
        if (defaultBinPaths)
                *binaryPaths = *defaultBinPaths;
        else { // <-- REMOVE THIS
#ifndef Q_WS_MAC
                // on OS X, this will be the path to
                // which doesn't make any sense as a search dir for TeX binaries
                const char *envPath = getenv("PATH");
                if (envPath != NULL)
                        foreach (const QString& s,
                        if (!binaryPaths->contains(s))
#ifdef Q_WS_WIN
                        << "c:/texlive/2009/bin"
                        << "c:/texlive/2008/bin"
                        << "c:/texlive/2007/bin"
                        << "c:/w32tex/bin"
                        << "c:/Program Files/MiKTeX 2.7/miktex/bin"
                        << "c:/Program Files (x86)/MiKTeX 2.7/miktex/bin"
                foreach (const QString& s,
                        if (!binaryPaths->contains(s))
        } // <-- REMOVE THIS

The 'else' statement (marked with "// <-- REMOVE THIS", which is my
suggestion)  is executed *only* if defaultBinPaths is NULL (and that
happens only if defaultbinpaths is not defined in texworks-setup.ini).
 This means that PATH and compiled-in defaults are never appended to
binaryPaths. Is this the intended behaviour or simply a bug?

Also, envPath is split with `QString(envPath).split(PATH_LIST_SEP)',
while defaultBinPaths is assigned with:

*defaultBinPaths = portable.value("defaultbinpaths").toStringList();

Are these two equivalent? What separator is used for splitting in case
of `toStringList' method? If defaultbinpaths is not split properly,
maybe it could explain why tex bin dir has to be the first element of
defaultbinpaths (this still doesn't explain why Alain's settings don't
work, while very similar ones work for me). Can anyone make some sense
of it?



More information about the texworks mailing list