tcolorbox: parbox=false AND hyphenationfix=true












1
















  1. I want the text in a {tcolorbox} to exhibit the same paragraph style as the main body. As far as I know (as per the first reference) this requires using RestoreParskip:



    newcommand*{RestoreParskip}{%
    setlength{parskip}{currentparskip}%
    setlength{parindent}{currentparindent}%
    }%


    where currentparskip and currentparindent needs to be initialized before the {tcolorbox}.



    From the documentation, this appears to be exactly what parbox=false is intended to do:




    If the key value is set to false, the normal main text behavior is restored.




    However, this feature is marked as experiemntal as of 2015-10-14 with the caveat:




    In some situations, this has some unwanted side effects. It is recommended that you use this experimental setting only where you really want to have this feature.




    As I defintely want the same paragraph spacing inside {tcolorbox}, it seems I should use this.




  2. Secondly, using hyphenationfix=true seems to be useful:




    Long words at the beginning of paragraphs in very narrow boxes will not be hyphenated using pdflatex. This problem is circumvented by applying the hyphenationfix option.




    However, there is a warning:



    enter image description here






Using the example text given in the documentation, one can see that parbox=false, hyphenationfix=true together don't seem to work (see 3. in the output of the MWE). I can fix this by leaving parbox=true using RestoreParskip manually (see 4).



Results without {parskip} and with {parskip}:



enter image description hereenter image description here



Questions:




  1. What else is parbox=false doing (besides the RestoreParskip functionality) that causes it to fail with hyphenationfix=true?

  2. What functionality am I losing by manually using RestoreParskip?

  3. When will parbox=false functionality leave the experimental designation? I realize that this particluar question can only be asnwered by the package author, but as I have experienced the pain of having experimental features removed, it would be good to know if this is still really experimental or just that the documentation has not been updated.


Notes:




  • For now, I do not require breakable=true, but might need it in the future. In case it is relevant, comments addressing these cases separately would be useful.


References:





  • How to preserve the same parskip in minipage.


Code:



documentclass{article}
usepackage{tcolorbox}
usepackage[textwidth=4cm]{geometry}

%usepackage{parskip}% Needs to also work with parskip

newlength{currentparskip}
newlength{currentparindent}
setlength{currentparskip}{parskip}
setlength{currentparindent}{parindent}

newcommand*{RestoreParskip}{%
setlength{parskip}{currentparskip}%
setlength{parindent}{currentparindent}%
}%

newcommand*{Mytext}{%
Rechnungsadjunktentochter.par
Statthaltereikonzipist.
}

begin{document}
begin{tcolorbox}[title={1. Default}]
Mytext
end{tcolorbox}

begin{tcolorbox}[hyphenationfix, title={2. hyphenationfix}]
Mytext
end{tcolorbox}

begin{tcolorbox}[hyphenationfix, parbox=false, title={3. hyphenationfix, parbox=false}]
Mytext
end{tcolorbox}

setlength{currentparskip}{parskip}
begin{tcolorbox}[
hyphenationfix,
before upper=RestoreParskipnoindent,
title={4. hyphenationfix, texttt{stringRestoreParskip}},
]
Mytext
end{tcolorbox}

end{document}









