# Breaking line in shadow box

I am going to write Definitions: Least element, Greatest element, minimal element, maximal element in a shadow box but the line exceeds the page margin. Here's my code:

\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage[utf8x]{inputenc}
\usepackage{centernot}
\usepackage{fancybox}
\usepackage[breakable]{tcolorbox}
\usepackage{tabularx}
\usepackage{graphicx}
\usepackage{parskip}
\DeclareUnicodeCharacter{2061}{}
\DeclareUnicodeCharacter{8289}{}
\begin{document}
text
\par
\shadowbox{\textbf{Definitions: Upper bound, Least Upper Bound, Lower Bound, Greatest Lower Bound}}
\par \hspace{0.3cm}
text
\end{document}


How do I break the long line within shadow box?

• You are already loading tcolorbox, so why don't you use it, instead of – the rather old – fancybox?
– DG'
Apr 21, 2021 at 9:46
• @DG' because i'm using shadow box for every 'Definition'. tcolorbox isn't providing me this. Apr 21, 2021 at 11:34

As explained in the fancybox documentation (page 5):

Entire paragraphs or other vertical mode material such as displayed equations can be nested in a \parbox or minipage.

MWE

\documentclass{article}
\usepackage{fancybox}

\begin{document}

\parbox{\textwidth}{%
\bfseries
Definitions: Upper bound, Least Upper Bound, Lower Bound, Greatest Lower Bound}}


• why is it not working when I write \shadowbox{%\parbox{\textwidth}{%\bfseries Definitions: Upper bound, Least Upper Bound, Lower Bound, Greatest Lower Bound}} in a single line? Apr 21, 2021 at 11:45
• Because the first % makes all following code invisible or "commented". Your code is equivalent to \shadowbox{, which returns an error
• what does \bfseries do? Apr 21, 2021 at 17:22