2

I use "shaded" to indicate the reader that the text is about something special. This works fine but i can not extend the box to the full page with. How is this possible? I use LYX and i can imagine that this can be done with renewcommand in some way?! Any hints for this?this is how it should be

And this is how it currently looks like: current appearance

The problem with "shaded" is currently: 1) the width is only the width of the text 2) footnotes which are included in some text within the "shaded" area are not shown anywhere (the numbering works)

MWE:

\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}
3

As suggested in your previous question you can use mdframed. Related to your style request you should define a new style:

\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,
}

With these settings the modified mwe looks:

\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}

And the result is:

enter image description here enter image description here

  • Unfortunately this does not work for me. I just can see the box with intended content. The outer frame stays the same :( – drofluga Jun 14 '13 at 10:41
  • @drofluga: What does not work? Do you get any warnings? Which version do you use? – Marco Daniel Jun 14 '13 at 16:05
  • Compilation does work and i do not get any errors but the visible result is different: the measurements of the box are the same like before and the text within the box is intended – drofluga Jun 14 '13 at 20:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.