type Chinese in Latexdraw

Asked by chenglo76@hotmail.com on 2010-05-11

Chiese characters become square in Latexdraw.
How can I fix it?
Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
LaTeXDraw Edit question
Assignee:
No assignee Edit question
Last query:
2010-05-11
Last reply:
2018-11-02
arno_b (arno.b) said : #1

Well, I do not know how to fix that.
Where did you get squres? When you want to add a text shape? when you include pstcode or comments? In the code panel?
I will look at this problem to find a solution.

arno_b (arno.b) said : #2

I have made some tests and indeed when you add a text with chinese, thai, etc. characters, squares are displayed.
The problem comes from the selected fonts: if you select palatino I have no more squares with Thai characters. But with some others languages, the problem occurs in the text field: when you type characters, squares are displayed.

Koji (koji.yk) said : #3

Although this is an old question, I leave a comment for those who might be interested.

Since latexdraw uses pdftex for compile, you should rely on a package for CJK (Chinese, Japanese and Korean) which is compatible with it. For example, in Edit -> Settings -> LaTeX, you can fill in

\usepackage{CJKutf8}
\newcommand*{\CH}[1]{\begin{CJK}{UTF8}{gbsn}#1\end{CJK}}
\newcommand*{\JA}[1]{\begin{CJK}{UTF8}{ipxm}#1\end{CJK}}
\newcommand*{\KO}[1]{\begin{CJK}{UTF8}{mj}#1\end{CJK}}

Then, when you draw a text, you write, say, "\CH{Chinese text}", "\JA{Japanese text}" or "\KO{Korean text}" for each language. By changing the font name "gbsn" to an appropriate Chinese font name, you can choose other Chinese fonts.

For the font name, please refer to the CJK package documentation.

Restart of latexdraw is required to enable the change.

arno_b (arno.b) said : #4

Thanks for the info.
Which tool do you usually use to compile pstricks and latex code? luatex? xetex?

Cheers

arno_b (arno.b) said : #5

I will put your trick in the official documentation BTW.

Koji (koji.yk) said : #6

Hi thanks, arno.

I usually use platex (and its variants ptex, eptex, uptex, etc.) which can handle Japanese. I think most of Japanese do the same, but it seems an increasing number of people are moving toward xetex and luatex as they become more stable and popular.

Also, some Chinese people may be using ctex. So an option to choose latex binary might be pretty much helpful ;)

Koji

Koji (koji.yk) said : #7

Well, I think I have to sort out the situation.

The comment I added applies to the situation when your final output is graphical files such as EPS, or when you compile the main latex file with pdftex or other "plain" latex.

Unfortunately, it is known that CJK package with pdftex is not suitable for document-wide use, at least for Japanese language, as it violates some formatting rules. In such a case, platex is frequently used in Japanese context. When the main document is compiled with platex, you omit the settings I wrote in the previous post, but still you can fill in Japanese texts. The text may not be compiled correctly in latexdraw, but still you can go on.

arno_b (arno.b) said : #8

Hi,
Thx for the information.
I will investigate the possibility to change and choose a specific compiler ; it may depend on what is compatible with pstricks.

Cheers

Can you help with this problem?

Provide an answer of your own, or ask chenglo76@hotmail.com for more information if necessary.

To post a message you must log in.