Fonts & Character SetsIncluding Japanese Characters

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
User1291
Posts: 5
Joined: Sat Jun 22, 2013 10:14 am

Including Japanese Characters

Post by User1291 »

So I was trying to add Japanese text to an otherwise english document. Here is my attempt:

Code: Select all

\documentclass[11pt, pdftex, a4page, utf8]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
%...
\usepackage{CJK}
\newcommand{\jap}[1]{\begin{CJK}{UTF8}{min}#1\end{CJK}}
%...
\begin{document}
  %...
  \jap{よろしくお願いします}
  %...
\end{document}
And these are some of the errors I'm getting for that exact code:
japanese-error.jpg
japanese-error.jpg (136.46 KiB) Viewed 11095 times
Since there are many duplicates, here are the unique ones:
  • Warnings:

    Code: Select all

    No file texstudio_N11212.aux.
    No file C70min.fd. on input line 11.
    Font shape `C70/min/m/n' undefined(Font) using `C70/song/m/n' instead
  • Errors:

    Code: Select all

    Undefined control sequence \jap{よろしくお願いします}
    Argument of filename@dot has an extra } \jap{よろしくお願いします}
    Paragraph ended before filename@dot was complete \jap{よろしくお願いします}
    Missing endcsname inserted \jap{よろしくお願いします}
    
And quite frankly, I'm at a loss. Log says, first notice encountered is

Code: Select all

LaTeX Font Warning: Font shape `C70/min/m/n' undefined
followed by

Code: Select all

! Undefined control sequence.
If anybody could help me out, that would be greatly appreciated.
Last edited by localghost on Sat Jun 22, 2013 12:09 pm, edited 1 time in total.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Re: Including Japanese Characters

Post by cgnieder »

The code you posted does not produce this error, at least not for me. It also works without error on writelatex (you can check this yourself by clicking on the writelatex link right above the code block).

If you look in the log file: is the “undefined control sequence” error the first one? Is your TeX distribution up to date?

Regards
site moderator & package author
User1291
Posts: 5
Joined: Sat Jun 22, 2013 10:14 am

Including Japanese Characters

Post by User1291 »

Well, I just run an update on my MiKTeX and I am still getting these errors for this very code that does not seem to produce any on writeLaTeX.

As far as the log file goes, this is it until the first error.
I am especially suspicious of all of these
... no UTF-8 mapping file for font encoding OML
(line 117) and the resulting line 422
LaTeX Info: Redefining \selectfont on input line 755
as well as all messages in the lines 353–422 of the log.

I today learned LaTeX had a sense of humor. However, that doesn't exactly help me in solving this problem.
Attachments
japTest.log
(23.06 KiB) Downloaded 550 times
Last edited by localghost on Sat Jun 22, 2013 6:40 pm, edited 1 time in total.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Including Japanese Characters

Post by cgnieder »

Concerning the

Code: Select all

! Package CJK Error: Encoding `utf8' is not defined.
error: remove utf8 from the class options. It's unnecessary, especially since you call it explicitly for inputenc. (Probably unrelated but the option pdftex isn't needed either.)

Regards
site moderator & package author
User1291
Posts: 5
Joined: Sat Jun 22, 2013 10:14 am

Including Japanese Characters

Post by User1291 »

Code: Select all

    \documentclass{scrreprt}
    \usepackage[utf8]{inputenc}
    \usepackage[english]{babel}
    %\usepackage[T1]{fontenc}
    %...
    \usepackage{CJK}
    \newcommand{\jap}[1]{\begin{CJK}{UTF8}{min}#1\end{CJK}}
    %...
    \begin{document}
    %...
    \jap{よろしくお願いします}
    %...
    \end{document}
That changed something, after all, yet I'm still getting errors.
The first error changed to (ln.497-521 in the log file):
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\cjk\UTF8\UTF8.chr"
File: UTF8.chr 2012/05/07 4.8.3
)
LaTeX Font Info: Try loading font information for C70+min on input line 11.
LaTeX Font Info: No file C70min.fd. on input line 11.


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

LaTeX Font Info: Try loading font information for C70+song on input line 11.

("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\cjk\UTF8\c70song.fd"
File: c70song.fd 2012/05/07 4.8.3
)
! Undefined control sequence.
try@size@range ...extract@rangefontinfo font@info
<-*>@nil <@nnil
l.11 \jap{よろしくお願いします}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
Attachments
japTest.log
(68.15 KiB) Downloaded 579 times
Post Reply