0

I'm trying to center the caption of my table, but it seems i'm not getting it right. I'm working with a header file (thesis.tex) where I declare al the packages I used and input different chapters. The table is code from a chapter.

I'm getting this:

enter image description here

Code:

\begin{table}[H]
    \centering
    \caption{Infrarood spectrum}
    \begin{tabular}{| c | c |}
        \hline
        Naam & Golflengte \\
        \hline
        Near Infrared (NIR) & 700 nm - 1.5 $\mu$m \\
        Short Wavelength Infrared (SWIR) & 1.5 $\mu$m - 3 $\mu$m \\
        Mid Wavelength Infrared (MWIR) & 3 $\mu$m - 8 $\mu$m\\
        Long Wanelength Infrared (LWIR) & 8 $\mu$m - 15 $\mu$m \\
        Far Infrared (FIR) & 15 $\mu$m - 1 mm \\
        \hline
    \end{tabular}
    \label{tab:infraroodSpectrum}
\end{table}

Thesis.tex:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                      %
% LaTeX, FIIW thesis template                                          %
%                                                                      %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[11pt,a4paper]{report}
% Indien je je thesis recto-verso wil afdrukken gebruik je onderstaande opties i.p.v. bovenstaande
%\documentclass[11pt,a4paper,twoside,openright]{report}

\usepackage[a4paper,left=3.5cm, right=2.5cm, top=3.5cm, bottom=3.5cm]{geometry}
\usepackage[dutch]{babel}
\usepackage{graphicx}
\usepackage[latin1]{inputenc}           % om niet ascii karakters rechtstreeks te kunnen inputten
%\usepackage[utf8]{inputenc}            % commentarieer deze regel uit als je utf8 encoded files gebruikt in plaats van latin1
\usepackage{natbib}
\usepackage{listings}                   % voor het weergeven van broncode
\usepackage{verbatim}                   % weergeven van code, commando's, ...
\usepackage{hyperref}                   % maak PDF van de thesis navigeerbaar
\usepackage{url}                        % URL's invoegen in tekst met behulp van \url{http://}
\usepackage[small,bf,hang]{caption}     % om de captions wat te verbeteren
\usepackage[final]{pdfpages}            % gebruikt voor het invoegen van het artikel in pdf-formaat
\usepackage{pslatex}                    % andere lettertype's dan de standaard types
\usepackage{lipsum}
\usepackage{sectsty}                    % aanpassen van de fonts van sections en chapters
%\usepackage[nottoc,numbib]{tocbibind}  % Bibliography mee in de ToC

\allsectionsfont{\sffamily}
\chapterfont{\raggedleft\sffamily}

\usepackage{float}                      % De optie H voor de plaatsing van figuren op de plaats waar je ze invoegt. bvb. \begin{figure}[H]
%\usepackage{longtable}                 % tabellen die over meerdere pagina's gespreid worden
%\usepackage[times]{quotchap}           % indien je fancy hoofdstuktitels wil
%\usepackage[none]{hyphenat}
%\usepackage{latexsym}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[bottom]{footmisc}           %footnote onderaan pagina, niet meer aan tekst "gelijmd"
\usepackage{lscape}
\usepackage{rotating}
\usepackage[]{algorithm2e}

% MFA: zet zoekpad voor figure
\graphicspath{{afbeeldingen/}}

