
mattt 글꼴의 텍스트를 두 개의 별도 줄에 표시하고 싶지만 다음이 작동하지 않습니다.
\documentclass{article}
\begin{document}
\title{Scratch}
$$\mathtt{Say\ hello} \newline \mathtt{to\ my\ little\ friend}$$
\end{document}
\newline
로 교체하거나 \\
단일 \mathtt{}
. 모든 경우의 결과는 \newline
or 이 없는 것과 같습니다 \\
.
정리 증명자 Isabelle의 JEdit 코드처럼 보이도록 텍스트 형식을 이런 방식으로 지정해야 합니다. 이 작업을 수행하는 방법에 대한 다른 제안 사항이 있으면 기꺼이 듣겠습니다.
답변1
이런 뜻인가요?
\mathtt
여기서는 전혀 필요하지 않습니다 .
\ttfamily
TeX 그룹에서 사용하거나 (예: a 래핑) 자체 그룹을 자동으로 형성하는 \begingroup...\endgroup
특수 환경을 정의하면 tttt
백그라운드의 세부 사항은 다르지만 두 버전 모두 동일한 출력을 제공합니다.
'줄바꿈'을 강제하려면 빈 줄을 남겨두세요.
\documentclass{article}
\title{Scratch}
\newenvironment{tttt}{\ttfamily}{}
\begin{document}
\begingroup
\ttfamily Say hello
to my little friend
\endgroup
\begin{tttt}
Say hello
to my little friend
\end{tttt}
\end{document}