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.

3
  • bigskip, \medskip, \vspace{ }, of \\[40mm]. en.wikibooks.org/wiki/LaTeX/Lengths#Fixed-length_spaces
    – MS-SPO
    Commented Sep 28, 2023 at 15:29
  • 2
    \newenvironment{\myenv}{\bigskip}{\bigskip} as @MS-SPO just implied. Exchange bigskip with any length you want
    – lukeflo
    Commented Sep 28, 2023 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
    Commented Sep 28, 2023 at 20:52

1 Answer 1

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).

1
  • If your installation of TeX is recent, you don't need xparse.
    – cfr
    Commented Oct 3, 2023 at 17:15

You must log in to answer this question.

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