\usepackage{fiiw}
% \usepackage{fiiw_denayer_eng} % For the english version (also change last page at the bottom of this file!

%door onderstaande regels in commentaar te zetten, of op false, kan je pagina's weglaten
%bijvoorbeeld het weglaten van een voorwoord, lijst met symbolen, ...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%voorwoord toevoegen?
\acknowledgementspagetrue
\acknowledgements{voorwoord}            %.tex file met daarin het voorwoord

%samenvatting toevoegen
%\summarypagetrue
%\summary{samenvatting}                 %.tex met daarin de samenvatting

%abstract toevoegen?
\abstractpagetrue
\abstracts{abstract}                    %.tex file met daarin het abstract
%lijst van figuren toevoegen?
\listoffigurespagetrue
%lijst van tabellen toevoegen?
\listoftablespagetrue
%lijst van symbolen toevoegen?
\listofsymbolspagetrue
\listofsymbols{symbolen}                %.tex file met daarin de lijst van symbolen
%lijst van afkortingen toevoegen?
\listofabbrevspagetrue
\listofabbrevs{afkortingen}             %.tex file met daarin de lijst van symbolen

%informatie over het eindwerk, de promotor, ...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\opleiding{Elektronica-ICT ICT}
\afdeling{ }

\campus{denayer} %denayer,denayereng,geel,geeleng,gent,ghenteng,groept,groupteng,brugge,brugeseng

\title{Detectie van landingsplatformen voor drones}
\subtitle{}
% \author{naam student}
\forenameA{Simon}
\surnameA{Vleugels}

% l
\forenameB{}
\surnameB{}

\academicyear{2017 - 2018}

\promotorA[Promotor]{Prof. dr. ir. Toon Goedemé }
\promotorB[Co-promotor]{Ing. Maarten Vandersteegen}
\promotorC[]{}

\begin{document}
\selectlanguage{dutch}
% \selectlanguage{english} % For the english version
\preface

\input{hfdst1-SitueringEnDoelstelling}
\input{hfdst2-Literatuurstudie}
\input{hfdst3-Landingsplatformen}
\input{hfdst4-Behuizing}
\input{hfdst5-communicatieRPI-PX}
\input{hfdst6-ROS-framework}
\input{hfdst7-Testen}
\input{hfdst8-Resultaten}
\input{hfdst9-Besluit}
% Bibliografie: referenties. De items zitten in bibliografie.bib
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Indien je ook de niet geciteerde werken in je bibliografie wil opnemen, commentarieer dan onderstaande regel uit!
\nocite{*}
\bibliographystyle{apalike}
\bibliography{bibliografie}

% Eventueel enkele appendices
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\appendix
\input{bijlageA}

% Back cover: change according to the correct campus
\includepdf{private/back_fiiw_denayer.pdf}
% \includepdf{private/back_fiiw_denayer_eng.pdf} % For the english version
%\includepdf{private/back_fiiw_geel.pdf}
% \includepdf{private/back_fiiw_geel_eng.pdf} % For the english version
%\includepdf{private/back_fiiw_gent.pdf}
% \includepdf{private/back_fiiw_ghent_eng.pdf} % For the english version
%\includepdf{private/back_fiiw_brugge.pdf}
% \includepdf{private/back_fiiw_bruges_eng.pdf} % For the english version
%\includepdf{private/back_fiiw_groept.pdf}
% \includepdf{private/back_fiiw_groupt_eng.pdf} % For the english version

\end{document}
  • 2
    Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. In particular the answer highly depends on the class and packages used (KOMA-script based answers would differ a lot from package caption for example). – Skillmon Jan 7 '18 at 13:10
  • 3
    B.t.w. don't use the center environment with figure or table. It just adds unwanted vertical spacing. \centering does the job. – Bernard Jan 7 '18 at 13:21
  • I edited my question. I hope this can help you/me – Maxime Jan 7 '18 at 13:43
  • Could you please clarify from where you got fiiw.sty as it is not available at CTAN but seems to be responsible for the caption design. Maybe it already helps to add \captionsetup[table]{justification=centering} to your preamble. – leandriis Jan 7 '18 at 14:12
  • The fiiw is a package made by the faculty of my university. \captionsetup[table]{justification=centering} isn't doing anything – Maxime Jan 7 '18 at 14:20
1

The fiiw package seems to use the \captionsetup command from the caption package to left align table captions. To instead print them horizontally centered, you can add \captionsetup[table]{justification=centering} after \usepackage{fiiw}.

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.