Monday, September 24, 2012

MiKTex 2.9: Packages and Styles Not Found Error on Windows 8

I just tried to compile one of my old Latex documents (which compiles fine on my Linux boxes) on my freshly installed Windows 8 machine with MiKTeX 2.9 and all hell broke loose with different a million "missing package" and "missing styles" error. My document is a IEEE conference paper. So it all started with a "IEEEtran.sty missing" error. Interestingly, although I had "Install missing packages on the fly" set to "Yes" (as can be seen on the screenshot), still I was getting this error.

A little bit of debugging through the error messages reveals - it's all about file write permission. Windows 8 has a stricter ACL set for the installed programs on write access. Therefore, the "on the fly" installable packages, although were being fetched, were failing to get installed.

The trivial solution was to launch the "command prompt" (cmd.exe) as administrator and do a "pdflatex document.tex". This time all my missing styles and packages were fetched and installed!

P.S.
  • To manually install Latex packages on Windows 8, run "C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\mpm_mfc_admin.exe", select and install your package.
  •  To set your packages to install automatically, run "C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\mo_admin.exe" and set "Install missing packages automatically" to "yes" as shown in the screenshot.

Monday, September 10, 2012

Fix Error Code 2503/2502 on Windows 8

I have decided to give Windows 8 a few more days of my life (before deciding if I am going back to Windows 7). So I am re-installing many of the programs that I used everyday on my Windows 7 setup. Some of them are giving me this - "Error code 2503" dialog box followed by one more with "Error code 2502" while installation.

It appears that these installation packages lack required permissions to access and deploy files  necessary files due to Windows 8's strict security model. Right-clicking the installer (MSI or EXE) and selecting "Run as Administrator" solves the issue.

P.S.
Just realized that some of you might still be struggling to find the option "Run as Administrator" in the context menu. Try right-clicking on you MSI or EXE with the Shift button pressed (Shift+Right Click that is), you should have the option now.

The second option would be to search for the file through Window 8's unified start-button-search.
  1. Press the Windows key 
  2. Type part of the file name and navigate to the file
  3. Now press Ctrl+Shift+Enter
This will run your MSI or EXE as administrator. Cheers.

Wednesday, September 5, 2012

The Quickest way to edit environment variables in Windows 8

I am trying to setup my Android development environment on my freshly installed Windows 8 machine and quite obviously I needed to add "tools" and "platform-tools" directory from the Android SDK into my %PATH% environment variable. It took me a good couple of minutes to figure out how to do it under Windows 8. So I thought why not save someone else from wasting 2 minutes of his life. Thankfully it really is a 3 step process once you know how to get there:

  1. Press the Windows key and just type "control panel" followed by Enter to quickly navigate to Control-Panel.
  2. Now press F3 and type "environment"
  3. That's it, now you should have found a link waiting to be clicked saying "Edit the system environment variables" as shown in the screenshot on the right hand side. Click on that to open the window titled "System Properties" with the "Environment Variables..." button.

UPDATE:
  • Looks likes it's actually a 2 step process :-). You can simply press Windows key, type "Environment" and navigate to "Settings". It will give you the  options to edit both system environment or the user environment variables. Cheers!