![\small 内の誤った空白の折り返しにより数式が表示される](https://rvso.com/image/328820/%5Csmall%20%E5%86%85%E3%81%AE%E8%AA%A4%E3%81%A3%E3%81%9F%E7%A9%BA%E7%99%BD%E3%81%AE%E6%8A%98%E3%82%8A%E8%BF%94%E3%81%97%E3%81%AB%E3%82%88%E3%82%8A%E6%95%B0%E5%BC%8F%E3%81%8C%E8%A1%A8%E7%A4%BA%E3%81%95%E3%82%8C%E3%82%8B.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
あなたは得る二不要なスペース: 行の先頭に 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}
この定義の結果は