![\citet*의 렌더링 수정](https://rvso.com/image/353029/%5Ccitet*%EC%9D%98%20%EB%A0%8C%EB%8D%94%EB%A7%81%20%EC%88%98%EC%A0%95.png)
\citet*
더 작은 글꼴 크기와 특정 색상을 사용하는 렌더링을 변경하고 싶습니다 .
아래 MWE는 별표가 없는 버전에서 작동하며 \citet
다음을 생성합니다.
\documentclass{article}
\usepackage{filecontents}
\usepackage{natbib}
\usepackage{color}
\let\oldcitet=\citet
\renewcommand{\citet}[1]{{\footnotesize\textcolor[rgb]{.8, .1, .4}{\oldcitet{#1}}}}
\begin{filecontents}{refs.bib}
@book{ref,
title = {title},
author = {john and abi and fein},
location = {here},
publisher = {publisher},
year = {2017},
}
\end{filecontents}
\begin{document}
\citet{ref}
\citet*{ref}
\bibliography{refs.bib}
\bibliographystyle{plainnat}
\end{document}
의 재정의는 \citet
별표 버전의 재정의를 깨뜨립니다. 이 문제를 해결하는 방법에 대한 제안이 있으십니까?
답변1
설정에서 별표 버전을 수용하려면 *
다음과 같은 사용을 조건으로 해야 합니다.
\let\oldcitet=\citet
\makeatletter
\renewcommand{\citet}{\@ifstar\newcitetstar\newcitet}
\newcommand{\newcitet}[1]{{\footnotesize\textcolor[rgb]{.8, .1, .4}{\oldcitet{#1}}}}
\newcommand{\newcitetstar}[1]{{\footnotesize\textcolor[rgb]{.8, .1, .4}{\oldcitet*{#1}}}}
\makeatother
선택적 인수(예:)와 같은 다른 옵션을 협상하는 더 쉬운 방법도 있습니다. 보다 일반적인 접근 방식을 고려하면xparse
.