0

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?

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

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}  

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

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

\end{document}

enter image description here

3
  • 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? – Manjoy Das Apr 21 at 11:45
  • Because the first % makes all following code invisible or "commented". Your code is equivalent to \shadowbox{, which returns an error – Ivan Apr 21 at 11:51
  • what does \bfseries do? – Manjoy Das Apr 21 at 17:22

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.