Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
LaTeX and Japanese Text
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Kenji Miyamoto
Veteran
Veteran


Joined: 28 May 2005
Posts: 1452
Location: Looking over your shoulder.

PostPosted: Fri Sep 28, 2007 1:03 am    Post subject: LaTeX and Japanese Text Reply with quote

I've looked into this, and it looks like there's no reliable way to get Japanese to work under LaTeX. I've tried pTeX, and I get this output and no Japanese text in the resulting PDF. platex results in a DVI which has the same problem:
Code:
This is pdfeTeX, Version 3.141592-1.30.5-2.2 (Web2C 7.5.5)
entering extended mode
(./2007-09-27:Introduction.tex.out.tex
LaTeX2e <2003/12/01>
Babel <v3.8d> and hyphenation patterns for american, french, german, ngerman, b
ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch, esperanto, e
stonian, finnish, greek, icelandic, irish, italian, latin, magyar, norsk, polis
h, portuges, romanian, russian, serbian, slovak, slovene, spanish, swedish, tur
kish, ukrainian, nohyphenation, loaded.
(/usr/share/texmf/tex/latex/base/article.cls
Document Class: article 2004/02/16 v1.4f Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/size12.clo))
(/usr/share/texmf-site/tex/latex/notes/notes.sty
(/usr/share/texmf/tex/latex/graphics/graphicx.sty
(/usr/share/texmf/tex/latex/graphics/keyval.sty)
(/usr/share/texmf/tex/latex/graphics/graphics.sty
(/usr/share/texmf/tex/latex/graphics/trig.sty)
(/usr/share/texmf/tex/latex/graphics/graphics.cfg)
(/usr/share/texmf/tex/latex/graphics/dvips.def)))
(/usr/share/texmf/tex/latex/wrapfig/wrapfig.sty)
(/usr/share/texmf/tex/latex/graphics/color.sty
(/usr/share/texmf/tex/latex/graphics/color.cfg)
(/usr/share/texmf/tex/latex/graphics/pdftex.def))
(/usr/share/texmf-site/tex/latex/polynom/polynom.sty)
(/usr/share/texmf/tex/latex/jknappen/mathrsfs.sty)
(/usr/share/texmf/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/share/texmf/tex/latex/amsmath/amstext.sty
(/usr/share/texmf/tex/latex/amsmath/amsgen.sty))
(/usr/share/texmf/tex/latex/amsmath/amsbsy.sty)
(/usr/share/texmf/tex/latex/amsmath/amsopn.sty)))
(/usr/share/texmf/tex/latex/geometry/geometry.sty
(/usr/share/texmf/tex/latex/geometry/geometry.cfg))
No file 2007-09-27:Introduction.tex.out.aux.
(/usr/share/texmf/tex/context/base/supp-pdf.tex
(/usr/share/texmf/tex/context/base/supp-mis.tex
loading : Context Support Macros / Miscellaneous (2004.10.26)
)
loading : Context Support Macros / PDF (2004.03.26)
) (/usr/share/texmf/tex/latex/base/omscmr.fd) [1{/var/lib/texmf/fonts/map/pdfte
x/updmap/pdftex.map
Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `cidgoth-h': font file missing

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `cidgoth-v': font file missing

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `cidmin-h': font file missing

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `cidmin-v': font file missing

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `futogo-b': font file missing

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `futogo-b-v': font file missing

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `futomin-b': font file missing

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `futomin-b-v': font file missing

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `gbm': font file missing

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `gbmsl': SlantFont/ExtendFont can be used only with emb
edded T1 fonts

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `gbmv': font file missing

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `gtbbb-m': font file missing

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `gtbbb-m-v': font file missing

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `jun101-l': font file missing

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `jun101-l-v': font file missing

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `rml': font file missing

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `rmlsl': SlantFont/ExtendFont can be used only with emb
edded T1 fonts

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `rmlv': font file missing

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `ryumin-l': font file missing

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `ryumin-l-v': font file missing

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `unigoth': font file missing

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `unijgoth-h': font file missing

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `unijgoth-v': font file missing

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `unijmin-h': font file missing

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `unijmin-v': font file missing

Warning: /usr/bin/pdflatex (file /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.
map): invalid entry for `unimin': font file missing
}] (./2007-09-27:Introduction.tex.out.aux) )
(see the transcript file for additional information)</usr/share/texmf/fonts/typ
e1/bluesky/cm/cmsy10.pfb></usr/share/texmf/fonts/type1/bluesky/cm/cmr12.pfb></u
sr/share/texmf/fonts/type1/bluesky/cm/cmti12.pfb>
Output written on 2007-09-27:Introduction.tex.out.pdf (1 page, 17102 bytes).
Transcript written on 2007-09-27:Introduction.tex.out.log.
Where do I get these fonts? I already have latex-unicode and cjk-latex installed.
_________________
[ Kawa-kun, new and improved!! ]

