KTUGFaq

KTUG FAQ

XeTeX (rev. 1.26)

·Î±×ÀÎ:
ºñ¹Ð¹øÈ£:
°¡ÀÔ
You like to form new friendships and make new acquaintances.
FrontPage › XeTeX

Jonathan Kew°¡ ¸¸µç »õ·Î¿î °³³äÀÇ TeX ½Ã½ºÅÛ. OS¿¡ ¼³Ä¡µÈ ÆùÆ®¸¦ TeX ½ÄÀÚ¿¡ Á÷Á¢ ÀÌ¿ëÇÒ ¼ö ÀÖ´Ù. Mac OS X¿ëÀ̸ç, Mac¿ë°ú´Â Á¶±Ý ´Ù¸¥ ¶óÀ̺귯¸®¸¦ ¾²Áö¸¸ ±â´ÉÀº °ÅÀÇ µ¿ÀÏÇÑ Linux ¹öÀüÀÌ °³¹ßÁßÀÌ´Ù. Windows¿ëÀº Linux ¹öÀüÀ» Win32 ÇÁ·Î±×·¥À¸·Î portingÇÑ °ÍÀ¸·Î ÇöÀç´Â W32TeX¿¡ Å×½ºÆ® ¹öÀüÀÌ Æ÷ÇԵǾî ÀÖ´Ù.

¸ñÂ÷

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

1 Mac OS X

1.1 XeLaTeX ÇÑ±Û Ç¥Çö

ÇѱÛÀ» ½ÄÀÚÇÏ´Â Å×½ºÆ®.
\begin{filecontents}{xetexlogo.sty} % Define the \XeTeX logo: \def\reflect#1{% {\setbox0=\hbox{#1}\rlap{\kern0.5\wd0 \special{x:gsave}\special{x:scale -1 1}}\box0 \special{x:grestore}}% } \def\XeTeX{\leavevmode \setbox0=\hbox{X\lower.5ex\hbox{\kern-.15em\reflect{E}}\kern-.1667em \TeX}% \dp0=0pt\ht0=0pt\box0 } \def\XeLaTeX{\leavevmode \setbox0=\hbox{X\lower.5ex\hbox{\kern-.15em\reflect{E}}\kern-.0833em \LaTeX}% \dp0=0pt\ht0=0pt\box0 } \end{filecontents} \documentclass{article} \usepackage{xetexlogo} \usepackage{fontspec} %\setromanfont{AppleMyungjo\space Regular} \setromanfont{UnBatang} \setsansfont{UnDotum} \setmonofont[Scale=0.9]{UnTaza} \usepackage[dvipdfm,bookmarks=false]{hyperref} \title{\XeTeX ¿¡¼­ ÇÑ±Û Ç¥Çö} \author{³ë¹Ùµð} \date{2006³â 3¿ù} \begin{document} \maketitle %% ÇÑ±Û ÁÙ¹Ù²Þ \XeTeXlinebreaklocale "ko" \XeTeXlinebreakskip = 0pt plus 1pt \section{ÆùÆ® ¼±ÅÃÇϱâ}%\bookmark{ÆùÆ® ¼±ÅÃÇϱâ} \XeLaTeX ¿¡¼­ ÇѱÛÀ» ¾²´Â °¡Àå ½¬¿î ¹æ¹ýÀº {\fontspec{AppleGothic\space Regular}Àª ·Î¹öÃù}ÀÇ \texttt{fontspec} ÆÐÅ°Áö¸¦ ÀÌ¿ëÇÏ´Â °ÍÀÌ´Ù. \begin{verbatim} \usepackage{fontspec} \setromanfont{AppleMyungjo\space Regular} \end{verbatim} preamble¿¡ À§¿Í °°ÀÌ ½á³ÖÀ¸¸é µ¿¾Æ½Ã¾Æ ÆùÆ®¸¦ ±âº» ±Û²Ã·Î »ç¿ëÇÒ ¼ö ÀÖ´Ù. \section{CJK ÅؽºÆ® ÀÔ·ÂÇϱâ} \textsf{¹®¼­ ±âº» ÆùÆ®}¸¦ 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}

°á°ú
xetextst.jpg

