[texworks] [patch] using env PATH on Unix instead of compiled defaults

Norbert Preining preining at logic.at
Mon May 18 17:05:15 CEST 2009

On Mo, 18 Mai 2009, Stefan Löffler wrote:
> IIRC, MikTeX doesn't register properly in the path. At least I think I
> had to tell some LaTeX editors where to find it back in my Windows days.
> They may also have changed it in the meantime, but I wouldn't rely
> solely on the path on Windows.
> In general I'd suggest to keep the paths as they were in the sources so
> far *in addition* to respecting the path. This raises the question of

Ok, that sounds reasonable. That would mean:
Index: src/TWApp.cpp
--- src/TWApp.cpp	(revision 295)
+++ src/TWApp.cpp	(working copy)
@@ -417,6 +417,7 @@
 		*binaryPaths = *defaultBinPaths;
 	else {
 #ifdef Q_WS_WIN
+		*binaryPaths = QString(getenv("PATH")).split(';');
 			<< "c:/texlive/2009/bin"
 			<< "c:/texlive/2008/bin"
@@ -426,7 +427,7 @@
 			<< "c:/Program Files (x86)/MiKTeX 2.7/miktex/bin"
-		*binaryPaths = QString(DEFAULT_BIN_PATHS).split(':');
+		*binaryPaths = QString(getenv("PATH")).split(':');
 	for (int i = binaryPaths->count() - 1; i >= 0; --i) {

> which to prefer, however. And this depends on if (how) all these paths
> are shown to the user.

In the above patch *first* the PATH setting and then the default paths
are used.

> In principle it is possible to have several TeX installations on the
> same machine. While this usually qualifies as an expert system, users on
> such systems may want to choose which installation they want to use,
> rather than using the one that comes first in the path. The reverse
> argument may be true as well, however (most users will usually want to
> use their default installation, which should be the one in the path). So
> in any case this should be user-customizable (I didn't look into your
> patch in detail, so I don't know whether it applies before the paths are
> displayed to the user in the preferences dialog or used afterwards).

The point is that these settings are only the *defaults*. The user can
already now edit these and select whatever TeX system there is.

The default done here are only made that they work in a reasonable way.

> Last but not least: on my Linux machine, TeXlive didn't modify my path.
> It rather sym-linked its programs into /usr/local/bin. When I installed

That is true.

> additional programs later on, they were not sym-linked automatically. So
> this would be another reason to at least try to guess the "correct"
> place of the binaries.

	tlmgr symlinks add

(as root)

Best wishes


Dr. Norbert Preining <preining at logic.at>        Vienna University of Technology
Debian Developer <preining at debian.org>                         Debian TeX Group
gpg DSA: 0x09C5B094      fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
An extremely intricate knot originally used for belaying the
topgallant foresheets of a gaff-rigged China clipper, and now more
commonly observed when trying to get an old kite out of the cupboard
under the stairs.
			--- Douglas Adams, The Meaning of Liff

More information about the texworks mailing list