Note: this article is for Windows platforms only.
After a lot of trial-and-error — not to mention a wee bit of teeth gnashing, hair pulling, and weeping uncontrollably — I have finally managed to get Texmaker USB configured work with MiKTeX Portable. Since there seems to be a relative dearth of information on this particular setup on the Web, I thought I’d detail the setup for anyone else trying to get these two programs to communicate. It’s a bit of work to set up, but the bonus is that it doesn’t require any batch files to run and each module can be updated independently.
First of all, you need to create an empty folder somewhere. I called mine LaTeX Portable. Then, download the following programs:
- MiKTeX Portable – extract into the new folder you just made
- Texmaker USB – extract into LaTeX Portable/miktex-portable/ (you’ll need to create a new directory for MiKTeX Portable)
- Foxit Reader Portable – extract into LaTeX Portable
When you’re done, you should have three subdirectories in your LaTeX Portable folder, one each for MiKTeX Portable, Texmaker USB, and Foxit Reader Portable.
LaTeX Portable
|_____FoxitReaderPortable
|_____miktex-portable
|_____texmakerwin32usb
Then, go to http://pages.cs.wisc.edu/~ghost/ and download the latest versions of Ghostscript and GSView (8.64 and 4.9, respectively, at the time of this writing). Both of these files are self-extracting executable archives. Save them to your computer. Rather than running the .exe files, use a program like 7-zip to extract their contents to your LaTeX Portable directory. Again, you’ll need to create a new directory for each of these archives to extract the files into. When you’re done, your folder structure should look something like this:
LaTeX Portable
|_____FoxitReaderPortable
|_____ghostscript
|_____GSView
|_____miktex-portable
|_____texmakerwin32usb
Inside your ghostscript directory, you’ll see:
ghostscript
|_____gs864w32
|_____gs8.64
|_____filelist.txt
|_____setupgs.exe
|_____uninstgs.exe
Copy the gs8.64 directory into your GSView directory, then delete the ghostscript directory. Your LaTeX Portable folder structure should now look like:
LaTeX Portable
|_____FoxitReaderPortable
|_____GSView
|_____gs8.64
|_____gsview
|_____pstotext
|_____miktex-portable
|_____texmakerwin32usb
The next step is to configure Texmaker to access the MiKTeX Portable and Ghostscript/GSView files. Launch Texmaker, then click on Options -> Configure Texmaker. The Commands screen should pop up by default. We’re going to modify most of these fields so that Texmaker can process your .tex files while still being able to run from a USB stick on any Windows computer.
LaTeX: "../miktex-portable/miktex/bin/latex.exe" --src -interaction=nonstopmode %.tex %0 "%N%T" dvips: "../miktex-portable/miktex/bin/dvips.exe" -o %.ps %.dvi Bibtex: "../miktex-portable/miktex/bin/bibtex.exe" % Makeindex: "../miktex-portable/miktex/bin/makeindex.exe" %.idx Dvi Viewer: "../miktex-portable/miktex/bin/yap.exe" -1 -s @%.tex %.dvi PS Viewer: "../GSView/GSviewPortable.exe" %.ps PdfLaTeX: "../miktex-portable/miktex/bin/pdflatex.exe" -interaction=nonstopmode %.tex Dvipdfm: "../miktex-portable/miktex/bin/dvipdfm.exe" %.dvi ps2pdf: "../miktex-portable/miktex/bin/ps2pdf.exe" %.ps Pdf Viewer: "../FoxitReaderPortable/FoxitReaderPortable.exe" %.pdf metapost: "../miktex-portable/miktex/bin/mpost.exe" --interaction nonstopmode ghostscript: "../GSView/gs8.64/bin/gswin32c.exe"
Set your QuickBuild to run PdfLaTeX + View PDF. Once you make these changes, your portable LaTeX setup should be all configured and ready to work on any USB stick.
Inverse Search
To set up Yap to run inverse search, it’s important to run it as an administrator (Right-click -> ‘Run as Administrator’) so that it will be able to permanently save your setting. Go to View -> Options -> Inverse DVI Search. Click ‘New’. Type
Texmaker
in Name and
"%f" -line %l
where it says to specify the program arguments. YAP doesn’t support relative paths, so you’ll have to point YAP at the absolute path to Texmaker. Once you’ve completed all three of these steps, click ‘Ok’ and Texmaker will be displayed in the list. Select Texmaker, click Apply, and Ok. You should now be able to conduct both Forward and Inverse search.
Additional resources:
GSview 4.9 and Ghostscript 8.60 Portable
“Forward/Inverse search” with Texmaker

