source2e.pdf에서

source2e.pdf에서

의 정의는 \@setfontsize다음과 같습니다(의 출력 \makeatletter\meaning\@setfontsize).

\@nomath#1\ifx\protect\@typeset@protect\let\@currentsize#1\fi\fontsize{#2}{#3}\selectfont
  • \@nomath수학 모드에서 이 매크로를 호출하면 경고가 발생합니다. source2e를 참조하세요.
  • \let\@currentsize#1내 source2e에 없습니다. 광산(v. 2017/01/01 패치 레벨 1)에는\@currsize#1
  • \fontsize{fontsize}{baselineskip}

공개 \@typeset@protect(출력\makeatletter\meaning\@typeset@protect )는 를 산출합니다 \relax.

source2e.pdf에서

\@setfontsize가 강력하게 유지되도록 하기 위해 \protect가 \@typeset@protect와 다른 경우에는 이 할당을 생략합니다.

  • 그 때는 언제입니까?
  • 언제 다른 것으로 설정되나요?\relax이것은 언제 어떤 목적으로
  • 그런데 "계속 견고하다"는 흥미로운 표현입니다.

답변1

\documentclass{article}

\begin{document}

\typeout{\large abc}

\end{document}

로그를 생성합니다.

\relax \fontsize {12}{14}\selectfont abc

특별히 흥미롭지는 않지만 \large작성되는 실제 애플리케이션 과 동등한 코드입니다 aux.toc 과 동일한 코드이며 다시 읽을 때 의도한 대로 작동합니다.

테스트 를 제거하기 위해 정의를 수정하면 \ifx\protect\@typeset@protect그 효과는 상당히 극적입니다.

\documentclass{article}

\begin{document}


\makeatletter
\def\@setfontsize#1#2#3{\@nomath#1%
%    \ifx\protect\@typeset@protect
      \let\@currsize#1%
%    \fi
    \fontsize{#2}{#3}\selectfont}

\typeout{\large abc}

\end{document}

생산하다

! TeX capacity exceeded, sorry [input stack size=5000].
\@nomath ...e \@font@warning {Command \noexpand #1
                                                  invalid in math mode}\fi 
l.13 \typeout{\large abc}

!  ==> Fatal error occurred, no output PDF file produced!

기본적으로 테스트는 글꼴 크기 명령이 취약하지 않고 강력하다는 것을 확인합니다.

관련 정보