2

I'm using the code below (which I got off this website: https://jevon.org/wiki/Fancy_Quotation_Boxes_in_Latex) to generate this formal box

I want to have the left-hand vertical bar repeated on the right-hand side of the box, but I'm not sure how to modify the code. Any help would be appreciated. Thanks in advance.

MWE

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{color, colortbl}
\usepackage{changepage}
\usepackage[english]{babel}
\usepackage{lipsum}
% for formal definitions
\usepackage{framed}
% environment derived from framed.sty: see leftbar environment definition
\definecolor{formalshade}{rgb}{0.95,0.95,1}
\definecolor{darkblue}{rgb}{0.0, 0.0, 0.55}

\newenvironment{formal}{% \def\FrameCommand{% \hspace{1pt}% {\color{darkblue}\vrule width 2pt}% {\color{formalshade}\vrule width 4pt}% \colorbox{formalshade}% }% \MakeFramed{\advance\hsize-\width\FrameRestore}% \noindent\hspace{-4.55pt}% disable indenting first paragraph \begin{adjustwidth}{}{7pt}% \vspace{2pt}\vspace{2pt}% } {% \vspace{2pt}\end{adjustwidth}\endMakeFramed% }

\begin{document}

\begin{formal} \textit{``\lipsum[1]''} \end{formal}

\end{document}

1 Answers1

2

I'd use tcolorbox insted of framed and define the box as shown in the following example: enter image description here

\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}

\definecolor{formalshade}{rgb}{0.95,0.95,1} \definecolor{darkblue}{rgb}{0.0, 0.0, 0.55}

\newtcolorbox{mybox}{ enhanced, boxrule=0pt, frame hidden, borderline west={2pt}{0pt}{darkblue}, borderline east={2pt}{0pt}{darkblue}, colback=formalshade, sharp corners, fontupper=\itshape } \begin{document}

\begin{mybox} ``\lipsum[1]'' \end{mybox}

\end{document}

leandriis
  • 62,593