[XeTeX] Book Templates

Herbert Schulz herbs at wideopenwest.com
Mon Nov 2 11:00:53 CET 2009


On Nov 1, 2009, at 8:10 PM, sjo wrote:

>> \RequirePackage{fourier}
>> \RequirePackage[scaled=0.85]{berasans}
>> \RequirePackage[scaled=0.85]{beramono}
>
>> Herb Schulz
>> (herbs at wideopenwest dot com)
>
> Very nice combination.
>
> I tried it with xelatex/bidi (font in Hebrew) and I like it. The
> problem is that after typing in Hebrew, and changing back to English I
> don't get the berasans, but something else (Ezra Sil English
> perhaps?). See below
>
> How do I set the main font to always be berasans/beramono/fourier.
>
> ===============
> % !TEX TS-program = xelatex
> \documentclass[10pt]{article} % use larger type; default would be 10pt
>
> \usepackage{fourier}
> \usepackage[scaled=0.85]{berasans}
> \usepackage[scaled=0.85]{beramono}
>
> \usepackage{bidi}
> \usepackage{fontspec}
> \usepackage{xltxtra}
> \usepackage{hebcal,url}
> \usepackage{xunicode}
> \newfontfamily\ezra[Script=Hebrew]{Ezra SIL}
> \def\h{\beginR\setRL\ezra}
> \def\e{\beginL\setLR}
>
> \begin{document}
>
>
> \section{First section}
> \section{What is bidi?}
> Bi-directional text is text containing text in both text
> directionalities, both right-to-left (RTL) and left-to-right (LTR). It
> generally involves text containing different types of alphabets, but
> may also refer to boustrophedon, which is changing text directionality
> in each row.
> $x = \beta \rightarrow \alpha$
>
>
> \h
> אבגדהו אבגדהואבגדהואבגדהואבגדהו  
> אבגדהו אבגדהו אבגדהו אבגדהו אבגדה
>
> \e
> Bi-directional text is text containing text in both text
> directionalities, both right-to-left (RTL) and left-to-right (LTR). It
> generally involves text containing different types of alphabets, but
> may also refer to boustrophedon, which is changing text directionality
> in each row.
> $x = \beta \rightarrow \alpha$
>
> \subsection{A subsection}
>
> More text.
>
> \end{document}

Howdy,

What you are seeing is the roman text of Ezra SIL. Isolate the change  
to the Ezra SIL font with the definitions for \h and \e:

\def\h{\beginR\setRL\bgroup\ezra}
\def\e{\egroup\beginL\setLR}

Even cleaner is to define a new hebrew environment,

\newenvironment{hebrew}{\beginR\setRL\ezra}{\beginL\setLR}

and then use that

\begin{hebrew}
אבגדהו אבגדהואבגדהואבגדהואבגדהו  
אבגדהו אבגדהו אבגדהו אבגדהו אבגדה
\end{hebrew}

to get the same thing. Environments isolate the their effects within  
groups.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)





More information about the XeTeX mailing list