4

I am using KOMA-Script and \DeclareNewTOC to create custom float and inline environments. For my document, I would like to have spacing between paragraphs. I use the parskip option of the KOMA-Script class. This option gets applied to the regular paragraphs as expected but not for the paragraphs inside the environments generated by \DeclareNewTOC.

How can I generate floating and inline environments which acts exactly like the rest of the document?

\documentclass[parskip]{scrartcl}
\DeclareNewTOC[
  type=tip,
  float,
  nonfloat,
]{tip}

\usepackage{lipsum}
\begin{document}
  \lipsum[1-2]
  \begin{tip}
    \caption{Floating}
    \lipsum[3-4]
  \end{tip}
  \lipsum[5]
  \begin{tip-}
    \caption{Inline}
    \lipsum[6-7]
  \end{tip-}
  \lipsum[8-9]
\end{document}

Page 1 Page 2

3

You can use option atbegin={\KOMAoptions{parskip}} for the new environments:

\documentclass[parskip]{scrartcl}
\DeclareNewTOC[
  type=tip,
  float,
  nonfloat,
  atbegin={\KOMAoptions{parskip}}% <- added
]{tip}

\usepackage{lipsum}
\begin{document}
  \lipsum[1-2]
  \begin{tip}
    \caption{Floating}
    \lipsum[3-4]
  \end{tip}
  \lipsum[5]
  \begin{tip-}
    \caption{Inline}
    \lipsum[6-7]
  \end{tip-}
  \lipsum[8-9]
\end{document}

enter image description here

  • Some times one misses the obvious. Thanks for helping me out. – Corvus Jan 16 '17 at 18:07

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.