1

I'm using a minted block in my document as follows

\captionof{listing} {Salt state for setting up a PostgreSQL server. \label{lst:salt_state_postgres}}
\begin{minted}
[
breaklines=true,
linenos,
fontsize=\footnotesize,
frame=lines,
framesep=2mm,
baselinestretch=1.2
]
{yaml}
install_server:
  pkg.installed:
    - name: postgresql95-server.x86_64

initialize_db:
  cmd.run:
    - name: /usr/pgsql-9.5/bin/postgresql95-setup initdb
    - unless: stat /var/lib/psql/9.5/data/postgresql.conf

/var/lib/pgsql/9.5/data/postgresql.conf:
  file.managed:
    - source: salt://postgres/config/postgresql.conf
    - user: postgres
    - group: postgres
    - mode: 600
    - makedirs: True


start_server:    
  service.running:
    - name: postgresql-9.5
    - watch:
      - file: /var/lib/pgsql/9.5/data/*
\end{minted}

My issue is that, before this block, all my paragraphs show up with some whitespace between them, and a slight indentation on the first line, whereas after this block ends, all the paragraphs for the rest of the document have no indentation and no space between them. What is causing this to happen and how to undo it?

Full working example

\documentclass[12pt, twoside]{report}
\usepackage[a4paper,width=150mm, top=25mm, bottom=25mm, bindingoffset=6mm]{geometry}
\usepackage{minted}
\usepackage{caption}
\usepackage[backend=biber,style=numeric,hyperref=true]{biblatex}
\setlength{\parindent}{1em}
\setlength{\parskip}{1em}
\raggedbottom

\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tristique mollis diam, porttitor vehicula erat sagittis ac. Praesent vel placerat velit. Donec risus lorem, faucibus vitae metus et, aliquet hendrerit neque. Cras in dui vitae libero egestas suscipit bibendum eget mauris. Quisque mollis metus felis, et rutrum felis imperdiet at. Aenean quis ligula ligula. Curabitur diam velit, ultrices at ullamcorper eu, elementum pharetra metus. Nulla lacinia sem ac purus consequat accumsan. Vivamus sit amet accumsan ante, at gravida odio. Integer mi diam, eleifend in lectus in, pulvinar placerat risus.

In in eros vel odio ultricies volutpat eget sit amet velit. Nulla libero nisi, elementum quis enim finibus, fermentum vulputate magna. Donec sem tortor, facilisis ut tristique sit amet, pulvinar nec nibh. Aliquam semper nunc eu tortor laoreet auctor. Aenean quis tellus dignissim, feugiat ex nec, vestibulum magna. Proin finibus sollicitudin volutpat. Nulla malesuada rutrum metus, non faucibus purus consectetur eget. Sed bibendum sapien sagittis, convallis ligula non, finibus mauris. Vivamus varius euismod augue, vitae convallis massa. Ut molestie orci in odio semper molestie. Mauris finibus, velit at tempor dictum, mi mi fermentum quam, eu viverra augue magna in mauris. Nulla facilisi. Proin vulputate urna et lacus ultricies aliquet.

Vivamus a eros non enim venenatis pretium. Suspendisse aliquet enim sed ex laoreet, quis condimentum tortor luctus. Nam condimentum vitae ante blandit viverra. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis faucibus quis felis quis consequat. Nam feugiat vel sem gravida posuere. Donec tincidunt tincidunt enim a interdum. Integer malesuada congue turpis, eu pellentesque orci iaculis id. Suspendisse potenti.

\captionof{listing} {Salt state for setting up a PostgreSQL server. \label{lst:salt_state_postgres}}
\begin{minted}
[
breaklines=true,
linenos,
fontsize=\footnotesize,
frame=lines,
framesep=2mm,
baselinestretch=1.2
]
{yaml}
install_server:
  pkg.installed:
    - name: postgresql95-server.x86_64

initialize_db:
  cmd.run:
    - name: /usr/pgsql-9.5/bin/postgresql95-setup initdb
    - unless: stat /var/lib/psql/9.5/data/postgresql.conf

/var/lib/pgsql/9.5/data/postgresql.conf:
  file.managed:
    - source: salt://postgres/config/postgresql.conf
    - user: postgres
    - group: postgres
    - mode: 600
    - makedirs: True

start_server:    
  service.running:
    - name: postgresql-9.5
    - watch:
      - file: /var/lib/pgsql/9.5/data/*
\end{minted}

Ut sodales lacus facilisis eros iaculis, eget fermentum ex consequat. Aliquam et convallis elit, quis dapibus tellus. Integer ornare, justo dapibus facilisis hendrerit, justo purus faucibus nisi, placerat feugiat nulla ligula nec tortor. Donec erat mi, feugiat nec aliquet eu, lobortis quis purus. Mauris varius et metus id pulvinar. Nullam euismod placerat nunc, sed bibendum massa pretium eu. Pellentesque aliquet, ipsum vel iaculis efficitur, dui ipsum luctus libero, eget lacinia arcu risus ac leo. Pellentesque in aliquam tellus.

Duis id enim vestibulum, tincidunt magna sed, malesuada elit. Phasellus porttitor, tellus sed imperdiet vulputate, est eros interdum tellus, a rutrum erat velit ut diam. In et velit bibendum, dapibus elit eu, hendrerit lectus. Fusce vehicula egestas justo quis imperdiet. Nunc vel eleifend risus. Donec auctor interdum arcu, nec tempus enim. Donec ornare nec tellus non rutrum.

Duis id urna consectetur, dignissim diam eget, tincidunt risus. Curabitur sit amet orci et odio luctus tempus. Integer vitae arcu aliquet, gravida nisl non, hendrerit lorem. Curabitur vestibulum elit orci, in dapibus velit scelerisque nec. Suspendisse a nunc quis dolor auctor tincidunt euismod tincidunt massa. Mauris in mauris non diam condimentum consectetur. Curabitur sed scelerisque quam. Duis at suscipit nibh. Vestibulum nec iaculis nisi. Pellentesque venenatis porttitor elit, quis facilisis lorem ultrices nec.


\end{document}

Thanks.

  • Don't use \captionof outside of an environment or group: tex.stackexchange.com/q/62875/35864. See also the warning: Package caption Warning: \captionsetup{type*=...} or \captionof outside box or environment on input line 17. See the caption package documentation for explanation. in your .logfile. – moewe Apr 12 at 11:59
  • Add \begingroup and \endgroup. – user156344 Apr 12 at 12:00
  • Totally off-topic, but because it caught my eye: The option hyperref=true for biblatex is usually useless (especially if you don't read all the warnings you get carefully). The default setting hyperref=auto, differs from hyperref=true only in that true issues a warning if the hyperref package is not loaded. In particular both the default hyperref=auto and hyperref=true will produce links if and only if hyperref is loaded. – moewe Apr 12 at 12:03
  • Thanks, I didn't realize that. True Latex neophyte, just trying to write my thesis. – llevar Apr 12 at 12:09
1

The warning says it all. Never ignore warnings.

Package caption Warning: \captionsetup{type*=...} or \captionof 
outside box or environment on input line 17. See the caption 
package documentation for explanation.

A fix: put the listing to a group:

\documentclass[12pt, twoside]{report}
\usepackage[a4paper,width=150mm, top=25mm, bottom=25mm, bindingoffset=6mm]{geometry}
\usepackage{minted}
\usepackage{caption}
\usepackage[backend=biber,style=numeric,hyperref=true]{biblatex}
\setlength{\parindent}{1em}
\setlength{\parskip}{1em}
\raggedbottom

\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tristique mollis diam, porttitor vehicula erat sagittis ac. Praesent vel placerat velit. Donec risus lorem, faucibus vitae metus et, aliquet hendrerit neque. Cras in dui vitae libero egestas suscipit bibendum eget mauris. Quisque mollis metus felis, et rutrum felis imperdiet at. Aenean quis ligula ligula. Curabitur diam velit, ultrices at ullamcorper eu, elementum pharetra metus. Nulla lacinia sem ac purus consequat accumsan. Vivamus sit amet accumsan ante, at gravida odio. Integer mi diam, eleifend in lectus in, pulvinar placerat risus.

In in eros vel odio ultricies volutpat eget sit amet velit. Nulla libero nisi, elementum quis enim finibus, fermentum vulputate magna. Donec sem tortor, facilisis ut tristique sit amet, pulvinar nec nibh. Aliquam semper nunc eu tortor laoreet auctor. Aenean quis tellus dignissim, feugiat ex nec, vestibulum magna. Proin finibus sollicitudin volutpat. Nulla malesuada rutrum metus, non faucibus purus consectetur eget. Sed bibendum sapien sagittis, convallis ligula non, finibus mauris. Vivamus varius euismod augue, vitae convallis massa. Ut molestie orci in odio semper molestie. Mauris finibus, velit at tempor dictum, mi mi fermentum quam, eu viverra augue magna in mauris. Nulla facilisi. Proin vulputate urna et lacus ultricies aliquet.

Vivamus a eros non enim venenatis pretium. Suspendisse aliquet enim sed ex laoreet, quis condimentum tortor luctus. Nam condimentum vitae ante blandit viverra. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis faucibus quis felis quis consequat. Nam feugiat vel sem gravida posuere. Donec tincidunt tincidunt enim a interdum. Integer malesuada congue turpis, eu pellentesque orci iaculis id. Suspendisse potenti.

\begingroup
\captionof{listing} {Salt state for setting up a PostgreSQL server. \label{lst:salt_state_postgres}}
\begin{minted}
[
breaklines=true,
linenos,
fontsize=\footnotesize,
frame=lines,
framesep=2mm,
baselinestretch=1.2
]
{yaml}
install_server:
  pkg.installed:
    - name: postgresql95-server.x86_64

initialize_db:
  cmd.run:
    - name: /usr/pgsql-9.5/bin/postgresql95-setup initdb
    - unless: stat /var/lib/psql/9.5/data/postgresql.conf

/var/lib/pgsql/9.5/data/postgresql.conf:
  file.managed:
    - source: salt://postgres/config/postgresql.conf
    - user: postgres
    - group: postgres
    - mode: 600
    - makedirs: True

start_server:    
  service.running:
    - name: postgresql-9.5
    - watch:
      - file: /var/lib/pgsql/9.5/data/*
\end{minted}
\endgroup

Ut sodales lacus facilisis eros iaculis, eget fermentum ex consequat. Aliquam et convallis elit, quis dapibus tellus. Integer ornare, justo dapibus facilisis hendrerit, justo purus faucibus nisi, placerat feugiat nulla ligula nec tortor. Donec erat mi, feugiat nec aliquet eu, lobortis quis purus. Mauris varius et metus id pulvinar. Nullam euismod placerat nunc, sed bibendum massa pretium eu. Pellentesque aliquet, ipsum vel iaculis efficitur, dui ipsum luctus libero, eget lacinia arcu risus ac leo. Pellentesque in aliquam tellus.

Duis id enim vestibulum, tincidunt magna sed, malesuada elit. Phasellus porttitor, tellus sed imperdiet vulputate, est eros interdum tellus, a rutrum erat velit ut diam. In et velit bibendum, dapibus elit eu, hendrerit lectus. Fusce vehicula egestas justo quis imperdiet. Nunc vel eleifend risus. Donec auctor interdum arcu, nec tempus enim. Donec ornare nec tellus non rutrum.

Duis id urna consectetur, dignissim diam eget, tincidunt risus. Curabitur sit amet orci et odio luctus tempus. Integer vitae arcu aliquet, gravida nisl non, hendrerit lorem. Curabitur vestibulum elit orci, in dapibus velit scelerisque nec. Suspendisse a nunc quis dolor auctor tincidunt euismod tincidunt massa. Mauris in mauris non diam condimentum consectetur. Curabitur sed scelerisque quam. Duis at suscipit nibh. Vestibulum nec iaculis nisi. Pellentesque venenatis porttitor elit, quis facilisis lorem ultrices nec.


\end{document}
  • There are some warnings that can be safely ignored. But at the very least one should always read all warnings and try to minimise the number of warnings in a document. If one decides to ignore a warning that should be a conscious decision and one should ideally know the possible bad consequences. – moewe Apr 12 at 12:05
  • Thank you for your help JouleV. I see you've removed some of your comments, but you come off rather curt and patronizing. Appreciate the help, but not the attitude. – llevar Apr 12 at 12:07
  • My editor Visual Studio Code doesn't really show warnings, only "Problems", and this wasn't flagged as a problem. – llevar Apr 12 at 12:08
  • @llevar Soon or late those comments will be removed because they are not needed anymore. Once the request of posting an MWE is done, I will remove the request, as everyone here. – user156344 Apr 12 at 12:09

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.