1.2.1 install °úÁ¤

  1. °£´ÜÈ÷ 'MacTeX'À» ´Ù¿î ¹Þ¾Æ ¼³Ä¡Çϰųª
  2. 'i-installer'¸¦ ÀÌ¿ëÇÏ¿©
  3. ¸¦ ¼³Ä¡ÇÕ´Ï´Ù. ÀÌ·¸°Ô Çϸé /usr/local/teTeX/share/texmf.local/web2c/cont-en.fmt ÀÌ »ý±é´Ï´Ù. ±×·±µ¥ XeTeX+ConTeXt¸¦ »ç¿ëÇϱâ À§Çؼ­´Â ÀÌ°ÍÀ» /usr/local/teTeX/share/texmf.local/web2c/pdfetex/cont-en.fmt ¿¡ ¿Å°ÜÁÝ´Ï´Ù.
  4. Uploads:type-xkor.texÀ» ~/Library/texmf/tex/xetex/ ¿¡ ÀúÀåÇÕ´Ï´Ù. ÀÌ ÆÄÀÏÀÇ À̸§Àº Àû´çÈ÷ Á¤Çϼŵµ µË´Ï´Ù. ±×¸®°í ³»¿ë¿¡ ÀÖ´Â typescript ¿¡´Â ½Ã½ºÅÛ ÆùÆ®¿¡ ÀÖ´Â ÇѱÛÀ̸§À» Àû¾îÁÖ¼Å¾ß ÇÕ´Ï´Ù. ÀÌ ÆÄÀÏÀº Adam LindsayÀÇ µµ¿òÀ¸·Î ¸¸µé¾ú½À´Ï´Ù.
  5. sudo texexec --make --xtx en
    • /usr/local/teTeX/share/texmf.local/web2c/xetex/cont-en.fmt ÀÌ »ý±é´Ï´Ù.
  6. À§ÀÇ °úÁ¤ÀÌ ³¡³ª¸é ´ÙÀ½°ú °°ÀÌ ¿¹Á¦¸¦ ÀÛ¼ºÇÏ¿© "filename.tex"À» utf-8 no BOMÀ¸·Î ÀúÀåÇÏ°í
    \usetypescriptfile[type-xkor] 
    \usetypescript[myface]
    \XeTeXlinebreaklocale[ko]
    \setupbodyfont[Myface, 10pt, ss] 
    \starttext 
    
    ÇÑ±Û Å×½ºÆ®ÀÔ´Ï´Ù. 
    
    \stoptext
  7. texexec --xtx filename ÀÌÈÄ 'xdvipdfmx fimename.xdv'·Î compileÇÏ¿© testÇÕ´Ï´Ù.

1.2.2 Âü°í

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
¿Í °°ÀÌ ÇÕ´Ï´Ù...

3 XeTeX for Windows

  • W32TeX¿¡ XeTeX/LinuxÀÇ Å×½ºÆ® ¹öÀüÀÌ Win32·Î Æ÷ÆõǾî ÀÖÀ½.
  • Zapfino OpenType ±Û²ÃÀ» ÀÌ¿ëÇÑ Å×½ºÆ®

4 XeTeX in KTUGCollection2006

  • KTUGCollection2006¿¡´Â W32TeXÀÇ ¹ÙÀ̳ʸ®¿Í ÇÑ±Û ÆùÆ® ¼³Á¤ ÆÄÀϵéÀ» Æ÷ÇÔÇÏ¿©, º°µµÀÇ Ãß°¡ ¼³Ä¡ ¾øÀÌ ÇѱÛÀ» Å×½ºÆ®ÇÒ ¼ö ÀÖ´Ù.

5 XeTeX À» ¿©·¯Ç÷§Æû¿¡¼­ µ¿½Ã¿¡ »ç¿ëÇϱâ

  • KTUGOperate:19096
  • ´ÙÀ½°ú °°Àº ´Ü°è¸¦ °ÅÄ£´Ù.
    • ifxetexsystem.sty ¸¸µé±â
      \RequirePackage{ifXeTeX}
      \newif\ifMac\Macfalse\newif\ifPC\PCtrue
      \IfFileExists{thissystem.cfg}{\input thissystem.cfg}{\PCtrue}
      \endinput
      
    • thissystem.cfg ¸¸µé±â
      \Mactrue\PCfalse
      
    • source ¸¸µé±â
      \usepackage{ifxetexsystem}
      \ifXeTeX
      \usepackage{fontspec}
      \ifPC
       \setromanfont{ÇÑ°Ü·¹°áü}
      \else\ifMac
       \setromanfont{Apple\space Myoungjo}
      \else
       \setromanfont{Àº\space ¹ÙÅÁ}
      \fi\fi
      \fi
      
ÀÌ·¸°Ô .sty¿Í .cfg¸¦ ¸¸µé¾î¼­ texmf tree ¾Æ·¡ °¡Á®´ÙµÎ°í ¼Ò½º´Â À§ÀÇ ¿¹½Ã ó·³ ÇÏ¸é µÈ´Ù.

6 Âü°í¹®¼­