如何在没有框的情况下为乳胶中的文本添加阴影?

如何在没有框的情况下为乳胶中的文本添加阴影?

我想在报告中为文本添加背景阴影。但我不想使用方框来包装文本。这可能吗?我的代码的 MWE 如下所示。在代码中,我想为描述列表添加阴影。

\documentclass[11pt]{report}
\begin{document}

This document contains the author's responses to the comments from Examiner 2 and Examiner 3.\\\\ 
\Large{\underline{Response Categories}}
\begin{description}
  \item[A (Accept)] Denotes that the author accepts the comments in their entirety.
  \item[AM (Accept with Modifications to Original Context)] Denotes that the author accepts the comments in their entirety, and changes to the thesis would involve modification to the original context in which the relevant subject matter had been placed.
  \item[P (Partially Accept)] Denotes that the author accepts certain aspects of the comments while explicating reservations on the rest.
  \item[R (Reject)] Denotes that the author does not accept the comments.
  \item[RM (Reject with Suitable Modifications to Text)] Denotes that author does not accept the broader implication of the comment, but the text has been modified to address individual points raised as part of the comment, as applicable.
\end{description}

答案1

使用tcolorbox,阴影背景并不是很困难,例如使用interior style={top color=red,bottom color=yellow}

\documentclass[11pt]{report}
\usepackage[lmargin=1.5cm,rmargin=2cm]{geometry}
\usepackage[most]{tcolorbox}
\begin{document}

This document contains the author's responses to the comments from Examiner 2 and Examiner 3.\\\\ 
\Large{\underline{Response Categories}}
\begin{tcolorbox}[width=\textwidth,enhanced,interior style={top color={red},bottom color={yellow}}]
  \begin{description}
  \item[A (Accept)] Denotes that the author accepts the comments in their entirety.
  \item[AM (Accept with Modifications to Original Context)] Denotes that the author accepts the comments in their entirety, and changes to the thesis would involve modification to the original context in which the relevant subject matter had been placed.
  \item[P (Partially Accept)] Denotes that the author accepts certain aspects of the comments while explicating reservations on the rest.
  \item[R (Reject)] Denotes that the author does not accept the comments.
  \item[RM (Reject with Suitable Modifications to Text)] Denotes that author does not accept the broader implication of the comment, but the text has been modified to address individual points raised as part of the comment, as applicable.
  \end{description}
\end{tcolorbox}
\end{document}

在此处输入图片描述

答案2

最简单的方法可能是使用framed包,它定义了一个shaded(阴影溢出边距)和一个shaded*(阴影适合边距)环境。这些环境可以跨页面。顺便说一句,您的一个描述文本会以默认布局流入边距。如果您不使用边距注释,您可以加载包geometry,它会设置更合理的边距。或者,您可以加载enumitem并使用nextline描述样式。

\documentclass[11pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[x11names]{xcolor}
\colorlet{shadecolor}{LavenderBlush3}
\usepackage{framed}
\usepackage{enumitem}
\usepackage[showframe]{geometry}

\begin{document}

This document contains the author's responses to the comments from Examiner 2 and Examiner 3.\\\\
\Large{\underline{Response Categories}}
\begin{shaded}
\begin{description}[style=nextline]
  \item[A (Accept)] Denotes that the author accepts the comments in their entirety.
  \item[AM (Accept with Modifications to Original Context)] Denotes that the author accepts the comments in their entirety, and changes to the thesis would involve modification to the original context in which the relevant subject matter had been placed.
  \item[P (Partially Accept)] Denotes that the author accepts certain aspects of the comments while explicating reservations on the rest.
  \item[R (Reject)] Denotes that the author does not accept the comments.
  \item[RM (Reject with Suitable Modifications to Text)] Denotes that author does not accept the broader implication of the comment, but the text has been modified to address individual points raised as part of the comment, as applicable.
\end{description}
\end{shaded}
%%%%%%%%%%%%%%%%%
\colorlet{shadecolor}{Thistle3!50}
\begin{shaded*}
\begin{description}
  \item[A (Accept)] Denotes that the author accepts the comments in their entirety.
  \item[AM (Accept with Modifications to Original Context)] Denotes that the author accepts the comments in their entirety, and changes to the thesis would involve modification to the original context in which the relevant subject matter had been placed.
  \item[P (Partially Accept)] Denotes that the author accepts certain aspects of the comments while explicating reservations on the rest.
  \item[R (Reject)] Denotes that the author does not accept the comments.
  \item[RM (Reject with Suitable Modifications to Text)] Denotes that author does not accept the broader implication of the comment, but the text has been modified to address individual points raised as part of the comment, as applicable.
\end{description}
\end{shaded*}
\end{document} 

在此处输入图片描述

答案3

这是一个选项。也许使用该enumitem包可以做得更好。

\documentclass{article}
\usepackage{color,soul}

\definecolor{lightblue}{rgb}{.8,.95,1}
\definecolor{LightBlue}{rgb}{.8,.9,1}
\sethlcolor{lightblue}

\renewcommand*\descriptionlabel[1]{\hspace\labelsep
                                \normalfont\bfseries
                                \sethlcolor{LightBlue}\hl{#1}}

   % to be automatic                             
\newcommand{\bgitem}[2]{\item[#1]\hl{#2}}

\begin{document}


\begin{description}
  \item[A (Accept)]\hl{Denotes that the author accepts the comments in their entirety.}
  \item[AM (Accept with Modifications to Original Context)]\hl{Denotes that the author accepts the comments in their entirety, and changes to the thesis would involve modification to the original context in which the relevant subject matter had been placed.}
  \item[P (Partially Accept)]\hl{Denotes that the author accepts certain aspects of the comments while explicating reservations on the rest.}
  % here with \bgitem
  \bgitem{R (Reject)}{Denotes that the author does not accept the comments.}
\end{description}

\end{document}

最好定义一个新环境hldescription,并将更改标记为本地。 在此处输入图片描述

答案4

\documentclass[11pt]{report}
\usepackage{xcolor}
\begin{document}

This document contains the author's responses to the comments from Examiner 2 and 
Examiner 3.

\bigskip\noindent
{\Large\underline{Response Categories}\par}\smallskip
\noindent
\colorbox{blue!40!white!80}{\parbox{\linewidth}{%
    \begin{description}
        \item[A (Accept)] Denotes that the author accepts the comments in their entirety.
        \item[AM (Accept with Modifications to Original Context)] Denotes that the author 
        accepts the comments in their entirety, and changes to the thesis would involve 
        modification to the original context in which the relevant subject matter had 
        been placed.
        \item[P (Partially Accept)] Denotes that the author accepts certain aspects of 
        the comments while explicating reservations on the rest.
        \item[R (Reject)] Denotes that the author does not accept the comments.
        \item[RM (Reject with Suitable Modifications to Text)] Denotes that author does 
        not accept the broader implication of the comment, but the text has been modified 
        to address individual points raised as part of the comment, as applicable.
    \end{description}%
}}
\end{document}

在此处输入图片描述

相关内容