我正在使用下面的代码(从这个网站上获取的):https://jevon.org/wiki/Fancy_Quotation_Boxes_in_Latex)来生成这个
我想让左侧竖线在框的右侧重复出现,但我不知道如何修改代码。任何帮助都将不胜感激。提前致谢。
平均能量损失
\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
我将使用tcolorbox
insted offramed
并定义框,如下例所示:
\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}