섹션 제목에 작은 대문자 사용

섹션 제목에 작은 대문자 사용

간단히 검색해봐도 답이 나오지 않아서 이렇게 질문을 드립니다.

(하위...)섹션 제목에 작은 대문자를 올바르게 표시할 수 있는 방법이 있습니까?

특히 내 문제는 다음 코드에 있습니다.

\documentclass{article}
\newcommand*{\matlab}{\textsc{matlab}}

\begin{document}
 \section{\matlab}}
\end{document}

제목에 작은 대문자 MATLAB을 생성하는 대신 일반 텍스트("matlab", \textsc{}newcommand*{}{}.

실제로 오류나 경고를 생성하지 않고 컴파일하지만 필요한 출력을 제공하지 않습니다.

해결 방법/솔루션을 아는 사람이 있나요?

답변1

당신이 발견한 것은 Computer Modern 글꼴 계열에는 굵은 글씨/작은 대문자의 두께/모양 조합이 없다는 것입니다. smallcaps 문자열의 "정상" 가중치를 복원하려면 지시문을 앞에 붙여야 합니다 \mdseries.

여기에 이미지 설명을 입력하세요

\documentclass{article}
\newcommand*{\matlab}{\textsc{matlab}}
\newcommand*{\altmatlab}{{\mdseries\matlab}} % note the double pair of curly braces
%%% "\newcommand*{\altmatlab}{\textmd{\matlab}}" works too...
\begin{document}
 \section{A title that contains ``\matlab'' as a string}
 \section{A title that contains ``\altmatlab'' as a string}
\end{document}

Times Roman과 같은 다른 글꼴 모음에는 굵은 글꼴/작은 대문자 조합이 있습니다. 이러한 글꼴 모음 중 하나를 사용하려면 \matlab섹션 헤더에 기본 매크로를 사용하는 것이 좋습니다.

답변2

또한 가능합니다:

\documentclass{article}

\newcommand*\matlab{{\normalfont\textsc{matlab}}}

\begin{document}

  \section{A title that contains ``\matlab'' as a string}

\end{document}

관련 정보