share|improve this question



























    1
















    1. I want the text in a {tcolorbox} to exhibit the same paragraph style as the main body. As far as I know (as per the first reference) this requires using RestoreParskip:



      newcommand*{RestoreParskip}{%
      setlength{parskip}{currentparskip}%
      setlength{parindent}{currentparindent}%
      }%


      where currentparskip and currentparindent needs to be initialized before the {tcolorbox}.



      From the documentation, this appears to be exactly what parbox=false is intended to do:




      If the key value is set to false, the normal main text behavior is restored.




      However, this feature is marked as experiemntal as of 2015-10-14 with the caveat:




      In some situations, this has some unwanted side effects. It is recommended that you use this experimental setting only where you really want to have this feature.




      As I defintely want the same paragraph spacing inside {tcolorbox}, it seems I should use this.




    2. Secondly, using hyphenationfix=true seems to be useful:




      Long words at the beginning of paragraphs in very narrow boxes will not be hyphenated using pdflatex. This problem is circumvented by applying the hyphenationfix option.




      However, there is a warning:



      enter image description here






    Using the example text given in the documentation, one can see that parbox=false, hyphenationfix=true together don't seem to work (see 3. in the output of the MWE). I can fix this by leaving parbox=true using RestoreParskip manually (see 4).



    Results without {parskip} and with {parskip}:



    enter image description hereenter image description here



    Questions:




    1. What else is parbox=false doing (besides the RestoreParskip functionality) that causes it to fail with hyphenationfix=true?

    2. What functionality am I losing by manually using RestoreParskip?

    3. When will parbox=false functionality leave the experimental designation? I realize that this particluar question can only be asnwered by the package author, but as I have experienced the pain of having experimental features removed, it would be good to know if this is still really experimental or just that the documentation has not been updated.


    Notes:




    • For now, I do not require breakable=true, but might need it in the future. In case it is relevant, comments addressing these cases separately would be useful.


    References:





    • How to preserve the same parskip in minipage.


    Code:



    documentclass{article}
    usepackage{tcolorbox}
    usepackage[textwidth=4cm]{geometry}

    %usepackage{parskip}% Needs to also work with parskip

    newlength{currentparskip}
    newlength{currentparindent}
    setlength{currentparskip}{parskip}
    setlength{currentparindent}{parindent}

    newcommand*{RestoreParskip}{%
    setlength{parskip}{currentparskip}%
    setlength{parindent}{currentparindent}%
    }%

    newcommand*{Mytext}{%
    Rechnungsadjunktentochter.par
    Statthaltereikonzipist.
    }

    begin{document}
    begin{tcolorbox}[title={1. Default}]
    Mytext
    end{tcolorbox}

    begin{tcolorbox}[hyphenationfix, title={2. hyphenationfix}]
    Mytext
    end{tcolorbox}

    begin{tcolorbox}[hyphenationfix, parbox=false, title={3. hyphenationfix, parbox=false}]
    Mytext
    end{tcolorbox}

    setlength{currentparskip}{parskip}
    begin{tcolorbox}[
    hyphenationfix,
    before upper=RestoreParskipnoindent,
    title={4. hyphenationfix, texttt{stringRestoreParskip}},
    ]
    Mytext
    end{tcolorbox}

    end{document}









    share|improve this question

























      1












      1








      1









      1. I want the text in a {tcolorbox} to exhibit the same paragraph style as the main body. As far as I know (as per the first reference) this requires using RestoreParskip:



        newcommand*{RestoreParskip}{%
        setlength{parskip}{currentparskip}%
        setlength{parindent}{currentparindent}%
        }%


        where currentparskip and currentparindent needs to be initialized before the {tcolorbox}.



        From the documentation, this appears to be exactly what parbox=false is intended to do:




        If the key value is set to false, the normal main text behavior is restored.




        However, this feature is marked as experiemntal as of 2015-10-14 with the caveat:




        In some situations, this has some unwanted side effects. It is recommended that you use this experimental setting only where you really want to have this feature.




        As I defintely want the same paragraph spacing inside {tcolorbox}, it seems I should use this.




      2. Secondly, using hyphenationfix=true seems to be useful:




        Long words at the beginning of paragraphs in very narrow boxes will not be hyphenated using pdflatex. This problem is circumvented by applying the hyphenationfix option.




        However, there is a warning:



        enter image description here






      Using the example text given in the documentation, one can see that parbox=false, hyphenationfix=true together don't seem to work (see 3. in the output of the MWE). I can fix this by leaving parbox=true using RestoreParskip manually (see 4).



      Results without {parskip} and with {parskip}:



      enter image description hereenter image description here



      Questions:




      1. What else is parbox=false doing (besides the RestoreParskip functionality) that causes it to fail with hyphenationfix=true?

      2. What functionality am I losing by manually using RestoreParskip?

      3. When will parbox=false functionality leave the experimental designation? I realize that this particluar question can only be asnwered by the package author, but as I have experienced the pain of having experimental features removed, it would be good to know if this is still really experimental or just that the documentation has not been updated.


      Notes:




      • For now, I do not require breakable=true, but might need it in the future. In case it is relevant, comments addressing these cases separately would be useful.


      References:





      • How to preserve the same parskip in minipage.


      Code:



      documentclass{article}
      usepackage{tcolorbox}
      usepackage[textwidth=4cm]{geometry}

      %usepackage{parskip}% Needs to also work with parskip

      newlength{currentparskip}
      newlength{currentparindent}
      setlength{currentparskip}{parskip}
      setlength{currentparindent}{parindent}

      newcommand*{RestoreParskip}{%
      setlength{parskip}{currentparskip}%
      setlength{parindent}{currentparindent}%
      }%

      newcommand*{Mytext}{%
      Rechnungsadjunktentochter.par
      Statthaltereikonzipist.
      }

      begin{document}
      begin{tcolorbox}[title={1. Default}]
      Mytext
      end{tcolorbox}

      begin{tcolorbox}[hyphenationfix, title={2. hyphenationfix}]
      Mytext
      end{tcolorbox}

      begin{tcolorbox}[hyphenationfix, parbox=false, title={3. hyphenationfix, parbox=false}]
      Mytext
      end{tcolorbox}

      setlength{currentparskip}{parskip}
      begin{tcolorbox}[
      hyphenationfix,
      before upper=RestoreParskipnoindent,
      title={4. hyphenationfix, texttt{stringRestoreParskip}},
      ]
      Mytext
      end{tcolorbox}

      end{document}









      share|improve this question















      1. I want the text in a {tcolorbox} to exhibit the same paragraph style as the main body. As far as I know (as per the first reference) this requires using RestoreParskip:



        newcommand*{RestoreParskip}{%
        setlength{parskip}{currentparskip}%
        setlength{parindent}{currentparindent}%
        }%


        where currentparskip and currentparindent needs to be initialized before the {tcolorbox}.



        From the documentation, this appears to be exactly what parbox=false is intended to do:




        If the key value is set to false, the normal main text behavior is restored.




        However, this feature is marked as experiemntal as of 2015-10-14 with the caveat:




        In some situations, this has some unwanted side effects. It is recommended that you use this experimental setting only where you really want to have this feature.




        As I defintely want the same paragraph spacing inside {tcolorbox}, it seems I should use this.




      2. Secondly, using hyphenationfix=true seems to be useful:




        Long words at the beginning of paragraphs in very narrow boxes will not be hyphenated using pdflatex. This problem is circumvented by applying the hyphenationfix option.




        However, there is a warning:



        enter image description here






      Using the example text given in the documentation, one can see that parbox=false, hyphenationfix=true together don't seem to work (see 3. in the output of the MWE). I can fix this by leaving parbox=true using RestoreParskip manually (see 4).



      Results without {parskip} and with {parskip}:



      enter image description hereenter image description here



      Questions:




      1. What else is parbox=false doing (besides the RestoreParskip functionality) that causes it to fail with hyphenationfix=true?

      2. What functionality am I losing by manually using RestoreParskip?

      3. When will parbox=false functionality leave the experimental designation? I realize that this particluar question can only be asnwered by the package author, but as I have experienced the pain of having experimental features removed, it would be good to know if this is still really experimental or just that the documentation has not been updated.


      Notes:




      • For now, I do not require breakable=true, but might need it in the future. In case it is relevant, comments addressing these cases separately would be useful.


      References:





      • How to preserve the same parskip in minipage.


      Code:



      documentclass{article}
      usepackage{tcolorbox}
      usepackage[textwidth=4cm]{geometry}

      %usepackage{parskip}% Needs to also work with parskip

      newlength{currentparskip}
      newlength{currentparindent}
      setlength{currentparskip}{parskip}
      setlength{currentparindent}{parindent}

      newcommand*{RestoreParskip}{%
      setlength{parskip}{currentparskip}%
      setlength{parindent}{currentparindent}%
      }%

      newcommand*{Mytext}{%
      Rechnungsadjunktentochter.par
      Statthaltereikonzipist.
      }

      begin{document}
      begin{tcolorbox}[title={1. Default}]
      Mytext
      end{tcolorbox}

      begin{tcolorbox}[hyphenationfix, title={2. hyphenationfix}]
      Mytext
      end{tcolorbox}

      begin{tcolorbox}[hyphenationfix, parbox=false, title={3. hyphenationfix, parbox=false}]
      Mytext
      end{tcolorbox}

      setlength{currentparskip}{parskip}
      begin{tcolorbox}[
      hyphenationfix,
      before upper=RestoreParskipnoindent,
      title={4. hyphenationfix, texttt{stringRestoreParskip}},
      ]
      Mytext
      end{tcolorbox}

      end{document}






      spacing tcolorbox parskip






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 28 mins ago









      Peter Grill

      164k25434746




      164k25434746



























          active

          oldest

          votes











          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%2f467691%2ftcolorbox-parbox-false-and-hyphenationfix-true%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          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.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • 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%2f467691%2ftcolorbox-parbox-false-and-hyphenationfix-true%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

          サソリ

          広島県道265号伴広島線

          Setup Asymptote in Texstudio