I need to reduce the space between floats and text; now I used the
command \floatsep:
\setlength{\floatsep}{1.5ex plus0.2ex}
\setlength{\textfloatsep}{\floatsep}
\setlength{\intextsep}{\floatsep}
this works fine for the space between the text and the float (space
above the float), but not for the space between the float and the text
(space below the table).
How can I act on that space?
thanks in advance
Lorenzo
--
+-----------------------------------------------------+
| Lorenzo Bettini ICQ# lbetto, 16080134 |
| PhD student in Computer Science |
| Dip. Sistemi e Informatica, Univ. di Firenze |
| Tel +39 055 4796741, Fax +39 055 4796730 |
| Florence - Italy (Linux User # 158233) |
| Home Page : http://w3.newnet.it/bettini |
| Mail : bet...@dsi.unifi.it |
| http://music.dsi.unifi.it XKlaim language |
| http://w3.newnet.it/bettini/purple Cover Band |
| http://www.gnu.org/software/src-highlite |
| http://www.gnu.org/software/gengetopt |
+-----------------------------------------------------+
> \setlength{\floatsep}{1.5ex plus0.2ex}
> \setlength{\textfloatsep}{\floatsep}
> \setlength{\intextsep}{\floatsep}
These cover it all...
> this works fine for the space between the text and the float (space
> above the float), but not for the space between the float and the text
> (space below the table).
I don't parse that, but it is probably \textfloatsep there.
Donald Arseneau as...@triumf.ca
I meant that what I get is something like
text text text text text text
text text text text text text
(*)
+---------------------------+
| |
| float |
| |
+---------------------------+
(**)
text text text text text text
text text text text text text
with the commands I used I can decrease (*), but it does not work for
(**)... am I missing something? Is there a way to decrease (**) as
well?
thanks
> text text text text text text
> text text text text text text
> (*)
> +---------------------------+
> | |
> | float |
> | |
> +---------------------------+
> (**)
>
>
> text text text text text text
> text text text text text text
>
>
> with the commands I used I can decrease (*), but it does not work for
> (**)... am I missing something? Is there a way to decrease (**) as
> well?
You probably do decrease both * and **, as LaTeX inserts \intextsep
in both places. You probably have some other vertical space at
** that is independent of the float; perhaps a list or a section
title.
Donald Arseneau as...@triumf.ca
..
I'm afraid not; moreover it happens for every float, and only for some
of them...
> Donald Arseneau wrote:
> > You probably do decrease both * and **, as LaTeX inserts \intextsep
> > in both places. You probably have some other vertical space at
> > ** that is independent of the float; perhaps a list or a section
> > title.
>
> I'm afraid not; moreover it happens for every float, and only for some
> of them...
Well post a short, but complete, file that demonstrates the effect,
and someone will be able to track it down, even if it takes \tracing...
Donald Arseneau as...@triumf.ca
Maybe I found out what the problem is; actually it came out when I use
the package float with the style boxed; with this style the caption is
moved a little up, very near the box, but probably the space below the
caption is sort of left, so it is considered anyway.
The same problem happen when I use the style llncs (from Lecture Notes
in Computer Science), that also makes table captions very near the
content of the table itself.
Indeed by taking a look at the contents of llncs.cls you find:
\renewenvironment{table}
{\setlength\abovecaptionskip{0\p@}%
\setlength\belowcaptionskip{10\p@}%
\@float{table}}
{\end@float}
if I change the \belowcaptionskip to 0\p@ it seems that it works as I
wanted.
Now the problem is to find out how to solve this problem when I use the
package float...
> Now the problem is to find out how to solve this problem when I use the
> package float...
Which version of float are you using?
You may wish to look at the definition of the »boxed« float style,
which is in a command called »\fs@boxed« near the very end of the
float.dtx (or float.sty) file, in particular at the »\@fs@mid« command
defined there.
Feel free to mail me privately if I can help you further.
Anselm
--
Anselm Lingnau .......................................... ans...@strathspey.org
You can give without loving, but you can never love without giving.
-- Robert Louis Stevenson
> \renewenvironment{table}
> {\setlength\abovecaptionskip{0\p@}%
> \setlength\belowcaptionskip{10\p@}%
> \@float{table}}
This makes sense for table captions above the table, which is
indeed the usual format.
> Now the problem is to find out how to solve this problem when I use the
> package float...
The float package does its own weird arrangement inside floats,
moving the caption to the top or bottom. It may well leave
spurious spaces within the float.
Donald Arseneau as...@triumf.ca
> The float package does its own weird arrangement inside floats,
> moving the caption to the top or bottom.
This is necessary for the support of »float styles« that put the
caption at the top (e.g., the »ruled« float style whose result is
analogous to the tables in »Concrete Mathematics« by Graham, Knuth and
Patashnik). It would be a nuisance if changing float styles would
force people to go through their input files and move captions from
the top of a floating environment to the bottom just because the float
style makes a different stipulation about the position of the caption.
It would also be contrary to LaTeX's idea of »logical markup«.
However, with the standard figure and table environments people are
used to provide their own caption positioning. So it may come as a
surprise to them that the float package takes this over, especially
when they used to put their captions at the top (the float package
used to move these to the bottom if the figure and table environments
were »restyled« to use float, particularly for the »[H]«
construction).
The current version of float makes it possible to leave caption
handling to vanilla LaTeX, although this makes most sense for the
figure and table environments. It also contains some fixes for the
spacing around captions. I don't claim that the current state of
affairs is perfect, and would like to hear from people who have
suggestions for improvement.
Anselm
--
Anselm Lingnau .......................................... ans...@strathspey.org
A great obstacle to happiness is to anticipate too great a happiness.
-- Bernard le Bovier de Fontenelle
> Donald Arseneau <as...@triumf.ca> wrote:
>
> > The float package does its own weird arrangement inside floats,
> > moving the caption to the top or bottom.
>
> This is necessary for the support of »float styles« ...
> It would be a nuisance if changing float styles would
> force people to go through their input files and move captions from
> the top of a floating environment to the bottom just because the float
> style makes a different stipulation about the position of the caption.
> It would also be contrary to LaTeX's idea of »logical markup«.
Agreed. And I would certainly want a TeX format with truly
logical markup to do just that. The execution is somewhat
hindered in LaTeX 2__ because it isn't the original design,
and it may conflict with other things.
Does it accidentally leave space behind when it moves a
caption? Or leave the above/below skips inappropriate?
I don't know, and would have to see a complete (short) test
file for how it was being used.
Donald Arseneau as...@triumf.ca
> Does it accidentally leave space behind when it moves a
> caption? Or leave the above/below skips inappropriate?
It works by lifting the contents of \caption{} and re-inserting it
(elsewhere, potentially) in the float being constructed. Thus the
final float consists of whatever is in the environment that is not
within \caption, plus the \caption{} tacked on either at the top or at
the bottom as directed by the float style. A float style specifies
stuff such as rules or spacing that goes above the float contents (or
caption), between the float contents and caption (or vice-versa), and
below the caption (or float contents).
This works for the usual cases of
\begin{figure}
\includegraphics{...}
\caption{...}
\end{figure}
or
\begin{table}
\caption{...}
\begin{tabular}{...}
...
\end{tabular}
\end{figure}
but doesn't handle stuff like
\begin{figure}
\includegraphics{...}
\vspace{1cm}
\caption{...}
\end{figure}
(which one isn't supposed to write anyway) or
\begin{figure}
\includegraphics{...}
\caption{...}
Long additional explanations about the figure.
\end{figure}
(the \caption command offered by the float package has an optional
argument for such extra material, which of course has its own
drawbacks.)
The package tries to take care of the above/below skips where that
makes sense (for example, in the »plain« and »plaintop« float styles
which are supposed to look like the vanilla LaTeX setup, only with the
caption forced to the bottom and top, respectively), and the results
look reasonable to me at least.
Anselm
--
Anselm Lingnau .......................................... ans...@strathspey.org
Besides a mathematical inclination, an exceptionally good mastery of one's
native tongue is the most vital asset of a competent programmer. -- E. Dijkstra
> but doesn't handle stuff like
>
> \begin{figure}
> \includegraphics{...}
> \vspace{1cm}
> \caption{...}
> \end{figure}
And what about:
\begin{figure}
\includegraphics{...}
\caption{...}
\vspace{.5em}
\includegraphics{...}
\caption{...}
\end{figure}
or
\begin{figure}
\begin{minipage}{.45\textwidth}\centering
\includegraphics{...}
\caption{...}
\end{minipage}\hfill%
\begin{minipage}{.45\textwidth}\centering
\includegraphics{...}
\caption{...}
\end{minipage}%
\end{figure}
Markus
--
KOMA-Script documentation project at http://www.socha.net/scrguide
> And what about:
> [...]
I would certainly like to be able to work stronger magic but can't --
my crystal ball is only the basic model. If somebody has good
suggestions as to how to take care of cases like these, then please
tell me.
I suppose special-case support for something like »subfigure« would be
feasible -- this would in any event be much better LaTeX style than
the »\vspace{.5em} between two graphics« approach mentioned by Markus.
Anselm
--
Anselm Lingnau .......................................... ans...@strathspey.org
Books don't stay banned. They won't burn. Ideas won't go to jail. In the long
run of history, the censor and the inquisitor have always lost. The only sure
weapon against bad ideas is better ideas. -- A. Whitney Griswold
> this would in any event be much better LaTeX style than
> the »\vspace{.5em} between two graphics« approach mentioned by Markus.
Hey, it was an short example. I've defines my own macro:
\newcommand*{\nextfloatpart}{\vskip{.5em}}
and use this. It is good markup, it works fine, it is easy to use and
the result is nice. But it doesn't work with al float.sty-defined
float. The easy minipage-way for putting two or three of these floats
side by side is the other problem.
As I read the float-manual first, I thought: If I can only use one
caption at one of these floats, why did he use \caption? Why didn't he
use one more (maybe optional) environment-argument to be the caption.
I like the float package very much. Because I like the easy way of
defning my own floats. Because of this, I've changed KOMA-Script and
you've changed the package. But I don't like the \caption-restrictions
of the package.
> As I read the float-manual first, I thought: If I can only use one
> caption at one of these floats, why did he use \caption? Why didn't he
> use one more (maybe optional) environment-argument to be the caption.
The idea was for the newly-created float environments to look similar
to the ones that the standard classes already had (especially since it
is possible to apply the float styling to the standard float
environments as well, without users actually having to go through
their documents and change the captions). Also the float package sits
on top of the standard LaTeX float processing mechanism, and adding
extra optional arguments to the internal float commands would have
meant more extensive rewriting of LaTeX internals, thereby more
dependencies on LaTeX versions and so on. The current version of the
float package is much less dependent on the internal workings of LaTeX
than the 1.2 versions, due to some suggestions I received from
elsewhere, and I think this is basically a good thing.
The problem with having the caption(s) as optional argument(s) to the
float environment is that there is no telling how many »parts« there
may be in the environment and how they are supposed to be arranged
(one after the other, beside one another and so on). It would of
course be possible to define a whole bunch of different »multi-part«
float environments on the off-chance (on top of the two float
environments that are defined for each float type anyway), but this
would be quite wasteful since most of them would likely not be used a
whole lot.
> I like the float package very much. Because I like the easy way of
> defning my own floats. Because of this, I've changed KOMA-Script and
> you've changed the package. But I don't like the \caption-restrictions
> of the package.
Recent versions of the package make it possible to leave the caption
handling to LaTeX. This doesn't help a whole lot if you want several
figures or tables in the same float environments, unless the desired
float style is something like »plain«; if you want several tables in
the »ruled« style, for example, a better solution is to use multiple
float environments. However it seems to me that the approach that
combines multiple pictures or tables in a single floating environment
is most useful with the »plain« float style (or the LaTeX default)
anyway, so this should not be much of a problem to begin with.
I don't like the caption restrictions that much, either, but I don't
see a way around them that doesn't introduce different (and worse)
incompatibilities.
Anselm
--
Anselm Lingnau .......................................... ans...@strathspey.org
Advice is what we ask for when we already know the answer but wish we didn't.
-- Walter S. Landor
Have you tried the ccaption package?
Peter W.
> Have you tried the ccaption package?
Have you tried KOMA-Script and ccaption together? ccaption does those
ugly \MakeUppercase at \listfloats. float did same some time before,
but Anselm changed it, so it works very well with KOMA-Script and even
KOMA-Script's class option liststotoc works with float and puts float's
float lists to the toc. I never found the time, to do the needed
changes at a renamed copy of ccaption.sty to send a diff to you and
explain it. Documentation and development of KOMA-Script eats all my
time like a little monster.
\usepackage{ccaption}
\newcommand{\mylistof}{List of Myfloats}
\newfloatlist{myfloat}{myf}{\mylistof}{Myfloat}
% defines
\cftmarkmyf{\@mkboth{\MakeUppercase{\mylistof}}{\MakeUppercase{\mylistof}}}
for the marks
% change this to whatever you like, e.g.,
\makeatletter
\renewcommand{\cftmarkmyf}{\@mkboth{\textit{My list}}{\textbf{Myfloats}}}
\makeatother
See the ccaption documentation.
Peter W.