In a document, I need to get all these working:
- japanese text
- latin diacritics with cedilla, e.g
şţ
and with comma, e.gșț
- slanted text
This is a book I also distribute to others, so I can't change back to pdflatex, it has to remain xelatex (and besides, in xelated the second criteria is fulfilled).
With the following POC, the former and the latter don't work:
\documentclass[10pt]{article}
\usepackage{ifxetex}
\ifxetex
\usepackage{fontspec}
\usepackage{xunicode}
\defaultfontfeatures{Mapping=tex-text} % To support LaTeX quoting style
\defaultfontfeatures{Ligatures=TeX}
\else
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\fi
\usepackage{helvet}
\begin{document}
\setmainfont[Ligatures={TeX, Common}, % sequences of two or more characters yeld one character]
ItalicFont={Charis SIL:style=Italic},
% SlantedFont={SourceSansPro Slanted},
ItalicFeatures=FakeSlant,
%MonoFont={Myriad CAD:style=Regular},
Mapping=tex-text,AutoFakeSlant=0.2
]{Source Sans Pro:style=Regular} % found by $ fc-list
hello world \textit{italic text} and \textsl{slanted text} and \texttt{monospaced text}.
Diacritics: șş țţ ȘŞ ȚŢ î Î ă Ă
Japanese: 守 破 離
\end{document}
The output looks like:
How to get it working properly?
Working example
Thanks to @Ulrike Fischer, I got it working like this on ArchLinux with xelatex:
\documentclass[10pt]{article}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont[SlantedFont={Charis SIL},SlantedFeatures={FakeSlant=0.2}]{Charis SIL}
\usepackage{xeCJK}
\setCJKmainfont{DejaVu Sans Mono}
\setCJKfamilyfont{sf}{Kozuka Mincho Pr6N:style=R,Regular}
\setCJKfamilyfont{tt}{DejaVu Sans Mono}
\newcommand{\jptext}[1]{\sffamily#1}
\begin{document}
%Roman font Charis SIL:
hello world \textit{italic text} and \textsl{slanted text}.
Diacritics: șş țţ ȘŞ ȚŢ î Î ă Ă
\texttt{monospaced font}
Japanese: \jptext{守 破 離}
----------------------------------------------
%Sans serif font:
\sffamily
hello world \textit{italic text} and \textsl{slanted text}.
Diacritics: șş țţ ȘŞ ȚŢ î Î ă Ă
\texttt{monospaced font}
Japanese: \jptext{守 破 離}
\end{document}
Hope it helps someone.
japanese
forcjk
anddiacritics
foraccents
, but I didn't have enough reputation. Could you create those tag synonyms?{janpanese}
tag does not exist. I'll add the synonyms when necessary next time.