0

I'm writing an article in english but I should add some Korean symbols. E.g., 아스트로 in a sentence. Latex returns an error:

package inputenc error: unicode character 아스트로 

How can I fix this problems?

  • 1
    I might be wrong, but are those Korean symbols? – CuriousEinstein Jan 9 at 18:03
  • 2
    In fact, this is Korean and not Thai (it says "Astro"). Whatever. Use XeLaTeX or LuaLaTeX if you need Unicode characters. – JairoAraujo Jan 9 at 18:05
  • I'm sorry, I did not know these symbols, but I convinced myself were correct. Yes, I checked it and I found that ASTRO is a South Korean boy band. Thank you! – Mark Jan 9 at 18:29
5

Just for completeness, here is an example with babel 3.38, just released, and luatex. Note there is no need to mark the Korean text, as babel switches the font and the linebreaking rules automatically.

\documentclass{report}

\usepackage[english]{babel}

\babelprovide[import, onchar=ids fonts]{korean}

\babelfont[korean]{rm}{Batang}
\babelfont[korean]{sf}{Dotum}

\begin{document}

Some English text around this 아스트로 Korean text.

\sffamily

Some English text around this 아스트로 Korean text.

\end{document}

Babel 3.38 and Korean

6

To save yourself some headache, use engines that properly support Unicode characters rather than relying on old/unmaintained packages. Then you'll only need to use a font that supports Hangul (Korean charachters).

Here is a sample that works with Lua(La)Tex, assuming you have the font and packages available:

\documentclass{report}

\usepackage{fontspec}
\newfontfamily\kfont{Dotum}

\begin{document}
Some English text around this {\kfont 아스트로} Korean text.
\end{document}

enter image description here

If you do use a lot of Korean text though actually calling a package like polyglossia or babel (or some maintained Korean packages) might be a better idea.

  • You probably want to load \newfontfamily\kfont{Dotum}[Script = CJK, Language = Korean, Scale = MatchUppercase] if the font supports those features. It might also be worth loading polyglossia or babel. – Davislor Jan 10 at 3:07
  • @Davislor I think Hangul is actually considered separate from CJK? Also I'm not familiar with Korean (or CJK in general) fonts, if you know some supporting those features feel free to edit the answer or let me know to do so. – zareami10 Jan 10 at 3:24
  • You're right, there is a Hangul script. – Davislor Jan 10 at 3:25
  • I do not have Dotum but NanumGothic have also that glyphs. – Fran Jan 10 at 4:02
3

Here is a MWE using polyglossia. Babel would also work:

\documentclass{report}

\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{korean}

\defaultfontfeatures{Scale = MatchUppercase}
\newfontfamily\koreanfont{Noto Serif CJK KR}[Script = Hangul, Language = Korean]
\newfontfamily\koreanfontsf{Noto Sans CJK KR}[Script = Hangul, Language = Korean]

\begin{document}
Some English text around this \textkorean{아스트로} Korean text.
\end{document}

Korean font sample

Setting the Script= and Scale= options is often necessary to get the correct output. Language= here is probably unnecessary: there are not different variants of Hangul for different languages.

1

Perhaps you should simply save your files in UTF8 like this:

\usepackage[utf8]{inputenc}

and it should work without error.

  • 1
    Thank you but, unfortunately, the problem still exists – Mark Jan 9 at 18:31
  • 2
    ... I solved adding \usepackage{kotex}! – Mark Jan 9 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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