출력 억제

출력 억제

이상하게 들릴 수도 있지만, 뭔가를 작성해서 LaTeX를 실행하려고 합니다.~ 아니다문서에 인쇄하세요(제가 가졌던 또 다른 질문에서 비롯되었습니다.즉 이 링크)

이것이 내가 지금까지 가지고 있는 것입니다:

\documentclass[8pt]{book}
\usepackage{amsthm}

\begin{document}
\let\oldpar\par%
\let\par\relax%
\nullfont

Lorem ipsum dolor sit amet, \emph{consectetur adipiscing elit} 2000$^\circ$C.

\[ ax^2 = b \left( \frac{\sqrt{t}}{42} \right)\]

\normalfont%
\let\par\oldpar%

\end{document}

이것을 컴파일하면 수학 모드만 \emph인쇄된 문서를 얻을 수 있습니다. 예상되는 결과는 아무것도 인쇄되지 않는 것입니다.

나는 수학 모드가 대신 다른 글꼴을 \emph사용하지 않기 때문에 이런 일이 발생한다고 추측합니다 .\normalfont

거기에서 사용되는 명령은 무엇입니까? 나는 노력했지만 \let\itshape\relax 아무 소용이 없었습니다.

미리 감사드립니다!

답변1

숨기려는 내용을 상자에 저장하고 문서에서 동일한 크기의 빈 상자를 출력합니다.

\documentclass{book}
\begin{document}
ABC
\setbox0=\vbox{%
Lorem ipsum dolor sit amet, \emph{consectetur adipiscing elit} 2000$^\circ$C.

\[ ax^2 = b \left( \frac{\sqrt{t}}{42} \right)\]
}\par\vbox to \dimexpr\ht0+\dp0\relax{}
DEF
\end{document}

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

답변2

제안된 재정의는 그다지 안전하지 않습니다.

이 문서는 영원히 반복되며 종료되지 않습니다.

\documentclass[8pt]{book}
\usepackage{amsthm}

\begin{document}
\let\oldpar\par%
\let\par\relax%
\nullfont

Lorem ipsum dolor sit amet, \emph{consectetur adipiscing elit} 2000$^\circ$C.

\[ ax^2 = b \left( \frac{\sqrt{t}}{42} \right)\]

a\hrule

\normalfont%
\let\par\oldpar%

\end{document}

관련 정보