Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
    
The classes of KOMA Script know the class option captions=tableabove and some variants. Take a look into the user guide for the details. –  Thorsten Donig Feb 5 '12 at 14:27

1 Answer 1

up vote 11 down vote accepted

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}
share|improve this answer
3  
...and replace \begin{center}...\end{center} with \centering since the first will produce extra unwanted vertical space. –  Axel Sommerfeldt Feb 5 '12 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 Feb 5 '12 at 18:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.