f



framed.sty + chngpage.sty + float.sty

dear latex wizards---I am getting some interactions between packages
framed, cngpage, and float.  I would like to have floats that are style
"float", which have a colored background, and which extend into the
marginparwidth.  alas, I can get floats with colored background, or
floats which extend into the marginparwidth, but not both.  this is
easy to show with the latex segment below.  (if there is a more
advanced package out there that has more features than float.sty that
cover this, please let me know and ignore this post.)  any help would
be appreciated.

sincerely,

/ivo welch


\documentclass[12pt]{book}

\setlength{\textwidth}{4in}  % make it more obvious

\usepackage{color}
\usepackage{float}
\usepackage{chngpage}
\usepackage{framed}\definecolor{shadecolor}{gray}{0.75}

\makeatletter

% we need to redefine float@end to extend the table-rules.  thanks to
morten hogholm.
\renewcommand\float@end{\@endfloatbox
  \ifdim\linewidth<\columnwidth
    \global\setbox\@currbox\float@makebox\columnwidth
  \else
    \global\setbox\@currbox\float@makebox\linewidth
  \fi
  \let\@endfloatbox\relax\end@float}

\makeatother

\floatstyle{ruled} \restylefloat{table}


\newif\ifuseshaded \useshadedtrue  % set this to false to show that it
works w/o framed

\begin{document}

\marginpar{\footnotesize this is a marginal note to text.}
some text. some text. some text. some text. some text. some text. some
text.

\begin{table}[H]
  \begin{adjustwidth}{}{-\marginparwidth}
\ifuseshaded    \begin{shaded} \fi
    \caption{A Table}
    this is a table that I wish to extend into the margin.  it works
well
    as long as shaded is not set.
\ifuseshaded    \end{shaded} \fi
  \end{adjustwidth}
\end{table}

\marginpar{\footnotesize this is a marginal note to text.}
some more text. some more text. some more text. some more text. some
more
text. some more text.


\end{document}

0
ivowel (414)
9/22/2006 3:08:43 PM
comp.text.tex 39027 articles. 3 followers. Post Follow

6 Replies
1075 Views

Similar Articles

[PageSpeed] 12

ivowel@gmail.com wrote:
> dear latex wizards---I am getting some interactions between packages
> framed, cngpage, and float.  I would like to have floats that are style
> "float", which have a colored background, and which extend into the
> marginparwidth.  alas, I can get floats with colored background, or
> floats which extend into the marginparwidth, but not both.  this is
> easy to show with the latex segment below.  (if there is a more
> advanced package out there that has more features than float.sty that
> cover this, please let me know and ignore this post.)  any help would
> be appreciated.
> 
> sincerely,
> 
> /ivo welch
> 
> 
> \documentclass[12pt]{book}
> 
> \setlength{\textwidth}{4in}  % make it more obvious
> 
> \usepackage{color}
> \usepackage{float}
> \usepackage{chngpage}
> \usepackage{framed}\definecolor{shadecolor}{gray}{0.75}
> 
> \makeatletter
> 
> % we need to redefine float@end to extend the table-rules.  thanks to
> morten hogholm.
> \renewcommand\float@end{\@endfloatbox
>   \ifdim\linewidth<\columnwidth
>     \global\setbox\@currbox\float@makebox\columnwidth
>   \else
>     \global\setbox\@currbox\float@makebox\linewidth
>   \fi
>   \let\@endfloatbox\relax\end@float}
> 
> \makeatother
> 
> \floatstyle{ruled} \restylefloat{table}
> 
> 
> \newif\ifuseshaded \useshadedtrue  % set this to false to show that it
> works w/o framed
> 
> \begin{document}
> 
> \marginpar{\footnotesize this is a marginal note to text.}
> some text. some text. some text. some text. some text. some text. some
> text.
> 
> \begin{table}[H]
>   \begin{adjustwidth}{}{-\marginparwidth}
> \ifuseshaded    \begin{shaded} \fi
>     \caption{A Table}
>     this is a table that I wish to extend into the margin.  it works
> well
>     as long as shaded is not set.
> \ifuseshaded    \end{shaded} \fi
>   \end{adjustwidth}
> \end{table}
> 
> \marginpar{\footnotesize this is a marginal note to text.}
> some more text. some more text. some more text. some more text. some
> more
> text. some more text.
> 
> 
> \end{document}
> 

no idea what is going on there, but a simple fix could be

....
\begin{minipage}{\linewidth}
\begin{shaded}
....
\end{shaded}
\end{minipage}
....

At least my testing shows that it seems to work.


-- 

/daleif (remove RTFSIGNATURE from email address)

LaTeX FAQ:      http://www.tex.ac.uk/faq
LaTeX book:     http://www.imf.au.dk/system/latex/bog/    (in Danish)
Remember to post minimal examples, see URL below
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl
0
daleif2 (2648)
9/22/2006 4:17:59 PM
"ivowel@gmail.com" <ivowel@gmail.com> writes:

> dear latex wizards---I am getting some interactions between packages
> framed, cngpage, and float.  I would like to have floats that are style
> "float", which have a colored background, and which extend into the
> marginparwidth. 

I think there is a package for such wider floats, without the need
for chngpage.  In a float, there's no reason to use {framed} either
because you don't have page breaks.  

I expect chngpage isn't altering \hsize, which seems odd.  But 
then {adjustwidth} is just a list environment.

I would have done 

\leftline{\colorbox{shade}{\begin{minipage}{\fullwidth}
....
\end{minipage}}}

using macros from chngpage to select leftline or rightline,
or equivalent \hspace.


-- 
Donald Arseneau                          asnd@triumf.ca
0
asnd (4601)
9/22/2006 10:17:53 PM
hi don:  as always, many thanks for the fix.  I am running into two
further "small" problems (well, one big, one tiny).  I need to figure
out how to get a ruled float that begins not at the leftmargin, but at
the leftmargin minus length x.  the reason is that my marginpar notes
appear on the left side on even pages.  the following sample moves the
content of my exhibitbox left, but not the caption and rules.

regards,

/ivo


\newsavebox{\exhibitcontentbox}

\newenvironment{makeexhibitcontentbox}{
  \begin{lrbox}{\exhibitcontentbox}%argument is the name of the box
    \begin{minipage}{\fullwidth}% was columnwidth
    }%
    %%%%%
    {
    \end{minipage}%
  \end{lrbox}%
  \global\sbox\exhibitcontentbox{\usebox\exhibitcontentbox}
}


%%%%%%%%%%%%%%%%%%%%%%%%%
\newenvironment{mytable}{
  \begin{table}[htpbH]%
    \begin{makeexhibitcontentbox}%
    }
    {%
    \end{makeexhibitcontentbox}%
    \checkoddpage%
    \ifcpoddpage%
    \else%
    \hspace*{-1in}% <-- too late.  I need to move the whole float left,
not just the box contents.
    \fi%
    \colorbox{shadecolor}{\usebox{\exhibitcontentbox}}%
  \end{table}
}




Donald Arseneau wrote:
> "ivowel@gmail.com" <ivowel@gmail.com> writes:
>
> > dear latex wizards---I am getting some interactions between packages
> > framed, cngpage, and float.  I would like to have floats that are style
> > "float", which have a colored background, and which extend into the
> > marginparwidth.
>
> I think there is a package for such wider floats, without the need
> for chngpage.  In a float, there's no reason to use {framed} either
> because you don't have page breaks.
>
> I expect chngpage isn't altering \hsize, which seems odd.  But
> then {adjustwidth} is just a list environment.
>
> I would have done
>
> \leftline{\colorbox{shade}{\begin{minipage}{\fullwidth}
> ...
> \end{minipage}}}
>
> using macros from chngpage to select leftline or rightline,
> or equivalent \hspace.
> 
> 
> -- 
> Donald Arseneau                          asnd@triumf.ca

0
ivowel (414)
9/23/2006 12:21:56 AM
"ivowel@gmail.com" <ivowel@gmail.com> writes:

> further "small" problems (well, one big, one tiny).  I need to figure
> out how to get a ruled float that begins not at the leftmargin, but at
> the leftmargin minus length x.

Do you mean ruled float as in one defined by float.sty and 
\restylefloat?


-- 
Donald Arseneau                          asnd@triumf.ca
0
asnd (4601)
9/23/2006 1:06:34 AM
exactly.

Donald Arseneau wrote:
> "ivowel@gmail.com" <ivowel@gmail.com> writes:
>
> > further "small" problems (well, one big, one tiny).  I need to figure
> > out how to get a ruled float that begins not at the leftmargin, but at
> > the leftmargin minus length x.
>
> Do you mean ruled float as in one defined by float.sty and
> \restylefloat?
> 
> 
> -- 
> Donald Arseneau                          asnd@triumf.ca

0
ivowel (414)
9/23/2006 1:47:16 PM
hi don:  can I beg you for some help here?

regards,

/iaw

Donald Arseneau wrote:
> "ivowel@gmail.com" <ivowel@gmail.com> writes:
>
> > further "small" problems (well, one big, one tiny).  I need to figure
> > out how to get a ruled float that begins not at the leftmargin, but at
> > the leftmargin minus length x.
>
> Do you mean ruled float as in one defined by float.sty and
> \restylefloat?
> 
> 
> -- 
> Donald Arseneau                          asnd@triumf.ca

0
ivowel (414)
9/25/2006 3:00:21 PM
Reply:

Web resources about - framed.sty + chngpage.sty + float.sty - comp.text.tex

The TeX Catalogue OnLine, Alphabetic Ctan Edition
Search - Home - Alpha - Brief - Topical - Hierarchical TeX Catalogue (Alphabetic Ctan Edition) Graham Williams A - B - C - D - E - F - G - H ...

Resources last updated: 3/11/2016 11:12:01 AM