Joerg Hau wrote:

I'm currently writing a long document with a number of table floats (actually they contain code snippets). I would like to put a frame around those, and/or use a shaded background.

With the LaTeX-package "float", you can define your own float or redefine an existing one. But the package does only provide four float styles: plain, plaintop, boxed, and ruled


In the attached example, I redefined the table float in the preamble in the style boxed. Because the float package defines the caption label as bold, I used the LaTeX-package "caption" to set the label in sansserif.

It seems to be a dumb question, but I've only found material that was basically "TeX-only" ... and most adress each float individually :-(

What have you found? I'm interested in a floatstyle with a colored background. In the description of "float" the code is described to define own styles, but my plain TeX knowledge lacks.


Is there a straightforward way to tell LyX that it should use a frame or shading for _all_ table floats, without the need of adressing them one-by-one?

This is possible if you redefine the figure or table float. For self-defined floats you need the LaTeX-commands
\begin{floatfname} / \end{floatname}


regards Uwe
#LyX 1.3 created this file. For more info see http://www.lyx.org/
\lyxformat 221
\textclass article
\begin_preamble
\usepackage{float}

\floatstyle{boxed}
\restylefloat{table}

\usepackage[labelfont=sf]{caption}
\end_preamble
\options fleqn
\language english
\inputencoding auto
\fontscheme default
\graphics default
\paperfontsize 12
\spacing single 
\papersize a4paper
\paperpackage a4
\use_geometry 0
\use_amsmath 1
\use_natbib 0
\use_numerical_citations 0
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation skip
\defskip medskip
\quotes_language english
\quotes_times 2
\papercolumns 1
\papersides 1
\paperpagestyle empty
\bullet 1
        1
        34
        -1
\end_bullet
\bullet 2
        2
        35
        -1
\end_bullet
\bullet 3
        2
        7
        -1
\end_bullet

\layout Standard

dsgdsg
\layout Standard


\begin_inset Float table
wide false
collapsed true

\layout Caption

sdfga
\layout Standard
\align center 

\begin_inset  Tabular
<lyxtabular version="3" rows="5" columns="5">
<features>
<column alignment="center" valignment="top" leftline="true" width="0">
<column alignment="center" valignment="top" leftline="true" width="0">
<column alignment="center" valignment="top" leftline="true" width="0">
<column alignment="center" valignment="top" leftline="true" width="0">
<column alignment="center" valignment="top" leftline="true" rightline="true" 
width="0">
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" 
usebox="none">
\begin_inset Text

\layout Standard

s
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" 
usebox="none">
\begin_inset Text

\layout Standard

d
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" 
usebox="none">
\begin_inset Text

\layout Standard

f
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" 
usebox="none">
\begin_inset Text

\layout Standard

g
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" 
rightline="true" usebox="none">
\begin_inset Text

\layout Standard

a
\end_inset 
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" 
usebox="none">
\begin_inset Text

\layout Standard

s
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" 
usebox="none">
\begin_inset Text

\layout Standard

d
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" 
usebox="none">
\begin_inset Text

\layout Standard

f
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" 
usebox="none">
\begin_inset Text

\layout Standard

g
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" 
rightline="true" usebox="none">
\begin_inset Text

\layout Standard

a
\end_inset 
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" 
usebox="none">
\begin_inset Text

\layout Standard

s
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" 
usebox="none">
\begin_inset Text

\layout Standard

d
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" 
usebox="none">
\begin_inset Text

\layout Standard

f
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" 
usebox="none">
\begin_inset Text

\layout Standard

g
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" 
rightline="true" usebox="none">
\begin_inset Text

\layout Standard

a
\end_inset 
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" 
usebox="none">
\begin_inset Text

\layout Standard

s
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" 
usebox="none">
\begin_inset Text

\layout Standard

d
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" 
usebox="none">
\begin_inset Text

\layout Standard

f
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" 
usebox="none">
\begin_inset Text

\layout Standard

g
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" 
rightline="true" usebox="none">
\begin_inset Text

\layout Standard

a
\end_inset 
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" 
usebox="none">
\begin_inset Text

\layout Standard

s
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" 
usebox="none">
\begin_inset Text

\layout Standard

d
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" 
usebox="none">
\begin_inset Text

\layout Standard

f
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" 
usebox="none">
\begin_inset Text

\layout Standard

g
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" 
rightline="true" usebox="none">
\begin_inset Text

\layout Standard

a
\end_inset 
</cell>
</row>
</lyxtabular>

\end_inset 


\end_inset 


\layout Standard

sdgdgd
\the_end

Reply via email to