SPACE and , only takes half space

Steps to reproduce

  1. open sandbox vault
  2. type below
    – SPACE and , takes only half space
    abcd
    ,

-- the issue does not exist inside code block
abcd
,,,,

3 you will see outside the codeblock, the , only takes halfspace

The width of each character depends on the font used.

In a code block, the font is typically one of fixed-width (also called monospaced), in which all characters have the same width. This is convenient to type code and have consistent indentation.

In the main text, however, a variable-width font is typically used because it is easier to read (this is why books and papers use this kind of font too). In these fonts the β€œm” is much wider than the β€œi”, for example.

You can change your Obsidian settings to have fixed-width font in the main text if you prefer. You can use for example β€œConsolas” (in windows) or Monaco in OSX. There are also lots of fonts designed for programmers (Source Code Pro, or many others).

1 Like