2

I have read the answers to the question How does one type Chinese in LaTeX?.

In my case the solution compiling in xelatex, and the one compiling in pdflatex both manage to compile without errors.

The problem is that when I open the output PDF it only shows question marks: "?????"

This might not be a question strictly about latex, but it is about using latex at least: Does anyone know what might be the problem?

If I understand correctly, I need the fonts required to be installed. I think they are. I can input Mandarin Chinese through keyboard. I have Microsoft Word and it shows Simplified Chinese characters when I copy in it the phrase in the example given in the liked question:

(Interesting! I cannot copy said phrase in the body of this question. It doesn't work as a quote either).

I guess now I also have the question on how to input Chinese characters in this site?

Example:

% UTF-8 encoding, pdflatex or latex+dvipdfmx
% Simplified Chinese fonts should be installed
\documentclass{article}
\usepackage{CJKutf8}
\AtBeginDvi{\input{zhwinfonts}}
\begin{document}
\begin{CJK*}{UTF8}{zhsong}
XXXXX
\clearpage\end{CJK*}
\end{document}

The XXXXX part I can't copy. This website shows a sign saying: Body cannot contain "X", where "X" is the first character of "XXXXX".

I am using Windows 7, TeXnicCenter 2.02 (64 bits), and pdflatex if that is relevant.

Followup: Tried to update MiKTeX, the server was rejecting the connection, uninstalled MiKTeX and installed TexLive. Now it works. My guess is that something was missing in the MiKTeX installation that likely would have been fixed if I had updated.

Second thought: The above followup happened in my home laptop. In my work computer, where I was having the problem for the first time, has a fresh installation of MiKTeX (two weeks old). This makes me unsure about updating MiKTeX as a solution.

  • An example of code? – egreg Aug 05 '15 at 21:00
  • @egreg Couldn't add it. The examples I tried are the 3rd and 4th in the linked page. I don't know why I couldn't add them to the body of this question. That is the second thing I was asking at the end. – Anna Taurogenireva Aug 05 '15 at 21:09
  • Are you talking about the examples in Leo Liu's answer? – egreg Aug 05 '15 at 21:11
  • @egreg yes, those. – Anna Taurogenireva Aug 05 '15 at 21:12
  • Curious: I get a message telling “Body cannot contain U+6587” (with the character instead of the Unicode point). – egreg Aug 05 '15 at 21:20
  • @egreg That is what happened to me. I wonder what did they do two write the other question. – Anna Taurogenireva Aug 05 '15 at 21:22
  • Looks like a bug. – egreg Aug 05 '15 at 21:26
  • @egreg I don't know much about these things but maybe it is the encoding of the characters that I send to the website. Maybe it is different from the one used by the people in the other question. Maybe that is also related to why my output PDF doesn't show the characters. I am using Windows 7, if that means anything. – Anna Taurogenireva Aug 05 '15 at 21:30
  • I too get the "Body cannot .." message when copying the code here on tex.sx, but the code itself works copies without problem in my editor and the pdf created with pdflatex is fine. The font used is c:/windows/fonts/simsun.ttc. – Ulrike Fischer Aug 05 '15 at 21:37
  • See http://meta.tex.stackexchange.com/questions/6249/typing-chinese-character-in-the-main-site – egreg Aug 05 '15 at 21:37
  • @UlrikeFischer The same happens to me: the characters are OK for other programs, but the site (and also other StackExchange ones) doesn't accept them. – egreg Aug 05 '15 at 21:39
  • @UlrikeFischer Did your output PDF show the characters? I don't know why mine is not showing them. I do have the font simsun.ttc installed. – Anna Taurogenireva Aug 05 '15 at 22:53
  • @MlazhinkaShungGronzalezLeWy: Yes I get output when I compile the examples using gbsn and zhsong with miktex and texlive. And (unlike the mincho fonts where files are missing https://sourceforge.net/p/miktex/bugs/2095/) it should imho work in miktex out-of-the box. But without a log-file it is difficult to say why it fails for you. You can't update miktex currently, there is a bug in the babel package (miktex forgot some files) and so the repository is offline to prevent damage. – Ulrike Fischer Aug 06 '15 at 07:15
  • For the problem about typing Chinese, see http://meta.tex.stackexchange.com/a/6252/4427; see also http://meta.stackexchange.com/questions/261609/not-all-utf-8-characters-supported – egreg Aug 07 '15 at 09:23
  • It seems that Chinese can be input again: 文章内容. Maybe you can revise your question. – egreg Aug 14 '15 at 20:31

0 Answers0