Put horizontal lines above and below tabbing and prohibit page breaks between the lines and the tabbing...












0















I wish to put a horizontal line above tabbing and another one below it in such a way that there are no page breaks between the tabbing contents and the two lines.
Here is what I tried so far:



documentclass[a4paper]{article}
newenvironment{ruletabbing}{%
begingroupsetlength{topsep}{0pt}setlength{partopsep}{0pt}raggedrighthrulenopagebreaktabbingnopagebreak%
}{%
nopagebreakendtabbingnopagebreakvspace{-.05baselineskip}nopagebreakhruleparvspace{.07baselineskip}endgroup%
}
begin{document}
strut
vspace{46.8baselineskip}\
A page break after this text would be ok.\[.1baselineskip]
begin{ruletabbing}
A page break after this text in tabbing, but not before it, would be ok.\
A page break before this text in tabbing, but not after it, would be ok.
end{ruletabbing}
noindent A page break before this text would be ok.
end{document}


However, the nopagebreaks seem to have to effect; this example blatantly fails:



output



Above, there is a page break right after the first rule, which is NOT what we want. If it doesn't fail for you, adapt 46.8 above slightly. The same problem we have for the second line, by means of changing 46.8 to a particular smaller value.



How to forbid page breaks between the two horizontal lines and the tabbing contents? The tabbing conents should be allowed to have page breaks inside by all means. Ideally, the new tabbing environment should also work inside lists (itemize, enumerate, description), though it's not a must.










