I write both English and Persian documents. I work with Texstudio and TeXLive. I have to compile Latin documents in pdfLatex and Persian documents in XeLatex. But I'd rather to change the configuration of LaTeX with some lines of code in the preamble of documents, instead of changing it every time and through the menus and manually.
Is there a command for switching between pdfLaTeX and XeLaTex?