TeX Live and MacTeXlatex erroro with cjk-utf8

Information and discussion about TeX Live distribution for all platforms (Windows, Linux, Mac OS X) and the related MacTeX: installing, updating, configuring
Post Reply
gosha
Posts: 16
Joined: Mon Nov 24, 2008 2:48 pm

latex erroro with cjk-utf8

Post by gosha »

Hello everyone!
I'm new here and fairly new to latex too.
For the little I did until new everything went very smooth, but I need to write and print multilanguage text containig also chinese characters.
I'm running OpenBSD 4.3 and I installed the full texlive package, but when I run latex on a file with chinese characters it gives me the errors below, althought the fonts seem to be there.
Any idea?
Thank you in advance
Here is the error I get:

Code: Select all

This is pdfTeX, Version 3.141592-1.40.3 (Web2C 7.5.6)
entering extended mode
(./perte.tex
LaTeX2e <2005/12/01>
Babel <v3.8h> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, arabic, basque, bulgarian, coptic, welsh, czech, slovak, german, ng
erman, danish, esperanto, spanish, catalan, galician, estonian, farsi, finnish,
 french, greek, monogreek, ancientgreek, croatian, hungarian, interlingua, ibyc
us, indonesian, icelandic, italian, latin, mongolian, dutch, norsk, polish, por
tuguese, pinyin, romanian, russian, slovenian, uppersorbian, serbian, swedish,
turkish, ukenglish, ukrainian, loaded.
(/usr/local/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2005/09/16 v1.4f Standard LaTeX document class
(/usr/local/share/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/share/texmf-dist/tex/generic/babel/babel.sty
(/usr/local/share/texmf-dist/tex/generic/babel/italian.ldf
(/usr/local/share/texmf-dist/tex/generic/babel/babel.def)))
(/usr/local/share/texmf-dist/tex/latex/CJK/CJK.sty
(/usr/local/share/texmf-dist/tex/latex/CJK/mule/MULEenc.sty)
(/usr/local/share/texmf-dist/tex/latex/CJK/CJK.enc))
(/usr/local/share/texmf-dist/tex/latex/ucs/ucs.sty
(/usr/local/share/texmf-dist/tex/latex/ucs/data/uni-global.def))
(/usr/local/share/texmf-dist/tex/latex/base/inputenc.sty
(/usr/local/share/texmf-dist/tex/latex/ucs/utf8x.def))
(/usr/local/share/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/share/texmf-dist/tex/latex/base/t1enc.def))
(/usr/local/share/texmf-dist/tex/latex/preprint/fullpage.sty) (./perte.aux)
(/usr/local/share/texmf-dist/tex/generic/babel/lgrcmr.fd)
(/usr/local/share/texmf-dist/tex/latex/ucs/ucsencs.def
fontencoding LGR patched
) (/usr/local/share/texmf-dist/tex/latex/CJK/UTF8/UTF8.bdg)
(/usr/local/share/texmf-dist/tex/latex/CJK/UTF8/UTF8.enc)
(/usr/local/share/texmf-dist/tex/latex/CJK/UTF8/UTF8.chr)

LaTeX Font Warning: Font shape `C70/P/m/n' undefined
(Font)              using `C70/song/m/n' instead on input line 12.

(/usr/local/share/texmf-dist/tex/latex/CJK/UTF8/c70song.fd)kpathsea: Running mktextfm cyberb4e
/usr/local/share/texmf/web2c/mktexnam: Could not map typeface abbreviation yb for cyberb4e.
/usr/local/share/texmf/web2c/mktexnam: Need to update /usr/local/share/texmf-dist/fonts/map/fontname/special.map?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input cyberb4e
This is METAFONT, Version 2.71828 (Web2C 7.5.6)

kpathsea: Running mktexmf cyberb4e
! I can't find file `cyberb4e'.
<*> ...ljfour; mag:=1; nonstopmode; input cyberb4e

Please type another input file name
! Emergency stop.
<*> ...ljfour; mag:=1; nonstopmode; input cyberb4e

Transcript written on mfput.log.
grep: cyberb4e.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input cyberb4e' failed to make cyberb4e.tfm.
kpathsea: Appending font creation commands to missfont.log.

! Font C70/song/m/n/10/4e=cyberb4e at 10.0pt not loadable: Metric (TFM) file no
t found.
<to be read again>
                   relax
l.12 Per te 
               
?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

gosha
Posts: 16
Joined: Mon Nov 24, 2008 2:48 pm

Re: latex erroro with cjk-utf8

Post by gosha »

Problem solved!
Thank you anyway
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: latex erroro with cjk-utf8

Post by localghost »

I guess the solution would be interesting for all of us.


Best regards and welcome to the board
Thorsten¹
gosha
Posts: 16
Joined: Mon Nov 24, 2008 2:48 pm

latex erroro with cjk-utf8

Post by gosha »

Yes, of course, sorry I did not post it right away.
It seems I was missing a lot of things in the preample, I had tried with some examples found with google, but they would give those errors. For some reason, the examples of the cjk latex package don't seem to be installed with the openbsd package. I downloaded cjk-4.8.1.tar.gz and looked at the examples provided by Werner Lemberg <wl@gnu.org>.
For example:

Code: Select all

cat CJKutf8.tex
% This is the file CJKutf8.tex of the CJK package
%   for testing the CJKutf8 style file.
%
% written by Werner Lemberg <wl@gnu.org>
%
% Version 4.8.1 (10-Aug-2008)

% Vietnamese support for Babel comes with the VnTeX package.
%
% Read CJKutf8.txt for more details.

\documentclass[12pt]{article}

\usepackage[10pt]{type1ec}          % use only 10pt fonts
\usepackage[T1]{fontenc}

\usepackage{CJKutf8}
\usepackage[german, russian, vietnam, USenglish]{babel}

\usepackage[overlap, CJK]{ruby}
\usepackage{CJKulem}

\renewcommand{\rubysep}{-0.2ex}

\newenvironment{SChinese}{%
  \CJKfamily{gbsn}%
  \CJKtilde
  \CJKnospace}{}
\newenvironment{TChinese}{%
  \CJKfamily{bsmi}%
  \CJKtilde
  \CJKnospace}{}
\newenvironment{Japanese}{%
  \CJKfamily{min}%
  \CJKtilde
  \CJKnospace}{}
\newenvironment{Korean}{%
  \CJKfamily{mj}}{}


\begin{document}

\parskip 3ex
\parindent 0pt

\begin{CJK}{UTF8}{}

\begin{Korean}
  이 FAQ 은 자주 반복되는 질문과 그에 대한 대답을 간단명료한 양식으로
  모아 엮어졌습니다. \uline{이 FAQ 의 구조는 지난 판에 비하여
    획기적으로 변경되었습니다.}  \textbf{상세한 것은 ``이 FAQ 을 어떻게
    읽을 것인가'' 라는 대목을 참조하시기 바랍니다.}
\end{Korean}

\begin{otherlanguage}{german}
  Dieses FAQ wurde erstellt, um häufig gestellte Fragen und ihre
  Antworten in einer gefälligen Form zusammenzufassen.  \uline{Die
    Struktur dieses FAQ wurde drastisch geändert seit der letzten
    Version.}  \textbf{Für Details siehe den Abschnitt "`Wie lese ich
    dieses FAQ"'.}
\end{otherlanguage}

\begin{SChinese}
  本常问问答集~(FAQ list)~是从一些经常被问到的问题及其适当的解答中,以
  方便的形式摘要而出的。\uline{跟上一版不同的是,其编排结构已彻底改变。}
  \textbf{有关新结构的细节,可参考「如何阅读本问答集及了解其编排结构」
    该项中的说明。}
\end{SChinese}

\begin{TChinese}
  本常問問答集~(FAQ list)~是從一些經常被問到的問題及其適當的解答中,以
  方便的形式摘要而出的。\uline{跟上一版不同的是,其編排結構已徹底改變。}
  \textbf{有關新結構的細節,可參考「如何閱讀本問答集及了解其編排結構」
    該項中的說明。}
\end{TChinese}

This FAQ list was made to summarize some frequently asked questions
and their answers in a convenient form.  \uline{The structure of this
  FAQ list has drastically changed since the last version.}
\textbf{For details of the new structure, see the entry of `How to
  read this FAQ and its structure'.}

\begin{Japanese}
  この~FAQ~リストは、よくある質問とその答を集め、役に立つようにしたもの
  です。\uline{この~FAQ~リストの構造は、以前のものと比べて大幅に変更さ
    れています。}\textbf{\ruby{新}{あたら}しい構造に関しては、「こ
    の~FAQ~ の読み方とその構造」の項目を\ruby{参}{さん}\ruby{照}{しょ
      う}して下さい。}
\end{Japanese}

\begin{otherlanguage}{vietnam}
  Phần ``Những câu hỏi và giải đáp thường gặp'' (viết tắt từ tiếng Anh
  là FAQ) được nêu ra ở đây nhằm mục đích thu thập những câu hỏi
  thường gặp trong thực tế và những lời giải đáp thích hợp nhất của
  nó.  \uline{Từ lần ấn bản cuối cùng đến nay, đã có những sự thay đổi
    khá lớn trong cấu trúc của FAQ.}  \textbf{Để hiểu rõ hơn bạn nên
    xem lại chương ``Làm sao tôi có thể đọc đuợc FAQ''.}
\end{otherlanguage}

\begin{otherlanguage}{russian}
  Этот список был составлен для суммирования некоторых часто
  задаваемых вопросов (FAQ), вместе с ответами на них, в удобной
  форме.  \uline{Структура этого FAQ кардинально изменилась по
    сравнению с послед\-ней версией.}  \textbf{В разделе `Как читать
    этот FAQ и его структура' объяснены детали этой новой структуры.}
\end{otherlanguage}

\end{CJK}

\end{document}


%%% Local Variables:
%%% coding: utf-8
%%% mode: latex
%%% TeX-master: t
%%% End:
If you have a full texlive distribution you should be able to produce a dvi file displaying correctly all the scripts.
In my own file I added this preamble (in this file I only need Italian and Chinese simplified):

Code: Select all

\documentclass[a4paper]{article}
\usepackage{fullpage}
\pagestyle{empty}
\usepackage[T1]{fontenc}
\usepackage{CJKutf8}
\usepackage[italian]{babel}
\usepackage[overlap, CJK]{ruby}
\usepackage{CJKulem}

\renewcommand{\rubysep}{-0.2ex}

\newenvironment{SChinese}{%
  \CJKfamily{gbsn}%
  \CJKtilde
  \CJKnospace}{}
\begin{document}

\parskip 3ex
\parindent 0pt

\begin{CJK}{UTF8}{}
\begin{SChinese}
when you finish with the text of course you have to add:

Code: Select all

\end{SChinese}
\end{CJK}
\end{document}
There is only one little problem, but I don't know if it can be solved:
the examples that come with the distribution, all show one language per paragraph. But I need to write different languages in the same paragraph. Usually, if it's only english alphabet characters, the chinese environment will properly handle the distance from the ending western word and the chinese characters (chinese characters don't have spaces between them), but if the ending or starting letter is, for instance, an à (a with an accent) or similar, the chinese environment will not put a space and the letter will be to close to the chinese character, so it will look ugly. One solution I tried which works is to insert a space manually in the tex file:

Code: Select all

\ 
(escape characher plus a space). Of course, you can begin and end a language for every single phrase in different languages inside the same paragraph. If you have a lot of different words, it might be quite a bit of typing. I don't know if there's a way to let latex handle this problem automatically with some lines in the preamble. But I doubt it, and actually I'm quite happy already with the present solution.

Hope it will be of some help for someone, if you have any suggestions please share.
steinchen
Posts: 21
Joined: Thu Oct 29, 2009 12:18 pm

Re: latex erroro with cjk-utf8

Post by steinchen »

Post Reply