Is it possible to have `partopsep` added below a list environment that is followed by a new paragraph?












2















Given the following minimal example



documentclass[parskip=full]{scrreprt}
usepackage[onehalfspacing]{setspace}
usepackage{enumitem}
usepackage{lipsum}

setlist{
parsep=parsep,
itemsep=-.5parsep,
topsep=-.5parsep,
partopsep=.5parsep
}

begin{document}
lipsum[1]
begin{itemize}
item list
item between
item paragraphs
end{itemize}
lipsum[2]

begin{itemize}
item list
item in
item own
item paragraph
end{itemize}

lipsum[3]
begin{itemize}
item list
item above
item paragraph
end{itemize}

lipsum[4-5]
end{document}


The first and second lists are spaced as expected, with the second list spaced as an individual paragraph (compare with last two paragraphs).
However, the third list is spaced in the same way as the first one, even though it is followed by an unrelated paragraph.



This answer states that partopsep is added above and below a list environment if it begins a new paragraph.
Is there a (reasonably simple) way to get a partopsep added only to the bottom if a list environment is followed by a new paragraph?










share|improve this question















This question has an open bounty worth +50
reputation from KJO ending in 4 days.


This question has not received enough attention.





















    2















    Given the following minimal example



    documentclass[parskip=full]{scrreprt}
    usepackage[onehalfspacing]{setspace}
    usepackage{enumitem}
    usepackage{lipsum}

    setlist{
    parsep=parsep,
    itemsep=-.5parsep,
    topsep=-.5parsep,
    partopsep=.5parsep
    }

    begin{document}
    lipsum[1]
    begin{itemize}
    item list
    item between
    item paragraphs
    end{itemize}
    lipsum[2]

    begin{itemize}
    item list
    item in
    item own
    item paragraph
    end{itemize}

    lipsum[3]
    begin{itemize}
    item list
    item above
    item paragraph
    end{itemize}

    lipsum[4-5]
    end{document}


    The first and second lists are spaced as expected, with the second list spaced as an individual paragraph (compare with last two paragraphs).
    However, the third list is spaced in the same way as the first one, even though it is followed by an unrelated paragraph.



    This answer states that partopsep is added above and below a list environment if it begins a new paragraph.
    Is there a (reasonably simple) way to get a partopsep added only to the bottom if a list environment is followed by a new paragraph?










    share|improve this question















    This question has an open bounty worth +50
    reputation from KJO ending in 4 days.


    This question has not received enough attention.



















      2












      2








      2








      Given the following minimal example



      documentclass[parskip=full]{scrreprt}
      usepackage[onehalfspacing]{setspace}
      usepackage{enumitem}
      usepackage{lipsum}

      setlist{
      parsep=parsep,
      itemsep=-.5parsep,
      topsep=-.5parsep,
      partopsep=.5parsep
      }

      begin{document}
      lipsum[1]
      begin{itemize}
      item list
      item between
      item paragraphs
      end{itemize}
      lipsum[2]

      begin{itemize}
      item list
      item in
      item own
      item paragraph
      end{itemize}

      lipsum[3]
      begin{itemize}
      item list
      item above
      item paragraph
      end{itemize}

      lipsum[4-5]
      end{document}


      The first and second lists are spaced as expected, with the second list spaced as an individual paragraph (compare with last two paragraphs).
      However, the third list is spaced in the same way as the first one, even though it is followed by an unrelated paragraph.



      This answer states that partopsep is added above and below a list environment if it begins a new paragraph.
      Is there a (reasonably simple) way to get a partopsep added only to the bottom if a list environment is followed by a new paragraph?










      share|improve this question














      Given the following minimal example



      documentclass[parskip=full]{scrreprt}
      usepackage[onehalfspacing]{setspace}
      usepackage{enumitem}
      usepackage{lipsum}

      setlist{
      parsep=parsep,
      itemsep=-.5parsep,
      topsep=-.5parsep,
      partopsep=.5parsep
      }

      begin{document}
      lipsum[1]
      begin{itemize}
      item list
      item between
      item paragraphs
      end{itemize}
      lipsum[2]

      begin{itemize}
      item list
      item in
      item own
      item paragraph
      end{itemize}

      lipsum[3]
      begin{itemize}
      item list
      item above
      item paragraph
      end{itemize}

      lipsum[4-5]
      end{document}


      The first and second lists are spaced as expected, with the second list spaced as an individual paragraph (compare with last two paragraphs).
      However, the third list is spaced in the same way as the first one, even though it is followed by an unrelated paragraph.



      This answer states that partopsep is added above and below a list environment if it begins a new paragraph.
      Is there a (reasonably simple) way to get a partopsep added only to the bottom if a list environment is followed by a new paragraph?







      spacing lists paragraphs enumitem






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 26 at 10:00









      JoeJoe

      25419




      25419






      This question has an open bounty worth +50
      reputation from KJO ending in 4 days.


      This question has not received enough attention.








      This question has an open bounty worth +50
      reputation from KJO ending in 4 days.


      This question has not received enough attention.
























          1 Answer
          1






          active

          oldest

          votes


















          1














          Interesting question. Here's my attempt at a solution. You have to enable it for a particular list by adding first={useparbotsep}. It modifies one macro from latex.ltx (@doendpe), but hopefully in a way that only makes a difference when useparbotsep is called.



          documentclass[parskip=full]{scrreprt}
          usepackage[onehalfspacing]{setspace}
          usepackage{enumitem}

          makeatletter
          newskipbottomsepadd
          newififparbotsep
          defuseparbotsep{%
          globalbottomsepaddpartopsep
          global@topsepaddtopsep
          globalparbotseptrue}
          def@doendpe{% <- modified from latex.ltx (hopefully with no side effects)
          @endpetrue
          defpar{@restorepar
          clubpenalty@clubpenalty
          everypar{}%
          ifparbotsep
          if@endpevskipbottomsepaddfi
          globalparbotsepfalse
          fi
          par@endpefalse}
          everypar{{setboxz@lastbox}%
          everypar{}@endpefalse}}
          makeatother

          setlist{
          parsep=parsep,
          itemsep=-.5parsep,
          topsep=-.5parsep,
          partopsep=.5parsep,
          first={useparbotsep}
          }

          begin{document}

          vskip 5pthrulevskip 5pt


          List within paragraph:
          begin{itemize}
          item List item.
          item List item.
          item List item.
          end{itemize}
          End of List within paragraph.

          vskip 5pthrulevskip 5pt


          List as its on paragraph:

          begin{itemize}
          item List item.
          item List item.
          item List item.
          end{itemize}

          Paragraph following list as its own paragraph.

          vskip 5pthrulevskip 5pt


          List above paragraph:

          begin{itemize}
          item List item.
          item List item.
          item List item.
          end{itemize}
          Text following list.

          vskip 5pthrulevskip 5pt


          List below paragraph:
          begin{itemize}
          item List item.
          item List item.
          item List item.
          end{itemize}

          Paragraph following list.

          vskip 5pthrulevskip 5pt
          end{document}


          output






          share|improve this answer


























          • Interesting step towards a solution, but if a call has to be made manually, it would probably be simpler to just add a vspace

            – Joe
            yesterday











          • @Joe, well its better than that. It figures out whether you need the vspace for each list environment. And you only have to set up the lists once in your preamble. @doendpe is used for many things. So you have to restrict it to lists somehow and extra calculations have to be done at the start of the list.

            – David Purton
            yesterday











          • Sorry, Must have misread the answer (on my phone right now). I’ll check it out in more detail later.

            – Joe
            yesterday











          • @Joe, it doesn't work with nested lists :(. Perhaps I (or someone else) can work it out.

            – David Purton
            yesterday











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f476728%2fis-it-possible-to-have-partopsep-added-below-a-list-environment-that-is-follo%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          Interesting question. Here's my attempt at a solution. You have to enable it for a particular list by adding first={useparbotsep}. It modifies one macro from latex.ltx (@doendpe), but hopefully in a way that only makes a difference when useparbotsep is called.



          documentclass[parskip=full]{scrreprt}
          usepackage[onehalfspacing]{setspace}
          usepackage{enumitem}

          makeatletter
          newskipbottomsepadd
          newififparbotsep
          defuseparbotsep{%
          globalbottomsepaddpartopsep
          global@topsepaddtopsep
          globalparbotseptrue}
          def@doendpe{% <- modified from latex.ltx (hopefully with no side effects)
          @endpetrue
          defpar{@restorepar
          clubpenalty@clubpenalty
          everypar{}%
          ifparbotsep
          if@endpevskipbottomsepaddfi
          globalparbotsepfalse
          fi
          par@endpefalse}
          everypar{{setboxz@lastbox}%
          everypar{}@endpefalse}}
          makeatother

          setlist{
          parsep=parsep,
          itemsep=-.5parsep,
          topsep=-.5parsep,
          partopsep=.5parsep,
          first={useparbotsep}
          }

          begin{document}

          vskip 5pthrulevskip 5pt


          List within paragraph:
          begin{itemize}
          item List item.
          item List item.
          item List item.
          end{itemize}
          End of List within paragraph.

          vskip 5pthrulevskip 5pt


          List as its on paragraph:

          begin{itemize}
          item List item.
          item List item.
          item List item.
          end{itemize}

          Paragraph following list as its own paragraph.

          vskip 5pthrulevskip 5pt


          List above paragraph:

          begin{itemize}
          item List item.
          item List item.
          item List item.
          end{itemize}
          Text following list.

          vskip 5pthrulevskip 5pt


          List below paragraph:
          begin{itemize}
          item List item.
          item List item.
          item List item.
          end{itemize}

          Paragraph following list.

          vskip 5pthrulevskip 5pt
          end{document}


          output






          share|improve this answer


























          • Interesting step towards a solution, but if a call has to be made manually, it would probably be simpler to just add a vspace

            – Joe
            yesterday











          • @Joe, well its better than that. It figures out whether you need the vspace for each list environment. And you only have to set up the lists once in your preamble. @doendpe is used for many things. So you have to restrict it to lists somehow and extra calculations have to be done at the start of the list.

            – David Purton
            yesterday











          • Sorry, Must have misread the answer (on my phone right now). I’ll check it out in more detail later.

            – Joe
            yesterday











          • @Joe, it doesn't work with nested lists :(. Perhaps I (or someone else) can work it out.

            – David Purton
            yesterday
















          1














          Interesting question. Here's my attempt at a solution. You have to enable it for a particular list by adding first={useparbotsep}. It modifies one macro from latex.ltx (@doendpe), but hopefully in a way that only makes a difference when useparbotsep is called.



          documentclass[parskip=full]{scrreprt}
          usepackage[onehalfspacing]{setspace}
          usepackage{enumitem}

          makeatletter
          newskipbottomsepadd
          newififparbotsep
          defuseparbotsep{%
          globalbottomsepaddpartopsep
          global@topsepaddtopsep
          globalparbotseptrue}
          def@doendpe{% <- modified from latex.ltx (hopefully with no side effects)
          @endpetrue
          defpar{@restorepar
          clubpenalty@clubpenalty
          everypar{}%
          ifparbotsep
          if@endpevskipbottomsepaddfi
          globalparbotsepfalse
          fi
          par@endpefalse}
          everypar{{setboxz@lastbox}%
          everypar{}@endpefalse}}
          makeatother

          setlist{
          parsep=parsep,
          itemsep=-.5parsep,
          topsep=-.5parsep,
          partopsep=.5parsep,
          first={useparbotsep}
          }

          begin{document}

          vskip 5pthrulevskip 5pt


          List within paragraph:
          begin{itemize}
          item List item.
          item List item.
          item List item.
          end{itemize}
          End of List within paragraph.

          vskip 5pthrulevskip 5pt


          List as its on paragraph:

          begin{itemize}
          item List item.
          item List item.
          item List item.
          end{itemize}

          Paragraph following list as its own paragraph.

          vskip 5pthrulevskip 5pt


          List above paragraph:

          begin{itemize}
          item List item.
          item List item.
          item List item.
          end{itemize}
          Text following list.

          vskip 5pthrulevskip 5pt


          List below paragraph:
          begin{itemize}
          item List item.
          item List item.
          item List item.
          end{itemize}

          Paragraph following list.

          vskip 5pthrulevskip 5pt
          end{document}


          output






          share|improve this answer


























          • Interesting step towards a solution, but if a call has to be made manually, it would probably be simpler to just add a vspace

            – Joe
            yesterday











          • @Joe, well its better than that. It figures out whether you need the vspace for each list environment. And you only have to set up the lists once in your preamble. @doendpe is used for many things. So you have to restrict it to lists somehow and extra calculations have to be done at the start of the list.

            – David Purton
            yesterday











          • Sorry, Must have misread the answer (on my phone right now). I’ll check it out in more detail later.

            – Joe
            yesterday











          • @Joe, it doesn't work with nested lists :(. Perhaps I (or someone else) can work it out.

            – David Purton
            yesterday














          1












          1








          1







          Interesting question. Here's my attempt at a solution. You have to enable it for a particular list by adding first={useparbotsep}. It modifies one macro from latex.ltx (@doendpe), but hopefully in a way that only makes a difference when useparbotsep is called.



          documentclass[parskip=full]{scrreprt}
          usepackage[onehalfspacing]{setspace}
          usepackage{enumitem}

          makeatletter
          newskipbottomsepadd
          newififparbotsep
          defuseparbotsep{%
          globalbottomsepaddpartopsep
          global@topsepaddtopsep
          globalparbotseptrue}
          def@doendpe{% <- modified from latex.ltx (hopefully with no side effects)
          @endpetrue
          defpar{@restorepar
          clubpenalty@clubpenalty
          everypar{}%
          ifparbotsep
          if@endpevskipbottomsepaddfi
          globalparbotsepfalse
          fi
          par@endpefalse}
          everypar{{setboxz@lastbox}%
          everypar{}@endpefalse}}
          makeatother

          setlist{
          parsep=parsep,
          itemsep=-.5parsep,
          topsep=-.5parsep,
          partopsep=.5parsep,
          first={useparbotsep}
          }

          begin{document}

          vskip 5pthrulevskip 5pt


          List within paragraph:
          begin{itemize}
          item List item.
          item List item.
          item List item.
          end{itemize}
          End of List within paragraph.

          vskip 5pthrulevskip 5pt


          List as its on paragraph:

          begin{itemize}
          item List item.
          item List item.
          item List item.
          end{itemize}

          Paragraph following list as its own paragraph.

          vskip 5pthrulevskip 5pt


          List above paragraph:

          begin{itemize}
          item List item.
          item List item.
          item List item.
          end{itemize}
          Text following list.

          vskip 5pthrulevskip 5pt


          List below paragraph:
          begin{itemize}
          item List item.
          item List item.
          item List item.
          end{itemize}

          Paragraph following list.

          vskip 5pthrulevskip 5pt
          end{document}


          output






          share|improve this answer















          Interesting question. Here's my attempt at a solution. You have to enable it for a particular list by adding first={useparbotsep}. It modifies one macro from latex.ltx (@doendpe), but hopefully in a way that only makes a difference when useparbotsep is called.



          documentclass[parskip=full]{scrreprt}
          usepackage[onehalfspacing]{setspace}
          usepackage{enumitem}

          makeatletter
          newskipbottomsepadd
          newififparbotsep
          defuseparbotsep{%
          globalbottomsepaddpartopsep
          global@topsepaddtopsep
          globalparbotseptrue}
          def@doendpe{% <- modified from latex.ltx (hopefully with no side effects)
          @endpetrue
          defpar{@restorepar
          clubpenalty@clubpenalty
          everypar{}%
          ifparbotsep
          if@endpevskipbottomsepaddfi
          globalparbotsepfalse
          fi
          par@endpefalse}
          everypar{{setboxz@lastbox}%
          everypar{}@endpefalse}}
          makeatother

          setlist{
          parsep=parsep,
          itemsep=-.5parsep,
          topsep=-.5parsep,
          partopsep=.5parsep,
          first={useparbotsep}
          }

          begin{document}

          vskip 5pthrulevskip 5pt


          List within paragraph:
          begin{itemize}
          item List item.
          item List item.
          item List item.
          end{itemize}
          End of List within paragraph.

          vskip 5pthrulevskip 5pt


          List as its on paragraph:

          begin{itemize}
          item List item.
          item List item.
          item List item.
          end{itemize}

          Paragraph following list as its own paragraph.

          vskip 5pthrulevskip 5pt


          List above paragraph:

          begin{itemize}
          item List item.
          item List item.
          item List item.
          end{itemize}
          Text following list.

          vskip 5pthrulevskip 5pt


          List below paragraph:
          begin{itemize}
          item List item.
          item List item.
          item List item.
          end{itemize}

          Paragraph following list.

          vskip 5pthrulevskip 5pt
          end{document}


          output







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited yesterday

























          answered yesterday









          David PurtonDavid Purton

          10.2k2937




          10.2k2937













          • Interesting step towards a solution, but if a call has to be made manually, it would probably be simpler to just add a vspace

            – Joe
            yesterday











          • @Joe, well its better than that. It figures out whether you need the vspace for each list environment. And you only have to set up the lists once in your preamble. @doendpe is used for many things. So you have to restrict it to lists somehow and extra calculations have to be done at the start of the list.

            – David Purton
            yesterday











          • Sorry, Must have misread the answer (on my phone right now). I’ll check it out in more detail later.

            – Joe
            yesterday











          • @Joe, it doesn't work with nested lists :(. Perhaps I (or someone else) can work it out.

            – David Purton
            yesterday



















          • Interesting step towards a solution, but if a call has to be made manually, it would probably be simpler to just add a vspace

            – Joe
            yesterday











          • @Joe, well its better than that. It figures out whether you need the vspace for each list environment. And you only have to set up the lists once in your preamble. @doendpe is used for many things. So you have to restrict it to lists somehow and extra calculations have to be done at the start of the list.

            – David Purton
            yesterday











          • Sorry, Must have misread the answer (on my phone right now). I’ll check it out in more detail later.

            – Joe
            yesterday











          • @Joe, it doesn't work with nested lists :(. Perhaps I (or someone else) can work it out.

            – David Purton
            yesterday

















          Interesting step towards a solution, but if a call has to be made manually, it would probably be simpler to just add a vspace

          – Joe
          yesterday





          Interesting step towards a solution, but if a call has to be made manually, it would probably be simpler to just add a vspace

          – Joe
          yesterday













          @Joe, well its better than that. It figures out whether you need the vspace for each list environment. And you only have to set up the lists once in your preamble. @doendpe is used for many things. So you have to restrict it to lists somehow and extra calculations have to be done at the start of the list.

          – David Purton
          yesterday





          @Joe, well its better than that. It figures out whether you need the vspace for each list environment. And you only have to set up the lists once in your preamble. @doendpe is used for many things. So you have to restrict it to lists somehow and extra calculations have to be done at the start of the list.

          – David Purton
          yesterday













          Sorry, Must have misread the answer (on my phone right now). I’ll check it out in more detail later.

          – Joe
          yesterday





          Sorry, Must have misread the answer (on my phone right now). I’ll check it out in more detail later.

          – Joe
          yesterday













          @Joe, it doesn't work with nested lists :(. Perhaps I (or someone else) can work it out.

          – David Purton
          yesterday





          @Joe, it doesn't work with nested lists :(. Perhaps I (or someone else) can work it out.

          – David Purton
          yesterday


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f476728%2fis-it-possible-to-have-partopsep-added-below-a-list-environment-that-is-follo%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to change which sound is reproduced for terminal bell?

          Can I use Tabulator js library in my java Spring + Thymeleaf project?

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents