14

Is there a command that compresses equation horizontally, so that everything is closer together in the horizontal direction?

This is not for a real document but rather just for viewing and playing around.

7
  • 2
    Not clear what do you want. Consider adding an MWE, at least specify \documentclass.
    – hola
    Jun 10, 2014 at 13:39
  • \small ?........ Jun 10, 2014 at 13:44
  • Do you want, e.g., no (or at least less than normal amounts of) space around +, -, and = symbols?
    – Mico
    Jun 10, 2014 at 13:44
  • @DavidCarlisle - Wouldn't \small reduce things vertically as well as horizontally?
    – Mico
    Jun 10, 2014 at 13:45
  • 1
    You could use the graphics package to rescale it. Jun 10, 2014 at 13:46

2 Answers 2

23

enter image description here

\documentclass{article}

\def\z{
\par
\noindent X\dotfill X\[
a+b^{x+y} + \sum_{i=0}^n(x+y)^i + \sqrt{x+y+z} =  2 < a\frac{1+2}{3}b
\]}

\begin{document}

\z

{\small\z}

\medmuskip=0mu
\thinmuskip=0mu
\thickmuskip=0mu

\z

\medmuskip=-2mu
\thinmuskip=-2mu
\thickmuskip=-2mu
\nulldelimiterspace=-1pt
\scriptspace=0pt
\z
\end{document}
6
  • It's strange that some things (eg things in double-fractions "\frac{\frac{1}{2}}{3}") don't get affected that much by changing the parameters \medmuskip etc. Any reason for this or how one could fix that? Jun 10, 2014 at 14:21
  • What I'm saying is that if one have an expression of the form \frac{A\times\frac{B}{C}}{D\times\frac{E}{F}} and then one plays around with the parameters \medmuskip etc and the others...A and D changes but B, C, E and F do not since they occur as "double-fractions". Any idea why and how to fix that? Jun 10, 2014 at 14:39
  • Doesn't \nulldelimiterspace get around fractions, tho? Also you could squeeze a wee bit more with \scriptspace.
    – morbusg
    Jun 10, 2014 at 14:39
  • @LoveLearning the additional medmuskip spacing around infix operators isn't added to scripts (or nested fractions which are set in same style) so (unless you make it negative) there is no more space to be gained there, and don't make them negative in a real document:=) Jun 10, 2014 at 15:03
  • 1
    @pluton \divide\medmuskip by 2 or \medmuskip=\muexpr\medmuskip/2\relax Jan 29, 2019 at 7:43
1

Probably your equation is a little bit too long. Then you can manually scale it using \scalebox. Certainly, if the scale factor is far from 1, it must look ugly.

\documentclass{article}
\usepackage{graphics}

\begin{document}

\begin{equation}
1<12345667890123456789012345678901234566789012345678901234567890
\end{equation}

\begin{equation}
\scalebox{0.95}[1]{$1<12345667890123456789012345678901234566789012345678901234567890$}
\end{equation}

\end{document}

enter image description here

1
  • \scalebox seems to have some conflict with "aligned" inside "equation". Jun 10, 2014 at 14:26

You must log in to answer this question.

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