
문서를 작성 중인데 굵은 텍스트를 모두 빨간색으로 표시하고 싶습니다. 명령이 래핑되도록 어떻게 명령 renewcommand
을 내릴 수 있는지 궁금합니다 .textbf
\textcolor{red}
감사해요
답변1
기본 정의는 textbf
다음과 같습니다.
\DeclareTextFontCommand{\textbf}{\bfseries}
새로운 기능을 추가하려면 간단히 추가하면 됩니다.\color{red}
\DeclareTextFontCommand{\textbf}{\bfseries\color{red}}
\DeclareTextFontCommand
오류 없이 원래 정의를 재정의합니다. 당신은 다음을 통해서만 정보를 얻습니다.\@latex@info
전체 MWE는 다음과 같습니다.
\documentclass[]{article}
\usepackage[T1]{fontenc}
\usepackage{xcolor}
\DeclareTextFontCommand{\textbf}{\bfseries\color{red}}
\begin{document}
text \textbf{foo} bar
\end{document}