\documentclass{article} \usepackage{times,lipsum} \usepackage[svgnames]{xcolor} \usepackage[strict]{changepage} % for formal definitions \usepackage{framed} % environment derived from framed.sty: see leftbar environment definition \definecolor{formalshade}{rgb}{0.95,0.95,1} \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} \section{The first section of my article} \lipsum[1] \begin{formal} I wanted to have some fancy boxes for displaying particular definitions - in my case, formal definitions - that would be readable, span pages, and easy to use. I wanted a left-hand margin border and background shading for the entire box. \end{formal} \lipsum[2-4] \end{document}
选自:http://www.jevon.org/wiki/Fancy_Quotation_Boxes_in_Latex扩展阅读:http://www.latexstudio.net/how-to-highlight-an-entire-paragraph/
发表评论 取消回复