KTUGFaq

KTUG FAQ

XeTeX (rev. 1.13)

·Î±×ÀÎ:
ºñ¹Ð¹øÈ£:
°¡ÀÔ
To laugh at men of sense is the privilege of fools.
FrontPage › XeTeX

Mac OS X¿¡¼­ ½ÇÇàµÇ´Â »õ·Î¿î °³³äÀÇ TeX ½Ã½ºÅÛ.

¸ñÂ÷

1 XeLaTeX ÇÑ±Û Ç¥Çö
2 XeTeX + ConTeXt
3 endash, emdash, mapping
4 Âü°í¹®¼­

1 XeTeX + LaTeX ÇÑ±Û Ç¥Çö

ÇѱÛÀ» ½ÄÀÚÇÏ´Â Å×½ºÆ®.
\documentclass{article}
 
\usepackage{fontspec}
\setromanfont{AppleMyungjo\space Regular}
\setmonofont[Scale=0.8]{AppleGothic\space Regular}

\XeTeXlinebreakskip = 0pt plus 1pt

\section{ÆùÆ® ¼±ÅÃÇϱâ}
°¡Àå ½¬¿î ¹æ¹ýÀº Àª ·Î¹öÃùÀÇ \texttt{fontspec} ÆÐÅ°Áö¸¦ ÀÌ¿ëÇÏ´Â °ÍÀÌ´Ù.
\begin{verbatim}
\usepackage{fontspec}
\setromanfont{AppleMyungjo\space Regular}
\end{verbatim}
preamble¿¡ À§¿Í °°ÀÌ ½á³ÖÀ¸¸é µ¿¾Æ½Ã¾Æ ÆùÆ®¸¦ ±âº» ±Û²Ã·Î »ç¿ëÇÒ ¼ö ÀÖ´Ù.

