7

I am new to LaTeX, tentatively using it to prepare a complicated industrial document (laboratory test report). I had selected the report class. After numerous experiments, I have just found that just switching to the KOMA-Script class scrreprt provides numerous visual changes that suit me, because they give the document a more "industrial" appearance that suits me well. My previous efforts in that direction involved a number of complicated settings concerning the headings of chapters, departing from the report class. While most areas look fine, I am facing a problem with the distance between the captions and the upper limit of the tables, that is very small after the change of class. I used to use the code

\usepackage[margin=10pt, font=bf]{caption}

and I have replaced this line with:

\renewcommand{\capfont}{\bfseries}
\renewcommand{\caplabelfont}{\bfseries} 

as indicated in the KOMA-Script documentation. However I cannot find a way to adjust the distance. Surprisingly, the distance between the bottom of a figure and the caption looks OK, but higher than with the previous report class, and for reasons I do not understand. How can I fix this?

\documentclass[a4paper, oneside,11pt, english]{scrreprt} % Mode production
\usepackage[utf8]{inputenc} % UTF-8 encoding for code editing
\usepackage[T1]{fontenc} % Usual fonts
\usepackage[draft]{graphicx} % Graphics-mode draft.
\usepackage{tabularx}
%\usepackage[margin=10pt, font=bf]{caption} % Setting options for captions

\renewcommand{\capfont}{\bfseries}
\renewcommand{\caplabelfont}{\bfseries}

\begin{document}

\begin{table}[H]
\noindent
\begin{center}
\caption {Test sequence group 2}
\begin{tabularx}{\textwidth}{|l|c|X|}
\hline
Description&Test per EN2591-&Remark\\
\hline\hline
Visual examination  &1511       &\\
Shock           &4200       &\\
Visual examination  &15111      &\\
\hline
\end {tabularx}
\end{center}
\end{table}


\centering
\begin{figure}[H]
\centering
\begin{minipage}[b]{.46\textwidth}
\centering
\includegraphics[width=\linewidth]{test.jpg}
\end{minipage}
\begin{minipage}[b]{.46\textwidth}
\centering
\includegraphics[width=\linewidth]{test2.jpg}
\end{minipage}
\caption {Sample caption}
\end{figure}
\raggedright

\end{document}
1
  • The classes of KOMA Script know the class option captions=tableabove and some variants. Take a look into the user guide for the details. Commented Feb 5, 2012 at 14:27

1 Answer 1

12

Either replace \caption with \captionabove inside table floats, or add the class option captions=tableheading. See section 3.20 of the KOMA-Script manual for details.

(EDIT: And as Axel Sommerfeldt commented, replace \begin{center} ... \end{center} with \centering.)

enter image description here

Another possibility (which also automatically adds \centering) is

\usepackage{floatrow}
\floatsetup[table]{capposition=top}
2
  • 3
    ...and replace \begin{center}...\end{center} with \centering since the first will produce extra unwanted vertical space.
    – user2574
    Commented Feb 5, 2012 at 14:33
  • Many thanks to all. I have used the global option "captions=tableheading" and replaced all "\begin{center}" and "\end{center}" in my numerous tables by a single"\centering". I was ready to end every table by "\raggedright", in order for the text to continue normally, but to my surprise, this does not appear necessary....
    – Yves
    Commented Feb 5, 2012 at 18:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .