1

I would like to use Chinese characters in TexMaker on Mac OS X (using latest mactex). It appears not to be supported OOTB, any Chinese characters appears as a series of "▯▯▯▯▯". I do have the chinese input sources on the mac of course, and I tried using different font in texmaker.

I tested on windows and the same version of texmaker is able to type chinese characters.

Any idea how to make it work on Mac?

3
  • Welcome! Are you asking about typing the characters in the source code? Or are you asking about getting the characters in the typeset output?
    – cfr
    Feb 2, 2016 at 1:14
  • @cfr I guess the first one...? Anyway, we should have plenty of questions on that. I remember answering one or two.
    – Alenanno
    Feb 2, 2016 at 1:27
  • @Alenanno I think so. But then what are the Chinese input sources? I'm trying to figure out what makes this a TeX question rather than a OS X question. @ OP Can you input Chinese in TeXShop? I ask because TeXShop, unlike TeXmaker, is Cocoa-based, I believe. (Or was.)
    – cfr
    Feb 2, 2016 at 2:06

1 Answer 1

2

actually I didn't use TexMaker on Mac before. I use TexShop and I thinks it is convenient to use to type in Chinese. If you use TexShop, please set your unicode to UTF-8 in preference.

Here is the code for reference:

\usepackage[T1]{fontenc}
\usepackage{xeCJK}
\setCJKmainfont{BiauKai}
\newCJKfontfamily\Kai{魏碑-繁}       % Set main font in your document.
\newCJKfontfamily\ChCal{行楷-繁}     % Set a new font so that you can 
\newCJKfontfamily\ChBlack{蘭亭黑-繁} % change the font in the document. 
\XeTeXlinebreaklocale "zh"          % Following set to break line automatically.
\XeTeXlinebreakskip = 0pt plus 1pt 
\usepackage{xltxtra,xunicode}

\begin{document}
     中文字測試
\end{document}

If you'd like to change your font, just use

\ChCal{行楷-繁}

command, for example.

In TexShop, you can use the font directly installed on your Mac. You don't need to download another set of font, like CJK font by Han-tsong Wang.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .