0

I have to use the document class and style of the university to write my msc thesis. But they seems to put the caption under longtable on the right instead of centered. Under the normal table it works just fine.

\documentclass[a4paper,10pt,openright]{unibe-msc}

\usepackage{unibe-msc}
\usepackage[english]{babel}
\usepackage[caption=off]{subfig}
\usepackage{longtable}
\usepackage{booktabs}


\begin{document}

\begin{longtable}{l*{4}{l}}
      \toprule
      \multicolumn{4}{c}{Parameters of the body segments}\\
      Body Segment                  & Parameters & Value    & Unit\\
      \midrule
      \endfirsthead
      Body Segment                  & Parameters & Value    & Unit\\
      \midrule
      \endhead 
      Head                          & R     &           & $mm$  \\
                                    & RR    &           & $mm$  \\
                                    & SL    &           & $mm$  \\
                                    & SW    &           & $N$       \\
                                    & SIXX  &           & $kg \cdot mm^4$\\
                                    & SIYY  &           & $kg \cdot mm^4$\\
                                    & SIZZ  &           & $kg \cdot mm^4$\\
      \bottomrule
   \caption{Parameters of the body segments}
   \label{tab:bsegparam}
\end{longtable}
\end{document}

here is the class I use :

\NeedsTeXFormat{LaTeX2e}[2001/01/01]
\ProvidesClass{unibe-msc}
              [2009/10/28 v2.1 Document Class for UniBE MSc Theses]
\newif\if@uthesis@electronic \@uthesis@electronicfalse
\DeclareOption{electronic}{\@uthesis@electronictrue}
\def\@uthesis@setpapersize@afour{%
  \setstocksize{297mm}{210mm}
  \settrimmedsize{297mm}{210mm}{*}
  \settypeblocksize{49pc}{33pc}{*}}
\def\@uthesis@setpapersize@gfive{%
  \if@uthesis@electronic
    \setstocksize{239mm}{169mm}
    \settrimmedsize{239mm}{169mm}{*}
    \ifpdf
    \else
      \special{papersize=169mm,239mm}
    \fi
  \else
    \setstocksize{297mm}{210mm}
    \settrimmedsize{239mm}{169mm}{*}
    \setlength{\trimtop}{\stockheight}
    \addtolength{\trimtop}{-\paperheight}
    \setlength{\trimtop}{0.5\trimtop}
    \setlength{\trimedge}{\stockwidth}
    \addtolength{\trimedge}{-\paperwidth}
    \ifpdf
      \AtBeginDocument{%
        \setlength{\pdfpagewidth}{\stockwidth}
        \setlength{\pdfpageheight}{\stockheight}}
    \fi
  \fi
  \settypeblocksize{43pc}{30pc}{*}}
\DeclareOption{g5paper}{\def\uthesis@trimmedsize{gfive}}
\DeclareOption{a3paper}{\OptionNotUsed}
\DeclareOption{a4paper}{\def\uthesis@trimmedsize{afour}}
\DeclareOption{a6paper}{\OptionNotUsed}
\DeclareOption{a5paper}{\OptionNotUsed}
\DeclareOption{b3paper}{\OptionNotUsed}
\DeclareOption{b4paper}{\OptionNotUsed}
\DeclareOption{b5paper}{\OptionNotUsed}
\DeclareOption{b6paper}{\OptionNotUsed}
\DeclareOption{letterpaper}{\OptionNotUsed}
\DeclareOption{legalpaper}{\OptionNotUsed}
\DeclareOption{executivepaper}{\OptionNotUsed}
\DeclareOption{ebook}{\OptionNotUsed}
\DeclareOption{landscape}{\OptionNotUsed}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{memoir}}
\ExecuteOptions{g5paper}
\ProcessOptions\relax
\LoadClass[a4paper]{memoir}
\AtBeginDocument{\RequirePackage{graphics}}
\@nameuse{@uthesis@setpapersize@\uthesis@trimmedsize}
\setlrmargins{*}{*}{*}
\setulmargins{*}{*}{*}
\checkandfixthelayout
\def\subtitle{\gdef\thesubtitle}
\def\frontsignature{\gdef\thefrontsignature}
\def\unibelogo{\gdef\theunibelogo}
\def\htilogo{\gdef\thehtilogo}
\def\place{\gdef\theplace}
\def\faculty{\gdef\thefaculty}
\def\affiliation{\gdef\theaffiliation}
\def\examiner{\gdef\theexaminer}
\def\discipline{\gdef\thediscipline}
\def\supervisor{\gdef\thesupervisor}
\def\origin{\gdef\theorigin}
\let\thesubtitle\relax
\let\theunibelogo\relax
\let\thehtilogo\relax
\let\theplace\relax
\let\thefaculty\relax
\let\theaffiliation\relax
\let\thediscipline\relax
\let\thesupervisor\relax
\let\theorigin\relax
\def\maketitle{%
  \begingroup
  %\sffamily
  \pagestyle{empty}
  \renewcommand*{\thepage}{title-\arabic{page}}
  \vspace*{-30mm}
  \noindent
  \scalebox{0.525}{\includegraphics{\thehtilogo}}  \hfill
    \scalebox{0.35}{\includegraphics{\theunibelogo}}
  \parbox[b][0.65\textheight]{\textwidth}{\centering\noindent
    \vskip2cm
    {\large\mdseries \thefaculty \par \thediscipline}\par
    \vskip1cm
    \Large\mdseries\thesubtitle\par
    \vskip2cm
    \huge\bfseries\thetitle\par
    \vskip2cm
    \large\mdseries by
    \vskip2cm
    \LARGE\bfseries\theauthor\par\vfill
    \vskip1cm
    \large\mdseries of \theorigin
  }
  \vfill\noindent
  \parbox[b]{\textwidth}{\centering\noindent
    \large\mdseries Supervisors \\ \thesupervisor\par
    \vskip1cm
    \large\mdseries Institutions \\ \theaffiliation\par
    \vskip1cm
    \large\mdseries Examiners \\ \theexaminer
    \vskip1cm
    \large\mdseries\thefrontsignature\\ 
   % {\color{red}This report is confidential.} {\tiny(Delete this statement in the file ``unibe-msc.cls'' if the report is not confidential.)}
  }
  \cleardoublepage
  \endgroup
}
\endinput

and the style :

\ProvidesPackage{unibe-msc}[2009/10/28]

%% Customization for the unibe-msc class
\maxsecnumdepth{subsection}
\setsecnumdepth{subsection}
\maxtocdepth{subsection}
\settocdepth{subsection}
\renewcommand{\bf}{\bfseries}
\renewcommand{\partnamefont} {\usefont{T1}{lmss}{m}{n}\boldmath\huge}
\renewcommand{\partnumfont}  {\usefont{T1}{lmss}{m}{n}\boldmath\huge}
\renewcommand{\parttitlefont}{\usefont{T1}{lmss}{m}{n}\boldmath\Huge}
\renewcommand{\chapnamefont} {\usefont{T1}{lmss}{m}{n}\boldmath\huge} %
\renewcommand{\chapnumfont}  {\usefont{T1}{lmss}{m}{n}\boldmath\huge}
\renewcommand{\chaptitlefont}{\usefont{T1}{lmss}{m}{n}\boldmath\Huge}
\setsecheadstyle   {\usefont{T1}{lmss}{m}{n}\boldmath\Large\raggedright}
\setsubsecheadstyle{\usefont{T1}{lmss}{m}{n}\boldmath\large\raggedright}
\setsubsubsecheadstyle{\usefont{T1}{lmss}{m}{n}\boldmath\normalsize\raggedright}
\setparaheadstyle   {\usefont{T1}{cbr}{sbc}{n}\normalsize\bfseries\boldmath}
\setsubparaheadstyle{\usefont{T1}{cbr}{sbc}{n}\normalsize\bfseries\boldmath}
\makeevenhead{headings}%
  {\normalfont\small\thepage}{}{\normalfont\small\leftmark}
\makeoddhead{headings}%
  {\normalfont\small\rightmark}{}{\normalfont\small\thepage}
\setlength{\@tempdima}{\textwidth}
\addtolength{\@tempdima}{-2\leftmargini}
\captionwidth{\@tempdima}
\changecaptionwidth
\captiondelim{. }
\captionnamefont{\normalfont\footnotesize\bfseries}
\captiontitlefont{\normalfont\footnotesize}
\setlength{\parskip}{0pt}

\endinput
2
  • 1
    Please minimize your code as most parts are not needed here. The caption is centred indeed. How should we help you with that? We can't guess. Please try to locate the issue in your main document. You get some guidance here: meta.tex.stackexchange.com/q/228 For the other topic: What you are asking is one of the main features of the longtable package. Please read its documentation which you can find here ctan.org/pkg/longtable .
    – LaRiFaRi
    Jun 10, 2015 at 7:39
  • @LaRiFaRi Thanks for the link, I was able to do every things with the column names and to find from where the problem with the caption come from.
    – Pierrick
    Jun 10, 2015 at 8:31

0

You must log in to answer this question.

Browse other questions tagged .