1

I'm putting together a document containing some code snippets. The way I'm doing this is to have a style called code with a monospaced font. This style has to have no spacing between paragraphs, however this means that at the end of code blocks when returning to the the normal style I end up with something like the example shown below.

To get around this I either: a) put a new line after each codeblock in a 5pt font or b) have a second style called code last line that has a break after a paragraph, and select that style for the last line of every code snippet. Can anyone recommend a more elegant solution?


Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna

int main(){ cout << "Hello world"; return(0); }
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.

1 Answer 1

1

You can select the option Don't add space between paragraphs of the same style, so both before and after spacing will be applied only before and after your code section.

enter image description here

1
  • 1
    Smashing. This is exactly what I need
    – Some_Guy
    Oct 6, 2015 at 10:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .