2

This must be a duplicate, I'm sure, but I just couldn't find the answer.

I want to tell LaTeX to also shrink math, as opposed to only/mainly text, if doing so would allow more content to fit into one line or avoid typographical runts/widows or such. For example,

\documentclass{article}
\begin{document}
\noindent This is a long line, but I would still like to have it fit on one line. $A\in B = C \subseteq D$.
\end{document}

yields this unfortunate creation:

scr1

Meanwhile,

\documentclass{article}
\begin{document}
\noindent This is a long line, but I would still like to have it fit on one line. $A\!\in\!B\!=\!C\!\subseteq\!D$.
\end{document}

yields what, in most contexts, might be considered a typographical abomination, but for my purposes (typesetting a cheatsheet) would be preferred:

scr2

I realize there are answers that talk about allowing LaTeX to reduce interword spacing more, and that microtype can also help with such issues, but what I could not find is how to tell LaTeX that reducing horizontal spacing in math mode is also okay.

TL;DR: How can I tell LaTeX to feel free to viciously shrink text and math.

1 Answer 1

5

Math spaces stretch and shrink just as inter word spaces do, but not enough for you here, adding a minus component produces

enter image description here

\documentclass{article}
%\thinmuskip=3mu
%\medmuskip=4mu plus 2mu minus 4mu
%\thickmuskip=5mu plus 5mu 

\thinmuskip=3mu  minus 1mu
\medmuskip=4mu plus 2mu minus 4mu
\thickmuskip=5mu plus 5mu minus 2mu

\begin{document}
\noindent This is a long line, but I would still like to have it fit on one line. $A\in B=C\subseteq D$.
\end{document}
2
  • Thank you so much, this is perfect!
    – steve
    Aug 16, 2020 at 23:48
  • 2
    I do this sometimes as well, but I keep these redefinitions local to the one formula where it is needed. Aug 16, 2020 at 23:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .