KTUGFaq

KTUG FAQ

·Î±×ÀÎ:
ºñ¹Ð¹øÈ£:
°¡ÀÔ
You will meet an important person who will help you advance professionally.
FrontPageMacTeX › PDFHyperLink
PDF / PDF ÇÏÀÌÆÛ¸µÅ©

PDF ÇÏÀÌÆÛ¸µÅ©¸¦ À§Çؼ­´Â HyperRef ÆÐÅ°Áö¸¦ ÀÌ¿ëÇÑ´Ù.

¸ñÂ÷

1 hyper-ÂüÁ¶
1.1 \href ¸í·É
1.1.1 \href ¸í·ÉÀ» ÀÌ¿ëÇؼ­ url ¸µÅ©Çϱâ
1.1.2 \href ¸í·ÉÀ» ÀÌ¿ëÇؼ­ pdf ÆÄÀÏ ¸µÅ©Çϱâ
1.1.3 \href ¸í·ÉÀ» ÀÌ¿ëÇؼ­ ÇÁ·Î±×·¥ ½ÇÇà½ÃÅ°±â
1.1.4 ±âŸ À¯¿ëÇÑ ±â´Éµé
1.2 \hyperref ¸í·É
1.3 \hypertarget°ú \hyperlink
1.4 \url ¸í·É
1.5 breakurl
2 Colorlink
3 TIP : link to external file
3.1 xr-hyper
3.2 xr-hyper ¾øÀÌ ¿ÜºÎ ÆÄÀÏÀÇ Æ¯Á¤ À§Ä¡ ¸µÅ©

1 hyper-ÂüÁ¶

1.1 \href ¸í·É

1.1.1 \href ¸í·ÉÀ» ÀÌ¿ëÇؼ­ url ¸µÅ©Çϱâ

