Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Japanese, please help:

I need to put the following into LaTeX and print it out with pdfLaTeX. The document itself is in English, so I only need a way to put these Kanji characters (Jin, aza, BUN, MOJI, or so, at least I was told so, I have no clue) into the text. Something like \jin, \aza ... would be great.

: (char "a")
-> 97
: (char "字")
-> 23383
: (char 23383)
-> "字"
: (chop "文字")
-> ("文" "字")
: (mapcar char @)
-> (25991 23383)
share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

You can use the CJKutf8 package (I wasn't sure about then intended formatting for the other characters, so I left them as they were):

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{CJKutf8}
\usepackage[english]{babel}

\newenvironment{Japanese}{%
  \CJKfamily{min}%
  \CJKtilde
  \CJKnospace}{}

\begin{document}

\begin{CJK}{UTF8}{}
\begin{Japanese}
\noindent: (char ``a'') \\
-> 97 \\
: (char ``字'') \\
-> 23383 \\
: (char 23383) \\
-> ``字'' \\
: (chop ``文字'') \\
-> (``文'' ``字'') \\
: (mapcar char @) \\
-> (25991 23383)
\end{Japanese}
\end{CJK}

\end{document}

enter image description here

share|improve this answer
    
Thank you, very nice solution, I'm sure it works, but I get other error messages for the document when I try it. So I resorted to an easier solution - include this as a graphic ;) –  user17106 Aug 23 '12 at 12:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.