Specify Indentation Type & Changing The Default Font

Hi,
I noticed that logseq indents unordered lists using hard tabs with the size of 4 spaces.

  • Is there a way to force the use of spaces instead of tabs?
  • Where can I change the default font used by logseq?
2 Likes

I’d like spaces instead of tabs, too.

The font depends on the theme you use. It’s also possible to add them overrides to your config directory,in a file called custom.css

Thanks for the info. Do you know the syntax used to specify a font or do you know of an example config?

To overwrite the font you can use the following in custom.css

@font-face {
  font-family: "JetBrains Mono Nerd";
  font-weight: 200 900;
  font-style: normal;
  font-stretch: normal;
  src: url("https://github.com/ryanoasis/nerd-fonts/raw/v2.3.3/patched-fonts/JetBrainsMono/Ligatures/Regular/complete/JetBrains%20Mono%20Regular%20Nerd%20Font%20Complete.ttf");
}
:root {
  --ct-text-size: 14px;
  --ct-line-height: 1.6;
  --ls-font-family: "Only Emoji", "JetBrains Mono Nerd";
  --ct-page-title-font-family: var(--ls-font-family);
  --ct-code-font-family: "JetBrains Mono Nerd";
}

This example is based on the logseq dev theme and the font used in this example is JetBrains Mono Nerd Font.

for windows change the following line:

-   src: url("https://github.com/ryanoasis/nerd-fonts/raw/v2.3.3/patched-fonts/JetBrainsMono/Ligatures/Regular/complete/JetBrains%20Mono%20Regular%20Nerd%20Font%20Complete.ttf");
# with
+    src: url("https://github.com/ryanoasis/nerd-fonts/raw/v2.3.3/patched-fonts/JetBrainsMono/Ligatures/Regular/complete/JetBrains%20Mono%20Regular%20Nerd%20Font%20Complete%20Windows%20Compatible.ttf");


updated: Fri Jan 27 04:10:55 PM EST 2023
4 Likes

Overwriting Font Settings

To overwrite the font you can use the following in custom.css

@font-face {
  font-family: "JetBrains Mono Nerd";
  font-weight: 200 900;
  font-style: normal;
  font-stretch: normal;
  src: url("https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/JetBrainsMono/Ligatures/Regular/complete/JetBrains%20Mono%20Regular%20Nerd%20Font%20Complete.ttf");
}
:root {
  --ct-text-size: 14px;
  --ct-line-height: 1.6;
  --ls-font-family: "Only Emoji", "JetBrains Mono Nerd";
  --ct-page-title-font-family: var(--ls-font-family);
  --ct-code-font-family: "JetBrains Mono Nerd";
}

This example is based on the logseq dev theme by @Peng_Xiao and the font used in this example is JetBrains Mono with Nerd Font glyphs

Replacing Tabs with Spaces

You can specify the indentation type and count in config.edn using the following syntax

 :export/bullet-indentation :two-spaces
  • Note that this will only affect new pages!

Refactor existing notes

In Linux, to replace all tabs in your vault with 2 spaces (markdown default) you can use the following command:

  • Make sure to back up your notes!
find . -name '*.md' ! -type d -exec bash -c 'expand -t 2 "$0" | sponge "$0"' {} \;

Dependencies:

7 Likes

Hi, I’m new here :smiley:

Not sure if I mis-understand this option or it doesn’t work anymore.
I append :export/bullet-indentation :two-spaces to config.edn, restart Logseq and create a new page.

Then I create a block and some nested blocks. For example:

- level 1
  - level 2.1
  - level 2.2

Then I select this block and its nested blocks, and try all of these 3 methods:

  • Cmd + C to copy
  • Right click and select Copy as.
  • Upper-right 3 dots and Export page.

And I paste it to text editor, but I find the indent is tab instead of spaces in all 3 methods. So I’d like to ask if I do any step wrong?

I’ve noticed with the suggested font settings italicized and bold text do not appear. In other CSS I would add additional @font-face definitions for italics and bold, but these seem to be overwritten by Logseq. Is there a way to change the fonts and keep additional font-styles?

1 Like

Any updates on this issue? I tried adding the config option and performing the same steps. I am still getting tabs instead of spaces as well.

Top of my config.edn file looks like this:

{:meta/version 1
 
 :export/bullet-indentation :two-spaces
 

I just noticed this and am having the same problem; I’m hoping somebody has a solution.

Mono is a huge upgrade, but I’d still like italicized and bold for occasional emphasis.

1 Like