4

I set up hlatex (the package for compiling in Korean) but when I build the file, I end up getting ?? instead of 안녕. How do you fix this?

MWE:

\documentclass{article}
\usepackage{hangul}
\begin{document}
testing 안녕
\end{document}

No errors come up. The word "testing" comes up, but "안녕" does not.

2
  • Please provide a complete MWE (minimum working example) that generates the problem you're trying to solve. As it stands, your posting doesn't really provide sufficient information to allow a decent diagnosis of what may be going on.
    – Mico
    Commented Oct 19, 2013 at 20:05
  • Sorry, but no hangul.sty package is on CTAN.
    – egreg
    Commented Oct 19, 2013 at 23:12

2 Answers 2

2

Have a look at the CJK bundle.

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{CJKutf8}
 
\begin{document}
\begin{CJK}{UTF8}{mj}
``하나님이 세상을 이처럼 사랑하사 독생자를 주셨으니 이는 그를 믿는 자마다 멸망하지 않고 영샘을 얻게 하려 하심이라.'' - 요한복음 3:16
\end{CJK}
\end{document}

-- Reponse due to Thorsten (localghost on AoPS).

1
  • Maybe try @MoogleLogic answer from another thread : tex.stackexchange.com/a/144607/128104 This worked great for me and I don't need to surround every piece of Korean text with a tag soup.
    – Shautieh
    Commented Mar 20, 2017 at 7:08
3
+50

I'm probably the wrong person to anwser, because I have no experience in Korean or CJK usage in latex, but if you "only" want to typeset Korean and (maybe) latin texts, I would suggest to use lualatex (or xelatex). The benefit is that those latex engines are build to use the UTF-8 encoding without any hacks and they support OTF fonts. So you can use any system font you have to typeset your document. Here is a small example:

% !TEX TS-program = lualatex
\documentclass{article}

\usepackage{fontspec}
\setmainfont{Batang}
\setsansfont{Dotum}

\begin{document}
testing 안녕
{\sffamily testing 안녕}
\end{document}

enter image description here

Here I use the fonts Batang and Dotum shipped with Windows, but you can take any other that have Korean characters support. You probably know some of them. If you do not like the Latin letters you can also define commands to switch to the desired font:

% !TEX TS-program = lualatex
\documentclass{article}

\usepackage{fontspec}
%\setmainfont{Batang}
% or 
\setmainfont{TeX Gyre Schola}
\setsansfont{TeX Gyre Heros}
\newfontfamily\dotum{Dotum}
\newfontfamily\batang{Batang}

\begin{document}
testing \batang 안녕
{\sffamily testing \dotum 안녕}
\end{document}

enter image description here

If you have predominantly Korean text you can of course define font commands for the latin text and use the Korean font as default. I hope I could give you a starting point.

Not the answer you're looking for? Browse other questions tagged .