[Bug] Formatting issues when exporting note to PDF (using obsidian default feature)

Steps to reproduce

  1. Export a note to pdf format using obsidian’s default feature (no plugin required).

Note in Source Mode:

Note in Live Mode:

I have following settings for this export:

I have tried with changing these settings too, but in all cases the result are not as expected.

Expected result

The formatting on the output pdf should be proper.

Actual result

Instead, the text in the note is center-aligned in all situations.

Export in Prism Theme

Export in Default Theme

Please follow all of the debug steps in the template (including using the default theme, in Restricted mode, etc.).


Are you sure you don’t have better pdf export installed?

moved to help

Hey folks. After some troubleshooting, I found that this is happening because of a css snippet that I am using to justify the text. If I disable that snippet, then the export to pdf works fine.

So, this is not a bug. Thanks for the re-classification.

However, can someone help me with this? What modification is required in the snippet so that the text exports as it is visible on the screen? It is weird that the note is rendered on the screen correctly but it is exported in a different style.

This is the css snippet:

/* reading mode */
.markdown-preview-view p {
	text-align: justify;
	text-justify: inter-word;	
}

/* source view and live preview */
.markdown-source-view.mod-cm6 .cm-line {
	text-align: justify;
	text-justify: inter-word;	
}