Install Xfig On Windows 7

Since LaTeX works so well in the Linux/UNIX world (with tools like xFig for example) I installed cygwin on my Win7 machine to accompany the win32 installation of TeX Live. So I already had a TeX Live directory under

C:Program Files

Xfig3.2 uses a new type of spline called an X-Spline. X-splines allow the user to mix interpolation and approximation points in the same curve. X-splines allow the user to mix interpolation and approximation points in the same curve. Plain Xaw version of xfig, an X Window System tool for creating basic vector graphics, including bezier curves, lines, rulers and more. The normal xfig package uses the more modern / prettier looking Xaw3d toolkit, whereas this version uses the very basic Xaw toolkit.

and then I thought maybe I should just do it all inside cygwin. but it was not so easy… so this is about “Getting latex to work on cygwin when it is already installed as a windows application in C:Program Files (texlive in both cases).”

I am on win32 but 64 bit may be the same, I don’t know.

(1) Installed cygwin using setup-x86.exe, including TeX Live.

(2) A quick test using kpathsea shows that the files are not where TeX is expecting them:

kpsewhich --var-value=TEXMFMAIN

does not gives you the actual distribution texmf tree. For example, if you run:

texconfig confall

it thinks it should look in

C:cygwinusrsharetexmftexconfig

when really it should look in

C:cygwinusrsharetexmf-disttexconfig

(3) But this is not so bad — there is a cygwin version of texmf.cnf, you just need to copy it to where texconfig will look for it:

$ cp /usr/share/texmf/web2c/texmf.cnf /usr/share/texmf/web2c/texmf_noncygwin_backup_cnf.bak

$ cp /usr/share/texmf-dist/web2c/texmf.cnf /usr/share/texmf/web2c/

(4) But then it did not work. The reason was that cygwin default install was incorporating the PATH from Windows into the cygwin PATH. This was easy to test:

$ echo $PATH

(5) What was happening was that texconfig was finding the config files in the win32 installation and getting confused. Since I am happy for my cygwin to be essentially independent of any binaries installed outside it (and if I want to use them I’ll tell it to myself) I just changed the PATH statement in my .bash_profile to overwrite the system-defined path with a simple:

PATH='/usr/local/bin:/usr/bin'

(6) And the last trick was that Windows was defining an environment variable

TEXMFCNF=C:Program FilesTeXLivetexmf-varweb2c

which was misleading texconfig. Whether this was the problem or the whole path was the problem I’m not sure, so I cleaned up both. I just added

unset TEXMFCNF

to my .bash_profile as well. This may be overkill, but that way if I add a font or something and rerun mktexlsr in the furture when I have forgotten all this it should still work.

(7) Configure TeX…

Cygwin compiler

$ texhash (or mktexlsr) (should list the files it is updating)

$ texconfig confall

I decided to manually create the directories under $HOME that it was expecting, though I don’t think you need to:

$ mkdir -p .cache/texmf/fonts

$ mkdir -p .config/texmf

$ mkdir -pv .local/share/texmf

Songs

Then the big one…

$ texconfig init

(8) Note the end of the messages output from init:

Boyka 5

WARNING: you are switching to updmap's per-user mappings.

You have run updmap (as opposed to updmap-sys) for the first time; this has created configuration files which are local to your personal account.

Any changes in system map files will *not* be automatically reflected in your files; furthermore, running updmap-sys will no longer have any effect for you. As a consequence, you have to rerun updmap yourself after any change in the system directories; for example, if a new font
package is added.

If you want to undo this, remove the files mentioned above.

(Run updmap --help for full documentation of updmap.)

Transcript written on '/home/username/.cache/texmf/web2c/updmap.log'.
updmap: Updating ls-R files.

(9) And … it works! If it run X (startx, wm or tw at my cygwin prompt) I can use xdvi, xpdf, xFig and so on.

Or just do this.

If you’re a coder or programmer, you probably spend a decent amount of time using the command prompt to execute programs or compile code. In order to complete those tasks, you most likely have to use a command from a library or software package installed (like Python) on your system.

By default, most of these programs will add their own custom shortcuts to the Windows environment variables. The most used environment variable in Windows is probably the PATH variable. It basically allows you to run any executables that are located inside the paths specified in the variable at the command prompt without having to give the full path to the executable.

In this article, I’ll show you how you can add more paths to the Windows PATH variable in case you want to run executables from your own custom directories. It’s worth noting that the procedure below is for Windows 10, but it’s almost exactly the same for Windows 7 also.

Add Directories to PATH Variable

To get started, right-click on the Computer or This PC icon on the desktop and select Properties. If you don’t have that icon on your desktop already, you can add any missing desktop icons easily.

On the System dialog page, you’ll see an Advanced system settings link on the left-hand side.

This will bring up the System Properties dialog, which should already be open to the Advanced tab. Go ahead and click on the Environment Variables button at the very bottom.

On the Environment Variables dialog, you’ll see two sets of variables: one for user variables and the other for system variables. Both lists have the PATH variable, so you have to decide which one to edit.

If you only need the commands for your own user account, then edit the user variable. If you need it to work across the computer system regardless of which user is logged in, then edit the system variable. Click on Path and then click on Edit.

On the Edit environment variable dialog, you’ll see a list of all the paths that are currently in the PATH variable. As you can see, Node.js and Git already added their paths so that I can run Git commands and Node.js commands from anywhere while in the command prompt.

To add a new path, simply click on New and it’ll add a new line to the bottom of the list. If you know the path, simply type it in or copy and paste it. If you prefer, you can also click Browse and then navigate to the desired path.

To edit any path, simply select it and then click on the Edit button. You can also delete paths using the Delete button. Note that you can also move items up and down on the list. When you type a command at the command prompt, Windows has to search through each directory stored in the PATH variable to see if that executable exists or not. If you want your executable to be found faster, just move that path up to the top of the list.

This can also come in handy if you have multiple versions of the same command in different paths and need to have one run instead of the other. The one that shows up higher in the list will be run when you type in the command.

Lastly, if you click on Edit text, it will load a dialog where you can edit the Path variable using the old interface where all the paths are listed in one text box.

That’s all there is to it! If you want to learn more about environment variables, make sure to check out my post on how to create your own custom environment variables. Enjoy!

Related Post