\section{CJK ÅؽºÆ® ÀÔ·ÂÇϱâ}
¹®¼­ ±âº» ÆùÆ®¸¦ CJK ÆùÆ®·Î ÇÏ´Â °Íº¸´Ù ÀϺΠCJK ÅؽºÆ®°¡ µé¾î°¡´Â °÷¸¸
ÆùÆ®¸¦ ¹Ù²ãÁÖ´Â ¹æ¹ýÀÌ ÀÖ´Ù. À̸¦ À§Çؼ­ CJK ȯ°æÀ» ´ÙÀ½°ú °°ÀÌ Á¤ÀÇÇÏÀÚ.
\begin{verbatim}
\newenvironment{CJK}{\fontspec[Scale=0.9]{AppleGothic\space Regular}}{}
\newcommand{\cjk}[1]{{\fontspec[Scale=0.9]{AppleGothic\space Regular}#1}}
\end{verbatim}
ÀÌÁ¦ CJK ȯ°æ¿¡ ÀÇÇÏ¿© CJK ÅؽºÆ®¸¦ ½ÄÀÚÇÒ ¼ö ÀÖ´Ù. ¸¶Âù°¡Áö·Î À§ÀÇ
Á¤ÀÇ¿¡ µû¶ó \verb|\cjk| ¸í·Éµµ »ç¿ë °¡´ÉÇÏ´Ù.
\end{document}
°á°ú

xetexviewer.png

2.1 install °úÁ¤

  1. i-installer¸¦ ÀÌ¿ëÇÏ¿©
  2. ¸¦ ¼³Ä¡ÇÕ´Ï´Ù. ÀÌ·¸°Ô Çϸé /usr/local/teTeX/share/texmf.local/web2c/cont-en.fmt ÀÌ »ý±é´Ï´Ù. ±×·±µ¥ XeTeX+ConTeXt¸¦ »ç¿ëÇϱâ À§Çؼ­´Â ÀÌ°ÍÀ» /usr/local/teTeX/share/texmf.local/web2c/pdfetex/cont-en.fmt ¿¡ ¿Å°ÜÁÝ´Ï´Ù.

  3. `sudo texexec --make --xtx en ` À» Çϸé /usr/local/teTeX/share/texmf.local/web2c/xetex/cont-en.fmt ÀÌ »ý±é´Ï´Ù.

  4. Uploads:type-xkor.texÀ» ~/Library/texmf/tex/xetex/ ¿¡ ÀúÀåÇÕ´Ï´Ù. ÀÌ ÆÄÀÏÀÇ À̸§Àº Àû´çÈ÷ Á¤Çϼŵµ µË´Ï´Ù. ±×¸®°í ³»¿ë¿¡ ÀÖ´Â typescript ¿¡´Â ½Ã½ºÅÛ ÆùÆ®¿¡ ÀÖ´Â ÇѱÛÀ̸§À» Àû¾îÁÖ¼Å¾ß ÇÕ´Ï´Ù. ÀÌ ÆÄÀÏÀº Adam LindsayÀÇ µµ¿òÀ¸·Î ¸¸µé¾ú½À´Ï´Ù.

  5. º»¹®¿¡
    \usetypescriptfile[type-xkor] 
    \usetypescript[myface] 
    \setupbodyfont[Myface, 10pt, rm] 
    
    À» Àû¾îÁÝ´Ï´Ù.

  6. ÆÄÀÏÀÇ ÀúÀåÀº utf-8 no BOMÀ¸·Î ÇÏ¸é µË´Ï´Ù.
  7. texexec --xtx filename À¸·Î compile ÇÕ´Ï´Ù.

2.2 ¿¹Á¦

\usetypescriptfile[type-xkor] 
\usetypescript[myface] 

\setupbodyfont[Myface, 10pt, rm] 

\starttext 

ÇÑ±Û Å×½ºÆ®ÀÔ´Ï´Ù. 

\stoptext 

2.3 Âü°í

Apple ¸íÁ¶¿Í Apple °íµñÀ» ¾²±âÀ§Çؼ­´Â ´ÙÀ½À» type-xkor.tex¿¡¼­
\starttypescript[serif][myungjo][uc] 
% Regular variant: 
\definefontsynonym[MyungjoRegular][(AppleMyungjo\space Regular)][encoding=uc] 
\definefontsynonym[MyungjoBold][(AppleMyungjo\space Regular)][encoding=uc] 
\definefontsynonym[MyungjoLight][(AppleMyungjo\space Regular)][encoding=uc] 
\stoptypescript 
% Start another typescript that associates generic names with 
% mid-level names: 
\starttypescript[serif][myungjo][name] 
\definefontsynonym[Serif][MyungjoRegular] 
\definefontsynonym[SerifBold][MyungjoBold] 
\definefontsynonym[SerifItalic][MyungjoLight] 
\stoptypescript 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\starttypescript[sans][gothic][uc] 
% Regular variant: 
\definefontsynonym[GothicRegular][(AppleGothic\space Regular)][encoding=uc] 
\definefontsynonym[GothicBold][(AppleGothic\space Regular)][encoding=uc] 
\definefontsynonym[GothicLight][(AppleGothic\space Regular)][encoding=uc] 
\stoptypescript 
% Start another typescript that associates generic names with 
% mid-level names: 
\starttypescript[sans][gothic][name] 
\definefontsynonym[Sans][GothicRegular] 
\definefontsynonym[SansBold][GothicBold] 
\definefontsynonym[SansItalic][GothicLight] 
\stoptypescript 
  
Ãß°¡ÇÏ°í
%Start a convenience typescript that ties it all together:
\starttypescript[myface]
\definetypeface[Myface][rm][serif][myungjo][default][encoding=uc] 
\definetypeface[Myface][ss][sans][gothic][default][encoding=uc] 
 % \definetypeface[Myface][ss][sans][yoonche][default][encoding=uc]
 %\definetypeface[Myface][tt][mono][type][default][encoding=uc]
 % \definetypeface [Myface][mm][math,boldmath] [lucida] [default] [encoding=uc] 
\stoptypescript
¿Í °°ÀÌ ¼öÁ¤ÇÕ´Ï´Ù...