texlive[64279] Master/texmf-dist: pmhanguljamo (3sep22)

commits+karl at tug.org commits+karl at tug.org
Sat Sep 3 21:48:40 CEST 2022


Revision: 64279
          http://tug.org/svn/texlive?view=revision&revision=64279
Author:   karl
Date:     2022-09-03 21:48:40 +0200 (Sat, 03 Sep 2022)
Log Message:
-----------
pmhanguljamo (3sep22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/pmhanguljamo/README.md
    trunk/Master/texmf-dist/doc/latex/pmhanguljamo/pmhanguljamo-doc.pdf
    trunk/Master/texmf-dist/doc/latex/pmhanguljamo/pmhanguljamo-doc.tex
    trunk/Master/texmf-dist/doc/latex/pmhanguljamo/pmhanguljamo-kdoc.pdf
    trunk/Master/texmf-dist/doc/latex/pmhanguljamo/pmhanguljamo-kdoc.tex
    trunk/Master/texmf-dist/tex/latex/pmhanguljamo/pmhanguljamo-rrk.sty
    trunk/Master/texmf-dist/tex/latex/pmhanguljamo/pmhanguljamo.sty

Modified: trunk/Master/texmf-dist/doc/latex/pmhanguljamo/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pmhanguljamo/README.md	2022-09-03 19:48:22 UTC (rev 64278)
+++ trunk/Master/texmf-dist/doc/latex/pmhanguljamo/README.md	2022-09-03 19:48:40 UTC (rev 64279)
@@ -6,13 +6,16 @@
 
 It is mainly for the people who have a system without Korean keyboard IM, but want to typeset Hangul in their document. Not only modern Hangul, but so-colled “Old Hangul” characters that uses the lost letters can also be typeset.
 
+XeLaTeX or LuaLaTeX is recommended. And the legacy pdfTeX is not supported.
+
 In version 0.3, it provides two kinds of transliteration rules. The default way is this package's unique method. The alternative one is a more familiar *Korean Romanization Rule*. With the latter only Modern Hangul can be typeset.
 
-XeLaTeX or LuaLaTeX is recommended. And the legacy pdfTeX is not supported.
+In version 0.5, it is possible to specify proper font for typesetting Jamo Hangul.
 
+
 ## Copyright and License
 
-(C) 2020-2021 Kangsoo Kim <modviv2k15 at gmail.com>
+(C) 2020-2022 Kangsoo Kim <modviv2k15 at gmail.com>
 
 This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license or (at your option) any later version.
 The latest version of this license is in

Modified: trunk/Master/texmf-dist/doc/latex/pmhanguljamo/pmhanguljamo-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pmhanguljamo/pmhanguljamo-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pmhanguljamo/pmhanguljamo-doc.tex	2022-09-03 19:48:22 UTC (rev 64278)
+++ trunk/Master/texmf-dist/doc/latex/pmhanguljamo/pmhanguljamo-doc.tex	2022-09-03 19:48:40 UTC (rev 64279)
@@ -1,3 +1,5 @@
+%!TEX TS-program = arara
+% arara: xelatex: { shell: yes, synctex: yes }
 \documentclass[a4paper]{article}
 \usepackage{kotex}
 %\usepackage{fontspec}
@@ -4,7 +6,7 @@
 %\setmainfont{Noto Serif}
 %\setsansfont{Noto Sans}
 %\setmonofont{Noto Sans Mono}
-\setmainfont{XITS}
+\setmainfont{STIX Two Text}
 
 \usepackage{hologo}
 \newcommand*\XeTeX{\hologo{XeTeX}}
@@ -12,7 +14,7 @@
 \newcommand*\LuaTeX{\hologo{LuaTeX}}
 \newcommand*\LuaLaTeX{\hologo{LuaLaTeX}}
 
-\usepackage{pmhanguljamo}
+\usepackage[pmfont={Noto Serif KR}]{pmhanguljamo}
 \usepackage[colorlinks]{hyperref}
 
 %\usepackage{polyglossia}
@@ -20,7 +22,7 @@
 %\newfontfamily\hangulfont{UnBatang.ttf}[Script=Hangul,Renderer=OpenType]
 %%\newcommand*\jamo[1]{\begingroup\hangulfont\jamoword{#1}}
 
-\setmainhangulfont{Noto Serif CJK KR}[Script=Hangul,Renderer=OpenType]
+\setmainhangulfont{Noto Serif CJK KR}
 
 \providecommand*\textkorean[1]{#1}
 \newenvironment{korean}{}{}
@@ -30,6 +32,8 @@
 \newcommand*\thispkg{\pkg{pmhanguljamo}}
 %\maxsecnumdepth{section}
 
+\usepackage{hvextern}
+
 \begin{document}
 
 \title{Poorman's Hangul Jamo Input Method \\ \Large \texttt{pmhanguljamo.sty} }
@@ -36,7 +40,7 @@
 \author{Kangsoo Kim}
 %\date{10 Mar 2021\quad version 0.3.5}
 %\date{20 Sep 2021\quad version 0.3.6}
-\date{28 Nov 2021\quad version 0.4}
+\date{2 Sep 2022\quad version 0.5}
 
 \maketitle
 
@@ -67,18 +71,20 @@
 
 Put the following line in your preamble:
 \begin{verbatim}
-\usepackage{pmhanguljamo}
+\usepackage[<options>]{pmhanguljamo}
 \end{verbatim}
-
-The option \texttt{[RRK]} or \texttt{[rrk]}
-can be given, in which case the \emph{Standard Korean Romanization Transliteration}
-input method is activated. In section~\ref{sec:rrk},
-we will explain about it.
-Without option, the default input method of this package is used, that
-is explained in sections~\ref{sec:rule}--\ref{sec:exam}.
+\begin{enumerate}
+\item \texttt{[rrk]} or \texttt{[RRK]}. The \emph{Standard Korean Romanization Transliteration} input method is activated. In section~\ref{sec:rrk},
+we will explain about it. If this option is missing, the default input
+method is used, which is explained in sections~\ref{sec:rule}--\ref{sec:exam}.
 You are to specify just one of them. Using both methods in one document is
 not allowed.
 
+\item \texttt{pmfont=<fontname>}. The font that is used to typeset Hangul 
+characters in the scope of \verb|\jamoword| or \texttt{jamotext}. If this option missing, the Jamo-Hangul font is to be same as the \textit{main font} of 
+the document.
+\end{enumerate}
+
 \subsection{Commands and Environment Provided}
 
 The main command to typeset Hangul is \verb|\jamoword|.
@@ -90,8 +96,8 @@
 \end{quote}
 
 The argument of the command consists of roman alphabets 
-and a few marks that represent the transliteration of Hangul Jamo.
-The transliteration rule will be explained in the section~\ref{sec:rule} (page~\pageref{sec:rule}).
+and a few marks that represent Hangul Jamo.
+The transliteration rule will be explained in the section~\ref{sec:rule}, page~\pageref{sec:rule}.
 
 And an environment named \emph{jamotext} is provided.
 In the environment, multiple paragraphs can be located. So, it is
@@ -105,7 +111,7 @@
 na/nvn goi/ro/ue/haiss/da/.
 \end{jamotext}
 \end{verbatim}
-The result:
+Result:
 \begin{quote}
 \begin{korean}
 \begin{jamotext}
@@ -118,25 +124,89 @@
 \end{korean}
 \end{quote}
 
+\paragraph{ASCII-Escaping Trick}
+Sometimes it is needed to locate a few math materials or ASCII stuffs
+in the midst of Jamo Hangul texts. The tricky syntax 
+\begin{verbatim}
+   !{<ASCII stuffs>}
+\end{verbatim}
+makes it possible to insert non-Jamo ASCII characters into \texttt{jamotext}
+context. Note that it is not allowed in the arguments of \verb|\jamoword|.
 
+\begin{verbatim}
+\begin{jamotext}
+in/gan/i pog/jex/goa eg/ab/ei 
+!{tyranny and oppression} 
+dai/hax/ha/nvn ma/ji/mag su/dan/v/ro/se 
+!{as a last resort}
+ban/ran/vr ir/v/ki/do/rog gax/yo/bad/ji 
+anh/v/rye/myen
+
+pi/ta/go/ra/sv/vi jex/ri/ !{\unskip :} 
+!{$a^2+b^2=c^2$}.
+\end{jamotext}
+\end{verbatim}
+
+\noindent Result:\\
+\begin{jamotext}
+in/gan/i pog/jex/goa eg/ab/ei 
+!{tyranny and oppression} 
+dai/hax/ha/nvn ma/ji/mag su/dan/v/ro/se 
+!{as a last resort}
+ban/ran/vr ir/v/ki/do/rog gax/yo/bad/ji 
+anh/v/rye/myen
+
+pi/ta/go/ra/sv/vi jex/ri/ !{\unskip :} !{$a^2+b^2=c^2$}.
+\end{jamotext}
+
+\bigskip
+
+The \verb|!{| mark must be located in the head of a word.
+To remove the preceding space of a word, \verb|\unskip| is
+used in the example. This trick will be useful when using
+math equations, \LaTeX\ macros, or English words with long Jamo Hangul
+texts.
+
+
 \subsection{Setting up in your Preamble}
 
 Without any other packages, you can type Hangul. Be sure that
 proper fonts should be declared for Hangul, utilizing \pkg{fontspec}.
 
-\begin{verbatim}
-\documentclass{article}
+\begin{externalDocument}[ 
+	compiler=xelatex,
+	code,
+	cleanup]{testa}
+\documentclass{standalone}
+%StartVisiblePreamble
 \usepackage{fontspec}
-\usepackage{pmhanguljamo}
-
+\usepackage[pmfont={Noto Serif KR}]{pmhanguljamo}
+%StopVisiblePreamble
 \begin{document}
-\fontspec[Script=Hangul]{UnBatang.ttf}
 \jamoword{an/nyex/ha/sei/yo}
 \end{document}
-\end{verbatim}
+\end{externalDocument}
 
-\texttt{UnBatang.ttf} is a font shipped in \pkg{unfonts-core} package of \TeX\,Live.
-Not all Korean fonts can be available to typeset so-called `Old Hangul',
+If you don't want to specify \texttt{pmfont} option, you should manually
+declare the proper font for Jamo Hangul with \texttt{Script=Hangul} option.\footnote{See section \ref{sec:font}.}
+
+\begin{externalDocument}[ 
+	compiler=xelatex,
+	code,
+	cleanup]{testa}
+\documentclass{standalone}
+%StartVisiblePreamble
+\usepackage{fontspec}
+\usepackage{pmhanguljamo}
+\newfontfamily\mypmfont{Noto Serif KR}[Script=Hangul]
+%StopVisiblePreamble
+\begin{document}
+\mypmfont\jamoword{an/nyex/ha/sei/yo}
+\end{document}
+\end{externalDocument}
+
+%\texttt{UnBatang.ttf} is a font shipped in \pkg{unfonts-core} package of \TeX\,Live.
+Not all Korean fonts are available to typeset so-called `Old Hangul',
 because they happen to lack
 the feature of composing Korean syllables from conjoining Jamo codes. Fortunately,
 we have a few more fonts besides \texttt{UnBatang} that are \emph{proper}
@@ -143,40 +213,56 @@
 and freely available, which are listed in the section~\ref{sec:font}.
 In \TeX\,Live distribution, \texttt{UnBatang} is the only \emph{proper} one.
 
-The \pkg{polyglossia} package provides Korean language support. This package \thispkg\
+The \pkg{polyglossia} package provides Korean language support. \thispkg\
 can be used with it. The following is an example.
 
-\begin{verbatim}
-\documentclass{article}
+\begin{externalDocument}[ 
+	compiler=xelatex,
+	code,
+	cleanup]{testa}
+\documentclass{standalone}
+%StartVisiblePreamble
 \usepackage{polyglossia}
 \setmainlanguage{english}
 \setotherlanguage{korean}
-\newfontfamily\hangulfont{UnBatang.ttf}[Script=Hangul]
+\newfontfamily\hangulfont{Noto Serif KR}[Script=Hangul]
 \usepackage{pmhanguljamo}
-
+%StopVisiblePreamble
 \begin{document}
 \begin{korean}
-\jamoword{han/gvr/vr si/hem/hab/ni/da/.}
+\jamoword{a/rvm/da/un han/gvr/ib/ni/da/.}
 \end{korean}
 \end{document}
-\end{verbatim}
+\end{externalDocument}
 
+In this example, the Korean language is set as `other language',
+and the default font for Korean is declared as `\verb|\hangulfont|'.
+In the \textit{korean} environment, the \verb|\hangulfont| will be
+used for Hangul.
+
 Or the ko.\TeX\ package bundle can be used together.
 
-\begin{verbatim}
-\documentclass{article}
+\begin{externalDocument}[ 
+	compiler=xelatex,
+	code,
+	cleanup]{testa}
+\documentclass{standalone}
+%StartVisiblePreamble
 \usepackage{kotex}
-\usepackage{pmhanguljamo}
-\setmainhangulfont{UnBatang.ttf}[Script=Hangul]
-
+\usepackage[pmfont={NotoSerifKR-Regular.otf}]{pmhanguljamo}
+%StopVisiblePreamble
 \begin{document}
 \jamoword{na/ras/mar/ss@/mi}
 \end{document}
-\end{verbatim}
+\end{externalDocument}
 
-In any case, the option \verb|[Script=Hangul]| should be given
-to the font settings for Hangul. For more information, see section~\ref{sec:font}.
+When ko.\TeX\ is used, the fontspec command for Hangul is not
+\verb|\fontspec| but \verb|\hangulfontspec|. We recommend that
+you use \texttt{pmfont=} option to avoid the complicated situation.
 
+%The \verb|[Script=Hangul]| should be given
+%to the font settings for Hangul. For more information, see section~\ref{sec:font}.
+
 The Korean writing system does not have hyphenation rules.
 The line breaking can occur just after almost every syllable. Therefore,
 without Korean language supporting packages the line breaking and
@@ -318,11 +404,15 @@
 \texttt{UnBatang} is already installed in your \TeX\,Live installation.
 
 \begin{description}
-\item[Hamchorom LVT] Hamchorom fonts by Hancom Inc., and their variants with GSUB tables by KTS (the Korean \TeX\ Society).  \url{https://github.com/dohyunkim/hcr-lvt}
-\item[KoPub World] free fonts by Korea Publisher Society. \url{http://www.kopus.org/biz-electronic-font2/}
-\item[Malgun Gothic] One of Windows 10 system font. 
+\item[Hamchorom or Hamchorom-LVT] Hamchorom fonts by Hancom Inc., 
+\url{https://www.hancom.com/cs_center/csDownload.do},
+and their variants with GSUB tables by KTS (the Korean \TeX\ Society).  \url{https://github.com/dohyunkim/hcr-lvt}
+\item[KoPub World] free fonts by Korea Publisher Society. 
+\url{https://www.kopus.org/biz-electronic-font2/}.
+\item[Malgun Gothic] One of Windows 10 system fonts. 
 \item[Nanum Yet Hangul] Two font families from Naver. Nanum Myeongjo Yet Hangeul and Nanum Barun Gothic Yet Hangeul. \url{https://hangeul.naver.com/2014/archaicword}
-\item[Noto CJK or Source Han] Google's Noto CJK fonts. Or Adobe's Source Han fonts. \url{https://www.google.com/get/noto/help/cjk/}
+\item[Noto Korean or Source Han] Google's Noto Korean fonts --- Noto Serif Korean, Noto Sans Korean. Or Adobe's Source Han fonts. 
+\url{https://fonts.google.com}.
 \item[Un Batang] \verb|UnBatang.ttf|. on CTAN. \url{https://ctan.org/pkg/unfonts-core}
 \end{description}
 
@@ -340,7 +430,9 @@
 \begin{verbatim}
 \newfontfamily\pmjamofont{HCR Batang LVT}[Script=Hangul]
 \end{verbatim}
-and then issue \verb|\pmjamofont| command in the scope of Hangul to be typeset.
+and then issue \verb|\pmjamofont| command in the scope of Hangul to be typeset.\footnote{%
+	When \texttt{pmfont=} option is given, the \texttt{Script=Hangul} is
+	automatically activated by the package.}
 It is recommended that the \emph{proper} font should be used consistently.
 
 \medskip
@@ -364,7 +456,7 @@
 \usepackage{pmhanguljamo}
 \usepackage{polyglossia}
 \setotherlanguage{korean}
-\newfontfamily\hangulfont{UnBatang.ttf}[Script=Hangul]
+\newfontfamily\hangulfont{Noto Serif KR}[Script=Hangul]
 \end{verbatim}
 
 \subsection{Modern Hangul}\label{sec:exammodern}
@@ -523,8 +615,8 @@
 So we can make use of the former as an input method.
 
 If the package option \texttt{[RRK]} or \texttt{[rrk]} is given, 
-the RRK method is activated. In this case, only `Modern Hangul' can
-be available. 
+the RRK method is activated. With this method, only `Modern Hangul' can
+be typeset.
 
 \subsection{Transliteration Rule of RRK}
 

Modified: trunk/Master/texmf-dist/doc/latex/pmhanguljamo/pmhanguljamo-kdoc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pmhanguljamo/pmhanguljamo-kdoc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pmhanguljamo/pmhanguljamo-kdoc.tex	2022-09-03 19:48:22 UTC (rev 64278)
+++ trunk/Master/texmf-dist/doc/latex/pmhanguljamo/pmhanguljamo-kdoc.tex	2022-09-03 19:48:40 UTC (rev 64279)
@@ -1,10 +1,12 @@
-%
-% Poorman's Hangul Jamo Input Method
-% pmhanguljamo.sty 사용설명서
-%
-% (C) 2020 Nova de Hi.
-% 		part of pmhanguljamo package.
-%
+%!TEX program = SpiX
+%$ xelatex -shell-escape -synctex=1 $texname
+%%
+%% Poorman's Hangul Jamo Input Method
+%% pmhanguljamo.sty 사용설명서
+%%
+%% (C) 2020 Nova de Hi.
+%% 		part of pmhanguljamo package.
+%%
 \documentclass[a4paper]{oblivoir}
 
 \hypersetup{colorlinks}
@@ -28,9 +30,9 @@
 \setmainfont{Noto Serif}
 \setsansfont{Noto Sans}
 \setmonofont{Noto Sans Mono}
-\setsansfont{Noto Sans CJK KR}[\fontfeatureoption]
-\setkomainfont(Noto Serif CJK KR)(* Bold)(Noto Sans CJK KR Light)[\fontfeatureoption]
-\setkosansfont(Noto Sans CJK KR)(* Bold)[\fontfeatureoption]
+\setsansfont{Noto Sans KR}[\fontfeatureoption]
+\setkomainfont(Noto Serif KR)(* Bold)(Noto Sans KR Light)[\fontfeatureoption]
+\setkosansfont(Noto Sans KR)(* Bold)[\fontfeatureoption]
 \setkomonofont(Noto Sans Mono CJK KR)
 
 \usepackage{tcolorbox}
@@ -68,7 +70,8 @@
 %\date{2020/03/15\quad v0.3.4}
 %\date{2020/03/10\quad v0.3.5}
 %\date{2021/09/20\quad v0.3.6}
-\date{2021/11/28\quad v0.4}
+%\date{2021/11/28\quad v0.4}
+\date{2022/09/02\quad v0.5}
 
 \maketitle
 
@@ -75,7 +78,7 @@
 \begin{exampleside}
 \begin{jamotext}
 g@/r@/mi p@/r@/ni sai de/ug h at i/o/,\\
-moy/hi pe/re/h@/ni gos/ bi/ci bvr bvd/n at n d at s/do/da/.\\
+moy/hi pe/re/h@/ni gos bi/ci bvr bvd/n at n d at s/do/da/.\\
 ors bo/mi bon/d at in sdo di/na/ga/n@/ni \\
 e/nv na/ri i do/ra/gar h at i/o/.
 \end{jamotext}
@@ -95,6 +98,25 @@
 \hologo{XeLaTeX}, \hologo{LuaLaTeX}에서 사용할 수 있고 
 \hologo{pdfLaTeX}은 지원하지 않는다.
 
+\section{사용법 요약}\label{sec:summary}
+
+\begin{boxedverbatim}
+\documentclass{article}
+\usepackage{kotex}
+\usepackage[pmfont={Noto Serif KR}]{pmhanguljamo}
+\begin{document}
+\jamoword{sei/gyei/in/guen/sen/en}
+
+\begin{jamotext}
+mo/dvn in/ryu gu/sex/uen/vi cen/bu/vi jon/em/sex/goa
+dox/dvx/ha/go yax/do/har su ebs/nvn guen/ri/rvr in/jex/ha/nvn ges/i
+sei/gyei/vi ja/yu/, jex/vi mic pyex/hoa/vi gi/co/i/mye/,
+in/guen/ei dai/han mu/si/oa gyex/myer/i in/ryu/vi yax/sim/vr
+gyeg/bun/si/ki/nvn man/haix/vr co/rai/ha/yess/v/mye/,
+\end{jamotext}
+\end{document}
+\end{boxedverbatim}
+
 \section{사용법}
 
 \subsection{패키지 사용 선언}
@@ -103,11 +125,19 @@
 \usepackage[<option>]{pmhanguljamo}
 \end{boxedverbatim}
 
-preamble에 위의 문장을 둔다. 옵션으로 \verb|rrk| 또는 \verb|RRK| 하나를 쓸 수 있는데
-이 옵션은 ``표준 전자법''으로 현대 한글을 입력하는 방식으로 바뀐다. 이에 대해서는 
-\ref{sec:rrk}절을 보라.
-옵션을 주지 않으면 \ref{sec:pmrule}절에서 설명하는 pm 입력 방식을 따른다.
+preamble에 위의 문장을 둔다. 
 
+옵션은 다음 두 가지가 있다.
+\begin{enumerate}[1.]
+\item \verb|rrk| 또는 \verb|RRK|. 
+입력 방식이 ``표준 전자법''으로 현대 한글을 입력하는 방식으로 바뀐다. 이에 대해서는 
+\ref{sec:rrk}절을 보라. 옵션을 주지 않으면 \ref{sec:pmrule}절에서 설명하는 pm 입력 방식을 따른다.
+\item \verb|pmfont={<fontname>}|.
+식자할 폰트를 지정한다. 이 옵션이 주어지지 않으면 문서의 mainfont (\koTeX\ 패키지의
+경우는 mainhangulfont)를 따른다. 지정할 수 있는 폰트에 대해서는 \ref{sec:font} \titleref{sec:font}\를
+보라.
+\end{enumerate}
+
 \subsection{명령과 환경}
 
 \subsubsection{주의사항}
@@ -132,8 +162,8 @@
 \end{boxedverbatim}
 
 한글 자모를 알파벳으로 입력하여 출력한다. 
-하나 또는 둘 이상의 단어가 올 수 있다. (단 하나의 단어만을 처리하는 \cmda{\jamotextcmd}라는 명령이
-있기는 하나 내부적으로 사용되는 것이다.) 
+하나 또는 둘 이상의 단어가 올 수 있다.\footnote{단 하나의 단어만을 처리하는 \cmda{\jamotextcmd}라는 명령이
+있기는 하나 내부적으로 사용되는 것이다.}
 \verb|\par|를 포함하는 문단은 올 수 없다.
 
 \medskip
@@ -158,11 +188,49 @@
 \begin{exampleside}
 \begin{jamotext}
 na/ras;mar:ss@/mi; dyuq/guyg;ey; dar/a;
+mun/jj at x;oa;ro; se/rv s@/m at s/di; a/ni;h at r/ss at i;
 
-mun/jj at x;oa;ro; se/rv s@/m at s/di; a/ni;h at r/ss at i;
+i;ren jyen/c@;ro; e/rin; 百b at ig;姓syeq;i; 
+ni/rv/go;jye; horf; bai; i/sye;do;
 \end{jamotext}
 \end{exampleside}
 
+\leavevmode\marginpar{\footnotesize\fbox{v0.5}}%
+\env{jamotext} 환경 내에 긴 문장을 쓰다가 보면 잠시 jamo 입력이
+아닌 아스키 입력 상태로 escape하여야 할 때가 있다. 이를 위하여
+\begin{verbatim}
+    !{<ascii stuffs>}
+\end{verbatim}
+와 같은 트릭을 쓸 수 있다.
+이 때에 \verb|!{|는 반드시 단어의 첫머리여야 하므로 한 단어 안에서
+두 번 이상 쓸 수 없다. 문단 구분을 위한 빈 줄도 올 수 없다.
+
+이 아스키 에스케이프 트릭은 \env{jamotext} 환경 내에서만 쓸 수 있고 
+\cmda{\jamoword}의 인자 범위에서는 쓸 수 없다.
+
+\medskip
+\begin{exampleside}
+\begin{jamotext}
+in/gan/i pog/jex/goa eg/ab/ei 
+!{tyranny and oppression} 
+dai/hax/ha/nvn ma/ji/mag su/dan/v/ro/se 
+!{as a last resort}
+ban/ran/vr ir/v/ki/do/rog gax/yo/bad/ji 
+anh/v/rye/myen
+\end{jamotext}
+\end{exampleside}
+
+이를 이용하여 약간의 수식도 \env{jamotext} 안에 둘 수 있다.
+
+\medskip
+\begin{exampleside}
+\begin{jamotext}
+2/ca/bax/jex/sig/vi gvn/vi gox/sig/,
+!{\[ x = \frac{-b\pm\sqrt{b^2-4ac}}{2a} \]}
+vr yu/do/ha/ye bo/ja/.
+\end{jamotext}
+\end{exampleside}
+
 \subsubsection{\texttt{\bs jmcc} 명령}
 
 \begin{boxedverbatim}
@@ -170,8 +238,11 @@
 \end{boxedverbatim}
 
 음절이 아니라 한 개의 자모만을 표시할 목적으로 \href{https://en.wikipedia.org/wiki/Hangul_Compatibility_Jamo}{한글 호환 자모}를 식자하려 할 때 사용하는 명령이다.
-호환 자모를 \cmda{\jamoword} 명령의 인자 안에서 쓰는 방법은 \ref{sec:compjamo}절을 보라. 이 명령은 본문
-중에서 독립적으로 쓰기 위해 마련되었다.
+이 패키지의 기본 명령인 \cmda{\jamoword}로도 호환 자모를 식자할 수 있기 때문에 일반적으로
+이 명령을 사용할 필요가 없으나, rrk 입력 방식으로 문서를 작성할 때라든지 오로지 호환 자모만을
+표기해야 할 필요가 있다든지 등 부득이한 경우가 있을 수 있다. 
+호환 자모를 \cmda{\jamoword} 명령의 인자 안에서 쓰는 방법은 \ref{sec:compjamo}절을 보라. 
+%이 명령은 본문 중에서 독립적으로 쓰기 위해 마련되었다.
 인자로 단 하나의 자모만이 와야 한다. 설령 \texttt{RRK} 옵션을 부여하여 RRK 입력 방법을 쓰는 때라도
 이 명령의 인자는 이 패키지의 고유한 전자 규칙을 따른다. 쌍아래아는 유니코드 호환 자모에는 정의되어 있지
 않으나 편의를 위하여 조판할 수 있도록 해두었다.
@@ -337,14 +408,16 @@
 
 콜론, 세미콜론, 슬래시는 각각 \cmda{\ColonMark}, \cmda{\SemiColonMark}, \cmda{\SlashMark} 명령을 사용할 수 있게 해두었다.
 
+매크로를 쓸 수 없는 것이 원칙이기는 하나,
+protect된 단일 매크로는 그대로 출력된다. 그러나 인자를 취하는 매크로는 오류가 발생할 것이므로 
+인자 범위 밖에 두도록 하라.
+
 \medskip
 \begin{exampleside}
-\jamoword{15 세기 표기\ColonMark{} 國之語音, 우리나라의 말이 $\Rightarrow$ na/ras/mar/ss@/mi}
+\jamoword{15 세기 표기\ColonMark{} 國之語音, 우리나라의 말이 
+$\Rightarrow$ na/ras/mar/ss@/mi}
 \end{exampleside}
 
-매크로를 쓸 수 없는 것이 원칙이기는 하나,
-protect된 단일 매크로는 그대로 출력된다. 그러나 인자를 취하는 매크로는 오류가 발생할 것이므로 
-인자 범위 밖에 두도록 하라.
 
 %RRK 입력 방식이 활성화되면 매크로 사용은 더욱 제한된다. \cmda{\ColonMark}와 같은 임시 명령도 동작하지 않는다.
 
@@ -357,12 +430,11 @@
 이름을 적을 때도 쓰이기 때문에 그리 `옛' 것은 아니다.
 이 글에서는 관행을 따라 옛한글이라고 부르기로 한다.}
 텍스트를 복사해와서 넣을 때 유용할지도.
-다음 예에서 이 패키지의 입력 방식과 첫가끝 입력 방식이 혼용되어 있는 것을 볼 수 있다.
+다음 예에서 이 패키지의 입력 방식과 첫가끝 입력이 혼용되어 있는 것을 볼 수 있다.
 
 \medskip
 \begin{exampleside}
-\jamoword{(/du/si/en/hai dvx/go/)
-ᄇᆞᄅᆞ미 ᄲᆞᄅᆞ며 하ᄂᆞᆯ히 놉고 나ᄇᆡ 됫ᄑᆞ라미 슬프니}
+\jamoword{b@/r@/mi sb@/r@/mye ha/n at r/hi{} 놉고 나ᄇᆡ 됫ᄑᆞ라미 슬프니}
 \end{exampleside}
 
 \section{폰트}
@@ -394,7 +466,7 @@
 
 은 바탕 \testfont{UnBatang}
 
-본명조 또는 Noto Serif CJK \testfont{Noto Serif CJK KR}
+본명조 또는 Noto Serif \testfont{Noto Serif KR}
 
 나눔명조옛한글 \testfont{NanumMyeongjo-YetHangul.ttf}
 
@@ -402,7 +474,7 @@
 
 함초롬 돋움 \testfont{HCR Dotum LVT}
 
-본고딕 또는 Noto Sans CJK \testfont{Noto Sans CJK KR}
+본고딕 또는 Noto Sans \testfont{Noto Sans KR}
 
 나눔바른고딕옛한글 \testfont{NanumBarunGothic-YetHangul.ttf}
 
@@ -418,7 +490,7 @@
 
 옛한글을 무리없이 표현하는 것은 현재 이 정도인 것 같다.
 각 폰트는 특정한 문자에 대해서 약간의 차이를 보이기도 한다. 참고로 이 문서에서는
-본문과 옛한글에 Noto Serif CJK KR을 사용하였다.
+본문과 옛한글에 Noto Serif KR을 사용하였다.
 
 \hologo{LuaTeX}으로 컴파일하는 경우에는 위에 든 폰트들, 즉 \texttt{Script Hangul} 속성을 
 가진 폰트만 사용 가능하다. \hologo{LuaTeX}과 이 패키지의 관계에 대해서 
@@ -473,10 +545,55 @@
 
 \subsection{폰트의 지정}
 
+\paragraph{Script Hangul Option}
+
+\cmda{\jamoword}와 \env{jamotext} 인자 범위 내에서 한글을 식자하려 할 때에는
+주어진 (한글) 폰트의 \textsf{Script Hangul} 속성을 활성화하여야 한다.\footnote{이것은 
+폰트가 가지고 있는 오픈타입 속성을 활성화하여 자모 한글을 제대로 출력하도록 지정하는 역할을 한다. 자모 한글을
+처리하는 기능을 가지고 있지 않은 글꼴에서는 아무 역할도 하지 않고 컴파일 시 콘솔에 경고 메시지를 보일 것이다.}%
+\textsuperscript{, }\footnote{\hologo{LuaTeX}에서는 약간의
+추가 옵션이 더 필요할 수 있다. 이 문서의 이후 \texttt{[Script=Hangul]}을 주라고 하는 때에
+모두 동일하다. \pageref{sec:luatex}페이지의 부록 B를 보라.\label{fn:fontoption}}
+
+그러므로 \pkg{fontspec} 방식으로 폰트를 지정할 때 반드시
+\begin{verbatim}
+\set...font{<fontname>}[Script=Hangul]
+\end{verbatim}
+또는 Lua\TeX 이라면
+\begin{verbatim}
+\set...font{<fontname>}[Script=Hangul,Renderer=OpenType]
+\end{verbatim}
+을 지정하라.
+
+\paragraph{패키지 옵션 \texttt{pmfont}}
+
+\leavevmode{\marginpar{\fbox{\footnotesize v5.0}}}
+패키지 옵션 \verb|pmfont=|가 주어지지 않았을 때는 아무 일도 하지 않는다.
+이것이 의미하는 것은 현재 활성화된 기본 폰트가 pm 자모 식자에 이용된다는 뜻이다.
+mainfont로 식자할 것인지, 또는 별도의 폰트를 \cmda{\newfontfamily}로
+설정하여 식자할 것인지 사용자에게 맡겨져 있고, 이것이 디폴트이다.
+
+만약 \verb|pmfont=| 옵션이 예컨대 다음과 같이 주어졌다고 가정하자.
+\begin{verbatim}
+    \usepackage[pmfont={Noto Serif KR}]{pmhanguljamo}
+\end{verbatim}
+이 때에는 \cmda{\jamoword}와 \env{jamotext}의 인자 범위에서 pm 자모 입력된
+한글 문자에 대해서 지정된 폰트가 (\texttt{Script=Hangul}이 자동으로 주어져서)
+적용된다.
+
+두 개의 매크로가 정의되어 있다. \verb|\usepmfont|는 명령이 주어진 위치부터
+\verb|\setpmhangulfont|에 의하여 지정되는 폰트를 자모 식자에 사용한다.
+\begin{verbatim}
+  \usepmfont
+  \setpmhangulfont{HCR Batang LVT}
+\end{verbatim}
+옵션 \verb|pmfont={HCR Batang LVT}|는 이 두 매크로를 문서의 맨처음부터
+설정하는 것과 동일하다.
+
+\subsection{활용 방법}
+
 특정 언어 패키지나 입력기의 제약 없이 한글 글꼴을 지정하는 것만으로
 현대 한글과 옛한글을 모두 표현할 수 있다는 것이 \pkg{pmhanguljamo}의 장점이다.
-다만 \koTeX\ 없이는 글자 사이의 행나눔이나 양끝맞추기 등 한글 문장 식자에 꼭 필요한 몇 가지 기능이 구현되지 
-않을 것이므로 이런 점은 감안하여야 한다. 대체로 몇 자 정도의 한글을 넣어야 하는 때에 유용하리라 본다.
 
 \koTeX\ 패키지와 함께 쓸 때와 그렇지 않을 때를 나누어서 간단히 사용법을 보이겠다.
 
@@ -484,33 +601,32 @@
 만약 \koTeX\ (\pkg{xetexko} 또는 \pkg{luatexko})과 함께 사용하는 경우라면 본문 한글 글꼴을 
 다음과 같이 지정한다. 
 
-\texttt{[Script=Hangul]} \emph{옵션을 반드시 주어야 한다}는 점을 기억하자.\footnote{이것은 
-폰트가 가지고 있는 오픈타입 속성을 활성화하여 자모 한글을 제대로 출력하도록 지정하는 역할을 한다. 자모 한글을
-처리하는 기능을 가지고 있지 않은 글꼴에서는 아무 역할도 하지 않고 컴파일 시 콘솔에 경고 메시지를 보일 것이다.}%
-\textsuperscript{, }\footnote{\hologo{LuaTeX}에서는 약간의
-추가 옵션이 더 필요할 수 있다. 이 문서의 이후 \texttt{[Script=Hangul]}을 주라고 하는 때에
-모두 동일하다. \pageref{sec:luatex}페이지의 부록 B를 보라.\label{fn:fontoption}}
 
 \begin{boxedverbatim}
-\setmainhangulfont{Noto Serif CJK KR}[Script=Hangul]
+\setmainhangulfont{Noto Serif KR}[Script=Hangul]
 \end{boxedverbatim}
 
-본문과 폰트를 달리 쓰려 한다면 \cmda{\jamoword} 또는 \env{jamotext} 범위에 다음과 같이 임시로 한글 글꼴을 적용한다.
+또는 \texttt{pmfont} 옵션을 지정한다. 본문과 다른 폰트를 쓰게 하려 할 때에도
+이와 같이 한다. \texttt{pmfont} 옵션으로 지정되는 글꼴에는 \texttt{Script=Hangul}이
+자동으로 설정되므로 폰트 이름(또는 폰트 파일 이름)만을 주면 된다.
 
 \begin{boxedverbatim}
-\hangulfontspec[Script=Hangul]{HCR Batang LVT}
+  \usepackage[pmfont={HCR Batang LVT}]{pmhanguljamo}
 \end{boxedverbatim}
 
-\cmda{\adhochangulfont} 명령은 이와 동일한 명령이다. 이 폰트의 적용 범위를 설정하거나 하는 것은 문서작성자에게 맡겨져 있다.
+\ref{sec:summary}절에서 보인 샘플을 참고하라.
 
 \subsubsection{\koTeX 이 아닐 때}
 
 \koTeX\ 문서가 아닐 때는 \pkg{fontspec} 패키지를 이용한다. main font를 위의 글꼴 중의 하나로 하거나(이 때에도 \texttt{[Script=Hangul]} 옵션을 반드시 지정하여야 한다.),
 \cmda{\newfontfamily}로 글꼴 명령을 만들어 쓰거나,
-아니면 한글이 필요한 부분에만 \cmda{\fontspec}으로 글꼴을 지정해주는 것으로 될 것이다.
+아니면 %한글이 필요한 부분에만 \cmda{\fontspec}으로 글꼴을 지정해주는 것으로 될 것이다.
 %\fref{fig:sample}\는 \pkg{article} 문서의 한 예이다.
+\texttt{pmfont} 옵션으로 글꼴을 지정하면 될 것이다.
 다음은 \pkg{article} 문서의 한 예이다.\footnote{폰트에 부여하는
 옵션에 관하여 각주~\ref{fn:fontoption}\을 볼 것.}
+다만 이와 같이 한글 지원 패키지가 전혀 없는 상태에서는 글자 사이의 행나눔이나 양끝맞추기 등 한글 문장 식자에 꼭 필요한 몇 가지 기능이 구현되지 
+않을 것이다. 대체로 몇 자 정도의 한글을 넣어야 하는 때에 유용하리라 본다.
 
 %\begin{figure}
 %\centering
@@ -518,17 +634,11 @@
 \begin{boxedverbatim}
 \documentclass{article}
 \usepackage{fontspec}
-\newfontfamily\hngljmfont{HCR Batang LVT}[Script=Hangul]
-\usepackage{pmhanguljamo}
-\newcommand*\jmhangul[1]{%
-    \begingroup
-    \hngljmfont\jamoword{#1}%
-    \endgroup
-}
+\usepackage[pmfont={Noto Serif KR}]{pmhanguljamo}
 
 \begin{document}
 Say `Hello' in Korean, 
-\jmhangul{an/nyex/ha/sey/yo}.
+\jamoword{an/nyex/ha/sey/yo}.
 \end{document}
 \end{boxedverbatim}
 %\end{boxedminipage}
@@ -545,6 +655,12 @@
 \pkg{polyglossia}를 사용하여 \env{korean} 환경에서
 쓰게 되면 한국어 조판에 필요한 상당한 지원이 이루어진다.
 
+\pkg{polyglossia}에서 한국어 설정을 행한 경우에는 \cmda{\hangulfont}로
+한글 식자를 행하므로 별도로 \texttt{pmfont}를 설정하지 않아도 된다.
+\cmda{\hangulfont}를 지정할 때에 \texttt{[Script=Hangul]}을 빼먹지 않도록 한다.
+그러나 한국어가 mainlanguage라면 \texttt{pmfont}를 이용하여 
+자모 식자를 하도록 강제할 수 있다.
+
 \begin{boxedverbatim}
 \documentclass{article}
 \usepackage{polyglossia}
@@ -560,7 +676,7 @@
 \end{document}
 \end{boxedverbatim}
 
-만약에 \env{korean} 환경이 시작되면 그 안에서는 (무조건) pmjamo 입력 모드가 되도록 하려면
+만약에 \env{korean} 환경이 시작되면 그 안에서는 (무조건) pm 자모 입력 모드가 되도록 하려면
 다음 코드를 preamble에 두면 된다.
 
 \begin{boxedverbatim}
@@ -577,8 +693,8 @@
 \end{korean}
 \end{verbatim}
 
-그러나 위의 처방은 이 환경 안의 모든 로마자가 한글이라는 확신이 있을 때만 적용해야 할 것이다.
-\env{korean} 환경 안에서 로마자를 입력해야 할 일이 있을지 모르기 때문이다. 
+%그러나 위의 처방은 이 환경 안의 모든 로마자가 한글이라는 확신이 있을 때만 적용해야 할 것이다.
+%\env{korean} 환경 안에서 로마자를 입력해야 할 일이 있을지 모르기 때문이다. 
 
 \subsection{훈민정음 어제 서문}
 
@@ -705,7 +821,7 @@
 아래아는 \verb|@|로, 쌍아래아는 \verb|@@|로 적는다. 다른 옛한글 문자는 입력할 수 없다. \\
 \verb|\jamoword{h at ngeul}| \jamoword{h at ngeul}. \\
 \verb|\jamoword{@@nam-eun}| \jamoword{@@nam-eun}. \\
-단 `\jamoword{x@}' 글자만으로 한 단어를 이룰 때 \verb|@| 문자의 성격 때문에 음절이 만들어지지 않을 수 있다. 이럴 때는 \verb|x|를 앞에 붙여 \verb|x@|와 같이 입력한다. 받침이 붙거나 다음 음절이 이어지는 때에는 \verb|x|를 붙일 필요 없다.\\
+단 `\jamoword{x@}' 글자만으로 한 단어를 이룰 때 \verb|@| 문자의 성격 때문에 음절이 만들어지지 않을 수 있다. 이럴 때는 예외적으로 \verb|x|를 앞에 붙여 \verb|x@|와 같이 입력한다. 받침이 붙거나 다음 음절이 이어지는 때에는 \verb|x|를 붙일 필요 없다.\\
 \verb|\jamoword{x@ x@@ @n @@n}|. \jamoword{x@ x@@ @n @@n}.\\
 이로써 이 패키지의 RRK 방식
 입력으로도 제주어를 적을 수 있다. 
@@ -809,6 +925,31 @@
 이런 종류의 문헌을 조판하려면 당연히 \ref{sec:font}절에서 설명한 바,
 옛한글을 지원하는 글꼴이어야 한다.
 
+\section{제주어}
+
+현대 제주어를 식자하려면 아래아(\jmcc{W})가 필요하다. 이 패키지를 
+이용하여 제주어를 식자하는 예를 보이겠다.
+
+\begin{boxedverbatim}
+\jamoword{bu/jeis/jib/i/nan jox/nvm/der h at n x@@/nam/vn d at r/ax sar/gog/.}
+\end{boxedverbatim}
+
+RRK 입력 방식으로는 다음과 같이 된다.
+
+\begin{boxedverbatim}
+\jamoword{bujesjib-inan jongneumdeol h at n @@nam-eun d at l-ang salgog.}
+\end{boxedverbatim}
+
+\begin{quote}
+\jamoword{bujesjib-inan jongneumdeol h at n @@nam-eun d at l-ang salgog.}
+(부잣집이니까 종놈들 한 여남은 데리고 살고)
+\end{quote}
+
+제주특별자치도에서 배포하는 제주서체는 (안타깝지만) 이 패키지와 더불어 사용할 수 없다.
+왜냐하면 제주서체의 아래아 음절은 사용자 정의 영역(PUA)에 완성형 글자로 들어 있기
+때문이다. 그것을 꺼내쓰기 위해서는 폰트의 사용자 영역을 열어놓고 필요한 글자를 가져다 쓰는
+수밖에 없다. 폰트 설계가 만족스럽지 않다고밖에 말할 수 없겠다.
+
 \section{贅辭}
 
 이 패키지를 만들게 된 사연이 이러하다.
@@ -886,6 +1027,9 @@
 \textbullet\ v0.3.6 (2021/09/20): 중성 필러 \verb|*| 추가.
 
 \textbullet\ v0.4 (2021/11/28): 빠진 자모 추가, 훈민정음체 코멘트 추가. RRK 아래아입력 보완.
+
+\textbullet\ v0.5 (2022/09/02): 패키지 옵션 \texttt{pmfont} 추가. jamotext 환경 
+내에서 아스키 에스케이핑.
 %%% APPENDICES
 \ExplSyntaxOn
 \int_new:N \l_appsec_int
@@ -908,11 +1052,11 @@
 모두 설치되어 있어야 컴파일할 수 있다.
 
 \begin{description} \firmlist
-\item[Noto CJK] Noto Serif CJK, Noto Sans CJK, Noto Sans Mono CJK 폰트. \href{https://www.google.com/get/noto/help/cjk/}{Google Noto CJK}.
+\item[Noto CJK] Noto Serif, Noto Sans, Noto Sans Mono CJK 폰트. \href{https://fonts.google.com}{Google Fonts}.
 Adobe사의 \href{https://source.typekit.com/source-han-serif/kr/}{본명조(Source Han Serif)}\cntrdot \href{https://github.com/adobe-fonts/source-han-sans/tree/release/}{본고딕(Source Han Sans)}과 거의 같다.
 \item[함초롬 LVT] 함초롬 바탕 LVT, 함초롬 돋움 LVT. 한글과컴퓨터 \& 한국텍학회. \href{http://wiki.ktug.org/wiki/wiki.php/%ED%95%A8%EC%B4%88%EB%A1%AC%EC%B2%B4LVT}{KTUG:함초롬체 LVT}.
 \item[나눔 옛한글] 나눔명조 옛한글, 나눔바른고딕 옛한글. \href{https://hangeul.naver.com/2014/archaicword}{네이버 한글한글아름답게}.
-\item[KoPubWorld] KoPubWorld 바탕, KoPubWorld 돋움. \href{http://www.kopus.org/biz/electronic/font.aspx}{한국출판인회의}.
+\item[KoPubWorld] KoPubWorld 바탕, KoPubWorld 돋움. \href{https://www.kopus.org/biz-electronic-font2/}{한국출판인회의}.
 \item[맑은 고딕] Windows 8 이후 한글 Windows 폰트. 마이크로소프트. 
 \item[은 글꼴] 은 바탕 \TeX\,Live 배포 서체.
 \item[한컴 훈민정음 세로쓰기체] 한컴 배포 서체.

Modified: trunk/Master/texmf-dist/tex/latex/pmhanguljamo/pmhanguljamo-rrk.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pmhanguljamo/pmhanguljamo-rrk.sty	2022-09-03 19:48:22 UTC (rev 64278)
+++ trunk/Master/texmf-dist/tex/latex/pmhanguljamo/pmhanguljamo-rrk.sty	2022-09-03 19:48:40 UTC (rev 64279)
@@ -1,9 +1,10 @@
 %
 % subroutines of pmhanguljamo.sty
-%.  v0.3.2 (2020/02/05)
-%.  v0.3.3 (2020/03/09)
-%.  v0.3.4 (2020/03/15)
-%	v0.4   (2021/11/28)
+%  v0.3.2 (2020/02/05)
+%  v0.3.3 (2020/03/09)
+%  v0.3.4 (2020/03/15)
+%  v0.4   (2021/11/28)
+%  v0.5   (2022/09/02)
 %
 \seq_new:N \l_textjm_seq
 
@@ -10,22 +11,63 @@
 \NewDocumentEnvironment { jamotext } { +b }
 {
 	\seq_set_split:Nnn \l_textjm_seq {\par} { #1 }
-	\seq_indexed_map_inline:Nn \l_textjm_seq
+	\seq_map_indexed_function:NN \l_textjm_seq \jamo_word_rrk:nn
+%	\seq_map_indexed_inline:Nn \l_textjm_seq
+%	{
+%		\jamoword { ##2 }
+%		\int_compare:nT { ##1 < \seq_count:N \l_textjm_seq }
+%		{
+%			\par
+%		}
+%	}
+}{}
+
+\cs_new:Npn \jamo_word_rrk:nn #1 #2
+{
+%	\jamoword { #2 }
+	\seq_set_split:Nnn \l_inparpar_seq { ~ } { #2 }
+	
+	\seq_map_indexed_inline:Nn \l_inparpar_seq
 	{
-		\jamoword { ##2 }
-		\int_compare:nT { ##1 < \seq_count:N \l_textjm_seq }
+		\regex_match:nnTF { ^\!\{ } { ##2 }
 		{
-			\par
+			\tl_set:Nn \l_tmpa_tl { ##2 }
+			\regex_match:nnTF { ^\!\{(.+?)\}$ } { ##2 }
+			{
+				\regex_replace_once:nnN { ^\!\{(.+?)\}$ } { \1 } \l_tmpa_tl
+				\l_tmpa_tl 
+			}
+			{
+				\tl_set_eq:NN \l_tmpb_tl \l_tmpa_tl
+				\regex_replace_once:nnN { ^\!\{(.+?)\}(.*)$ } { \1 } \l_tmpa_tl
+				\l_tmpa_tl 
+				\regex_replace_once:nnN { ^\!\{(.+?)\}(.*)$ } { \2 } \l_tmpb_tl
+				\exp_args:No \jamoword { \l_tmpb_tl }
+			}	
 		}
+		{
+			\jamoword{ ##2 }
+		}
+		
+		\int_compare:nT { ##1 < \seq_count:N \l_inparpar_seq }
+		{ \space }
 	}
-}{}
 
+	\int_compare:nT { #1 < \seq_count:N \l_textjm_seq }
+	{ \par }
+}
+
+
 \tl_new:N \l_tmpz_tl
 
 \NewDocumentCommand \jamoword { m }
 {
+  \group_begin:
+  \bool_if:NT \opt_usepmfont_bool
+  { \pm_hangulfontspec[Script=Hangul,Renderer=OpenType] {\opt_pmfont_tl } }
+  
 	\seq_set_split:Nnn \l_tmpa_seq { ~ } { #1 }
-	\seq_indexed_map_inline:Nn \l_tmpa_seq
+	\seq_map_indexed_inline:Nn \l_tmpa_seq
 	{
 		\tl_set:Nn \l_tmpz_tl { ##2 }
 		\exp_args:No \str_if_in:nnT { \l_tmpz_tl } { - }
@@ -70,6 +112,7 @@
 			\space
 		}
 	}
+	\group_end:
 }
 
 \cs_new:Npn \rrk_fn_outer:n #1

Modified: trunk/Master/texmf-dist/tex/latex/pmhanguljamo/pmhanguljamo.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pmhanguljamo/pmhanguljamo.sty	2022-09-03 19:48:22 UTC (rev 64278)
+++ trunk/Master/texmf-dist/tex/latex/pmhanguljamo/pmhanguljamo.sty	2022-09-03 19:48:40 UTC (rev 64279)
@@ -2,7 +2,7 @@
 %%
 %% Poorman's Hangul Jamo Input Method.
 %%
-%% (C) 2020-2021 Kangsoo Kim
+%% (C) 2020-2022 Kangsoo Kim
 %%
 %% This work may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License, either version 1.3
@@ -16,22 +16,29 @@
 %% 
 %% The Current Maintainer of this work is Kangsoo Kim
 %%
-%% This work consists of the file pmhanguljamo.sty, pmhanguljamo-rrk.sty
+%% This work consists of the style files --- pmhanguljamo.sty, pmhanguljamo-rrk.sty,
 %% and the documentation files pmhanguljamo-doc.tex and pmhanguljamo-doc.pdf.
 %%
 \RequirePackage{xparse}
 \ProvidesExplPackage
 	{pmhanguljamo}
-	{2021/11/28}
-	{v0.4}
+	{2022/09/02}
+	{v0.5}
 	{Poorman's Hangul Jamo Input Method}
 
 \RequirePackage{l3keys2e}
 
+\bool_new:N \opt_usepmfont_bool
+\tl_new:N \opt_pmfont_tl
+
 \keys_define:nn { pmhanguljamo }
 {
 	rrk	.bool_set:N = \opt_rrkopt_bool,
-	RRK	.bool_set:N = \opt_rrkopt_bool
+	RRK	.bool_set:N = \opt_rrkopt_bool,
+	pmfont	.code:n = {
+		\bool_gset_true:N \opt_usepmfont_bool
+		\tl_gset:Nn \opt_pmfont_tl { #1 }
+	}
 }
 
 \ProcessKeysOptions { pmhanguljamo }
@@ -157,6 +164,26 @@
 	\makebox[\l_tmpa_dim][c]{ \char"318D\kern-.6em\char"318D }
 }
 
+%%%% usepmfont macro
+
+\cs_if_exist:NTF \hangulfontspec
+{
+	\cs_set_eq:NN \pm_hangulfontspec \hangulfontspec
+}
+{
+	\cs_set_eq:NN \pm_hangulfontspec \fontspec
+}
+
+\NewDocumentCommand \usepmfont { }
+{
+	\bool_gset_true:N \opt_usepmfont_bool
+}
+
+\NewDocumentCommand \setpmhangulfont { m }
+{
+	\tl_gset:Nn \opt_pmfont_tl { #1 }
+}
+
 %%%% if RRK is given, then input pmhanguljamo-rrk.sty
 %%%% and stop.
 
@@ -179,7 +206,7 @@
 	
 	\exp_args:Nno \regex_split:nnN { / } { \l_tmpa_tl } \l_tmpa_seq
 	
-	\seq_indexed_map_function:NN \l_tmpa_seq \build_syl:nn
+	\seq_map_indexed_function:NN \l_tmpa_seq \build_syl:nn
 }
 
 \tl_new:N \l_cho_tl
@@ -192,9 +219,9 @@
 \NewDocumentEnvironment { jamotext } { +b }
 {
 	\seq_set_split:Nnn \l_inputpar_seq { \par } { #1 }
-	\seq_indexed_map_function:NN \l_inputpar_seq \jamo_word:nn
+	\seq_map_indexed_function:NN \l_inputpar_seq \jamo_word:nn
 %	\seq_set_split:Nnn \l_inputword_seq { ~ } { #1 }
-%	\seq_indexed_map_inline:Nn \l_inputword_seq
+%	\seq_map_indexed_inline:Nn \l_inputword_seq
 %	{
 %		\jamotextcmd { ##2 }
 %		\int_compare:nT { ##1 < \seq_count:N \l_inputword_seq }
@@ -204,7 +231,35 @@
 
 \cs_new:Npn \jamo_word:nn #1 #2
 {
-	\jamoword { #2 }
+%	\jamoword { #2 }
+	\seq_set_split:Nnn \l_inparpar_seq { ~ } { #2 }
+	
+	\seq_map_indexed_inline:Nn \l_inparpar_seq
+	{
+		\regex_match:nnTF { ^\!\{ } { ##2 }
+		{
+			\tl_set:Nn \l_tmpa_tl { ##2 }
+			\regex_match:nnTF { ^\!\{(.+?)\}$ } { ##2 }
+			{
+				\regex_replace_once:nnN { ^\!\{(.+?)\}$ } { \1 } \l_tmpa_tl
+				\l_tmpa_tl 
+			}
+			{
+				\tl_set_eq:NN \l_tmpb_tl \l_tmpa_tl
+				\regex_replace_once:nnN { ^\!\{(.+?)\}(.*)$ } { \1 } \l_tmpa_tl
+				\l_tmpa_tl 
+				\regex_replace_once:nnN { ^\!\{(.+?)\}(.*)$ } { \2 } \l_tmpb_tl
+				\exp_args:No \jamoword { \l_tmpb_tl }
+			}	
+		}
+		{
+			\jamoword{ ##2 }
+		}
+		
+		\int_compare:nT { ##1 < \seq_count:N \l_inparpar_seq }
+		{ \space }
+	}
+
 	\int_compare:nT { #1 < \seq_count:N \l_inputpar_seq }
 	{ \par }
 }
@@ -212,9 +267,11 @@
 \NewDocumentCommand \jamoword { m }
 {
 	\seq_set_split:Nnn \l_inputword_seq { ~ } { #1 }
-	\seq_indexed_map_inline:Nn \l_inputword_seq
+	\seq_map_indexed_inline:Nn \l_inputword_seq
 	{
-		\jamotextcmd { ##2 }
+		\bool_if:NTF \opt_usepmfont_bool
+		{ {\pm_hangulfontspec[Script=Hangul,Renderer=OpenType]{\opt_pmfont_tl} \jamotextcmd{ ##2 } } }
+		{ \jamotextcmd { ##2 } }
 		\int_compare:nT { ##1 < \seq_count:N \l_inputword_seq }
 		{ \space }
 	}



More information about the tex-live-commits mailing list.