share|improve this question





























    0















    I wish to put a horizontal line above tabbing and another one below it in such a way that there are no page breaks between the tabbing contents and the two lines.
    Here is what I tried so far:



    documentclass[a4paper]{article}
    newenvironment{ruletabbing}{%
    begingroupsetlength{topsep}{0pt}setlength{partopsep}{0pt}raggedrighthrulenopagebreaktabbingnopagebreak%
    }{%
    nopagebreakendtabbingnopagebreakvspace{-.05baselineskip}nopagebreakhruleparvspace{.07baselineskip}endgroup%
    }
    begin{document}
    strut
    vspace{46.8baselineskip}\
    A page break after this text would be ok.\[.1baselineskip]
    begin{ruletabbing}
    A page break after this text in tabbing, but not before it, would be ok.\
    A page break before this text in tabbing, but not after it, would be ok.
    end{ruletabbing}
    noindent A page break before this text would be ok.
    end{document}


    However, the nopagebreaks seem to have to effect; this example blatantly fails:



    output



    Above, there is a page break right after the first rule, which is NOT what we want. If it doesn't fail for you, adapt 46.8 above slightly. The same problem we have for the second line, by means of changing 46.8 to a particular smaller value.



    How to forbid page breaks between the two horizontal lines and the tabbing contents? The tabbing conents should be allowed to have page breaks inside by all means. Ideally, the new tabbing environment should also work inside lists (itemize, enumerate, description), though it's not a must.










    share|improve this question



























      0












      0








      0








      I wish to put a horizontal line above tabbing and another one below it in such a way that there are no page breaks between the tabbing contents and the two lines.
      Here is what I tried so far:



      documentclass[a4paper]{article}
      newenvironment{ruletabbing}{%
      begingroupsetlength{topsep}{0pt}setlength{partopsep}{0pt}raggedrighthrulenopagebreaktabbingnopagebreak%
      }{%
      nopagebreakendtabbingnopagebreakvspace{-.05baselineskip}nopagebreakhruleparvspace{.07baselineskip}endgroup%
      }
      begin{document}
      strut
      vspace{46.8baselineskip}\
      A page break after this text would be ok.\[.1baselineskip]
      begin{ruletabbing}
      A page break after this text in tabbing, but not before it, would be ok.\
      A page break before this text in tabbing, but not after it, would be ok.
      end{ruletabbing}
      noindent A page break before this text would be ok.
      end{document}


      However, the nopagebreaks seem to have to effect; this example blatantly fails:



      output



      Above, there is a page break right after the first rule, which is NOT what we want. If it doesn't fail for you, adapt 46.8 above slightly. The same problem we have for the second line, by means of changing 46.8 to a particular smaller value.



      How to forbid page breaks between the two horizontal lines and the tabbing contents? The tabbing conents should be allowed to have page breaks inside by all means. Ideally, the new tabbing environment should also work inside lists (itemize, enumerate, description), though it's not a must.










      share|improve this question
















      I wish to put a horizontal line above tabbing and another one below it in such a way that there are no page breaks between the tabbing contents and the two lines.
      Here is what I tried so far:



      documentclass[a4paper]{article}
      newenvironment{ruletabbing}{%
      begingroupsetlength{topsep}{0pt}setlength{partopsep}{0pt}raggedrighthrulenopagebreaktabbingnopagebreak%
      }{%
      nopagebreakendtabbingnopagebreakvspace{-.05baselineskip}nopagebreakhruleparvspace{.07baselineskip}endgroup%
      }
      begin{document}
      strut
      vspace{46.8baselineskip}\
      A page break after this text would be ok.\[.1baselineskip]
      begin{ruletabbing}
      A page break after this text in tabbing, but not before it, would be ok.\
      A page break before this text in tabbing, but not after it, would be ok.
      end{ruletabbing}
      noindent A page break before this text would be ok.
      end{document}


      However, the nopagebreaks seem to have to effect; this example blatantly fails:



      output



      Above, there is a page break right after the first rule, which is NOT what we want. If it doesn't fail for you, adapt 46.8 above slightly. The same problem we have for the second line, by means of changing 46.8 to a particular smaller value.



      How to forbid page breaks between the two horizontal lines and the tabbing contents? The tabbing conents should be allowed to have page breaks inside by all means. Ideally, the new tabbing environment should also work inside lists (itemize, enumerate, description), though it's not a must.







      page-breaking rules line tabbing






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 24 '18 at 1:12







      user49915

















      asked Aug 24 '18 at 0:21









      user49915user49915

      41517




      41517






















          1 Answer
          1






          active

          oldest

          votes


















          0














          You can wrap the contents of the tabbing environment into a minipage to prevent any form of page breaking within.



          documentclass[a4paper]{article}
          newenvironment{ruletabbing}{%
          begin{minipage}{linewidth}
          setlength{topsep}{0pt}
          setlength{partopsep}{0pt}
          raggedright
          hrule
          begin{tabbing}
          }{%
          end{tabbing}
          vspace{-.05baselineskip}
          hrule
          vspace{.07baselineskip}
          end{minipage}%
          par
          }
          begin{document}
          strut
          vspace{46.8baselineskip}\
          A page break after this text would be ok.\[.1baselineskip]
          begin{ruletabbing}
          A page break after this text in tabbing, but not before it, would be ok.\
          A page break before this text in tabbing, but not after it, would be ok.
          end{ruletabbing}
          noindent A page break before this text would be ok.
          end{document}


          enter image description here





          share
























          • Preventing all pagebreaking is not what we want; please consider re-reading the example text carefully.

            – user49915
            58 secs ago











          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%2f447434%2fput-horizontal-lines-above-and-below-tabbing-and-prohibit-page-breaks-between-th%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









          0














          You can wrap the contents of the tabbing environment into a minipage to prevent any form of page breaking within.



          documentclass[a4paper]{article}
          newenvironment{ruletabbing}{%
          begin{minipage}{linewidth}
          setlength{topsep}{0pt}
          setlength{partopsep}{0pt}
          raggedright
          hrule
          begin{tabbing}
          }{%
          end{tabbing}
          vspace{-.05baselineskip}
          hrule
          vspace{.07baselineskip}
          end{minipage}%
          par
          }
          begin{document}
          strut
          vspace{46.8baselineskip}\
          A page break after this text would be ok.\[.1baselineskip]
          begin{ruletabbing}
          A page break after this text in tabbing, but not before it, would be ok.\
          A page break before this text in tabbing, but not after it, would be ok.
          end{ruletabbing}
          noindent A page break before this text would be ok.
          end{document}


          enter image description here





          share
























          • Preventing all pagebreaking is not what we want; please consider re-reading the example text carefully.

            – user49915
            58 secs ago
















          0














          You can wrap the contents of the tabbing environment into a minipage to prevent any form of page breaking within.



          documentclass[a4paper]{article}
          newenvironment{ruletabbing}{%
          begin{minipage}{linewidth}
          setlength{topsep}{0pt}
          setlength{partopsep}{0pt}
          raggedright
          hrule
          begin{tabbing}
          }{%
          end{tabbing}
          vspace{-.05baselineskip}
          hrule
          vspace{.07baselineskip}
          end{minipage}%
          par
          }
          begin{document}
          strut
          vspace{46.8baselineskip}\
          A page break after this text would be ok.\[.1baselineskip]
          begin{ruletabbing}
          A page break after this text in tabbing, but not before it, would be ok.\
          A page break before this text in tabbing, but not after it, would be ok.
          end{ruletabbing}
          noindent A page break before this text would be ok.
          end{document}


          enter image description here





          share
























          • Preventing all pagebreaking is not what we want; please consider re-reading the example text carefully.

            – user49915
            58 secs ago














          0












          0








          0







          You can wrap the contents of the tabbing environment into a minipage to prevent any form of page breaking within.



          documentclass[a4paper]{article}
          newenvironment{ruletabbing}{%
          begin{minipage}{linewidth}
          setlength{topsep}{0pt}
          setlength{partopsep}{0pt}
          raggedright
          hrule
          begin{tabbing}
          }{%
          end{tabbing}
          vspace{-.05baselineskip}
          hrule
          vspace{.07baselineskip}
          end{minipage}%
          par
          }
          begin{document}
          strut
          vspace{46.8baselineskip}\
          A page break after this text would be ok.\[.1baselineskip]
          begin{ruletabbing}
          A page break after this text in tabbing, but not before it, would be ok.\
          A page break before this text in tabbing, but not after it, would be ok.
          end{ruletabbing}
          noindent A page break before this text would be ok.
          end{document}


          enter image description here





          share













          You can wrap the contents of the tabbing environment into a minipage to prevent any form of page breaking within.



          documentclass[a4paper]{article}
          newenvironment{ruletabbing}{%
          begin{minipage}{linewidth}
          setlength{topsep}{0pt}
          setlength{partopsep}{0pt}
          raggedright
          hrule
          begin{tabbing}
          }{%
          end{tabbing}
          vspace{-.05baselineskip}
          hrule
          vspace{.07baselineskip}
          end{minipage}%
          par
          }
          begin{document}
          strut
          vspace{46.8baselineskip}\
          A page break after this text would be ok.\[.1baselineskip]
          begin{ruletabbing}
          A page break after this text in tabbing, but not before it, would be ok.\
          A page break before this text in tabbing, but not after it, would be ok.
          end{ruletabbing}
          noindent A page break before this text would be ok.
          end{document}


          enter image description here






          share











          share


          share










          answered 6 mins ago









          Henri MenkeHenri Menke

          72.7k8160270




          72.7k8160270













          • Preventing all pagebreaking is not what we want; please consider re-reading the example text carefully.

            – user49915
            58 secs ago



















          • Preventing all pagebreaking is not what we want; please consider re-reading the example text carefully.

            – user49915
            58 secs ago

















          Preventing all pagebreaking is not what we want; please consider re-reading the example text carefully.

          – user49915
          58 secs ago





          Preventing all pagebreaking is not what we want; please consider re-reading the example text carefully.

          – user49915
          58 secs ago


















          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%2f447434%2fput-horizontal-lines-above-and-below-tabbing-and-prohibit-page-breaks-between-th%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

          Accessing regular linux commands in Huawei's Dopra Linux

          Can't connect RFCOMM socket: Host is down

          Kernel panic - not syncing: Fatal Exception in Interrupt