我有一个阴影文本框,如下所示:
这是由以下代码生成的?
\documentclass{memoir}
\usepackage{titling}
\usepackage{algorithm,algpseudocode}
\usepackage{bm} % bold greek variables (boldmath)
\usepackage{tikz}
\usetikzlibrary{positioning} % use: above left of, etc
\usetikzlibrary{calc}
% Required for the ToDo list.
\usepackage{ifthen}
\usepackage[protrusion=true,expansion=true, kerning]{microtype}
\usepackage{enumitem}
\usepackage{booktabs}
\usepackage{lipsum}
\usepackage{wrapfig}
\newcommand{\secref}[1]{Section~\ref{#1}}
\newcommand{\chapref}[1]{Chapter~\ref{#1}}
\renewcommand{\eqref}[1]{Equation~(\ref{#1})}
\newcommand{\figref}[1]{Figure~\ref{#1}}
\newcommand{\tabref}[1]{Table~\ref{#1}}
\begin{document}
\definecolor{shadecolor}{RGB}{176,224,230}%{246,243,226}
\setlength\OuterFrameSep{0pt}
\begin{shaded*}
% \medskip
\textcolor{gray}{}\\
\textcolor{gray}{\textbf{Chapter 1}}\\
\textcolor{dark_red}{\textbf{SUMMARY: }}
\medskip \\
Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,
\end{shaded*}
\setlength\OuterFrameSep{0pt}
\begin{shaded*}
% \medskip
\textcolor{gray}{}\\
\textcolor{gray}{\textbf{Chapter 2}}\\
\textcolor{dark_red}{\textbf{SUMMARY: }}
\medskip \\
Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,
\end{shaded*}
\end{document}
有没有办法让角变圆,同时保持其他视觉特征的完整性?
答案1
也许tcolorbox
会让事情变得更容易。
https://ctan.org/pkg/tcolorbox?lang=en
% !TeX TS-program = pdflatex
\documentclass{memoir}
\usepackage{titling}
\usepackage{algorithm,algpseudocode}
\usepackage{bm} % bold greek variables (boldmath)
\usepackage{tikz}
\usetikzlibrary{positioning} % use: above left of, etc
\usetikzlibrary{calc}
% Required for the ToDo list.
\usepackage{ifthen}
\usepackage[protrusion=true,expansion=true, kerning]{microtype}
\usepackage{enumitem}
\usepackage{booktabs}
\usepackage{lipsum}
\usepackage{wrapfig}
\usepackage{tcolorbox}
\newcommand{\secref}[1]{Section~\ref{#1}}
\newcommand{\chapref}[1]{Chapter~\ref{#1}}
\newcommand{\eqref}[1]{Equation~(\ref{#1})}
\newcommand{\figref}[1]{Figure~\ref{#1}}
\newcommand{\tabref}[1]{Table~\ref{#1}}
\begin{document}
\definecolor{shadecolor}{RGB}{176,224,230}%{246,243,226}
%\setlength\OuterFrameSep{0pt}
%\begin{shaded*}
% % \medskip
% \textcolor{gray}{}\\
% \textcolor{gray}{\textbf{Chapter 1}}\\
% \textcolor{dark_red}{\textbf{SUMMARY: }}
% \medskip \\
% Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,
%\end{shaded*}
%
%
%
%\setlength\OuterFrameSep{0pt}
%\begin{shaded*}
% % \medskip
% \textcolor{gray}{}\\
% \textcolor{gray}{\textbf{Chapter 2}}\\
% \textcolor{dark_red}{\textbf{SUMMARY: }}
% \medskip \\
% Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,Some text,
%\end{shaded*}
\begin{tcolorbox}
\lipsum[3]
\end{tcolorbox}
\begin{tcolorbox}[colback=white, colframe=blue!20, arc=10pt, title=\color{gray} \textbf{Chapter 1}\\ \color{red} \textbf{SUMMARY:}]
\lipsum[1]
\end{tcolorbox}
\end{document}
您的代码中没有包含环境阴影(也许来自framed
?),所以我注释了这些行。