@lockstep: Do you think that the following behavior is more efficient?
\documentclass{article}
\usepackage{showframe}
\usepackage[linewidth=1.2pt]{mdframed}
\usepackage{fullwidth}
\newcommand*{\sometext}{Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,
adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu
libero, nonummy eget, consectetuer id, vulputate a, magna. Donec
vehicula augue eu neque.}
\makeatletter
\def\fullwidth@i[#1]{% default-Umgebung
\begingroup
\fullwidthsetup{#1}%%
\fwd@twoside@checklength%
\ifbool{fwd@twosidemode}%
{\advance\fwd@width@length by -\fwd@outermargin@length
\advance\fwd@width@length by -\fwd@outermargin@length}%
{\advance\fwd@width@length by -\fwd@leftmargin@length
\advance\fwd@width@length by -\fwd@rightmargin@length}%
\let\width\z@%
\let\height\z@%
\setlength{\topsep}{\fwd@skipabove@length}%
\begingroup%
\let\partopsep\z@%
\expandafter\endgroup%
\begin{fwd@trivlist}\item\relax%
\hsize=\fwd@width@length\relax%
\fwd@footnoteinput%
\begin{fwd@lrbox}{\@tempboxa}%
}
\makeatother
\begin{document}
\section{\texttt{mdframed} works as expected}
\sometext
\begin{mdframed}[leftmargin=3em]
\sometext
\end{mdframed}
\begin{mdframed}[rightmargin=3em]
\sometext
\end{mdframed}
\section{But \texttt{fullwidth} doesn't}
\sometext
\begin{fullwidth}[leftmargin=3em]
\sometext
\end{fullwidth}
\begin{fullwidth}[rightmargin=3em]
\sometext
\end{fullwidth}
\null\hfill\smash{\rule[1.5cm]{3em}{2pt}}
\end{document}
Here is a proposal, using some low level commands. The text is typeset in a \vtop
and its depth is used to place the opening quotes, while the closing quotes will be level with the top line (with some lowering due to size).
Thanks to Jake, I've been able to solve a mystery that bugged me, about a spacing that seems necessary and is due to the inner sep
of TikZ nodes.
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{kpfonts}
\usepackage[svgnames]{xcolor}
\definecolor{framecolor}{named}{SteelBlue}
\colorlet{framebgcolor}{PowderBlue!50!White}
\definecolor{quotesignclr}{named}{LightSlateGrey}
\usepackage{changepage}
\usepackage{environ,graphicx}
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\newcommand\sopeningquote{\scalebox{2}{\color{quotesignclr}\smash\quotedblbase}}
\newcommand\sclosingquote{\scalebox{2}{\color{quotesignclr}\smash\textquotedblleft}}
\makeatletter
\newsavebox\simplequestbox
\NewEnviron{simplequest}{%
\normalfont
\begin{adjustwidth}{3em}{3em}
\settowidth{\dimen@}{\sopeningquote\kern.4em\sclosingquote}%
\dimen@=\dimexpr\linewidth-\dimen@\relax
\setbox\simplequestbox=\vtop{
\@parboxrestore\itshape
\hsize=\dimexpr\dimen@-\pgfkeysvalueof{/pgf/inner xsep}*2\relax % thanks, Jake
\sbox\z@{\BODY}
\ifdim\wd\z@>\hsize
\noindent\BODY\par
\else
\box\z@
\fi
\xdef\simplequestpd{\the\prevdepth}
}
\begin{tikzpicture}
[background rectangle/.style={draw=framecolor,line width=0.2pt,
fill=framebgcolor,rounded corners}, show background rectangle,
inner frame xsep=-2pt,inner frame ysep=2pt]
\node {\mbox{%
\raisebox{\dimexpr-\dp\simplequestbox+\simplequestpd+.05ex}
[0pt][0pt]{\sopeningquote}%
\kern.2em
\box\simplequestbox
\kern.2em
\raisebox{-1.4ex}[0pt][0pt]{\sclosingquote}}};
\end{tikzpicture}
\end{adjustwidth}
}
\makeatother
\begin{document}
\begin{simplequest}
Dies hier ist ein Blindtext zum Testen von Textausgaben.
Wer diesen Text liest, ist selbst schuld.
\end{simplequest}
\begin{simplequest}
Dies hier ist ein Blindtext
\end{simplequest}
\Large
\begin{simplequest}
Dies hier ist ein Blindtext zum Testen von Textausgaben.
Wer diesen Text liest, ist selbst schuld.
\end{simplequest}
\end{document}
In the picture the similar quotes are: top mine, bottom yours.
A problem may arise in case the text consists of more than one paragraph and the first one is not long enough to fill a line. Should this case present itself in the document, the code might be changed like this:
\makeatletter
\newsavebox\simplequestbox
\NewEnviron{simplequest}[1][]{%
\normalfont
\begin{adjustwidth}{3em}{3em}
\settowidth{\dimen@}{\sopeningquote\kern.4em\sclosingquote}%
\dimen@=\dimexpr\linewidth-\dimen@\relax
\setbox\simplequestbox=\vtop{
\@parboxrestore\itshape
\hsize=\dimexpr\dimen@-\pgfkeysvalueof{/pgf/inner xsep}*2\relax % thanks, Jake
\if\relax\detokenize{#1}\relax
\sbox\z@{\BODY}
\ifdim\wd\z@>\hsize
\noindent\BODY\par
\else
\box\z@
\fi
\else
\sbox\z@{#1}
\hsize\wd\z@
\BODY\par
\fi
\xdef\simplequestpd{\the\prevdepth}
}
\begin{tikzpicture}
[background rectangle/.style={draw=framecolor,line width=0.2pt,
fill=framebgcolor,rounded corners}, show background rectangle,
inner frame xsep=-2pt,inner frame ysep=2pt]
\node {\mbox{%
\raisebox{\dimexpr-\dp\simplequestbox+\simplequestpd+.05ex}
[0pt][0pt]{\sopeningquote}%
\kern.2em
\box\simplequestbox
\kern.2em
\raisebox{-1.4ex}[0pt][0pt]{\sclosingquote}}};
\end{tikzpicture}
\end{adjustwidth}
}
\makeatother
The environment now has an optional argument, the first short line; here's an example:
\begin{simplequest}[Dies hier ist ein Blindtext.]
Dies hier ist ein Blindtext.
Wer diesen Text liest, ist selbst schuld.
\end{simplequest}
One could try getting only the first paragraph, but this might be error prone.
Best Answer
You should make the change outside the quote environment.
(You could also use two quote environments)