PDF export does not respect Tab indent size

With the Tab indent size set to 4 spaces (I think it is the default), a tab at the start of a line in a code block has the same effect as 4 spaces. This works correctly across the different views, but in the PDF export the tab size is 8 spaces.

  1. I presume this is a bug – hereby reported
  2. Is there a workaround, perhaps in CSS?

See this screenshot (a part of the PDF output generated from the sandbox vault).

Edit Obsidian v1.1.9 on macOS 13.0.1

I can’t reproduce. post a screen recording of this happening in the sandbox vault and attach a copy of the file where it happens.

Here is a screen recording:
Tabindent.mp4.zip (899.2 KB)

And here is the file made during the recording:
test.md (51 Bytes)

thanks, i got it

For those who need a workaround: create and activate a CSS snippet with these contents:

@media print {
	code {
		tab-size: 4;
	}
}
1 Like