LaTex noob here. Im looking for a simple way to make a box in latex that won't expand to fit the text. I have been trying to use a minipage within a fbox but it keeps expanding. I have been trying to make a 3in by 5in box

  • 2
    should it break the text?
    – percusse
    Mar 7 '16 at 0:17
  • I looking for it so when it reaches the end of the box, it would start a new line, so i believe so.
    – Alex
    Mar 7 '16 at 0:30
  • Parbox has three optional parameters the first [t,b,c] locates the baseline, the second specifies the height, and the third [t,b,c,s] locates the text inside the box. [s] stands for span which basically stretches the text to fill the box (requires at least something inside which stretches). Mar 7 '16 at 2:21

The following code uses the fitting library of the tcolorbox package to create a 3in by 5in box with never expands this size. The text content is rescaled to fit into this box.



  fit algorithm=hybrid*,
  sharp corners,



\mybox{Testbox with some more text, more text, more text, more text, more text.}






This output for the last four boxes is:

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.