[Tex/LaTex] Framebox with long paragraph and line break

framedline-breakingparagraphs

I want to make a border to a paragraph, so I use \framebox to do it. But I have a problem that my paragraph is so long, I can't insert a line break and my paragraph cross the frame.

\documentclass[12pt]{article}

\usepackage[utf8]{vietnam}

\begin{document}
     \framebox[0.9\textwidth]{
        \textbf{Subordinated bond} (Trái phiếu ưu tiên thấp nhất) là một trái phiếu chỉ được hoàn trả tiền sau          khi một số khoản vay khác của người phát hành đã được ưu tiên thanh toán trước. \par
        \textbf{Senior (Trái phiếu ưu tiên ở mức cao)} là những trái phiếu được đảm bảo chặt chẽ hơn, nghĩa là          được ưu tiên thanh toán tiền ở mức cao hơn các loại khác.
        }
\end{document}

enter image description here

Please help me fix problem and show me how to create a framebox whose contents are resized following that framebox.

Best Answer

You should wrap it in a \parbox of fixed width and box it using \fbox:

enter image description here

\documentclass[12pt]{article}
\usepackage[utf8]{vietnam}
\begin{document}
\fbox{%
  \parbox{0.9\textwidth}{%
  \textbf{Subordinated bond} (Trái phiếu ưu tiên thấp nhất) là một trái phiếu chỉ được hoàn trả tiền sau          khi một số khoản vay khác của người phát hành đã được ưu tiên thanh toán trước.
  \par
  \textbf{Senior (Trái phiếu ưu tiên ở mức cao)} là những trái phiếu được đảm bảo chặt chẽ hơn, nghĩa là          được ưu tiên thanh toán tiền ở mức cao hơn các loại khác.}%
}
\end{document}

\par inside a \framebox doesn't yield the desired result, but it works inside a \parbox.

Related Question