Closed eg9 closed 8 years ago
I've not done anything with XeLaTeX for a while, so I've been out of the loop on fotspec development; would you have any suggestions for the docs to make sense with the new fontspec that you might be able to file a pull request for? (which can be done through github itself these days, without needing to fork and clone first)
I encountered the same problem as well.
One solution is this:
\documentclass{article}
\usepackage[Latin, Greek, CJK, Hebrew]{ucharclasses}
\usepackage{fontspec}
\newfontfamily\greekfont{CMU Serif}
\newfontfamily\hebrewfont{Tahoma}
\newfontfamily\CJKfont{KaiTi}
\newcommand{\latinfont}{\renewcommand\rmdefault{lmr}\renewcommand\sfdefault{lmss}\renewcommand\ttdefault{lmtt}\defaultfontfeatures[\rmfamily,\sffamily]{Ligatures=TeX}}
\setTransitionsForLatin{\latinfont}{}
\setTransitionsForGreek{\greekfont}{}
\setTransitionsFor{Hebrew}{\hebrewfont\setRTL}{\setLTR}
\setTransitionsForCJK{\CJKfont}{}
\usepackage{bidi}
\begin{document}
but my righteous one shall live by faith
ὁ δὲ δίκαιός μου ἐκ πίστεως ζήσεται
只是義人必因信得生。
בֶּאֱמוּנָת֥וֹ יִחְיֶֽה׃
\end{document}
I've released 2.1 based on work in #14, and the documented use of fontspec in the updated .pdf
doc should work quite well (advocating syntax similar to @ickc's solution)
With the latest release of
fontspec
, an example such aswill make XeTeX into an endless loop (see ucharclasses package does not work with TeX Live 2014's fontspec.
I believe it's advisable to declare fonts beforehand in any case and that the documentation should be accordingly modified; besides making the examples work, this has also the advantage of not inducing users into thinking that
\fontspec
should be used in the code.