1

I use \begin{longtable} to edit a table to change page, and the title is as follows:

enter image description here

But I need to fit the template whose form is :

enter image description here

So how should I modify it?

My partial code:


\documentclass[review,onefignum,onetabnum]{siamart171218}


\usepackage{mathrsfs}
\usepackage[figuresright]{rotating}
\usepackage{longtable}

\usepackage{array}

\usepackage{multirow}
\usepackage{braket,amsfonts}

\usepackage{array}

\usepackage[caption=false]{subfig}
%% Used for papers with subtables created with the subfig package
\captionsetup[subtable]{position=bottom}
\captionsetup[table]{position=bottom}

%% For referencing line numbers
\Crefname{ALC@unique}{Line}{Lines}

%% For creating math operators
\usepackage{amsopn}
\DeclareMathOperator{\Range}{Range}

%% ------------------------------------------------------------------
%% Macros for in-document examples. These are not meant to reused for
%% SIAM journal papers.
%% ------------------------------------------------------------------
\usepackage{xspace}
\usepackage{bold-extra}
\usepackage[most]{tcolorbox}
\newcommand{\BibTeX}{{\scshape Bib}\TeX\xspace}
\newcounter{example}
\colorlet{texcscolor}{blue!50!black}
\colorlet{texemcolor}{red!70!black}
\colorlet{texpreamble}{red!70!black}
\colorlet{codebackground}{black!25!white!25}

\newcommand\bs{\symbol{'134}} % print backslash in typewriter OT1/T1
\newcommand{\preamble}[2][\small]{\textcolor{texpreamble}{#1\texttt{#2 \emph{\% <- Preamble}}}}
\begin{document}

\newcolumntype{R}{>{$}r<{$}}
\newcolumntype{V}[1]{>{[\;}*{#1}{R@{\;\;}}R<{\;]}}
\makeatletter\def\@captype{table}\makeatother
\captionsetup{position=top}
{\centering
\footnotesize
% \begin{center}
 \begin{longtable}{|c|c|cccc|}
 \caption{Comparison on artificial datasets}\label{tab:1}\\
 \hline
  (m,n) & p & method & ER & k & time\\
  \hline
  \multirow{20}{*}{(300,400)}
        & 0\% & \begin{tabular}{c}
         1 \\ 2 \\ 3 \\ 4 \\ 5\\ 6\\
           \end{tabular}
        & \begin{tabular}{c}
            \bf{1.02e-9}\\1.37e-5\\1.38e-6\\5.79e-5\\8.11e-8\\2.54e-6\\
           \end{tabular}
  \\
\hline
\end{longtable}}
\end{document}
  • Could you please add a minimal working example (MWE) that illustrates your problem? – leandriis Mar 24 at 11:05
  • Thanks for adding the code, but could you please also add the documentclass and the relevant packages that you use. Apart from that, your code misses a \\ after the caption. – leandriis Mar 24 at 11:19
  • Unrelated to the issue but regarding your use of \bf: “Correct” way to bold/italicize text? Could you please also add the reason for the nested tabular environments? – leandriis Mar 24 at 11:20
  • from \documentclass follows that article is intended to be published in some siam journal, so i would use caption style as they define in their document class. – Zarko Mar 24 at 12:13
  • Thank you a lot. – wendy Mar 24 at 12:13
0

It's easy to modify the caption layout with caption package.

But, as Zarko said, if you have to submit your article to a journal, are you sure they agree with these changes?

Off-topic: you loaded array twice, and I don't say anything about your table formatting because it's not the topic of the question, but it could be improved.

\documentclass[review,onefignum,onetabnum]{siamart171218}

\usepackage{mathrsfs}
\usepackage[figuresright]{rotating}
\usepackage{longtable}

\usepackage{array}

\usepackage{multirow}
\usepackage{braket,amsfonts}

\usepackage[caption=false]{subfig}
%% Used for papers with subtables created with the subfig package
\captionsetup[subtable]{position=bottom}
\captionsetup[table]{position=bottom}
\newcolumntype{R}{>{$}r<{$}}
\newcolumntype{V}[1]{>{[\;}*{#1}{R@{\;\;}}R<{\;]}}
\makeatletter\def\@captype{table}\makeatother
\captionsetup{position=top}

%% For referencing line numbers
\Crefname{ALC@unique}{Line}{Lines}

%% For creating math operators
\usepackage{amsopn}
\DeclareMathOperator{\Range}{Range}

%% ------------------------------------------------------------------
%% Macros for in-document examples. These are not meant to reused for
%% SIAM journal papers.
%% ------------------------------------------------------------------
\usepackage{xspace}
\usepackage{bold-extra}
\usepackage[most]{tcolorbox}
\newcommand{\BibTeX}{{\scshape Bib}\TeX\xspace}
\newcounter{example}
\colorlet{texcscolor}{blue!50!black}
\colorlet{texemcolor}{red!70!black}
\colorlet{texpreamble}{red!70!black}
\colorlet{codebackground}{black!25!white!25}

\newcommand\bs{\symbol{'134}} % print backslash in typewriter OT1/T1
\newcommand{\preamble}[2][\small]{\textcolor{texpreamble}{#1\texttt{#2 \emph{\% <- Preamble}}}}

\usepackage{caption}
\captionsetup[table]{labelfont=sc,textfont=it,labelsep = newline}
\begin{document}

{\footnotesize
 \begin{longtable}{|c|c|cccc|}
 \caption{Comparison on artificial datasets}\label{tab:1}\\
 \hline
  (m,n) & p & method & ER & k & time\\
  \hline
  \multirow{6}{*}{(300,400)}
        & 0\% & 
         1 & \bf{1.02e-9}&&\\ 
         &&2 & 1.37e-5 &&\\ 
         &&3 & 1.38e-6 &&\\ 
         &&4 & 5.79e-5 &&\\ 
         &&5 & 8.11e-8 &&\\ 
         &&6 & 2.54e-6 &&\\
\hline
\end{longtable}}

\begin{table}[htp]
    \centering
    \caption{Caption}
    \label{tab:my_label}
    \begin{tabular}{cc}
    \hline
    ordinary     & table \\
    \hline
    \end{tabular}
\end{table}

\end{document}

enter image description here

  • Thanks a lot. Because my table is very long. There is no way to implement table paging with the provided table template, so i use the longtable package. To be honest, I'm not sure if this is appropriate. – wendy Mar 28 at 9:28
  • @wendy You're welcome! I think it's better if you ask the journal. – CarLaTeX Mar 28 at 9:41
  • OK, i will. Thank you a lot~ – wendy Mar 28 at 10:24

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.