![가짜 공백 줄 바꿈은 \small에 수학을 표시합니다.](https://rvso.com/image/328820/%EA%B0%80%EC%A7%9C%20%EA%B3%B5%EB%B0%B1%20%EC%A4%84%20%EB%B0%94%EA%BF%88%EC%9D%80%20%5Csmall%EC%97%90%20%EC%88%98%ED%95%99%EC%9D%84%20%ED%91%9C%EC%8B%9C%ED%95%A9%EB%8B%88%EB%8B%A4..png)
를 사용하여 텍스트 단락 중간에 표시 수학을 넣을 수 있지만 \[...\]
수학에서는 글꼴 크기를 사용하고 싶습니다 small
. {\small...}
"centuries"라는 단어로 시작하는 단락의 후반부 에 표시 블록을 래핑하면 약간의 불필요한 공백으로 시작됩니다. 를 제거하면 이 현상이 사라집니다 {\small...}
.
\documentclass{article}
\begin{document}
Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book. It has survived not only five
{\small\[
A / B + C = D
\]}
centuries, but also the leap into electronic typesetting, remaining
essentially unchanged. It was popularised in the 1960s with the release
of Letraset sheets containing Lorem Ipsum passages, and more recently
with desktop publishing software like Aldus PageMaker including versions
of Lorem Ipsum.
\end{document}
나는 이 문제에 대해 잘못된 방향으로 가고 있는 것 같아요. 돕다?
답변1
당신은 얻는다둘허위 공백: 줄의 시작 부분에 하나가 있습니다. 이는 더 분명하지만 아래보다 디스플레이 위의 수직 공간이 더 좁습니다. 에 관한 위의 건너뛰기를 사용하고 에 \small
관련된 아래 건너뛰기를 사용하고 있기 때문입니다 \normalsize
.
표준 동작을 에뮬레이트할 수 있습니다.
\documentclass{article}
\begin{document}
Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book. It has survived not only five
{\par\penalty\predisplaypenalty\small\[
A / B + C = D
\]\par}\penalty\postdisplaypenalty\noindent
centuries, but also the leap into electronic typesetting, remaining
essentially unchanged. It was popularised in the 1960s with the release
of Letraset sheets containing Lorem Ipsum passages, and more recently
with desktop publishing software like Aldus PageMaker including versions
of Lorem Ipsum.
\end{document}
환경 을 정의할 수 있습니다 vardisplaymath
.
\makeatletter
\newenvironment{vardisplaymath}[1][\small]
{\par\penalty\predisplaypenalty\begingroup#1\begin{displaymath}}
{\end{displaymath}\par\endgroup\penalty\postdisplaypenalty
\@endparenv}
\makeatletter
전체 예:
\documentclass{article}
\makeatletter
\newenvironment{vardisplaymath}[1][\small]
{\par\penalty\predisplaypenalty\begingroup#1\begin{displaymath}}
{\end{displaymath}\par\endgroup\penalty\postdisplaypenalty
\@endparenv}
\makeatletter
\begin{document}
Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book. It has survived not only five
\begin{vardisplaymath}
A / B + C = D
\end{vardisplaymath}
centuries, but also the leap into electronic typesetting, remaining
essentially unchanged. It was popularised in the 1960s with the release
of Letraset sheets containing Lorem Ipsum passages, and more recently
with desktop publishing software like Aldus PageMaker including versions
of Lorem Ipsum.
\begin{vardisplaymath}[\footnotesize]
A / B + C = D
\end{vardisplaymath}
centuries, but also the leap into electronic typesetting, remaining
essentially unchanged. It was popularised in the 1960s with the release
of Letraset sheets containing Lorem Ipsum passages, and more recently
with desktop publishing software like Aldus PageMaker including versions
of Lorem Ipsum.
\end{document}
항상 에서 매개변수를 가져오도록 조정할 수 있습니다 \normalsize
.
개선을 제안한 Tobi에게 감사드립니다.
\penalty\postdisplaypenalty
(표시 후 페이지 나누기를 피하기 위해 필요함) 세부 사항을 자세히 설명하고 위와 아래 건너뛰기를 유지하지 않는 더 간단한 접근 방식은 \normalsize
다음과 같습니다.
\newsavebox{\vardisplaymathbox}
\newenvironment{vardisplaymath}[1][\small]
{\begin{displaymath}\begin{lrbox}{\vardisplaymathbox}
#1$\displaystyle}
{$\end{lrbox}\usebox{\vardisplaymathbox}\end{displaymath}%
\ignorespacesafterend}
이 정의의 결과는 다음과 같습니다.