Alex Libman seems to be more of an anarchist than a libertarian.
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Fri Sep 28, 2007 1:52 am    Post subject: Reply with quote

the cjk-latex gentoo package doesn't work for me for font sizes other than 10pt, so I got the cjk-latex-4.6.0 ebuild out of the gentoo bugtracker, renamed it to 4.7.0 (because that's the latest version and the ebuild will work unmodified) and renamed the 4.5.2 cjk-latex-fonts package to 4.7 as well. With this, Japanese in tetex works for me, like this:

Code:

\usepackage[nocjkjis]{ucs}
\usepackage[utf8x]{inputenc}
\usepackage[C40,T1]{fontenc}
\newcommand\japanesetext[1]{\bgroup\fontencoding{C40}\fontfamily{song}\selectfont\SetUnicodeOption{cjkjis}#1\egroup}

\begin{document}
\japanesetext{ひらがなカタカナ漢字}
\end{document}


However, it is using an ugly bitmap font which is barely readable. I can live with that, because I rarely actually need to put in Japanese characters somewhere (usually only for the glossary). I didn't manage yet to install a custom font for tetex... none of the howtos seem to work for me. If you seriously want to typeset Japanese text, expect there to be a ton of problems. Have a look at texlive / xetex, as it comes with built in TTF font support. It's the best I've come across so far regarding TeX + CJK, but still, it is far from perfect.

As for pTeX, this is what probably should work, since it's a Japanese distro and documentation is only available in Japanese too - but said documentation is too complicated for me to understand and so I didn't ever manage to produce any useful output with it either. Plus I don't need pure Japanese documents, but mixed German + Japanese if at all, making matters even more complicated.
Back to top
View user's profile Send private message
Kenji Miyamoto
Veteran
Veteran


Joined: 28 May 2005
Posts: 1452
Location: Looking over your shoulder.

PostPosted: Fri Sep 28, 2007 4:41 am    Post subject: Reply with quote

Mixed English and Japanese is what I need, for notes in my Japanese class. Why does pTeX complain about the lack of fonts? Where would I get the ones it's requesting?
_________________
[ Kawa-kun, new and improved!! ]

Alex Libman seems to be more of an anarchist than a libertarian.
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Fri Sep 28, 2007 5:52 am    Post subject: Reply with quote

as for old cjk-latex, I think it simply installed them into a wrong directory, and the newer ebuild fixed that. it only supplies you with an ugly bitmap font though.
regarding pTeX, I have no idea, sorry. :(
Back to top
View user's profile Send private message
Kenji Miyamoto
Veteran
Veteran


Joined: 28 May 2005
Posts: 1452
Location: Looking over your shoulder.

PostPosted: Fri Sep 28, 2007 3:19 pm    Post subject: Reply with quote

It looks like even with that ebuild renamed to cjk-latex.4.7.0.latex, the fonts still aren't displayed in neither KPDF nor KDVI. I even tried leaving the font size the default 10pt.
_________________
[ Kawa-kun, new and improved!! ]

Alex Libman seems to be more of an anarchist than a libertarian.
Back to top
View user's profile Send private message
Fukai
Tux's lil' helper
Tux's lil' helper


Joined: 05 Jul 2006
Posts: 149
Location: São Paulo, Brazil

PostPosted: Wed Oct 17, 2007 7:04 pm    Post subject: Reply with quote

I really recommend that you look at XeTeX/XeLaTeX.
A minimal example:

\documentclass{minimal}
\usepackage{fontspec}
\setromanfont{Kochi Mincho}

\begin{document}
This is english and 日本語.
\end{document}
Back to top
View user's profile Send private message
jansk
Apprentice
Apprentice


Joined: 09 Aug 2004
Posts: 164

PostPosted: Fri Aug 29, 2008 12:20 pm    Post subject: Reply with quote

Hello,

I tried XeLaTeX. Works like a charm with the example in the previous post. I however got "Undefined control sequence" errors when trying to compile a document I am working on against XeLaTeX. I coudn't figure out what's wrong so I turned back to normal LaTeX with CJK extension (latex-cjk).

I followed this link in order to install the Cyberbit font correctly for LaTeX.
Now adding japanese text to my documents is as simple as:

Code:

\documentclass[12pt,a4paper]{article}

\usepackage{CJK}

\begin{document}
Document with mixed text.
\begin{CJK}{UTF8}{cyberbit}
日本語
\end{CJK}
some more text...
\end{document}


Regards,
Jan

p.s. in documentation for latex-cjk-common there is detailed how-to on adding fonts to your LaTeX installation but I found the above link easier to understand.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum