Positive and Negative thin spaces in LaTeX

At times in LaTeX you want to introduce a small space between words. This is especially important in mathematical typesetting. Just adding a little bit of space hairspace, can alter the aesthetic look of the equation or mathematical entity substantially. For example consider this expression:


$|a|^{2}$

This produces the following

Screenshot 2020-04-04 at 15.47.51

The | braces are too close to the character “a”. To create a better version of this we introduce a small hairspace between the two. The code for hairspace is \,.

$|\,a\,|^{2}$

This produces a much nicer looking expression.
Screenshot 2020-04-04 at 15.47.55

This feature of hairspace was known to me for some time. But the problem came when I had to create a negative space. Take for example this expression:

 $F_{eff} = kx$

The result of this is not so nice looking as you can see:

Screenshot 2020-04-04 at 16.06.38

But then I came to know about a negative hairspace. The code for it is \!. Now let us introduce this in the above expression

$F_{e\!f\!\!f} = kx$

The result is much better visually:

Screenshot 2020-04-04 at 16.10.33

About The Mitr

I am The Mitr, The Friend
This entry was posted in latex and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.