在乳胶中缩进花式引文框而不列出列表

在乳胶中缩进花式引文框而不列出列表

我想创建一个格式为精美盒子,而是环境的缩进quote。我发现问题,涉及类似的问题,但该线程中给出的解决方案对我的情况并不是特别有用。

我想做的是修改formal环境,使其以与quote环境相同的方式缩进。提前致谢!

梅威瑟:

\documentclass{article}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   Formal Quotation Boxes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% for adjustwidth environment
\usepackage[strict]{changepage}

% for formal definitions
\usepackage{framed}
\usepackage[dvipsnames]{xcolor}


% environment derived from framed.sty: see leftbar environment definition
\definecolor{formalshade}{rgb}{0.95,0.95,1}
\definecolor{mygray}{gray}{0.4}
\definecolor{lightgray}{gray}{0.93}

\newenvironment{formal}{%
  \def\FrameCommand{%
    \hspace{1pt}%
    {\color{mygray}\vrule width 2pt}%
    {\color{lightgray}\vrule width 4pt}%
    \colorbox{lightgray}%
  }%
  \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}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Scelerisque felis imperdiet proin fermentum leo vel orci porta. Id cursus metus aliquam eleifend mi in nulla posuere sollicitudin. Id donec ultrices tincidunt arcu non sodales neque.


\begin{formal}
     Eget est lorem ipsum dolor sit amet consectetur. Semper eget duis at tellus at. Felis eget velit aliquet sagittis id consectetur purus ut faucibus. Augue neque gravida in fermentum. Quam nulla porttitor massa id neque aliquam vestibulum morbi. Duis at tellus at urna condimentum mattis pellentesque. Porttitor leo a diam sollicitudin tempor.
\end{formal}

Diam quis enim lobortis scelerisque fermentum dui faucibus in ornare. Erat imperdiet sed euismod nisi porta lorem mollis aliquam. Metus aliquam eleifend mi in nulla posuere sollicitudin aliquam ultrices. Turpis egestas integer eget aliquet nibh praesent tristique magna sit.

\begin{quote}
Nec ultrices dui sapien eget mi proin. Penatibus et magnis dis parturient montes nascetur ridiculus mus mauris. Nulla aliquet enim tortor at auctor urna nunc id. Eu facilisis sed odio morbi quis.
\end{quote}

\end{document}

答案1

将此作为答案发布。

\documentclass{article}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   Formal Quotation Boxes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% for adjustwidth environment
\usepackage[strict]{changepage}

% for formal definitions
\usepackage{framed}
\usepackage[dvipsnames]{xcolor}


% environment derived from framed.sty: see leftbar environment definition
\definecolor{formalshade}{rgb}{0.95,0.95,1}
\definecolor{mygray}{gray}{0.4}
\definecolor{lightgray}{gray}{0.93}

\newenvironment{formal}{%
  \def\FrameCommand{%
    \hspace{1cm}%  ← change this to modify the indentation ========================
    {\color{mygray}\vrule width 2pt}%
    {\color{lightgray}\vrule width 4pt}%
    \colorbox{lightgray}%
  }%
  \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}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Scelerisque felis imperdiet proin fermentum leo vel orci porta. Id cursus metus aliquam eleifend mi in nulla posuere sollicitudin. Id donec ultrices tincidunt arcu non sodales neque.


\begin{formal}
     Eget est lorem ipsum dolor sit amet consectetur. Semper eget duis at tellus at. Felis eget velit aliquet sagittis id consectetur purus ut faucibus. Augue neque gravida in fermentum. Quam nulla porttitor massa id neque aliquam vestibulum morbi. Duis at tellus at urna condimentum mattis pellentesque. Porttitor leo a diam sollicitudin tempor.
\end{formal}

Diam quis enim lobortis scelerisque fermentum dui faucibus in ornare. Erat imperdiet sed euismod nisi porta lorem mollis aliquam. Metus aliquam eleifend mi in nulla posuere sollicitudin aliquam ultrices. Turpis egestas integer eget aliquet nibh praesent tristique magna sit.

\begin{quote}
Nec ultrices dui sapien eget mi proin. Penatibus et magnis dis parturient montes nascetur ridiculus mus mauris. Nulla aliquet enim tortor at auctor urna nunc id. Eu facilisis sed odio morbi quis.
\end{quote}

\end{document}

输出如下所示。

输出

相关内容