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'
    Commented Apr 21, 2021 at 9:46
  • @DG' because i'm using shadow box for every 'Definition'. tcolorbox isn't providing me this.
    – Manjoy Das
    Commented Apr 21, 2021 at 11:34

1 Answer 1

1

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
    Commented 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
    – Ivan
    Commented Apr 21, 2021 at 11:51
  • what does \bfseries do?
    – Manjoy Das
    Commented Apr 21, 2021 at 17:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .