引用风格、技术和欣赏问题

引用风格、技术和欣赏问题

我知道有人对引号样式有疑问,我喜欢带大引号的样式。我想实现的效果更简单一些。

现在我有这样的东西:

\documentclass[11pt]{report}

\usepackage{framed}
\usepackage{color}

\newenvironment{shadequote}%
{\begin{snugshade}\begin{quote}}
{\hfill\end{quote}\end{snugshade}}


\definecolor{shadecolor}{rgb}{0.9,0.9,0.9}

\begin{document}
Text before. Text before. Text before. Text before.
Text before. Text before. Text before. Text before.
Text before. Text before. Text before. 

\begin{shadequote}
Refactoring is the process of changing a software system in such a way
that it does not alter the external behavior of the code yet improves its
internal structure. It is a disciplined way to clean up code that minimizes
the chances of introducing bugs. In essence when you refactor you are improving
the design of the code after it has been written.
\end{shadequote}

Text after Text After Text after Text After Text after
Text After Text after Text After Text after Text After
Text after Text After Text after 
\end{document}

它的作用如下:

在此处输入图片描述

现在,我想要完成的是:

在此处输入图片描述

阴影仅影响引文的文字。

最后,我喜欢 beamer 输出的引文: 在此处输入图片描述

但是我尝试用它改变引文,\itshape但它看起来很糟糕,Beamer 会改变引用文本的字体吗?

那么,现在的问题是,首先是技术问题:

1. 我怎样才能实现第二张图片所示的效果?(阴影仅影响文本部分)。额外奖励:同上,但具有 beamer 外观理想的答案是使用quote环境以免丢失其所有属性(例如空格、标识等)。

鉴赏问题:

我知道 LaTeX 做事是有原因的,有时我不喜欢它,但后来我意识到我错了(最新的例子是,当你设置 twoside 选项时,右页在右侧有更多的边距,起初我以为应该反过来),所以,虽然这是一个个人和主观的问题,但我想知道你的想法:

2. 我所尝试实现的效果可以吗?阴影应该只影响文本部分还是第一张图片的效果更好?

当然,欢迎大家补充或发表个人意见

答案1

这是使用该包的版本mdframed。下面的第一幅图使用该环境shadequote,下面的第二幅图使用该mdframed环境。

在此处输入图片描述

代码:

\documentclass[11pt]{report}
\usepackage{mdframed}
\usepackage{framed}
\usepackage{xcolor}

\mdfdefinestyle{MyShadeQuoteStyle}{%
    leftmargin=15pt,
    rightmargin=15pt,
    backgroundcolor=gray!25,
    linewidth=0pt,
    skipbelow=\topskip,
    skipabove=\topskip
}

\newenvironment{MyShadequote}[1][]{%
    \ignorespaces%
    \begin{mdframed}[style=MyShadeQuoteStyle,#1]%
}{%
    \end{mdframed}%
    \ignorespacesafterend%
}%


\newenvironment{shadequote}%
{\begin{snugshade}\begin{quote}}
{\hfill\end{quote}\end{snugshade}}


\definecolor{shadecolor}{rgb}{0.9,0.9,0.9}

\begin{document}
Text before. Text before. Text before. Text before.
Text before. Text before. Text before. Text before.
Text before. Text before. Text before. 

\begin{shadequote}
shadequote: Refactoring is the process of changing a software system in such a way
that it does not alter the external behavior of the code yet improves its
internal structure. It is a disciplined way to clean up code that minimizes
the chances of introducing bugs. In essence when you refactor you are improving
the design of the code after it has been written.
\end{shadequote}

Text after Text After Text after Text After Text after
Text After Text after Text After Text after Text After
Text after Text After Text after 

\begin{MyShadequote}
mdframed: Refactoring is the process of changing a software system in such a way
that it does not alter the external behavior of the code yet improves its
internal structure. It is a disciplined way to clean up code that minimizes
the chances of introducing bugs. In essence when you refactor you are improving
the design of the code after it has been written.
\end{MyShadequote}

Text after Text After Text after Text After Text after
Text After Text after Text After Text after Text After
Text after Text After Text after 
\end{document}

答案2

首先回答第二个问题,第三张图片中的字体是倾斜的无衬线字体,您可以使用\sffamily和获得它\slshape

{\sffamily\slshape 
  El proceso de cambiar un sistema \dots
}

生产

倾斜无衬线文本示例

其次回答第一个问题,我期望 mdframed 和 varwidth 包可能会更好、更有用、更强大,但对于快速而粗糙的解决方案,您可以使用center带有 a 的环境minipage和 ashaded环境:

\documentclass{article}

\newenvironment{shadequote}{%
  \begin{center}%
    \begin{minipage}{.8\linewidth}%
      \begin{shaded}%
        \sffamily\slshape}{%
      \end{shaded}
    \end{minipage}%
  \end{center}%
}

\usepackage{color}
\usepackage{framed}

\definecolor{shadecolor}{gray}{0.95}

\begin{document}

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. \dots

\begin{shadequote}
  El proceso de cambiar un sistema \dots
\end{shadequote}

Lorem ipsum dolor sit amet, consectetur adipisicing elit, \dots

\end{document}

产生

快速而肮脏的阴影引文示例

不过,我希望有人可以提供更有力的答案。

相关内容