0

For some typesetting, I want to add vertical margins (top and bottom) around certain paragraphs. I already found the package changepage and their environment adjustwidth to set the horizontal margins (https://tex.stackexchange.com/a/594).

However, I am not sure, how to achieve vertical margins.

Possibly through parskip or \\\\ (also see How to insert vertical space between paragraphs). However, I want it to be robust, and ideally apply it to a paragraph with an environment.

I hope, there is a nice way for this.

clel
  • 325
  • bigskip, \medskip, \vspace{ }, of \\[40mm]. https://en.wikibooks.org/wiki/LaTeX/Lengths#Fixed-length_spaces – MS-SPO Sep 28 '23 at 15:29
  • 2
    \newenvironment{\myenv}{\bigskip}{\bigskip} as @MS-SPO just implied. Exchange bigskip with any length you want – lukeflo Sep 28 '23 at 17:00
  • That's great! Thanks for the answer. I'll test, but am rather certain that it'll work. Feel free to post as answer, so I can accept it. – clel Sep 28 '23 at 20:52

1 Answers1

0

Building from the comments, I came up with:

\usepackage{xparse}

\NewDocumentEnvironment{verticalmargins}{mm}{\vspace{#1}}{\vspace{#2}}

This allows to specify margins separately for top and bottom (which is why I use xparse, as \newenvironment doesn't allow access of arguments in the second bracket for the code to be executed after the environment).

clel
  • 325