I'm typing my thesis in Farsi, and I'm using LiveTeX. I want to change my font in some parts of my documents. I checked most of the relevant questions and answers but unfortunately I couldn't find out my answer. There are two questions:
-
How can I change the font of some specific parts of my thesis?
-
What are font families?
I already used {\fontfamily{ppl}\selectfont ... }
but it didn't work.
I used it as:
\documentclass[a4]{book}
\usepackage{graphicx}
\newenvironment{ppl}{\fontfamily{ppl}\selectfont}{Times New Roman}
\textwidth =12cm
\textheight =19cm
\usepackage{amsmath,amssymb}
\usepackage{xepersian}
\settextfont[Scale=1]{XB Zar}
\setdigitfont[Scale=1]{XB Zar}
\begin{document}
من این همه را خودم نوشته ام و این یکی را می خواهم به صورت امتحانی در زیر با فونت دیگری بنویسم .
\begin{ppl}
من این را به صورت امتحانی مینویسم .
\end{ppl}
\end{document}
Best Answer
You are using
xepersian
which is used with XeLaTeX, so you can use commands from thefontspec
package (which is loaded automatically byxepersian
) to change fonts or you can use commands from thexepersian
package itself.XePersian has a command
\deflatinfont
which allows you to create a command for the latin font you want. For example, you want Times New Roman as the font, so you could do:You would then use it with:
To make this an environment, (after defining the font as shown above) you can do:
and then use
You can use
\deflatinfont
multiple times (with different command names) in your document to define other latin fonts.