Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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:

  1. How can I change the font of some specific parts of my thesis?

  2. 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 ‎R‎oman‎}‎
‎\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} 
share|improve this question
    
1. Do you mean change the typeface to italic and/or bold? –  Werner Aug 15 '11 at 3:54
    
No I didn't . I mean changing the font , i.e. frome XB Zar To Times New Roman . –  Negin Aug 15 '11 at 4:21
add comment

2 Answers

\documentclass{article}

\usepackage{xepersian}

\defpersianfont\Nastaliq{IranNastaliq}

\makeatletter

\newenvironment{Nastaliq}{\N@stliq}{}

\makeatother

\begin{document}

\begin{Nastaliq}

من ایران را دوست دارم

\end{Nastaliq}

\end{document}
share|improve this answer
add comment

You are using xepersian which is used with XeLaTeX, so you can use commands from the fontspec package (which is loaded automatically by xepersian) to change fonts or you can use commands from the xepersian 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:

\deflatinfont\timesroman{Times New Roman}

You would then use it with:

{\timesroman Some Times Roman text here}

To make this an environment, (after defining the font as shown above) you can do:

\newenvironment{Times}{\timesroman}{\par}

and then use

\begin{Times}
...
\end{Times}

You can use \deflatinfont multiple times (with different command names) in your document to define other latin fonts.

share|improve this answer
1  
@Negin: Note the use of \newenvironment{<nam>}{<begdef>}{<enddef>}. It takes 3 mandatory arguments, giving it a name <nam> and executing <begdef> at the start and <enddef> at the end. Effectively, \begin{<nam>}=<begdef> and \end{<nam>}=<enddef>. –  Werner Aug 15 '11 at 3:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.