KTUG 한국 텍 사용자 그룹

Menu

KTUG :: Q&A 마당

hyperref이 \ref, \label을 재정의하는 것은 잘 알려진 것이고요. 그 때문에 발생하는 문제라고 봐도 될 겁니다.


의견: \label{#1}과 같이 \affiliation의 옵션 인자로 주어진 것을 바로 라벨로 사용하는 것은, 같은 label을 저자가 본문 중에 붙일 수도 있기 때문에 좋지 않습니다. \label{author:#1}과 같이 하는 것이 좋겠습니다.


\ref{#1}에 의하여 만들어지는 결과는 hyperref 패키지가 로드되는 경우 간단한 문자나 숫자가 아니라 상당히 복잡한 매크로 집합입니다. 숫자로만 처리하는 것이 좋을 것 같지요.


다음처럼 하면 어떤가 싶습니다. 핵심은 \ref 자체가 아니라 \ref하여 얻어진 결과를 숫자로 취급하는 것입니다. (\affiliation 정의에서 \label{#1}을 \label{author:#1}로 바꾸어야 합니다.) 밑줄친 부분이 수정된 것입니다.


\usepackage{hyperref}

\usepackage{refcount}


% ....

\renewcommand{\author}[3][\empty]{\stepcounter{authors}%

\ifx#1\empty%

\ifthenelse{\equal{\arabic{authors}}{1}}{%

\g@addto@macro{\@authors}{#3}%

\g@addto@macro{\@headauthor}{#3}

}%

{%

\g@addto@macro{\@authors}{, #3}%

\g@addto@macro{\@headauthor}{, #3}%

}%

\else

\ifthenelse{\equal{\arabic{authors}}{1}}{%

\g@addto@macro{\@authors}{\textsuperscript{\getrefnumber{author:#1}}#3}%

\g@addto@macro{\@headauthor}{#2}%

}%

{%

\g@addto@macro{\@authors}{, \textsuperscript{\getrefnumber{author:#1}}#3}%

\g@addto@macro{\@headauthor}{, #2}%

}%

\fi}



개인적으로 이 상황에서 \g@addto@macro가 과연 필요한가 하는 생각을 가지고 있습니다만... 그건 다른 문제이므로.


KTUG 한국 텍 사용자 그룹