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}
Best Answer
Either replace
\caption
with\captionabove
insidetable
floats, or add the class optioncaptions=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
.)Another possibility (which also automatically adds
\centering
) is