Code spanning over two pages with minted, inside listing with captionMinted in listing: break code across...

How to prevent users from executing commands through browser URL

Advice for a new journal editor

Can an insurance company drop you after receiving a bill and refusing to pay?

What is 6÷2×(1+2) =?

How should I handle players who ignore the session zero agreement?

What's a good word to describe a public place that looks like it wouldn't be rough?

Can I string the D&D Starter Set campaign into another module, keeping the same characters?

Why are the books in the Game of Thrones citadel library shelved spine inwards?

Can we use the stored gravitational potential energy of a building to produce power?

How to count the characters of jar files by wc

How to avoid being sexist when trying to employ someone to function in a very sexist environment?

Writing a character who is going through a civilizing process without overdoing it?

How would an AI self awareness kill switch work?

Why zero tolerance on nudity in space?

It took me a lot of time to make this, pls like. (YouTube Comments #1)

Traveling through the asteriod belt?

Could a phylactery of a lich be a mirror or does it have to be a box?

How to deal with an incendiary email that was recalled

Why did other German political parties disband so fast when Hitler was appointed chancellor?

Roman Numerals equation 1

Dilemma of explaining to interviewer that he is the reason for declining second interview

Is it a fallacy if someone claims they need an explanation for every word of your argument to the point where they don't understand common terms?

Can making a creature unable to attack after it has been assigned as an attacker remove it from combat?

Strange Sign on Lab Door



Code spanning over two pages with minted, inside listing with caption


Minted in listing: break code across pages?minted vs. texments vs. verbmentsLabel and caption without floatminted truncates the code if it doesn't fit into one pageCaption and label on Minted codePagebreak for minted in figurePrevent caption to appear on separate pageSpaces and page break inside a minted listingPseudo code to be spread over multiple pages?Minted split code into two pagesCode over two Pages and continue counting LinesPrevent caption to appear on separate pageHow to make a minted code listing centered on a page?Split algorithm over two pages, inside a for loopPython console code with mintedCaption and label on Minted codeHow to let minted break across pages but keep the caption together with the end of listing?Spaces and page break inside a minted listing













39















I am trying using minted to display some code in my document, but the code is long and spans over two pages, this works fine, however when I place my code inside



begin{listing}
inputminted{java}{code/JavaCode.java}
caption{Some caption}
label{label1}
end{listing}


Then my code doesn't show up and I get the warning:




LaTeX Warning: Float too large for page




I have tried using the option H in listing, but then the code shows in only one page and it doesn't fit so I only see a part of it.



I also tried with the code directly in the latex document ie:



begin{listing}
begin{minted}{java}
Java code
end{minted}
caption{Some caption}
label{label1}
end{listing}


But the same happens, any ideas?










share|improve this question



























    39















    I am trying using minted to display some code in my document, but the code is long and spans over two pages, this works fine, however when I place my code inside



    begin{listing}
    inputminted{java}{code/JavaCode.java}
    caption{Some caption}
    label{label1}
    end{listing}


    Then my code doesn't show up and I get the warning:




    LaTeX Warning: Float too large for page




    I have tried using the option H in listing, but then the code shows in only one page and it doesn't fit so I only see a part of it.



    I also tried with the code directly in the latex document ie:



    begin{listing}
    begin{minted}{java}
    Java code
    end{minted}
    caption{Some caption}
    label{label1}
    end{listing}


    But the same happens, any ideas?










    share|improve this question

























      39












      39








      39


      13






      I am trying using minted to display some code in my document, but the code is long and spans over two pages, this works fine, however when I place my code inside



      begin{listing}
      inputminted{java}{code/JavaCode.java}
      caption{Some caption}
      label{label1}
      end{listing}


      Then my code doesn't show up and I get the warning:




      LaTeX Warning: Float too large for page




      I have tried using the option H in listing, but then the code shows in only one page and it doesn't fit so I only see a part of it.



      I also tried with the code directly in the latex document ie:



      begin{listing}
      begin{minted}{java}
      Java code
      end{minted}
      caption{Some caption}
      label{label1}
      end{listing}


      But the same happens, any ideas?










      share|improve this question














      I am trying using minted to display some code in my document, but the code is long and spans over two pages, this works fine, however when I place my code inside



      begin{listing}
      inputminted{java}{code/JavaCode.java}
      caption{Some caption}
      label{label1}
      end{listing}


      Then my code doesn't show up and I get the warning:




      LaTeX Warning: Float too large for page




      I have tried using the option H in listing, but then the code shows in only one page and it doesn't fit so I only see a part of it.



      I also tried with the code directly in the latex document ie:



      begin{listing}
      begin{minted}{java}
      Java code
      end{minted}
      caption{Some caption}
      label{label1}
      end{listing}


      But the same happens, any ideas?







      floats page-breaking highlighting minted code






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 1 '11 at 19:46









      lander16lander16

      32538




      32538






















          3 Answers
          3






          active

          oldest

          votes


















          28














          As far as I know, this is a fundamental restriction of floats. You cannot use floats that span over more than one page so you need to remove the surrounding listing.



          To make the caption still work, you can load the caption package and use the captionof command instead of caption:



          inputminted{java}{code/JavaCode.java}
          captionof{listing}{Some caption}


          Now the caption should also appear in the listoflistings.
          If you want to use a label here, you need to put it inside the captionof command:



          captionof{listing}{Some captionlabel{lst:some-label}}


          See also: Question “Label and caption without float”.






          share|improve this answer


























          • Thanks! This works. Is there a way to also add a label so I can reference it from other part of my text? Also, if I use this, then then listoflistings won't list my code right?

            – lander16
            Mar 1 '11 at 20:05











          • @lander See updated answer.

            – Konrad Rudolph
            Mar 1 '11 at 20:16






          • 2





            captionof requires an environment so this does not work correctly, see my answer.

            – schlamar
            Apr 27 '12 at 8:43











          • @ms4py Is right.

            – Konrad Rudolph
            Apr 27 '12 at 8:51











          • I realize that minted is not really maintained anymore, but still thought I should mention that page-spanning breaks the moment you set a background colour.

            – Stephen Bosch
            Sep 22 '13 at 14:46



















          21














          The suggested and accepted answer does not work correctly as the captionof command requires to be inside an environment. This is pointed out in the caption documentation. For example in my case there was no proper vertical space after the caption.



          A proper solution is to define a new environment:



          usepackage{caption}
          % ...
          newenvironment{code}{captionsetup{type=listing}}{}

          begin{code}
          begin{minted}[frame=single]{py}
          def my_func(x):
          print x
          end{minted}
          caption{My Func}
          label{lst:my_func}
          end{code}





          share|improve this answer





















          • 2





            When I use this solution with inputminted, page spanning breaks.

            – Stephen Bosch
            Sep 22 '13 at 14:55








          • 2





            I am using inputminted and it's running perfectly in my case. Are you sure you've included the caption package ?

            – Overdrivr
            Jan 11 '17 at 9:40



















          0














          Adapting the solution by @Konrad Rudolph to something that is simple and doesn't break anything:



          inputminted[linenos]{python}{code.py}
          begin{figure}[H]
          caption{Hello.}
          label{fig:foo}
          end{figure}


          Of course, this is going to be named and listed as a Figure, but that's not a problem for me.






          share|improve this answer
























          • You don't need to use a figure float. If captionof doesn't work for you (which, weird!) you can (and should) simply use a listing float environment.

            – Konrad Rudolph
            May 29 '16 at 8:34













          • The captionof appeared to work, until I noticed that the paragraphs don't start with the usual indentation (and are restored to normal when I removed the captionof). The listing environment doesn't split over two pages (I haven't tried mdframed for breaking a listing environment, because according to tex.stackexchange.com/a/103471/8666, mdframed helps with breaking in the presence of a background color).

            – Ioannis Filippidis
            May 29 '16 at 21:43











          • No floating environment breaks across pages. I meant using the "correct" environment to put the title in.

            – Konrad Rudolph
            May 29 '16 at 21:53











          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%2f12428%2fcode-spanning-over-two-pages-with-minted-inside-listing-with-caption%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          3 Answers
          3






          active

          oldest

          votes








          3 Answers
          3






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          28














          As far as I know, this is a fundamental restriction of floats. You cannot use floats that span over more than one page so you need to remove the surrounding listing.



          To make the caption still work, you can load the caption package and use the captionof command instead of caption:



          inputminted{java}{code/JavaCode.java}
          captionof{listing}{Some caption}


          Now the caption should also appear in the listoflistings.
          If you want to use a label here, you need to put it inside the captionof command:



          captionof{listing}{Some captionlabel{lst:some-label}}


          See also: Question “Label and caption without float”.






          share|improve this answer


























          • Thanks! This works. Is there a way to also add a label so I can reference it from other part of my text? Also, if I use this, then then listoflistings won't list my code right?

            – lander16
            Mar 1 '11 at 20:05











          • @lander See updated answer.

            – Konrad Rudolph
            Mar 1 '11 at 20:16






          • 2





            captionof requires an environment so this does not work correctly, see my answer.

            – schlamar
            Apr 27 '12 at 8:43











          • @ms4py Is right.

            – Konrad Rudolph
            Apr 27 '12 at 8:51











          • I realize that minted is not really maintained anymore, but still thought I should mention that page-spanning breaks the moment you set a background colour.

            – Stephen Bosch
            Sep 22 '13 at 14:46
















          28














          As far as I know, this is a fundamental restriction of floats. You cannot use floats that span over more than one page so you need to remove the surrounding listing.



          To make the caption still work, you can load the caption package and use the captionof command instead of caption:



          inputminted{java}{code/JavaCode.java}
          captionof{listing}{Some caption}


          Now the caption should also appear in the listoflistings.
          If you want to use a label here, you need to put it inside the captionof command:



          captionof{listing}{Some captionlabel{lst:some-label}}


          See also: Question “Label and caption without float”.






          share|improve this answer


























          • Thanks! This works. Is there a way to also add a label so I can reference it from other part of my text? Also, if I use this, then then listoflistings won't list my code right?

            – lander16
            Mar 1 '11 at 20:05











          • @lander See updated answer.

            – Konrad Rudolph
            Mar 1 '11 at 20:16






          • 2





            captionof requires an environment so this does not work correctly, see my answer.

            – schlamar
            Apr 27 '12 at 8:43











          • @ms4py Is right.

            – Konrad Rudolph
            Apr 27 '12 at 8:51











          • I realize that minted is not really maintained anymore, but still thought I should mention that page-spanning breaks the moment you set a background colour.

            – Stephen Bosch
            Sep 22 '13 at 14:46














          28












          28








          28







          As far as I know, this is a fundamental restriction of floats. You cannot use floats that span over more than one page so you need to remove the surrounding listing.



          To make the caption still work, you can load the caption package and use the captionof command instead of caption:



          inputminted{java}{code/JavaCode.java}
          captionof{listing}{Some caption}


          Now the caption should also appear in the listoflistings.
          If you want to use a label here, you need to put it inside the captionof command:



          captionof{listing}{Some captionlabel{lst:some-label}}


          See also: Question “Label and caption without float”.






          share|improve this answer















          As far as I know, this is a fundamental restriction of floats. You cannot use floats that span over more than one page so you need to remove the surrounding listing.



          To make the caption still work, you can load the caption package and use the captionof command instead of caption:



          inputminted{java}{code/JavaCode.java}
          captionof{listing}{Some caption}


          Now the caption should also appear in the listoflistings.
          If you want to use a label here, you need to put it inside the captionof command:



          captionof{listing}{Some captionlabel{lst:some-label}}


          See also: Question “Label and caption without float”.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 13 '17 at 12:35









          Community

          1




          1










          answered Mar 1 '11 at 20:01









          Konrad RudolphKonrad Rudolph

          26.8k1786140




          26.8k1786140













          • Thanks! This works. Is there a way to also add a label so I can reference it from other part of my text? Also, if I use this, then then listoflistings won't list my code right?

            – lander16
            Mar 1 '11 at 20:05











          • @lander See updated answer.

            – Konrad Rudolph
            Mar 1 '11 at 20:16






          • 2





            captionof requires an environment so this does not work correctly, see my answer.

            – schlamar
            Apr 27 '12 at 8:43











          • @ms4py Is right.

            – Konrad Rudolph
            Apr 27 '12 at 8:51











          • I realize that minted is not really maintained anymore, but still thought I should mention that page-spanning breaks the moment you set a background colour.

            – Stephen Bosch
            Sep 22 '13 at 14:46



















          • Thanks! This works. Is there a way to also add a label so I can reference it from other part of my text? Also, if I use this, then then listoflistings won't list my code right?

            – lander16
            Mar 1 '11 at 20:05











          • @lander See updated answer.

            – Konrad Rudolph
            Mar 1 '11 at 20:16






          • 2





            captionof requires an environment so this does not work correctly, see my answer.

            – schlamar
            Apr 27 '12 at 8:43











          • @ms4py Is right.

            – Konrad Rudolph
            Apr 27 '12 at 8:51











          • I realize that minted is not really maintained anymore, but still thought I should mention that page-spanning breaks the moment you set a background colour.

            – Stephen Bosch
            Sep 22 '13 at 14:46

















          Thanks! This works. Is there a way to also add a label so I can reference it from other part of my text? Also, if I use this, then then listoflistings won't list my code right?

          – lander16
          Mar 1 '11 at 20:05





          Thanks! This works. Is there a way to also add a label so I can reference it from other part of my text? Also, if I use this, then then listoflistings won't list my code right?

          – lander16
          Mar 1 '11 at 20:05













          @lander See updated answer.

          – Konrad Rudolph
          Mar 1 '11 at 20:16





          @lander See updated answer.

          – Konrad Rudolph
          Mar 1 '11 at 20:16




          2




          2





          captionof requires an environment so this does not work correctly, see my answer.

          – schlamar
          Apr 27 '12 at 8:43





          captionof requires an environment so this does not work correctly, see my answer.

          – schlamar
          Apr 27 '12 at 8:43













          @ms4py Is right.

          – Konrad Rudolph
          Apr 27 '12 at 8:51





          @ms4py Is right.

          – Konrad Rudolph
          Apr 27 '12 at 8:51













          I realize that minted is not really maintained anymore, but still thought I should mention that page-spanning breaks the moment you set a background colour.

          – Stephen Bosch
          Sep 22 '13 at 14:46





          I realize that minted is not really maintained anymore, but still thought I should mention that page-spanning breaks the moment you set a background colour.

          – Stephen Bosch
          Sep 22 '13 at 14:46











          21














          The suggested and accepted answer does not work correctly as the captionof command requires to be inside an environment. This is pointed out in the caption documentation. For example in my case there was no proper vertical space after the caption.



          A proper solution is to define a new environment:



          usepackage{caption}
          % ...
          newenvironment{code}{captionsetup{type=listing}}{}

          begin{code}
          begin{minted}[frame=single]{py}
          def my_func(x):
          print x
          end{minted}
          caption{My Func}
          label{lst:my_func}
          end{code}





          share|improve this answer





















          • 2





            When I use this solution with inputminted, page spanning breaks.

            – Stephen Bosch
            Sep 22 '13 at 14:55








          • 2





            I am using inputminted and it's running perfectly in my case. Are you sure you've included the caption package ?

            – Overdrivr
            Jan 11 '17 at 9:40
















          21














          The suggested and accepted answer does not work correctly as the captionof command requires to be inside an environment. This is pointed out in the caption documentation. For example in my case there was no proper vertical space after the caption.



          A proper solution is to define a new environment:



          usepackage{caption}
          % ...
          newenvironment{code}{captionsetup{type=listing}}{}

          begin{code}
          begin{minted}[frame=single]{py}
          def my_func(x):
          print x
          end{minted}
          caption{My Func}
          label{lst:my_func}
          end{code}





          share|improve this answer





















          • 2





            When I use this solution with inputminted, page spanning breaks.

            – Stephen Bosch
            Sep 22 '13 at 14:55








          • 2





            I am using inputminted and it's running perfectly in my case. Are you sure you've included the caption package ?

            – Overdrivr
            Jan 11 '17 at 9:40














          21












          21








          21







          The suggested and accepted answer does not work correctly as the captionof command requires to be inside an environment. This is pointed out in the caption documentation. For example in my case there was no proper vertical space after the caption.



          A proper solution is to define a new environment:



          usepackage{caption}
          % ...
          newenvironment{code}{captionsetup{type=listing}}{}

          begin{code}
          begin{minted}[frame=single]{py}
          def my_func(x):
          print x
          end{minted}
          caption{My Func}
          label{lst:my_func}
          end{code}





          share|improve this answer















          The suggested and accepted answer does not work correctly as the captionof command requires to be inside an environment. This is pointed out in the caption documentation. For example in my case there was no proper vertical space after the caption.



          A proper solution is to define a new environment:



          usepackage{caption}
          % ...
          newenvironment{code}{captionsetup{type=listing}}{}

          begin{code}
          begin{minted}[frame=single]{py}
          def my_func(x):
          print x
          end{minted}
          caption{My Func}
          label{lst:my_func}
          end{code}






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 8 mins ago









          konstantin

          31




          31










          answered Apr 27 '12 at 8:47









          schlamarschlamar

          600414




          600414








          • 2





            When I use this solution with inputminted, page spanning breaks.

            – Stephen Bosch
            Sep 22 '13 at 14:55








          • 2





            I am using inputminted and it's running perfectly in my case. Are you sure you've included the caption package ?

            – Overdrivr
            Jan 11 '17 at 9:40














          • 2





            When I use this solution with inputminted, page spanning breaks.

            – Stephen Bosch
            Sep 22 '13 at 14:55








          • 2





            I am using inputminted and it's running perfectly in my case. Are you sure you've included the caption package ?

            – Overdrivr
            Jan 11 '17 at 9:40








          2




          2





          When I use this solution with inputminted, page spanning breaks.

          – Stephen Bosch
          Sep 22 '13 at 14:55







          When I use this solution with inputminted, page spanning breaks.

          – Stephen Bosch
          Sep 22 '13 at 14:55






          2




          2





          I am using inputminted and it's running perfectly in my case. Are you sure you've included the caption package ?

          – Overdrivr
          Jan 11 '17 at 9:40





          I am using inputminted and it's running perfectly in my case. Are you sure you've included the caption package ?

          – Overdrivr
          Jan 11 '17 at 9:40











          0














          Adapting the solution by @Konrad Rudolph to something that is simple and doesn't break anything:



          inputminted[linenos]{python}{code.py}
          begin{figure}[H]
          caption{Hello.}
          label{fig:foo}
          end{figure}


          Of course, this is going to be named and listed as a Figure, but that's not a problem for me.






          share|improve this answer
























          • You don't need to use a figure float. If captionof doesn't work for you (which, weird!) you can (and should) simply use a listing float environment.

            – Konrad Rudolph
            May 29 '16 at 8:34













          • The captionof appeared to work, until I noticed that the paragraphs don't start with the usual indentation (and are restored to normal when I removed the captionof). The listing environment doesn't split over two pages (I haven't tried mdframed for breaking a listing environment, because according to tex.stackexchange.com/a/103471/8666, mdframed helps with breaking in the presence of a background color).

            – Ioannis Filippidis
            May 29 '16 at 21:43











          • No floating environment breaks across pages. I meant using the "correct" environment to put the title in.

            – Konrad Rudolph
            May 29 '16 at 21:53
















          0














          Adapting the solution by @Konrad Rudolph to something that is simple and doesn't break anything:



          inputminted[linenos]{python}{code.py}
          begin{figure}[H]
          caption{Hello.}
          label{fig:foo}
          end{figure}


          Of course, this is going to be named and listed as a Figure, but that's not a problem for me.






          share|improve this answer
























          • You don't need to use a figure float. If captionof doesn't work for you (which, weird!) you can (and should) simply use a listing float environment.

            – Konrad Rudolph
            May 29 '16 at 8:34













          • The captionof appeared to work, until I noticed that the paragraphs don't start with the usual indentation (and are restored to normal when I removed the captionof). The listing environment doesn't split over two pages (I haven't tried mdframed for breaking a listing environment, because according to tex.stackexchange.com/a/103471/8666, mdframed helps with breaking in the presence of a background color).

            – Ioannis Filippidis
            May 29 '16 at 21:43











          • No floating environment breaks across pages. I meant using the "correct" environment to put the title in.

            – Konrad Rudolph
            May 29 '16 at 21:53














          0












          0








          0







          Adapting the solution by @Konrad Rudolph to something that is simple and doesn't break anything:



          inputminted[linenos]{python}{code.py}
          begin{figure}[H]
          caption{Hello.}
          label{fig:foo}
          end{figure}


          Of course, this is going to be named and listed as a Figure, but that's not a problem for me.






          share|improve this answer













          Adapting the solution by @Konrad Rudolph to something that is simple and doesn't break anything:



          inputminted[linenos]{python}{code.py}
          begin{figure}[H]
          caption{Hello.}
          label{fig:foo}
          end{figure}


          Of course, this is going to be named and listed as a Figure, but that's not a problem for me.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 29 '16 at 4:09









          Ioannis FilippidisIoannis Filippidis

          486521




          486521













          • You don't need to use a figure float. If captionof doesn't work for you (which, weird!) you can (and should) simply use a listing float environment.

            – Konrad Rudolph
            May 29 '16 at 8:34













          • The captionof appeared to work, until I noticed that the paragraphs don't start with the usual indentation (and are restored to normal when I removed the captionof). The listing environment doesn't split over two pages (I haven't tried mdframed for breaking a listing environment, because according to tex.stackexchange.com/a/103471/8666, mdframed helps with breaking in the presence of a background color).

            – Ioannis Filippidis
            May 29 '16 at 21:43











          • No floating environment breaks across pages. I meant using the "correct" environment to put the title in.

            – Konrad Rudolph
            May 29 '16 at 21:53



















          • You don't need to use a figure float. If captionof doesn't work for you (which, weird!) you can (and should) simply use a listing float environment.

            – Konrad Rudolph
            May 29 '16 at 8:34













          • The captionof appeared to work, until I noticed that the paragraphs don't start with the usual indentation (and are restored to normal when I removed the captionof). The listing environment doesn't split over two pages (I haven't tried mdframed for breaking a listing environment, because according to tex.stackexchange.com/a/103471/8666, mdframed helps with breaking in the presence of a background color).

            – Ioannis Filippidis
            May 29 '16 at 21:43











          • No floating environment breaks across pages. I meant using the "correct" environment to put the title in.

            – Konrad Rudolph
            May 29 '16 at 21:53

















          You don't need to use a figure float. If captionof doesn't work for you (which, weird!) you can (and should) simply use a listing float environment.

          – Konrad Rudolph
          May 29 '16 at 8:34







          You don't need to use a figure float. If captionof doesn't work for you (which, weird!) you can (and should) simply use a listing float environment.

          – Konrad Rudolph
          May 29 '16 at 8:34















          The captionof appeared to work, until I noticed that the paragraphs don't start with the usual indentation (and are restored to normal when I removed the captionof). The listing environment doesn't split over two pages (I haven't tried mdframed for breaking a listing environment, because according to tex.stackexchange.com/a/103471/8666, mdframed helps with breaking in the presence of a background color).

          – Ioannis Filippidis
          May 29 '16 at 21:43





          The captionof appeared to work, until I noticed that the paragraphs don't start with the usual indentation (and are restored to normal when I removed the captionof). The listing environment doesn't split over two pages (I haven't tried mdframed for breaking a listing environment, because according to tex.stackexchange.com/a/103471/8666, mdframed helps with breaking in the presence of a background color).

          – Ioannis Filippidis
          May 29 '16 at 21:43













          No floating environment breaks across pages. I meant using the "correct" environment to put the title in.

          – Konrad Rudolph
          May 29 '16 at 21:53





          No floating environment breaks across pages. I meant using the "correct" environment to put the title in.

          – Konrad Rudolph
          May 29 '16 at 21:53


















          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%2f12428%2fcode-spanning-over-two-pages-with-minted-inside-listing-with-caption%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

          Paper upload error, “Upload failed: The top margin is 0.715 in on page 3, which is below the required...

          Emraan Hashmi Filmografia | Linki zewnętrzne | Menu nawigacyjneGulshan GroverGulshan...

          How can I write this formula?newline and italics added with leqWhy does widehat behave differently if I...