Skip to content

Instantly share code, notes, and snippets.

@dohyunkim
Last active May 10, 2016 04:17
Show Gist options
  • Select an option

  • Save dohyunkim/1d695b419f1c283b3b894f9a67f504e6 to your computer and use it in GitHub Desktop.

Select an option

Save dohyunkim/1d695b419f1c283b3b894f9a67f504e6 to your computer and use it in GitHub Desktop.
it's not easy to use ucharclasses package with polyglossia korean.
%!TEX program = xelatex
\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{korean}
\newfontfamily\koreanfont{NanumMyeongjo}[Ligatures=TeX]
\usepackage{ucharclasses}
\setTransitionsForCJK{\begingroup\koreanfont
\XeTeXlinebreaklocale"ko"
\XeTeXlinebreakpenalty=50
\XeTeXlinebreakskip=0pt plus.1em minus.01em
}{\endgroup}
\usepackage{lipsum}
\def\jiwon{%
대체 학문이란 것은 ‘신중히 생각하고 사물을 밝게 분별하고 자세히 묻고
넓게 안다’는 것이다. 덕성만을 가지고 함부로 추어올릴 수 없기 때문에
다시 묻고 배움과 연결시킨 것이다.
}
\begin{document}
\today \par
\jiwon \par
\lipsum[1]
\jiwon \par
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage{korean}
\setotherlanguage{english}
\newfontfamily\koreanfont{NanumMyeongjo}[Ligatures=TeX]
\newfontfamily\englishfont{Palatino}[Ligatures=TeX]
\usepackage{ucharclasses}
\setTransitionsForLatin{\begingroup\englishfont}{\endgroup}
\usepackage{lipsum}
\def\jiwon{%
대체 학문이란 것은 ‘신중히 생각하고 사물을 밝게 분별하고 자세히 묻고
넓게 안다’는 것이다. 덕성만을 가지고 함부로 추어올릴 수 없기 때문에
다시 묻고 배움과 연결시킨 것이다.
}
\begin{document}
\uccon
\today \par
\jiwon \par
\lipsum[1]
\jiwon \par
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment