3

Consider the following code

\documentclass{svmono}% Version 5.5, available from https://www.springer.com/gp/authors-editors/book-authors-editors/manuscript-preparation/5636
\usepackage{newfloat}
\DeclareFloatingEnvironment[placement=htb,name={Spec.}]{specification}
%\usepackage[labelsep=space,justification=RaggedRight,labelfont={small,bf},textfont={small},skip=0pt]{caption}%%% Possible in an MWE, but leads to a different style than prescribed by Springer. It is difficult to reduce the vertical gap ONLY; including this package introduces a whole bunch of other changes.
\abovecaptionskip=0pt
\belowcaptionskip=0pt
\skip41=0pt
\skip42=0pt
\figcapgap=0pt%%% only for svmono, won't work with article
\tabcapgap=0pt%%% doesn't help either, as noticed by Axel
\begin{document}
\begin{specification}
  \noindent\strut\hrulefill\\[-.4\baselineskip]
  Line 1\\
  \(\vdots\)\\
  Line 9\\[-.8\baselineskip]%
  \strut\hrulefill%
  \caption{Too much space between the line just above and this caption.}%
  \end{specification}
\end{document}

The result is roughly as follows (I can't upload the image for an unknown reason; SE says imgur rejects the request):

―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Line 1
⁝
Line 9
―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

Spec. 1  Too much space between the line just above and this caption.

How to reduce the gap between the second horizontal rule and the caption? My standard solution is to insert something like \\[-.3\baselineskip]% as a new line right before \caption{...}, but the actual gap (-.3\baselineskip above) is a wild guess and thus fragile, as well as the other hardcoded skips you see in the code. In general, I would like to reduce the hardcoding of the adjustments one by one. In this question, I would like to get rid of just one vertical gap, namely the one before the caption, in an automatic way. I know how to do it in the article class, and I know how to do it with the package caption, which, however, changes the defaults a lot (which is NOT wanted in this question). As the reader might see in the source code, I tried to set some lengths known to me to 0pt, but nothing helped.

  • 1
    Behavior of svmono: If the floating environment is figure, \figcapgap will be applied above the caption. Otherwise \tabcapgap will be applied below the caption. So in your case no skip will be applied above the caption (because it's no figure environment), and therefore there is no skip you can adjust to decrease the space between content and caption. (To change that one needs to re-define \@makecaption offered by the svmono document class.) – Axel Sommerfeldt Aug 7 '18 at 18:52
4
+25

You can change the definition of \capstrut. By default it inserts a strut of 10pt height:

\documentclass{svmono}%
\usepackage{newfloat}
\DeclareFloatingEnvironment[placement=htb,name={Spec.}]{specification}

\begin{document}
\begin{specification}
  \noindent\strut\hrulefill\\[-.4\baselineskip]
  Line 1\\
  \(\vdots\)\\
  Line 9\\[-.8\baselineskip]%
  \strut\hrulefill
  \caption{Too much space between the line just above and this caption.}%
\end{specification}

\renewcommand\capstrut{\strut}
\begin{specification}
  \noindent\strut\hrulefill\\[-.4\baselineskip]
  Line 1\\
  \(\vdots\)\\
  Line 9\\[-.8\baselineskip]%
  \strut\hrulefill
  \caption{Too much space between the line just above and this caption.}%
\end{specification}

\end{document}

enter image description here

  • \usepackage{etoolbox}\AtBeginEnvironment{specification}{\renewcommand\capstrut{\strut}} – Ulrike Fischer Feb 5 at 19:11

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.