![Unzutreffendes Leerzeichen beim Umbrechen von Anzeigemathematik in \small](https://rvso.com/image/328820/Unzutreffendes%20Leerzeichen%20beim%20Umbrechen%20von%20Anzeigemathematik%20in%20%5Csmall.png)
Ich kann Anzeigemathematik in die Mitte eines Textabsatzes setzen \[...\]
, indem ich , aber ich möchte, dass die Mathematik die Schriftgröße verwendet small
. Wenn ich den Anzeigeblock in {\small...}
der zweiten Hälfte des Absatzes umbreche, beginnend mit dem Wort „Jahrhunderte“, beginnt eine kleine Menge unerwünschter Leerzeichen. Dies verschwindet, wenn ich das entferne {\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}
Ich glaube, ich gehe das falsch an. Hilfe?
Antwort1
Du erhältstzweiunerwünschte Leerzeichen: eines am Zeilenanfang, das deutlicher auffällt, aber auch der vertikale Abstand über der Anzeige ist kleiner als darunter, weil Sie oben den Sprung in Bezug auf verwenden \small
, unten jedoch den Sprung in Bezug auf \normalsize
.
Sie können das Standardverhalten emulieren:
\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}
Sie könnten eine vardisplaymath
Umgebung definieren:
\makeatletter
\newenvironment{vardisplaymath}[1][\small]
{\par\penalty\predisplaypenalty\begingroup#1\begin{displaymath}}
{\end{displaymath}\par\endgroup\penalty\postdisplaypenalty
\@endparenv}
\makeatletter
Vollständiges Beispiel:
\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}
Dies könnte angepasst werden, um die Parameter immer von zu erhalten \normalsize
.
Danke an Tobi für den Verbesserungsvorschlag.
Ein einfacherer Ansatz, der nicht in Details eintauchen muss, wie \penalty\postdisplaypenalty
(erforderlich, um Seitenumbrüche nach der Anzeige zu vermeiden) und das Überspringen von oben und unten zu verhindern, \normalsize
ist
\newsavebox{\vardisplaymathbox}
\newenvironment{vardisplaymath}[1][\small]
{\begin{displaymath}\begin{lrbox}{\vardisplaymathbox}
#1$\displaystyle}
{$\end{lrbox}\usebox{\vardisplaymathbox}\end{displaymath}%
\ignorespacesafterend}
Das Ergebnis mit dieser Definition ist