18

I want to type a text in persian. Does texstudio support xelatex? If yes where can i find it?
this is my code:

\documentclass{article}
\usepackage{xepersian}
\begin{document}
\centerline{به نام خداوند بخشندهٔ مهربان}

سلام

این یک مثال ساده با زی‌پرشین است. 

به همین سادگی.
\end{document}
zahraesb
  • 405
  • 1
    Yes, it in the tools menu. – Ulrike Fischer Mar 26 '15 at 17:48
  • I see no such name as xelatex on tools menu???!! – zahraesb Mar 26 '15 at 17:54
  • Did you check all submenus? – Ulrike Fischer Mar 26 '15 at 17:55
  • Yes please look at the photo below – zahraesb Mar 26 '15 at 18:03
  • If your texstudio is uptodate: Go to the options of texstudio, enable the extended options, and then in the entry "menu" enable the additional commands. – Ulrike Fischer Mar 26 '15 at 18:28
  • Hi ans welcome, this is not a very helpful information, please add a short but compilable test case along with the log-file to the question above. – Johannes_B Mar 26 '15 at 20:08
  • i compiled it using xelatex but i keep getting this error:Fatal fontspec error: "cannot-use-pdftex" The fontspec package requires either XeTeX or LuaTeX to function. You must change your typesetting engine to, e.g., "xelatex" or "lualatex" instead of plain "latex" or "pdflatex". For immediate help type H . – zahraesb Mar 27 '15 at 10:42
  • Can u please tell me what should i do? – zahraesb Mar 27 '15 at 11:04
  • Opten the option, go to commands, change the first line to xelatex -interaction=nonstopmode %.tex. Instead of pdflatex, you need to select latex in the tools menu. – Johannes_B Mar 27 '15 at 20:02
  • still no success .i added my code above please tell me if theres sth wrong with it. – zahraesb Mar 28 '15 at 05:56
  • Different question come to my mind: 1) have you used LaTeX before? if the basics are missing, you cannot give clear response. This seems to be the case right now. 2) Did you manage to run XeLaTeX on a simple Hello world document? 3) Your code misses the definition of a persian font, this is what XeLaTeX is telling me in plain english. Downloading a font, and set this font up for usage, everything is working just fine. – Johannes_B Mar 28 '15 at 14:59
  • \centerline should not be used in a LaTeX document. – Johannes_B Mar 28 '15 at 15:00

1 Answers1

40

Depending on your precise needs there are different options:

  • If you want to only run XeLaTeX explicitly from time to time, use Tools -> Commands -> XeLaTeX. You may assign a shortcut in the options.

  • If you want to modify the default build configuration (i.e. the compiler for Tools -> Build / Build & View) then change Options -> Build -> Default Compiler.

  • If you want to modify the build configuration only for this file, include the "magic comment" % !TeX program = xelatex at the top if your file. See the manual for more information on magic comments.

Tim Hoffmann
  • 11,159