This project is read-only.

New paragraph after code block

Feb 18, 2014 at 11:23 PM
Normally, when I write a code block in my code, I will have some text to write after it. In those cases, I am happy with Madoko's default behavior of not indenting the latex paragraph that follows. But in some cases, the code block may in fact end the paragraph, in which case I want the text that follows to start a new, indented paragraph.

For example,
... and therefore the final code is:
answer := 42;
In conclusion, the moral of this story is ...
Here, I want "In conclusion" to start a new paragraph. Can I do that?


PS. In the HTML output, this is not an issue, since paragraphs are not indented and I cannot see any difference in the text that follows a code block.
Feb 22, 2014 at 6:26 PM
btw. If you like the indented look of LaTeX, you can show this in HTML too, using the following style block at the start of your document (but after the metadata)
p { margin: 0pt; }
p.indent { text-indent: 1em; }
Personally, I feel it is less appropriate for good viewing in a browser though.
Feb 22, 2014 at 7:32 PM
Hi Rustan,

Thanks for being such a enthusiastic and discerning user of Madoko :-)

For now, the easiest way to get an indented paragraph after a code (or an equation) block is to add the {{indent}} class:
... and therefore the final code is:
answer := 42;
In conclusion, the moral of this story is ...
Note that attributes for a paragraph have to follow the paragraph on a line by itself.

Anyway, not a perfect solution but perhaps you should be discouraged to do so :-)
I personally quite dislike the look of indented paragraphs after code or equations, or at the start of a page (although you can make an argument why it should be like that).

Perhaps we need more design here? In LaTeX it is done using blank lines after code or equation but I like the text document to look nice (markdown philosophy!) and I always add blank lines around blocks in the text. Another design would be to add an attribute to the code block itself to signify it is ending the paragraph, i.e. a {{para-end}} class for example.
Marked as answer by daan on 3/5/2014 at 10:54 PM