Discussion:
Japanese word in English-language LaTeX document
(too old to reply)
Peter Flynn
2007-11-03 22:08:25 UTC
Permalink
I need to give a word in Japanese in an otherwise English-language
document:

\documentclass{article}
\usepackage[encapsulated]{CJK}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\newcommand{\cjktext}[1]{\begin{CJK}{UTF8}{cyberbit}#1\end{CJK}}
\begin{document}
Japanese \cjktext{類似した}
\end{document}

but this asks for the cyberbit or song fonts (see log output below),
which I don't have.

This is in Ubuntu Gutsy with TeX Live installed from the .debs, so I have
installed all the latex-cjk-* packages as well. There appears to be a set
of fonts called wadalab installed: how can I tell CJK.sty to use this
instead of cyberbit (if that's possible)

///Peter
-------------------------------------------------------------------------

This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
%&-line parsing enabled.
entering extended mode
LaTeX2e <2005/12/01>
Babel <v3.8h> and hyphenation patterns for english, usenglishmax,
dumylang, noh
yphenation, croatian, bulgarian, russian, ukrainian, czech, slovak,
danish, dut
ch, finnish, finnish, french, basque, french, german, ngerman, german,
ngerman,
greek, monogreek, ancientgreek, ibycus, hungarian, hungarian, italian,
italian
, latin, latin, mongolian, mongolian, norsk, norsk, coptic, esperanto,
estonian
, icelandic, indonesian, interlingua, romanian, serbian, slovenian,
turkish, up
persorbian, welsh, polish, polish, portuguese, portuguese, spanish,
catalan, ga
lician, spanish, catalan, galician, swedish, swedish, ukenglish,
ukenglish, pin
yin, loaded.

(./test.tex (/usr/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2005/09/16 v1.4f Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size10.clo))
(/usr/share/texmf/tex/latex/CJK/CJK.sty
(/usr/share/texmf/tex/latex/CJK/mule/MULEenc.sty)
(/usr/share/texmf/tex/latex/CJK/CJK.enc))
(/usr/share/texmf-texlive/tex/latex/ucs/ucs.sty
(/usr/share/texmf-texlive/tex/latex/ucs/data/uni-global.def))
(/usr/share/texmf-texlive/tex/latex/base/inputenc.sty
(/usr/share/texmf-texlive/tex/latex/ucs/utf8x.def)) (./test.aux)
(/usr/share/texmf-texlive/tex/latex/ucs/ucsencs.def)
(/usr/share/texmf/tex/latex/CJK/UTF8/UTF8.bdg)
(/usr/share/texmf/tex/latex/CJK/UTF8/UTF8.enc)
(/usr/share/texmf/tex/latex/CJK/UTF8/UTF8.chr)

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

! Undefined control sequence.
***@size@range ***@rangefontinfo ***@info
<-*>@nil <@nnil
l.7 Japanese \cjktext{é¡Ä¼¼ã—た}
c***@zedat.fu-berlin.de
2007-11-04 08:25:06 UTC
Permalink
Peter Flynn <***@m.silmaril.ie> wrote:
: I need to give a word in Japanese in an otherwise English-language
: document:

: \documentclass{article}
: \usepackage[encapsulated]{CJK}
: \usepackage{ucs}
: \usepackage[utf8x]{inputenc}
: \newcommand{\cjktext}[1]{\begin{CJK}{UTF8}{cyberbit}#1\end{CJK}}
: \begin{document}
: Japanese \cjktext{é¡?ä¼¼ã??ã??}
: \end{document}

: but this asks for the cyberbit or song fonts (see log output below),
: which I don't have.

Hi Peter,

In any case, you need a CJK font. I recommend TrueType fonts which are
fairly easily available. I've once had a look at the Wadalab fonts but
disliked them. Their glyphs are not really pleasing (at least me, that
is).

I am not familiar with Ubuntu. I found out many years ago that Red Hat
seems to have the most complete support for East Asian languages. Once
you installed UI languages like Chinese and Japanese, the fonts for CJK
were automatically installed, too. Have a look at /usr/share/fonts.

As long as no font for CJK is installed, you'll have to go through a bit
cumbersome process of installing one. That includes building a mapping
file (CJK operates with subsets of fonts) from where a map points to
the actual glyph to be used in the output (e.g., PDF). The requirements
for fonts in DVI files are different from PDF. DVI requires the TTF font
converted to .pk subfonts, each 256 chars, whereas PDF directly includes
TTF material.

The CJK documentation provides reading for a rainy Sunday afternoon. Un-
fortunately I sit at a different machine at the moment so I cannot directly
inspect my CJK installation.

Please feel free to ask for more, I can send the detailed setup later,
and I _should_ be able to give you pointers to suitable CJK fonts.

Oliver.
--
Dr. Oliver Corff e-mail: ***@zedat.fu-berlin.de
Patrick Steegstra
2007-11-04 10:37:57 UTC
Permalink
Post by Peter Flynn
I need to give a word in Japanese in an otherwise English-language
\documentclass{article}
\usepackage[encapsulated]{CJK}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\newcommand{\cjktext}[1]{\begin{CJK}{UTF8}{cyberbit}#1\end{CJK}}
\begin{document}
Japanese \cjktext{類似した}
\end{document}
but this asks for the cyberbit or song fonts (see log output below),
which I don't have.
This is in Ubuntu Gutsy with TeX Live installed from the .debs, so I have
installed all the latex-cjk-* packages as well. There appears to be a set
of fonts called wadalab installed: how can I tell CJK.sty to use this
instead of cyberbit (if that's possible)
///Peter
-------------------------------------------------------------------------
This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
%&-line parsing enabled.
entering extended mode
LaTeX2e <2005/12/01>
Babel <v3.8h> and hyphenation patterns for english, usenglishmax,
dumylang, noh
yphenation, croatian, bulgarian, russian, ukrainian, czech, slovak,
danish, dut
ch, finnish, finnish, french, basque, french, german, ngerman, german,
ngerman,
greek, monogreek, ancientgreek, ibycus, hungarian, hungarian, italian,
italian
, latin, latin, mongolian, mongolian, norsk, norsk, coptic, esperanto,
estonian
, icelandic, indonesian, interlingua, romanian, serbian, slovenian,
turkish, up
persorbian, welsh, polish, polish, portuguese, portuguese, spanish,
catalan, ga
lician, spanish, catalan, galician, swedish, swedish, ukenglish,
ukenglish, pin
yin, loaded.
(./test.tex (/usr/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2005/09/16 v1.4f Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size10.clo))
(/usr/share/texmf/tex/latex/CJK/CJK.sty
(/usr/share/texmf/tex/latex/CJK/mule/MULEenc.sty)
(/usr/share/texmf/tex/latex/CJK/CJK.enc))
(/usr/share/texmf-texlive/tex/latex/ucs/ucs.sty
(/usr/share/texmf-texlive/tex/latex/ucs/data/uni-global.def))
(/usr/share/texmf-texlive/tex/latex/base/inputenc.sty
(/usr/share/texmf-texlive/tex/latex/ucs/utf8x.def)) (./test.aux)
(/usr/share/texmf-texlive/tex/latex/ucs/ucsencs.def)
(/usr/share/texmf/tex/latex/CJK/UTF8/UTF8.bdg)
(/usr/share/texmf/tex/latex/CJK/UTF8/UTF8.enc)
(/usr/share/texmf/tex/latex/CJK/UTF8/UTF8.chr)
LaTeX Font Warning: Font shape `C70/cyberbit/m/n' undefined
(Font) using `C70/song/m/n' instead on input line 7.
! Undefined control sequence.
l.7 Japanese \cjktext{é¡Ä¼¼ã—た}
Hi,

Maybe XeTeX could do the job. I have never used it myself, but it is
supposed to make font handling very simple. On the website are some
examples that also show cjk characters.

http://scripts.sil.org/xetex

Cheers,
Patrick
Gernot Hassenpflug
2007-11-05 05:29:29 UTC
Permalink
Post by Peter Flynn
I need to give a word in Japanese in an otherwise English-language
\documentclass{article}
\usepackage[encapsulated]{CJK}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\newcommand{\cjktext}[1]{\begin{CJK}{UTF8}{cyberbit}#1\end{CJK}}
\begin{document}
Japanese \cjktext{類似した}
\end{document}
but this asks for the cyberbit or song fonts (see log output below),
which I don't have.
Hello Peter:

Replace "cyberbit" by:

a) "min" for Mincho variant (~serif)
b) "goth" for Gothic variant (~sans-serif)
c) "maru" for Marumoji letters (rounded leters)

All the above are IIRC Wadalab fonts.

Best regards,
Gernot Hassenpflug
--
BOFH excuse #55:

Plumber mistook routing panel for decorative wall fixture
Danai SAE-HAN (韓達耐)
2007-11-07 14:22:18 UTC
Permalink
Post by Gernot Hassenpflug
Post by Peter Flynn
I need to give a word in Japanese in an otherwise English-language
\documentclass{article}
\usepackage[encapsulated]{CJK}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\newcommand{\cjktext}[1]{\begin{CJK}{UTF8}{cyberbit}#1\end{CJK}}
\begin{document}
Japanese \cjktext{類似した}
\end{document}
I would ditch the packages "ucs" and "utf8x" and "CJK". Use "CJKutf8"
instead, which is also part of CJK, but with a much more improved Unicode
support.
Post by Gernot Hassenpflug
a) "min" for Mincho variant (~serif)
b) "goth" for Gothic variant (~sans-serif) c) "maru" for Marumoji
letters (rounded leters)
All the above are IIRC Wadalab fonts.
Indeed. Gernot's suggestion is the best one, because the Wadalab fonts
is a high quality fonts for Japanese specifically.

Or, if you did manage to get the Cyberbit fonts installed according to
the README file that I wrote in the Debian package, use "song".

If you have more questions about CJK, don't hesitate to contact the CJK
mailing list as well (cjk at ffii dottydot org), or check the archives at
http://lists.ffii.org/mailman/listinfo/cjk

HTH


/Danai SAE-HAN
--
題目:《宮詞》
作者:宋徽宗〔趙佶〕(1082-1135)

新樣梳妝巧畫眉,窄衣纖體最相宜;
一時趨向多情遠,小閣幽窗靜弈棋。
Barutan Seijin
2007-11-19 04:00:21 UTC
Permalink
Post by Peter Flynn
I need to give a word in Japanese in an otherwise English-language
\documentclass{article}
\usepackage[encapsulated]{CJK}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\newcommand{\cjktext}[1]{\begin{CJK}{UTF8}{cyberbit}#1\end{CJK}}
\begin{document}
Japanese \cjktext{$BN`;w$7$?(B}
\end{document}
but this asks for the cyberbit or song fonts (see log output below),
which I don't have.
This is in Ubuntu Gutsy with TeX Live installed from the .debs, so I have
installed all the latex-cjk-* packages as well. There appears to be a set
of fonts called wadalab installed: how can I tell CJK.sty to use this
instead of cyberbit (if that's possible)
The cyberbit fonts are freely available. Grab them and install.

I think TexLive includes the Wadalab fonts, the mincho at the very
least. You use them by doing something like the following:

\begin{CJK}[dnp]{$ENCODING}{min}

These days i xelatex everything, but i'm working on OS X and have
some OK Japanese fonts installed already.
--
***@gmail.com
Continue reading on narkive:
Loading...