Tabbing paragraphs and single space between them. So simple, yet I'm lost! SOS!

Hey Everyone,
I am working on a project where I need one specific folder to have all of its notes formatted in a certain way. I need the first line of each paragraph indented and for there to be a single line space between each paragraph.

At first I tried using snippets to affect the folder directly but that didn’t work. Then I tried using templater to apply a template to each note in the folder individually. I am wondering if I am using incorrect code or I am just not even using the correct plugin. Any suggestions would be greatly appreciated

If you know that your CSS is working, then you could apply is as a class to every file in the folder.

So the first question would be: Do you already have a CSS snippet that indents the first line of and adds space after each paragraph?

If yes, then wrap it in a class, something like:

.paragraph-format {

    /* put the entire snippet here */

}

… then add that name to your note’s cssclasses property values:

---
cssclasses: paragraph-format
---

Okay, the snippet below creates space between paragraphs and works in editing and reading views.

It also creates the appearance of a tab at the start of each paragraph in editing views. But for the indentation to work in the reading view, your paragraphs need to have a blank line between them. That is, two line breaks.

Here’s what to do:

  1. Add this snippet: (how to add snippets)
/* paragraph-writing class
	indents first lines of paragraphs, and adds space after paragraphs
*/
		
	/* editing views */
	.markdown-source-view.paragraph-writing .cm-line {
		padding-bottom: 1.5em;
		text-indent: 2em;
	}
	
	/* reading view */
	.paragraph-writing p {
		text-indent: 2em;
		white-space: pre-line;
	}
  1. In your note, add the cssclasses property and enter paragraph-writing as a value:

The result looks like this:

From now on, you could have Templater add the class to all new notes you create in the folder.

2 Likes

Basically paragraph formatting is not allowed in markdown. So you are using wrong tools (markdown). You might be interested in LaTeX. Using CSS with markdown is possible but this combination doesn’t work well when the source is converted to a published format (pdf etc). One might set other formatting requirements besides paragraph styling. LaTeX can solve such problems.

2 Likes

This worked like a charm, thank you so much for this!!

Thank you, I am going to look into this as I get more integrated into Obsidian. I am still learning a lot but this will be a fun thing to explore

Yay. You’re welcome!