Too few/too many uses of box register in leaders












3















I'm playing a bit with TeX's leaders and ran into a problem I don't understand. Given the following example code:



documentclass{article}

begin{document}

defbul{%
begingroup
setbox0=hbox to 10pt{hsstextbullethss}%
skip0=wd0 plus 0.5wd0 minus 0.5wd0
% skip0=10pt plus 5pt minus 5pt % the same as above
cleadersbox0hskipskip0
endgroup
}

1: fbox{hbox to 30pt{nullhskip13ptbulhskip13ptnull}} okay, too few space

2: fbox{hbox to 30pt{nullhskip10ptbulhskip10ptnull}} okay, space fits exactly

3: fbox{hbox to 30pt{nullhskip7.5ptbulhskip7.5ptnull}} okay, maximum stretch
medskip

4: fbox{hbox to 30pt{nullhskip11ptbulhskip11ptnull}} wrong, still enough space left

5: fbox{hbox to 30pt{nullbulnull}} wrong, too many bullets

end{document}


bul should, as I understand, output at most one textbullet centered across the available space if there's some free horizontal space of 5pt up to 15pt. Here's the result:



enter image description here



On the first line there's only 4pt left, so no bullet occurs. On line 2 the bullet can take its natural width and fits exactly once. On the third line it needs to stretch to its maximum width. Those cases are fine. The ones I don't understand are on the next two lines.



Line 4 should leave a space of 8pt in which a bullet can fit quite comfortably. No bullet occurs, though. Why?



The opposite problem is on line 5. Here the maximum stretch is exceeded, hence TeX gives an underfull hbox warning. But why does it output three boxes?



Section 9.3.3 of TeX by Topic explicitly states that you should use copy with the various leaders commands to make sure the box register is not empty after it has been used first. Actually, this is exactly the effect I want to achieve, which is why I used box. The output still has three bullets.



Could anyone explain why that is happening (and also how to fix it)?










