具有框架线的抽象彩色背景

具有框架线的抽象彩色背景

有没有办法让摘要周围的彩色框更加均匀,并在顶部和底部边缘带有蓝线?

就像在这本日记中一样:就像在这本日记里一样

我正在使用默认的 TeXStudio,这是我目前的代码:

\documentclass[oneside,onecolumn,9pt]{extarticle}

\usepackage[T1]{fontenc} %Encoding
\usepackage[english]{babel} %Language
\usepackage{amssymb} %Symbols

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%Side margins and colums seperation 
\usepackage[hmarginratio=1:1,columnsep=25pt]{geometry}
\geometry{
    left=1.8cm,
    right=1.8cm,
    top=2.5cm,
    bottom=2cm,
    bindingoffset=0mm}
%%%%%Colors
\usepackage{xcolor}
\definecolor{acsblue}{RGB}{17,76,139}
\definecolor{acsyellow}{RGB}{255,241,204}
%%%%%Frames
\usepackage{framed}
\definecolor{shadecolor}{RGB}{255,241,204}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%Abstract costumizaiton
\usepackage{abstract}
\renewcommand{\absnamepos}{flushleft}
\setlength{\absleftindent}{8.5pt}
\setlength{\absrightindent}{8.5pt}
\renewenvironment{abstract}{{\color{acsblue}\normalfont\textbf{ABSTRACT:}}}
{\vspace*{\baselineskip}}

\usepackage{lipsum}

\begin{document}

    \begin{shaded*}
        \begin{abstract}
            \noindent \lipsum[1]
        \end{abstract}
    \end{shaded*}


\end{document}

答案1

mdframed软件包为您提供了更多自定义选项。例如:

\documentclass[oneside,onecolumn,9pt]{extarticle}

\usepackage[T1]{fontenc} %Encoding
\usepackage[english]{babel} %Language
\usepackage{amssymb} %Symbols

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%Side margins and colums seperation 
\usepackage[hmarginratio=1:1,columnsep=25pt]{geometry}
\geometry{
    left=1.8cm,
    right=1.8cm,
    top=2.5cm,
    bottom=2cm,
    bindingoffset=0mm}
%%%%%Colors
\usepackage{xcolor}
\definecolor{acsblue}{RGB}{17,76,139}
\definecolor{acsyellow}{RGB}{255,241,204}
%%%%%Frames
\usepackage{mdframed}
\definecolor{shadecolor}{RGB}{255,241,204}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%Abstract costumizaiton
\usepackage{abstract}
\renewcommand{\absnamepos}{flushleft}
\setlength{\absleftindent}{8.5pt}
\setlength{\absrightindent}{8.5pt}
\renewenvironment{abstract}{{\color{acsblue}\normalfont\textbf{ABSTRACT:}}}
{}

\mdfdefinestyle{mdfabstract}{%
    linecolor=acsblue, linewidth=0.8pt,
    backgroundcolor=shadecolor,
    leftline=false, rightline=false,
    innertopmargin=0.25cm, innerbottommargin=0.25cm,
    innerleftmargin=0.25cm, innerrightmargin=0.25cm,
}

\usepackage{lipsum}

\begin{document}
    \begin{mdframed}[style=mdfabstract]
        \begin{abstract}
            \noindent \lipsum[1]
        \end{abstract}
    \end{mdframed}

\lipsum[1]

\end{document}

在此处输入图片描述

相关内容