如何将阴影扩展到整个页面宽度?

如何将阴影扩展到整个页面宽度?

我使用“阴影”来向读者表明文本是关于某些特殊内容的。这很好用,但我无法将框扩展到整页。这怎么可能呢?我使用 LYX,我可以想象这可以通过某种方式使用 renewcommand 来实现?!对此有什么提示吗?这才是应该的

现在它看起来是这样的: 目前的样子

目前“阴影”的问题是:1)宽度仅为文本的宽度 2)“阴影”区域内某些文本中包含的脚注不会显示在任何地方(编号有效)

梅威瑟:

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{luainputenc}
\usepackage{color}
\definecolor{shadecolor}{rgb}{0.171875, 0.6640625, 0.8828125}
\usepackage{float}
\usepackage{framed}
\usepackage{graphicx}
\usepackage{babel}
\begin{document}

\section{Document}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua.


\subsection{Sub}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua.Lorem ipsum 

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed%
\footnote{Footnote lj7898786576%
} diam voluptua.Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
erat, sed diam voluptua.


\subsection{Sub 2}

\begin{shaded}%
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua.Lorem ipsum dolor sit amet%
\footnote{Some footnote within the shaded area%
}, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
ut labore et dolore magna aliquyam erat, sed diam voluptua.Lorem ipsum
dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua.

\begin{figure}[H]
\begin{centering}
\includegraphics[scale=0.5]{testIllustration}
\par\end{centering}

\caption{Figure}
\end{figure}


Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua. At vero eos et accusam et justo duo dolores et
ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem
ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing
elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore
magna aliquyam erat, sed diam voluptua.\end{shaded}

some other text

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed%
\footnote{Footnote asdfasdf%
} diam voluptua.Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
erat, sed diam voluptua.


\subsection{Sub 3}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua. At vero eos et accusam et justo duo dolores et
ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem
ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing
elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore
magna aliquyam erat, sed diam voluptua. At vero eos et accusam et
justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata
sanctus est Lorem ipsum dolor sit amet.
\begin{description}
\item [{SOMETHING}] justo duo dolores et ea rebum. Stet clita kasd gubergren,
no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum
dolor sit amet, consetetur sadipscin
\item [{Other}] t justo duo dolores et ea rebum. Stet clita kasd gubergren,
no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum
dolor sit amet, consetetur sadipscin
\end{description}
t justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea
takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor
sit amet, consetetur sadipscint justo duo dolores et ea rebum. Stet
clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor
sit amet. Lorem ipsum dolor sit amet, consetetur sadipscint justo
duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata
sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet,
consetetur sadipscint justo duo dolores et ea rebum. Stet clita kasd
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscin
\end{document}

答案1

正如您上一个问题所建议的,您可以使用mdframed。与您的样式请求相关,您应该定义一种新样式:

\mdfdefinestyle{shaded}{%
 skipabove=\topskip,skipbelow=\topskip,
 hidealllines=true,backgroundcolor=shadecolor,
 leftmargin=\dimexpr-\oddsidemargin-1in-\hoffset\relax,
 rightmargin=\dimexpr-\marginparsep-\marginparwidth-\evensidemargin\relax,
 innerleftmargin=\dimexpr\oddsidemargin+1in+\hoffset\relax,
 innerrightmargin=\dimexpr\marginparsep+\marginparwidth+\evensidemargin\relax,
}

通过这些设置,修改后的 mwe 如下所示:

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage{xcolor}
\usepackage{float}
\usepackage{mdframed}
\definecolor{shadecolor}{rgb}{0.171875, 0.6640625, 0.8828125}

\usepackage[demo]{graphicx}

\mdfdefinestyle{shaded}{%
 skipabove=\topskip,skipbelow=\topskip,
 hidealllines=true,backgroundcolor=shadecolor,
 leftmargin=\dimexpr-\oddsidemargin-1in-\hoffset\relax,
 rightmargin=\dimexpr-\marginparsep-\marginparwidth-\evensidemargin\relax,
 innerleftmargin=\dimexpr\oddsidemargin+1in+\hoffset\relax,
 innerrightmargin=\dimexpr\marginparsep+\marginparwidth+\evensidemargin\relax,
}

\begin{document}

\section{Document}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua.


\subsection{Sub}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua.Lorem ipsum 

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed%
\footnote{Footnote lj7898786576%
} diam voluptua.Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
erat, sed diam voluptua.


\subsection{Sub 2}

\begin{mdframed}[style=shaded]
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua.Lorem ipsum dolor sit amet%
\footnote{Some footnote within the shaded area%
}, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
ut labore et dolore magna aliquyam erat, sed diam voluptua.Lorem ipsum
dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua.

\begin{figure}[H]
\begin{centering}
\includegraphics[scale=0.5]{testIllustration}
\par\end{centering}

\caption{Figure}
\end{figure}


Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua. At vero eos et accusam et justo duo dolores et
ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem
ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing
elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore
magna aliquyam erat, sed diam voluptua.
\end{mdframed}

some other text

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed%
\footnote{Footnote asdfasdf%
} diam voluptua.Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
erat, sed diam voluptua.


\subsection{Sub 3}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua. At vero eos et accusam et justo duo dolores et
ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem
ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing
elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore
magna aliquyam erat, sed diam voluptua. At vero eos et accusam et
justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata
sanctus est Lorem ipsum dolor sit amet.
\begin{description}
\item [{SOMETHING}] justo duo dolores et ea rebum. Stet clita kasd gubergren,
no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum
dolor sit amet, consetetur sadipscin
\item [{Other}] t justo duo dolores et ea rebum. Stet clita kasd gubergren,
no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum
dolor sit amet, consetetur sadipscin
\end{description}
t justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea
takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor
sit amet, consetetur sadipscint justo duo dolores et ea rebum. Stet
clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor
sit amet. Lorem ipsum dolor sit amet, consetetur sadipscint justo
duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata
sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet,
consetetur sadipscint justo duo dolores et ea rebum. Stet clita kasd
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscin
\end{document}

结果是:

在此处输入图片描述 在此处输入图片描述

相关内容