0

I was working with a Tex file in the standard font, and another in Calibri in Tex Studio.

The problem is that I have to switch compiler between the two files.

I don't want to use Configure -> Build -> Default Compiler. When I do that, it sets the default compiler for every Tex file. So I would need to switch between PdfLatex and XeLatex (and back) every time I work on the files.

enter image description here

So instead I would need to go into Tools every time I work on the one with Calibri font to compile using XeLatex. I cannot click on "compile" because that will run the PdfTex compiler and I will get an error involving fontspec package.

enter image description here

Is there a way to set the compiler for just a single Tex file? So I can work on different files with different fonts without having to do extra steps?

5
  • 1
    You can tell TeXstudio to use a specific compiler for a document with special comments added to the top, see e.g. How to invoke latex with the -shell-escape flag in TeXMakerX? (couldn't find any better links at the moment) Commented May 30, 2016 at 6:35
  • I suggest that you provide a minimum working example and describe that what sort of complicated compilation you are doing, and the reason why you have to do it by using combined TeX engine.
    – Spaceship
    Commented May 30, 2016 at 7:20
  • 5
    See tex.stackexchange.com/questions/236747/…. You can add also shortcuts (like the F5 for build and view) to the other commands too. Or you could use arara for all documents and add the needed arara rule at the begin of your document. Commented May 30, 2016 at 7:34
  • on the commandline I use pdflatex file if I want to use pdflatex and xelatex file if i want to use xelatex. If you find getting the editor to type this for you is easier then that is fine, but if it is not easier then you don't have to do it. Commented May 30, 2016 at 8:14
  • @UlrikeFischer Worked like a charm, thank you professor
    – Fraïssé
    Commented May 30, 2016 at 14:33

0

Browse other questions tagged .