2

Sorry for the noob question, I have the MWE example below, in which I just want to change the vertical spacing between 2 blocks of text, and I don't seem to be understanding how this works, or what the best way to do it should be, cause the result is far from the desired one.

This is the MWE:

\documentclass{article}
\usepackage{lipsum}

\setlength{\parindent}{0pt}% No paragraph indentation
\setlength{\parskip}{.5\baselineskip plus 0.1\baselineskip minus 0.1\baselineskip}

%%Page geometry
\usepackage[left=1cm,top=2cm,right=1cm,bottom=2cm]{geometry}


\begin{document}
    Some text here \lipsum[2], and after that I want to introduce some vertical space at the end of the paragraph.\\
    \medskip
    After the vertical space, I want to introduce more text \lipsum[10]

    \begin{itemize}
    \setlength\itemsep{1pt}
        \item item one
        \item item two
        \item item three
        \item item four
        \item item five
    \end{itemize}
\end{document} 

I just want to introduce some extra spacing (\medskip or \vspace) between the end of "...the paragraph" and the beginning of "After the vertical space...", but the result is really off, as you can see below.

Besides, I would like to reduce the space between \itemize items, as they still look really separated as they are right now, but it seems I cannot go further some limit.

figure

Thanks!

1

\medskip has to be written before the line break. Further, don't use \\ for new paragraphs, but a blank line or the command \par.

For lists environment, it's better to load the enumitem package. It uses a system of keys to change lists formatting. Compare here noitemsep and itemsep=0pt:

\documentclass{article}
\usepackage{lipsum}

\setlength{\parindent}{0pt}% No paragraph indentation
\setlength{\parskip}{.5\baselineskip plus 0.1\baselineskip minus 0.1\baselineskip}

%%Page geometry
\usepackage[left=1cm,top=2cm,right=1cm,bottom=2cm]{geometry}
\usepackage{enumitem} %

\begin{document}

    Some text here \lipsum[2]
     and after that I want to introduce some vertical space at the end of the paragraph. \medskip

    After the vertical space, I want to introduce more text \lipsum[10]

    \begin{itemize}[itemsep =0pt]
        \item item one
        \item item two
        \item item three
        \item item four
        \item item five
    \end{itemize}
    \begin{itemize}[noitemsep]
        \item item one
        \item item two
        \item item three
        \item item four
        \item item five
    \end{itemize}

\end{document} 

enter image description here

1

Vertical space is only applied in vertical mode. If you issue it while it horizontal mode, it is collected until vertical mode is entered, which may not always be where you intend it to go.

Below is a couple of examples showing insertions of vertical space between two pieces of text. Since I'm loading lipsum with the [nopar] option, none of the calls to \lipsum[.] are paragraphs. As such, in the first instance, \lipsum[1]<space>\lipsum[2] is actually a single paragraph.

enter image description here

    \documentclass{article}

    % Just for this example
    \usepackage[paperheight=35\baselineskip]{geometry}
    \usepackage[nopar]{lipsum}

    \begin{document}

    \noindent\hrulefill{ }1{ }\hrulefill

    \lipsum[1]
    \vspace{5\baselineskip}% Not in vertical mode; only issued once in vertical mode
    \lipsum[2]

    \noindent\hrulefill

    \clearpage
    \noindent\hrulefill{ }2{ }\hrulefill

    \lipsum[1]
    \vspace{5\baselineskip}% Not in vertical mode; next blank line, however, enters vertical mode

    \lipsum[2]

    \noindent\hrulefill

    \clearpage
    \noindent\hrulefill{ }3{ }\hrulefill

    \lipsum[1]

    \vspace{5\baselineskip}% In vertical mode; issued immediately
    \lipsum[2]

    \noindent\hrulefill

    \clearpage
    \noindent\hrulefill{ }4{ }\hrulefill

    \lipsum[1]

    \vspace{5\baselineskip}% In vertical mode; issued immediately (common usage)

    \lipsum[2]

    \noindent\hrulefill

    \end{document}

For consistent output of vertical space in the desired location (except at the top of a page where you need \vspace*) ensure you have a blank space before and after.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.