\href{URL}{text}
  • URLÀº Full URLÀ̾î¾ß ÇÑ´Ù. ¿¹¸¦ µé¸é, http://www.ktug.or.kr/. ¶Ç, ~ ¹®ÀÚ¿Í # ¹®ÀÚ´Â LaTeXÀÇ »ç¿ë¹æ½ÄÀ¸·Î ¾²ÀÌÁö ¾Ê°í URLÀÇ ÀϺηΠ¹Þ¾Æµé¿©Áø´Ù.
  • baseurl ¿É¼ÇÀ» ¼³Á¤ÇÑ °æ¿ì¶ó¸é baseurl¿¡ ´ëÇÑ »ó´ë ÁÖ¼Ò ÀÔ·ÂÀÌ °¡´ÉÇÏ´Ù.
    \hypersetup{baseurl={http://www.ktug.or.kr}}
    
    \href{document.php}{KTUG Documents}
    
  • baseurlÀ» ¼³Á¤ÇÒ ¶§ \hyperbaseurl{URL} ¸í·ÉÀ» ¾µ ¼öµµ ÀÖ´Ù.

1.1.2 \href ¸í·ÉÀ» ÀÌ¿ëÇؼ­ pdf ÆÄÀÏ ¸µÅ©Çϱâ

  • href ¸¦ ÀÌ¿ëÇÏ¿© ÀÎÅÍ³Ý »Ó¸¸ ¾Æ´Ï¶ó ·ÎÄà µð·ºÅ丮¿¡ ÀÖ´Â ÆÄÀϵµ ¿¬°áÇÏ´Â °ÍÀÌ °¡´ÉÇÏ´Ù. ·ÎÄà µð·ºÅ丮ÀÇ °æ¿ì »ó´ë °æ·Î¸¦ ÁöÁ¤ÇÏ´Â °ÍÀÌ °¡´ÉÇÏ´Ù.
    • »ó´ë µð·ºÅ丮¸¦ ÁöÁ¤ÇÏ´Â °æ¿ì °æ¿ì \usepackage[dvipdfm]{hyperref} ó·³ µå¶óÀ̹ö¸¦ ÁöÁ¤ÇØ ÁÖ¾î¾ß ÇÑ´Ù.
    • ½ÇÁ¦ »ç¿ëÀº ´ÙÀ½°ú °°´Ù. ¿¹Á¦ ÆÄÀÏÀ» º¸·Á¸é \href{./example/heading1.pdf}{¿¹Á¦ÆÄÀÏ}¸¦ Âü°íÇϱ⠹ٶõ´Ù
  • ÀÌ°æ¿ì pdf ÆÄÀϸ¸ ¸µÅ©°¡ µÈ´Ù. ÀÓÀÇÀÇ ÆÄÀÏÀ̳ª µð·ºÅ丮¸¦ ¸µÅ©ÇÏ°í ½ÍÀº °æ¿ì¿¡´Â \url ¸í·ÉÀ» »ç¿ëÇÑ´Ù.
  • pdf ÆÄÀÏÀÇ À̸§¿¡ Á¡ÀÌ µÎ°³ ÀÌ»ó ÀÖ´Â °æ¿ì(¿¹¸¦ µé¾î¼­ abc.tex.pdf)¿¡µµ \url ¸í·ÉÀ» »ç¿ëÇÑ´Ù.

1.1.3 \href ¸í·ÉÀ» ÀÌ¿ëÇؼ­ ÇÁ·Î±×·¥ ½ÇÇà½ÃÅ°±â

  • KTUGOperate:14591ÂüÁ¶
  • texdof hyperref ¸í·ÉÀ» pdf »ó¿¡¼­ ½ÇÇàÇÏ°í ½ÍÀº °æ¿ìÀÇ ¿¹
    \documentclass{article}
    \usepackage[dvipdfm]{hyperref}
    
    \begin{document}
    
    Run external program, \href{run:texdoc#hyperref}{Click here}.
    
    \end{document}
    


  • python script ¸¦ ½ÇÇà½ÃÅ°°í ½ÍÀº ¿¹
    \href{run:pythonw#test.py}{Python Code}
    
    • °á°ú´Â ÆÄÀÏ·Î ÀúÀåÇϵµ·Ï ¸®´ÙÀÌ·ºÆ®Çصξú´Ù°¡ ÇÊ¿äÇÏ¸é ¿¹ÄÁ´ë
      \href{run:notepad#result.txt}{View Result} 
      ÀÌ·± ½ÄÀ¸·Î º¼ ¼ö ÀÖ°Ô ÇÒ ¼ö ÀÖ´Ù.

  • ¸®´ÙÀÌ·º¼Ç ¸í·ÉÀº ¿©±â¼­´Â Àß µÇÁö ¾Ê´Â´Ù. Áï, \href{run:dir > out.txt}{...} ¿Í °°ÀÌ´Â µÇÁö ¾Ê´Â´Ù. ±×·¯¹Ç·Î, ¿¹ÄÁ´ë ´ÙÀ½ ÄÚµå ó·³ ÇÑ´Ù.
    \documentclass{article}
    \usepackage[dvipdfm]{hyperref}
    
    \begin{document}
    
    Run external program, \href{run:dir.bat}{Click here}.
    
    \href{run:notepad#out.txt}{View Result}
    
    \end{document}
    
    ÀÌ°ÍÀ» ½ÇÇàÇϱâ À§Çؼ­´Â dir > out.txt ¸¦ ³»¿ëÀ¸·Î ÇÏ´Â
dir.bat ÆÄÀÏÀÌ °°Àº µð·ºÅ丮¿¡ ÀÖ¾î¾ß ÇÑ´Ù. Áï, ÆÄÀÏ·ÎÀÇ ¸®´ÙÀÌ·º¼ÇÀº ÇÁ·Î±×·¥(½ºÅ©¸³Æ®) ÀÚü¿¡¼­ ±¸ÇöµÇ¾î¾ß ÇÑ´Ù.

1.1.4 ±âŸ À¯¿ëÇÑ ±â´Éµé

redirection ÀÇ °³³äÀ» ±¸ÇöÇϴµ¥ À־ ´ÙÀ½°ú °°Àº ¹æ¹ýµµ ÀÖ´Ù.

\documentclass{article}
\usepackage{hangul}
\usepackage{sverb}

\begin{document}

%ÀÌ µð·ºÅ丮ÀÇ ÆÄÀϵéÀÇ ³»¿ëÀ» Àд´Ù. 

\immediate\write18{ls -l > tmp.txt}
\verbinput{tmp.txt}

\end{document}

ÀÌ ÆÄÀÏÀ» ÄÄÆÄÀÏÇÒ ¶§´Â ´ÙÀ½°ú °°ÀÌ ÇÏ¿©¾ß °á°ú¸¦ ¾òÀ» ¼ö ÀÖ½À´Ï´Ù.

#> latex -enable-write18 foo

1.2 \hyperref ¸í·É

ÀÌ ¸í·ÉÀº ÁÖ·Î ³»ºÎ ¸í·ÉÀ¸·Î ¾²ÀÌÁö¸¸ ÇÊ¿äÇÏ´Ù¸é ´ÙÀ½ Çü½ÄÀ¸·Î »ç¿ëÇÏ´Â °ÍÀÌ °¡´ÉÇÏ´Ù.
\hyperref{URL}{category}{name}{text}
  • text´Â URL#category.nameÀ» ÂüÁ¶ÇÏ¿© ¸µÅ©µÈ´Ù.

1.3 \hypertarget°ú \hyperlink

ÀÓÀÇÀÇ ÅؽºÆ® À§Ä¡¿¡ ÇÏÀÌÆÛ¸µÅ©µÉ Ÿ°ÙÀ» ¸¸µé°í ±×°ÍÀ» ÂüÁ¶ÇÒ ¼ö ÀÖ´Ù.
\hyperlink{myhptarget}{see MyTarget}
.........
\hypertarget{myhptarget}{text} will be referred and linked.

1.4 \url ¸í·É

  • \usepackage{url}ÇÏÁö ¸»°í ±âÁ¸ÀÇ \usepackage[dvipdfm,colorlinks]{hyperref} ó·³ ±âÁ¸ÀÇ hyperref ÆÐÅ°Áö¸¦ dvipdfm µå¶óÀ̹ö¸¦ ¿É¼ÇÀ¸·Î »ç¿ëÇÑ´Ù.
  • \url ¸í·ÉÀº \href ¿Í ºñ½ÁÇÏÁö¸¸ ´ÙÀ½°ú °°Àº ÀÏÀ» ÇÒ ¼ö ÀÖ´Ù.
    1. pdf ÆÄÀÏ »Ó¸¸ ¾Æ´Ï¶ó ÀÓÀÇÀÇ ÆÄÀÏÀ» ¸µÅ©ÇÒ ¼ö ÀÖ´Ù.
    2. . ÀÌ µÎ°³ÀÖ´Â pdf ÆÄÀϵµ ¸µÅ©ÇÒ ¼ö ÀÖ´Ù. ¿¹¸¦ µé¾î¼­ abc.tex.pdf ¿Í °°Àº ÆÄÀÏÀ» ¸µÅ©ÇÒ ¼ö ÀÖ´Ù.
    3. ½ÇÇàÆÄÀÏÀ» ½ÇÇà½Ãų ¼ö ÀÖ´Ù.
      • XP SP2 ¿¡¼­´Â Registry ¿¡ ´ÙÀ½°ú °°Àº °ªÀ» Ãß°¡Çؾ߸¸ ÇÑ´Ù.
        HKCU\Software\Microsoft\Internet Explorer\Main
        Disable_Local_Machine_Navigate = 0 (REG_DWORD)
        
      • python ½ºÅ©¸³Æ®¿Í °°Àº ½ºÅ©¸³Æ®¸¦ ½ÇÇà½ÃÅ°±â À§Çؼ­´Â .bat ÆÄÀÏ¿¡¼­ python script ¸¦ ºÎ¸£°Ô ¸¸µç´ÙÀ½ À̸¦ \url ·Î ¸µÅ©ÇÏ¸é µÈ´Ù.

1.5 breakurl

  • dvips µå¶óÀ̹ö´Â \url ¸í·É µîÀÇ ÀÎÀÚ·Î µé¾î¿À´Â ÇÏÀÌÆÛ¸µÅ©¸¦ °³ÇàÇØÁÖÁö ¸øÇÑ´Ù. ÀÌ ¹®Á¦¸¦ ÇØ°áÇϱâ À§ÇÑ ÆÐÅ°Áö

2 Colorlink

HyperRef ÆÐÅ°ÁöÀÇ ¿É¼Ç ¶Ç´Â \hypersetup ¿É¼ÇÀ¸·Î colorlink°¡ ÄÑÁ®(true) ÀÖ´Ù¸é ¸µÅ©µÇ´Â À§Ä¡ÀÇ »ö»óÀ» ¼³Á¤ÇÒ ¼ö ÀÖ´Ù. ´ÙÀ½Àº ¸µÅ© Ä®·¯ °ü·Ã ¿É¼Ç°ú ±âº»°ªÀÌ´Ù.

»ö»ó È®Àå ¿É¼Ç ±âº»°ª Description
linkcolor red normal links
anchorcolor black anchor text
citecolor green bibliographic citations
filecolor magenta URLs which open local files
menucolor red Acrobat menu items
pagecolor red links to other pages
urlcolor cyan linked URLs

\hypersetup{%
   colorlinks=true,%
   citecolor=black,%
   pagecolor=black,%
   urlcolor=red,%
}

3 TIP : link to external file

3.1 xr-hyper

¿ÜºÎ PDF ÆÄÀÏÀÇ Æ¯Á¤ À§Ä¡¸¦ ÂüÁ¶(\ref, \pageref)ÇÏ·Á ÇÏ´Â °æ¿ì »ç¿ëÇÕ´Ï´Ù. KTUGOperate:8270.

¿ÜºÎ PDF ÆÄÀÏÀÌ HyperRefÀ» ÀÌ¿ëÇؼ­ ÀÛ¼ºµÇ¾ú´Ù¸é, xr-hyper.sty¸¦ ½á¼­ ¹®¼­°£ ÂüÁ¶°¡ °¡´ÉÇÕ´Ï´Ù. xr-hyper.sty´Â hyperref ÆÐÅ°Áö¿Í ÇÔ²² ¹èÆ÷µË´Ï´Ù.
<!> ÀÌ ¹®¼­°£ »óÈ£ÂüÁ¶ ±â´ÉÀº HyperRefÀÇ µå¶óÀ̹ö¿¡ ¹Î°¨ÇÕ´Ï´Ù. Áï, DVIPDFMx·Î PDF¸¦ ¸¸µé °ÍÀÎÁö, PDFLaTeXÀ» ÀÌ¿ëÇÒ °ÍÀÎÁö ¾Æ´Ï¸é GhostScriptÀÇ ps2pdf¸¦ ÀÌ¿ëÇÒ °ÍÀÎÁö¸¦ ¹Ì¸® ¿É¼ÇÀ¸·Î Áö½ÃÇصεµ·Ï ÇÕ´Ï´Ù.

%%%-----ÂüÁ¶µÇ´Â ¹®¼­ linked.tex-----
\documentclass{article}
\usepackage{hyperref}
\begin{document}
\section{T2}
\begin{equation}
foo=bar
\end{equation}
\begin{equation}
1+1=2\label{eq:2}
\end{equation}
\end{document}

ÀÌ ¹®¼­·ÎºÎÅÍ linked.pdf¸¦ ¾ò¾ú°í, ±×°ÍÀÌ °°Àº µð·ºÅ丮¿¡ ÀÖ´Ù¸é, ´ÙÀ½°ú °°Àº ÂüÁ¶ÇÏ´Â ¹®¼­ main.texÀ» ÀÛ¼ºÇÕ´Ï´Ù.
/!\ ¸¸¾à ¿Â¶óÀÎ ¹®¼­¸¦ ÂüÁ¶ÇÏ·Á ÇÑ´Ù¸é ÁÖ¼®Ã³¸®ÇÑ Çà°ú °°ÀÌ ±× ¹®¼­ÀÇ À§Ä¡¸¦ ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.

%%======main.tex=========
\documentclass{article}
\usepackage{xr-hyper}
\usepackage[dvipdfm,bookmarks=false]{hyperref}
   %%% ¹Ýµå½Ã µå¶óÀ̹ö¸¦ ¹àÇôÁÜ. ÀÌ µå¶óÀ̹ö ÁöÁ¤ ¿É¼ÇÀÌ ¾øÀ¸¸é PDFLaTeXÀ» ÀÌ¿ëÇØ¾ß ÇÔ.
\externaldocument[x-]{linked}
   %%% [x-]¸¦ ºÙÀÌ´Â ÀÌÀ¯´Â °°Àº ¹®¼­ ³»¿¡¼­ µ¿ÀÏÇÑ reference°¡ ÀÖÀ» °æ¿ì È¥µ¿À» ÇÇÇϱâ
   %%% À§Çؼ­ÀÌ´Ù.
%\externaldocument[x-]{linked}[http://myhost.mydomain/mydocument/linked.dvi]
   %%% ¿Â¶óÀÎ ¹®¼­¶ó¸é À§¿Í °°ÀÌ URLÀ» ¸ðµÎ Àû¾îÁØ´Ù.
\begin{document}
\section{CROSS-DOCUMENT hyperlink}
\begin{equation}
1+0=1\label{eq:1}
\end{equation}
See \ref{eq:1} and in the other document \ref{x-eq:2}.
   %%% ¿ÜºÎ ¹®¼­ÀÇ labelÀÌ eq:2 ¶ó¸é ÀÌ°ÍÀ» ºÎ¸¦ ¶§ \ref{x-eq:2}¿Í °°ÀÌ
   %%% È£ÃâÇÑ´Ù. À§ÀÇ \externaldocumentÀÇ [x-] ¼±ÅÃÀÎÀÚ¸¦ ÁöÁ¤ÇÏÁö
   %%% ¾Ê¾Ò´Ù¸é ÀÌ ¹®¼­ ³»¿¡ eq:2°¡ ¾ø¾î¾ß ÇÏ°í, ´Ü¼øÈ÷ \ref{eq:2}¿Í
   %%% °°ÀÌ ºÎ¸¦ ¼ö ÀÖ´Ù.
\end{document}

ÀÌÁ¦ main.pdf·ÎºÎÅÍ linked.pdf¸¦ ¹Ù·Î ¸µÅ©ÇÒ ¼ö ÀÖ°Ô µÇ¾ú½À´Ï´Ù.

3.2 xr-hyper ¾øÀÌ ¿ÜºÎ ÆÄÀÏÀÇ Æ¯Á¤ À§Ä¡ ¸µÅ©

Q. ±×·¯´Ï±î xr-hyper¸¦ ÀÌ¿ëÇÏÁö ¾Ê°í ¿ÜºÎ¿¡ ÀÖ´Â 2 °³ÀÇ pdfÀÇ Æ¯Á¤ ÆäÀÌÁö³ª ÀýÀ» ¸µÅ©ÇÒ ¼ö ÀÖÀ¸¸é ÇÕ´Ï´Ù.(KTUGOperate:11899)

A. ¿ÜºÎ PDF°¡ hyperrefÀ¸·Î ¸¸µé¾îÁø °ÍÀ̶ó¸é °¡´ÉÇÒ µíÇÕ´Ï´Ù.

¿¹Á¦ÀÔ´Ï´Ù. b.pdf¿¡¼­ a.pdf¸¦ ºÎ¸£´Â °ÍÀÔ´Ï´Ù.
%%-------------a.tex------------------------
\documentclass{article}
\usepackage{hangul-k}
\usepackage[dvipdfm,bookmarks=false]{hyperref}
\usepackage{color}
\begin{document}
\pagecolor{blue}
\section{ÂüÁ¶µÇ´Â ¹®¼­}
\hypertarget{omom}{¾ö¸¶¾ß} ³ª´Â ¿Ö ÀÚ²Ù¸¸ º¸°í ½ÍÁö
¾ö¸¶¾ß ³ª´Â ¿Ö ÀÚ²Ù¸¸ »ý°¢³ªÁö

\clearpage
\pagecolor{red}
\section{ÂüÁ¶µÉ ¹®¼­ µÎ¹ø° Àý}\label{sectwo}
\hypertarget{yourtarget}{¿©±â°¡ ÂüÁ¶Á¡}
¾Æ¸¶ ³ª´Â ¾ÆÁ÷Àº ¾î¸°°¡ºÁ ±×·±°¡ºÁ
¾ö¸¶¾ß
¾ö¸¶¾ß

\clearpage
\pagecolor{green}
\hypertarget{hereistarget}{¿ä±â¸¦ º¸¼¼¿ä}
ÇϳªµÑ¼Â
\end{document}
%%--------------------------------------------
%%-------------b.tex--------------------------
\documentclass{article}
%\usepackage{xr-hyper}
\usepackage{hangul-k}
\usepackage[dvipdfm,bookmarks=false]{hyperref}
%\externaldocument{a}
\begin{document}
\section{xr-hyper ¾øÀÌ ÂüÁ¶Çϱâ}
ÀÌ ´ë¸ñ¿¡¼­ ¿ì¸®´Â \href{a.pdf#section.2}{¿ÜºÎ¹®¼­ÀÇ Á¦2Àý}À»
ÂüÁ¶ÇÏ·Á ÇÑ´Ù.
\textsf{xr-hyper} ¾øÀÌ ÂüÁ¶ÇÏ´Â °ÍÀÌ °ú¿¬ °¡´ÉÇϰڴ°¡?
\begin{itemize}
\item ÃÊ·Ï: \href{a.pdf#hereistarget}{¿ä±â¸¦} º¸¼¼¿ä¶ó°í ¾²¿© ÀÖ³ª¿ä?
\item »¡°­: \href{a.pdf#yourtarget}{¿©±â´Â} ¶Ç ¾î¶³´ÂÁö?
\item ÆĶû: \href{a.pdf#omom}{¸ÇóÀ½ Àý}·Î °¡º¸¼¼¿ä.
\end{itemize}

\end{document}
%%---------------------------------------------



^
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2008-01-09 04:04:32
Processing time 0.0538 sec