Texmaker and Xetex on OS X

Persistent Inappeasable Mind


Back March '15 Forward
Mo Tu We Th Fr Sa Su
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          


Last entry: 2015-02-17 09:36
355 entries written
157 comments have been made

Wednesday, April 28. 2010

Texmaker and Xetex on OS X

Software hints Software Interfaces

As I am coming from a Linux world I am quite used to some software that is available for Linux. One of the software I used often was Texmaker. After switching to OS X I used TexShop (as it comes bundled with MacTex) for a couple of years. It is a good LaTex editor and it (besides Latex) also supports Xetex (a TeX typesetting engine that uses Unicode and system fonts) out of the box and it nicely updates PDF documents almost on the fly.

But I recently switched back to Texmaker because of some of its strengths that I really like (most UI related):

  • one window
  • tabs
  • auto completition of commands, references ...
  • a lot of icons for math symbols
  • document structure on the left side
  • quick access to almost every LaTeX command from menus and most often used ones from drop down menus
  • a better search box (although I would like it to be incremental like in Emacs :))
  • ...
But it doesn't work with Xetex right away. There is a simple solution to this, though. All it is needed is to change two preferences fields (assuming you have MacTex installed).

Go to  texmaker -> Preferences

Under Commands change Latex field to:

  /usr/texbin/xelatex  %.tex

Under Quick Build change User field to:

  /usr/texbin/xelatex %.tex|open %.pdf  

The second command can include several commands divided by | sign. So for example we could compile the .tex file with xetex first, then compile the auxiliary .aux file and compile the .tex document twice more (why this is necessary is beyond this post). User field should now look like (all in one line):

/usr/texbin/xelatex %.tex|/usr/texbin/bibtex %.aux
      |/usr/texbin/xelatex %.tex|/usr/texbin/xelatex %.tex
          |open %.pdf

Edit: there's one drawback  --  if there are some errors in the .tex document, Texmaker hangs up and only forcing it to shut down helps.


No Trackbacks

Display comments as (Linear | Threaded)

#1 - Philip Bliss 2010-05-19 22:31 -

Hi there,

I had the same problem--force-restarting Texmaker gets old FAST!

You can solve it by setting the command line to /usr/bin/xetex -interaction=nonstopmode %.tex

#1.1 - Matjaž Kljun 2010-05-24 16:44 -

Thank you! That worked like a charm :)

/usr/texbin/xelatex -interaction=nonstopmode %.tex

#1.2 - Flip said:
2011-06-01 21:00 -

You're the grateset! JMHO

#2 - Flash Sheridan said:
2011-03-18 04:53 -

Another couple of drawbacks: “|open %.pdf” uses your default PDF viewer (Preview in my case) rather than the built-in viewer. And not using the default also seems to break the PDF scrolling information, so “Click to jump to line” silently fails.

#2.1 - Matjaž Kljun 2011-03-18 11:40 -

It depends on what you set in your preferences. In the menu

texmaker -> Preferences ... Select 'Commnads' on the left and on the list select:

Pdf viewer - select Built in viewer.

The command 'open %.tex' is the same for both: built in viewer and default viewer.

If you need to synchronize PDF and tex file you'd need to use:

/usr/texbin/xelatex -interaction=nonstopmode -synctex=1 %.tex

#3 - Flash Sheridan said:
2011-03-19 01:24 -

Duh, thanks, that was documented somewhere. The command-line argument didn’t actually work for me, but using \synctex=1 in the source (per http://en.foursenses.net/usingsynctex) works fine. I did have some trouble with entering the command in the QuickBuild entry field (Preview was launched instead, even though the preference was set to the built-in viewer), but using the Wizard worked around the problem.

#3.1 - Matjaž Kljun 2011-03-19 22:24 -

I'm glad it worked in the end. I don't know if Texmaker needs a restart after selecting a different PDF viewer. Might this be the reason why it didn't used the one you selected?

But it works now :)

#4 - Flash Sheridan said:
2011-03-20 21:38 -

That couldn’t be it; I’d always had the built-in viewer set.

#5 - Eli 2012-11-06 07:04 -

Hi, I have a problem with my texmaker, it compiles correctly and builds the pdf file, but it only shows english words! I want to write in persian but it doesn't show persian words! Can you plz help me to solve it?

#5.1 - mk 2013-01-14 21:01 -

Hi Eli,

A bit late but someone might need it. Latex without additional packages usually only supports ASCII letters. In Slovenian I have to use


I have no idea about Arabic, but a quick search revealed you have to use ArabTex. More on the subject

Ottoman Turkish (Arabic letters):

How to write Persian/Arabic text in a LaTeX document which is mainly written in English?:

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.

Can you please write (or copy/paste) this text in the field below: i h a t e s p a m