2

This question already has an answer here:

I want to have one section of my work with whole Chinese with lualatex but the other sections are in English.

I found this question is very useful, How to use Chinese with lualatex?.

However, when I use the first answer in that question (copy code from the answer). I get a lot of errors with this pattern

Font \JT3/mc/m/n/10=IPAExMincho:jfm=ujisv at 9.62219pt not loadable: metric da ta not found or bad.

The second answer is work but has the problem as Leo Liu mentioned. The line break is make no sense.

I also tried this solution from How does one type Chinese in LaTeX?

\documentclass{article}
\usepackage[UTF8]{ctex}
...

but I get font-not-fount, "SimHei" and "Kaiti"

Another solution I've tried is

\documentclass{article}
\usepackage{CJK}
\begin{document}
\begin{CJK}{UTF8}{gbsn}
你好
\end{CJK}
\end{document}

There is no problem with compilation but I get the empty pdf file. If I put some English characters, only English characters are shown.

How to solve this problem?

Thanks.

Edited: Many people suggested that this question might be the same as How to use Chinese with lualatex?. As I mentioned in the context, I get some errors from the solution in that question and it didn't work for me. So, my question here is to find another solution for typing Chinese in latex with lualatex which leads to no errors. I hope that someone can give me new solutions or how to avoid those errors in the context.

marked as duplicate by Leo Liu, Stefan Pinnow, TeXnician, Maarten Dhondt, CarLaTeX Mar 30 '17 at 6:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Potentially two quick things to check: make sure your editor is saving the file with UTF8 encoding, and you could try using \fontspec to specify a different font if you have one that you know has the proper Chinese characters. – Ryan Mar 13 '17 at 15:08
  • @Ryan I use \usepackage[utf8]{inputenc} which I am not sure is it satisfy your first suggestion. For \fontspec, as I mentioned in the question, the line breaking is make no sense. – Natthawin Cho Mar 13 '17 at 15:39
  • Oops, I didn't see the part about line breaking. My first suggestion doesn't have to do with the LaTeX code itself (I can see you're using the right package) but instead your text editor used to create the .tex file; if this is not saving in UTF-8 your Chinese characters will get messed up. It's just a suggestion to check quick, but probably isn't the whole problem. If the fontspec suggestion is displaying characters, then you're probably saving the file correctly. – Ryan Mar 13 '17 at 15:43
  • @Ryan I've checked already and it is UTF-8. I've proposed my own method which is not good but it's work when we don't have other choices. – Natthawin Cho Mar 13 '17 at 15:47
  • Well, I cannot reproduce the problem: Font \JT3/mc/m/n/10=IPAExMincho:jfm=ujisv at 9.62219pt not loadable. It works well on TeX Live 2016. – Leo Liu Mar 30 '17 at 2:58
0

After trying many solutions and all of them didn't work.

I have an idea that: I use MS Word to write in Chinese and then save as PDF. After that, I just include PDF file into my tex with \usepackage{pdfpages}.

However, I also use \usepackage{fancyhdr} to change my header and footer and I am not sure that \usepackage{pdfpages} will include these changes or not. Therefore, I add my PDF file as a figure and it's work well (in case we have no other choices).

Note that, this method is working when we don't have mathmode in Chinese text because the font from equation function in MS word will be different from Chinese font. I am still waiting for another solutions for this problem.

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