share|improve this question



























    3















    I'm playing a bit with TeX's leaders and ran into a problem I don't understand. Given the following example code:



    documentclass{article}

    begin{document}

    defbul{%
    begingroup
    setbox0=hbox to 10pt{hsstextbullethss}%
    skip0=wd0 plus 0.5wd0 minus 0.5wd0
    % skip0=10pt plus 5pt minus 5pt % the same as above
    cleadersbox0hskipskip0
    endgroup
    }

    1: fbox{hbox to 30pt{nullhskip13ptbulhskip13ptnull}} okay, too few space

    2: fbox{hbox to 30pt{nullhskip10ptbulhskip10ptnull}} okay, space fits exactly

    3: fbox{hbox to 30pt{nullhskip7.5ptbulhskip7.5ptnull}} okay, maximum stretch
    medskip

    4: fbox{hbox to 30pt{nullhskip11ptbulhskip11ptnull}} wrong, still enough space left

    5: fbox{hbox to 30pt{nullbulnull}} wrong, too many bullets

    end{document}


    bul should, as I understand, output at most one textbullet centered across the available space if there's some free horizontal space of 5pt up to 15pt. Here's the result:



    enter image description here



    On the first line there's only 4pt left, so no bullet occurs. On line 2 the bullet can take its natural width and fits exactly once. On the third line it needs to stretch to its maximum width. Those cases are fine. The ones I don't understand are on the next two lines.



    Line 4 should leave a space of 8pt in which a bullet can fit quite comfortably. No bullet occurs, though. Why?



    The opposite problem is on line 5. Here the maximum stretch is exceeded, hence TeX gives an underfull hbox warning. But why does it output three boxes?



    Section 9.3.3 of TeX by Topic explicitly states that you should use copy with the various leaders commands to make sure the box register is not empty after it has been used first. Actually, this is exactly the effect I want to achieve, which is why I used box. The output still has three bullets.



    Could anyone explain why that is happening (and also how to fix it)?










    share|improve this question

























      3












      3








      3








      I'm playing a bit with TeX's leaders and ran into a problem I don't understand. Given the following example code:



      documentclass{article}

      begin{document}

      defbul{%
      begingroup
      setbox0=hbox to 10pt{hsstextbullethss}%
      skip0=wd0 plus 0.5wd0 minus 0.5wd0
      % skip0=10pt plus 5pt minus 5pt % the same as above
      cleadersbox0hskipskip0
      endgroup
      }

      1: fbox{hbox to 30pt{nullhskip13ptbulhskip13ptnull}} okay, too few space

      2: fbox{hbox to 30pt{nullhskip10ptbulhskip10ptnull}} okay, space fits exactly

      3: fbox{hbox to 30pt{nullhskip7.5ptbulhskip7.5ptnull}} okay, maximum stretch
      medskip

      4: fbox{hbox to 30pt{nullhskip11ptbulhskip11ptnull}} wrong, still enough space left

      5: fbox{hbox to 30pt{nullbulnull}} wrong, too many bullets

      end{document}


      bul should, as I understand, output at most one textbullet centered across the available space if there's some free horizontal space of 5pt up to 15pt. Here's the result:



      enter image description here



      On the first line there's only 4pt left, so no bullet occurs. On line 2 the bullet can take its natural width and fits exactly once. On the third line it needs to stretch to its maximum width. Those cases are fine. The ones I don't understand are on the next two lines.



      Line 4 should leave a space of 8pt in which a bullet can fit quite comfortably. No bullet occurs, though. Why?



      The opposite problem is on line 5. Here the maximum stretch is exceeded, hence TeX gives an underfull hbox warning. But why does it output three boxes?



      Section 9.3.3 of TeX by Topic explicitly states that you should use copy with the various leaders commands to make sure the box register is not empty after it has been used first. Actually, this is exactly the effect I want to achieve, which is why I used box. The output still has three bullets.



      Could anyone explain why that is happening (and also how to fix it)?










      share|improve this question














      I'm playing a bit with TeX's leaders and ran into a problem I don't understand. Given the following example code:



      documentclass{article}

      begin{document}

      defbul{%
      begingroup
      setbox0=hbox to 10pt{hsstextbullethss}%
      skip0=wd0 plus 0.5wd0 minus 0.5wd0
      % skip0=10pt plus 5pt minus 5pt % the same as above
      cleadersbox0hskipskip0
      endgroup
      }

      1: fbox{hbox to 30pt{nullhskip13ptbulhskip13ptnull}} okay, too few space

      2: fbox{hbox to 30pt{nullhskip10ptbulhskip10ptnull}} okay, space fits exactly

      3: fbox{hbox to 30pt{nullhskip7.5ptbulhskip7.5ptnull}} okay, maximum stretch
      medskip

      4: fbox{hbox to 30pt{nullhskip11ptbulhskip11ptnull}} wrong, still enough space left

      5: fbox{hbox to 30pt{nullbulnull}} wrong, too many bullets

      end{document}


      bul should, as I understand, output at most one textbullet centered across the available space if there's some free horizontal space of 5pt up to 15pt. Here's the result:



      enter image description here



      On the first line there's only 4pt left, so no bullet occurs. On line 2 the bullet can take its natural width and fits exactly once. On the third line it needs to stretch to its maximum width. Those cases are fine. The ones I don't understand are on the next two lines.



      Line 4 should leave a space of 8pt in which a bullet can fit quite comfortably. No bullet occurs, though. Why?



      The opposite problem is on line 5. Here the maximum stretch is exceeded, hence TeX gives an underfull hbox warning. But why does it output three boxes?



      Section 9.3.3 of TeX by Topic explicitly states that you should use copy with the various leaders commands to make sure the box register is not empty after it has been used first. Actually, this is exactly the effect I want to achieve, which is why I used box. The output still has three bullets.



      Could anyone explain why that is happening (and also how to fix it)?







      leaders






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 10 at 10:32









      siracusasiracusa

      5,08511429




      5,08511429






















          1 Answer
          1






          active

          oldest

          votes


















          2














          Glue with a nonzero stretch component will stretch to fill anyway, at the expense of badness.



          In the fifth example, with showoutput, you'd see



          ...hbox(4.44444+0.0)x30.0, glue set 4.0
          ....hbox(0.0+0.0)x0.0
          ....cleaders 10.0 plus 5.0 minus 5.0
          .....hbox(4.44444+0.0)x10.0, glue set 2.5fil
          ......glue 0.0 plus 1.0fil minus 1.0fil
          ......mathon
          ......tensy ^^O
          ......mathoff
          ......glue 0.0 plus 1.0fil minus 1.0fil
          ....hbox(0.0+0.0)x0.0


          where the glue stretch factor is 4. Hence the glue counts for 10+4*5=30 pt. No fix, this is how it is supposed to work.



          Note: tensy is because I typeset the thing with plain TeX to avoid irrelevant parts to show up.



          With your document, the relevant diagnostic would be



          ..........hbox(4.44444+0.0)x30.0, glue set 4.0
          ...........hbox(0.0+0.0)x0.0
          ...........cleaders 10.0 plus 5.0 minus 5.0
          ............hbox(4.44444+0.0)x10.0, glue set 2.5fil
          .............glue 0.0 plus 1.0fil minus 1.0fil
          .............OMS/cmsy/m/n/10 ^^O
          .............glue 0.0 plus 1.0fil minus 1.0fil
          ...........hbox(0.0+0.0)x0.0





          share|improve this answer
























          • When you write "No fix", do you also mean there's no way to define the desired bul macro? Also, any ideas about line 4?

            – siracusa
            Mar 11 at 9:41











          • @siracusa In line 4 the space for the leaders is 8pt, which is less than the natural width of the leader box, so nothing shows up.

            – egreg
            Mar 11 at 11:33













          • @siracusa If you want glue that stretches, but not more than a stated amount, well, you can't.

            – egreg
            Mar 11 at 11:56











          • I'd be fine with glue that stretches more than the maximum amount, but I don't want the bullet to occur multiple times in that case

            – siracusa
            Mar 11 at 14:43











          • @siracusa You're out of luck, I'm afraid.

            – egreg
            Mar 11 at 15:26











          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%2f478701%2ftoo-few-too-many-uses-of-box-register-in-leaders%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









          2














          Glue with a nonzero stretch component will stretch to fill anyway, at the expense of badness.



          In the fifth example, with showoutput, you'd see



          ...hbox(4.44444+0.0)x30.0, glue set 4.0
          ....hbox(0.0+0.0)x0.0
          ....cleaders 10.0 plus 5.0 minus 5.0
          .....hbox(4.44444+0.0)x10.0, glue set 2.5fil
          ......glue 0.0 plus 1.0fil minus 1.0fil
          ......mathon
          ......tensy ^^O
          ......mathoff
          ......glue 0.0 plus 1.0fil minus 1.0fil
          ....hbox(0.0+0.0)x0.0


          where the glue stretch factor is 4. Hence the glue counts for 10+4*5=30 pt. No fix, this is how it is supposed to work.



          Note: tensy is because I typeset the thing with plain TeX to avoid irrelevant parts to show up.



          With your document, the relevant diagnostic would be



          ..........hbox(4.44444+0.0)x30.0, glue set 4.0
          ...........hbox(0.0+0.0)x0.0
          ...........cleaders 10.0 plus 5.0 minus 5.0
          ............hbox(4.44444+0.0)x10.0, glue set 2.5fil
          .............glue 0.0 plus 1.0fil minus 1.0fil
          .............OMS/cmsy/m/n/10 ^^O
          .............glue 0.0 plus 1.0fil minus 1.0fil
          ...........hbox(0.0+0.0)x0.0





          share|improve this answer
























          • When you write "No fix", do you also mean there's no way to define the desired bul macro? Also, any ideas about line 4?

            – siracusa
            Mar 11 at 9:41











          • @siracusa In line 4 the space for the leaders is 8pt, which is less than the natural width of the leader box, so nothing shows up.

            – egreg
            Mar 11 at 11:33













          • @siracusa If you want glue that stretches, but not more than a stated amount, well, you can't.

            – egreg
            Mar 11 at 11:56











          • I'd be fine with glue that stretches more than the maximum amount, but I don't want the bullet to occur multiple times in that case

            – siracusa
            Mar 11 at 14:43











          • @siracusa You're out of luck, I'm afraid.

            – egreg
            Mar 11 at 15:26
















          2














          Glue with a nonzero stretch component will stretch to fill anyway, at the expense of badness.



          In the fifth example, with showoutput, you'd see



          ...hbox(4.44444+0.0)x30.0, glue set 4.0
          ....hbox(0.0+0.0)x0.0
          ....cleaders 10.0 plus 5.0 minus 5.0
          .....hbox(4.44444+0.0)x10.0, glue set 2.5fil
          ......glue 0.0 plus 1.0fil minus 1.0fil
          ......mathon
          ......tensy ^^O
          ......mathoff
          ......glue 0.0 plus 1.0fil minus 1.0fil
          ....hbox(0.0+0.0)x0.0


          where the glue stretch factor is 4. Hence the glue counts for 10+4*5=30 pt. No fix, this is how it is supposed to work.



          Note: tensy is because I typeset the thing with plain TeX to avoid irrelevant parts to show up.



          With your document, the relevant diagnostic would be



          ..........hbox(4.44444+0.0)x30.0, glue set 4.0
          ...........hbox(0.0+0.0)x0.0
          ...........cleaders 10.0 plus 5.0 minus 5.0
          ............hbox(4.44444+0.0)x10.0, glue set 2.5fil
          .............glue 0.0 plus 1.0fil minus 1.0fil
          .............OMS/cmsy/m/n/10 ^^O
          .............glue 0.0 plus 1.0fil minus 1.0fil
          ...........hbox(0.0+0.0)x0.0





          share|improve this answer
























          • When you write "No fix", do you also mean there's no way to define the desired bul macro? Also, any ideas about line 4?

            – siracusa
            Mar 11 at 9:41











          • @siracusa In line 4 the space for the leaders is 8pt, which is less than the natural width of the leader box, so nothing shows up.

            – egreg
            Mar 11 at 11:33













          • @siracusa If you want glue that stretches, but not more than a stated amount, well, you can't.

            – egreg
            Mar 11 at 11:56











          • I'd be fine with glue that stretches more than the maximum amount, but I don't want the bullet to occur multiple times in that case

            – siracusa
            Mar 11 at 14:43











          • @siracusa You're out of luck, I'm afraid.

            – egreg
            Mar 11 at 15:26














          2












          2








          2







          Glue with a nonzero stretch component will stretch to fill anyway, at the expense of badness.



          In the fifth example, with showoutput, you'd see



          ...hbox(4.44444+0.0)x30.0, glue set 4.0
          ....hbox(0.0+0.0)x0.0
          ....cleaders 10.0 plus 5.0 minus 5.0
          .....hbox(4.44444+0.0)x10.0, glue set 2.5fil
          ......glue 0.0 plus 1.0fil minus 1.0fil
          ......mathon
          ......tensy ^^O
          ......mathoff
          ......glue 0.0 plus 1.0fil minus 1.0fil
          ....hbox(0.0+0.0)x0.0


          where the glue stretch factor is 4. Hence the glue counts for 10+4*5=30 pt. No fix, this is how it is supposed to work.



          Note: tensy is because I typeset the thing with plain TeX to avoid irrelevant parts to show up.



          With your document, the relevant diagnostic would be



          ..........hbox(4.44444+0.0)x30.0, glue set 4.0
          ...........hbox(0.0+0.0)x0.0
          ...........cleaders 10.0 plus 5.0 minus 5.0
          ............hbox(4.44444+0.0)x10.0, glue set 2.5fil
          .............glue 0.0 plus 1.0fil minus 1.0fil
          .............OMS/cmsy/m/n/10 ^^O
          .............glue 0.0 plus 1.0fil minus 1.0fil
          ...........hbox(0.0+0.0)x0.0





          share|improve this answer













          Glue with a nonzero stretch component will stretch to fill anyway, at the expense of badness.



          In the fifth example, with showoutput, you'd see



          ...hbox(4.44444+0.0)x30.0, glue set 4.0
          ....hbox(0.0+0.0)x0.0
          ....cleaders 10.0 plus 5.0 minus 5.0
          .....hbox(4.44444+0.0)x10.0, glue set 2.5fil
          ......glue 0.0 plus 1.0fil minus 1.0fil
          ......mathon
          ......tensy ^^O
          ......mathoff
          ......glue 0.0 plus 1.0fil minus 1.0fil
          ....hbox(0.0+0.0)x0.0


          where the glue stretch factor is 4. Hence the glue counts for 10+4*5=30 pt. No fix, this is how it is supposed to work.



          Note: tensy is because I typeset the thing with plain TeX to avoid irrelevant parts to show up.



          With your document, the relevant diagnostic would be



          ..........hbox(4.44444+0.0)x30.0, glue set 4.0
          ...........hbox(0.0+0.0)x0.0
          ...........cleaders 10.0 plus 5.0 minus 5.0
          ............hbox(4.44444+0.0)x10.0, glue set 2.5fil
          .............glue 0.0 plus 1.0fil minus 1.0fil
          .............OMS/cmsy/m/n/10 ^^O
          .............glue 0.0 plus 1.0fil minus 1.0fil
          ...........hbox(0.0+0.0)x0.0






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 10 at 16:16









          egregegreg

          727k8819223231




          727k8819223231













          • When you write "No fix", do you also mean there's no way to define the desired bul macro? Also, any ideas about line 4?

            – siracusa
            Mar 11 at 9:41











          • @siracusa In line 4 the space for the leaders is 8pt, which is less than the natural width of the leader box, so nothing shows up.

            – egreg
            Mar 11 at 11:33













          • @siracusa If you want glue that stretches, but not more than a stated amount, well, you can't.

            – egreg
            Mar 11 at 11:56











          • I'd be fine with glue that stretches more than the maximum amount, but I don't want the bullet to occur multiple times in that case

            – siracusa
            Mar 11 at 14:43











          • @siracusa You're out of luck, I'm afraid.

            – egreg
            Mar 11 at 15:26



















          • When you write "No fix", do you also mean there's no way to define the desired bul macro? Also, any ideas about line 4?

            – siracusa
            Mar 11 at 9:41











          • @siracusa In line 4 the space for the leaders is 8pt, which is less than the natural width of the leader box, so nothing shows up.

            – egreg
            Mar 11 at 11:33













          • @siracusa If you want glue that stretches, but not more than a stated amount, well, you can't.

            – egreg
            Mar 11 at 11:56











          • I'd be fine with glue that stretches more than the maximum amount, but I don't want the bullet to occur multiple times in that case

            – siracusa
            Mar 11 at 14:43











          • @siracusa You're out of luck, I'm afraid.

            – egreg
            Mar 11 at 15:26

















          When you write "No fix", do you also mean there's no way to define the desired bul macro? Also, any ideas about line 4?

          – siracusa
          Mar 11 at 9:41





          When you write "No fix", do you also mean there's no way to define the desired bul macro? Also, any ideas about line 4?

          – siracusa
          Mar 11 at 9:41













          @siracusa In line 4 the space for the leaders is 8pt, which is less than the natural width of the leader box, so nothing shows up.

          – egreg
          Mar 11 at 11:33







          @siracusa In line 4 the space for the leaders is 8pt, which is less than the natural width of the leader box, so nothing shows up.

          – egreg
          Mar 11 at 11:33















          @siracusa If you want glue that stretches, but not more than a stated amount, well, you can't.

          – egreg
          Mar 11 at 11:56





          @siracusa If you want glue that stretches, but not more than a stated amount, well, you can't.

          – egreg
          Mar 11 at 11:56













          I'd be fine with glue that stretches more than the maximum amount, but I don't want the bullet to occur multiple times in that case

          – siracusa
          Mar 11 at 14:43





          I'd be fine with glue that stretches more than the maximum amount, but I don't want the bullet to occur multiple times in that case

          – siracusa
          Mar 11 at 14:43













          @siracusa You're out of luck, I'm afraid.

          – egreg
          Mar 11 at 15:26





          @siracusa You're out of luck, I'm afraid.

          – egreg
          Mar 11 at 15:26


















          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%2f478701%2ftoo-few-too-many-uses-of-box-register-in-leaders%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 send String Array data to Server using php in android

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

          Is anime1.com a legal site for watching anime?