[Tex/LaTex] Texmaker / TeXstudio does not compile XeLaTeX with MiKTeX portable

compilingmiktextexmakertexstudioxetex

I am trying to migrate from TeXworks to Texmaker (just for the fact that it is better for handling multi-files projects). I am using portable versions of both MiKTeX and Texmaker, so, in Texmaker I went to Options > Configure Texmaker > Commands and point every command available to the current path of MiKTeX. And it works just fine with PDFLaTeX, but at the moment I try to compile some XeLaTeX document it just do not generate any PDF output.

For a brief moment, in the log frame says that it can not recognize xdvipdfmx as a program or a command. So I figure that it is trying to find it in the default installed MiKTeX directory (because xdvipdfmx.exe indeed exist in the same folder than xelatex.exe and TeXworks never has a problem finding it). There is an option to set the path to dvipdfm (which —I am guessing— works with PDFLaTeX), but not for xdvipdfmx.

So, a concise question would be, Is there a way to change (or add) the default directory for Texmaker to look for? Or is the problem another?

[Addendum] [edited] So, I decided to put a xdvipdfmx.bat file into the Windows folder (which only contains one line: E:\LaTeX\MiKTeX\miktex\bin\xdvipdfmx.exe), and now it appears that compiles as it should, BUT it does not produce any PDF file, even tho the log file ends saying “Output written on satre-merleau-ponty-levinas.pdf (175 pages)” or, if I add an \includeonly sentence, “Output written on satre-merleau-ponty-levinas.pdf (9 pages)”. Every auxiliar file is also created, just not the PDF. Any thoughts?

A minimal example (not PDF output generated) is

\documentclass[11pt,twoside,book]{memoir}
\usepackage{lipsum}
\usepackage{fontspec}
\begin{document}
\lipsum
\end{document}

Under this conditions: MiKTeX portable 2.9, Texmaker portable 3.5.2 (or TeXstudio portable 2.5)

It indeed generates a PDF output if I compile it from TeXworks OR if I comment out the \usepackage{fontspec} line and compile it with pdfLaTeX.

Best Answer

This is not the optimal response, but it is an answer. You have to edit the path enviromental variable to add, at the end of it, the path to the bin MiKTeX folder (thanks to Speravir for pointing it out). In this case, just add ;E:\LaTeX\MiKTeX\miktex\bin (the semicolon is the separator). A guide to do that is in http://www.computerhope.com/issues/ch000549.htm.

The compiling worked in TeXworks because it sets one folder to look for all the programs, while Texmaker and TeXstudio set the path individually. So, I’m not sure if the fault is in MiKTeX or in the editors just mentioned.

So, what if I wanna use Texmaker from an usb in a computer with no admin rights? Well, just be sure to carry TeXwork (which comes with MiKTeX anyway), then work and save in Texmaker, and then compile from TeXworks.