I have installed "texlive-full" on my "ubuntu 22.04" and I use "Geany 1.38" as the editor to edit latex documents. Everything has been fine until I needed to work with a CV-template which requires "XeteX" engine to compile the document instead of pdfLatex.

I think I need to add the possibility of compilation with XeteX to Geany (which has only the options for (LaTex->DVI) and (LaTex->Pdf) in its Build menu.

I would appreciate if someone can help me configure geany to add the option for compiling with Xetex engine to Geany. I assume it should be done using "Set Build command" and "make custom target". But I can not see exactly how.

Many Thanks in advance

1 Answer 1


(This answer was tested on Arch Linux with Geany 1.38; let me know if Ubuntu's version is different.)

Open a .tex file in geany.

Go to Build > Set Build Commands.

Look under LaTeX commands, in the "LaTeX → PDF" row, in the commads column.

For me the default setting is:

pdflatex --file-line-error-style "%f"

Change it to:

xelatex --file-line-error-style "%f"


lualatex --file-line-error-style "%f"

Click OK.

It should now use one of the other engines. If you want to have easy access to multiple engines, you can keep the original one, and add the other (with its own name) to the "Independent commands" section.

You can also add options like -interaction=nonstopmode and -synctex here if you want that (but I haven't used geany enough to know how well geany supports SyncTeX).

You could also consider using latexmk, e.g.:

latexmk -xelatex "%f"

This will handle things like calling BibTeX for you, recompilation to make sure all labels are defined, etc.

You could use the "Make custom target" row, but that would be misleading, since you're not using make. It is possible to create makefiles for LaTeX, but most people don't bother unless they're already adept at using make for software compilation.

However, the labels in the left column can be anything; that's just what it will appear as in the menu. You can change them too. E.g., if you're probably not going to need to create a .dvi – and almost no one does in 2022 – you could rename "LaTeX → DVI" to "XeLaTeX → PDF" and use that row with the command above, and it'll get that key binding.

An aside: Be warned that your first time running lualatex often takes a long time since it has to build the font name database. It won't be so long every time!

  • Thank you very much indeed for this complete explanation. Your first suggestion (xelatex --file-line-error-style "%f") worked perfectly and now I try to add it permanently to list of available build choices so that I can switch between pdflatex and xelatex.
    – Sinooshka
    Nov 1, 2022 at 12:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .