如何对长表进行缩放?

如何对长表进行缩放?

下午好 !

我在一个名为 results.tex 的 pdf 中有一个长表,分为 4 页。我需要将该 pdf 包含在另一个 main.tex 文件中(此 main.tex 文件使用一些日志模板格式):

结果.tex:

\documentclass[times]{iapress}

\usepackage{pdflscape}
\usepackage[longtable]{multirow}
\usepackage{longtable}
\usepackage{amsmath}
%\usepackage[left=0.1in,right=0.1in,top=0.0in,bottom=0.5in]{geometry}
\usepackage[left=0.2in,right=0.2in,top=0.0in,bottom=0.0in]{geometry}

\usepackage{moreverb}
\usepackage[dvips,colorlinks,bookmarksopen,bookmarksnumbered,citecolor=red,urlcolor=red]{hyperref}

%%
 
 

%%
\def\volumeyear{202x}
\def\volumenumber{x}
\def\volumemonth{Month}
\setcounter{page}{00}
\renewcommand{\baselinestretch}{1.01}
%%

\usepackage{tikz}


\pagestyle{empty}
\usepackage{everypage}
\usepackage{lipsum}
\usepackage{afterpage}
\newcommand{\Lpagenumber}{\ifdim\textwidth=\linewidth\else\bgroup
  \dimendef\margin=0 %use \margin instead of \dimen0
  \ifodd\value{page}\margin=\oddsidemargin
  \else\margin=\evensidemargin
  \fi
  \raisebox{\dimexpr -\topmargin-\headheight-\headsep-0.5\linewidth}[0pt][0pt]{%
    \rlap{\hspace{\dimexpr \margin+\textheight+\footskip}%
    \llap{\rotatebox{90}{\thepage}}}}%
\egroup\fi}
%%\AddEverypageHook{\Lpagenumber}%
\usepackage{graphicx}
\usepackage{listings}
\usepackage{xcolor}
\renewcommand{\topfraction}{0.9}

\lstset{
basicstyle=\scriptsize\tt,
}
%%
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}

\lstdefinestyle{mystyle}{
    backgroundcolor=\color{backcolour},   
    commentstyle=\color{codegreen},
    keywordstyle=\color{magenta},
    numberstyle=\tiny\color{codegray},
    stringstyle=\color{codepurple},
    basicstyle=\ttfamily\footnotesize,
    breakatwhitespace=false,         
    breaklines=true,                 
    captionpos=b,                    
    keepspaces=true,                 
    numbers=left,                    
    numbersep=5pt,                  
    showspaces=false,                
    showstringspaces=false,
    showtabs=false,                  
    tabsize=2
}
\graphicspath{{figures/}}





\begin{document}
\thispagestyle{empty}

 

\begin{landscape}
 
 \renewcommand\thetable{11} 
 

\begin{longtable}{|c|c|l|l|l|cl|} 


\caption{Some simulation results of the suggested hybrid optimizer}
\\
\hline
Test function 
  & Study domain 
    & \multicolumn{2}{c|}{\begin{tabular}[c]{@{}c@{}} 
                          initial obtained solution (Algorithm 2 )
                          \end{tabular}} 
      & \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}} 
                            Obtained hybrid\\ 
                            optimizer solution\\ 
                            (Algorithm 3 ) 
                            \end{tabular}} 
        & \multicolumn{1}{l}{\begin{tabular}[c]{@{}c@{}} 
                             Objective\\ 
                             function\\ 
                             value  of the\\  
                             solution 
                             \end{tabular}} 
          & \multicolumn{1}{c|}{} \\* 
\hline
\multirow{13}{*}{\begin{tabular}[c]{@{}c@{}}   Sphere \\    ( dim = 13 )   \end{tabular}} 
  & \multirow{13}{*}{$ [-6,6]^{13} $ } 
    & $ Nbre\_iter=5  \;\; N=20 \; \; P=4 $  
      & \multirow{13}{*}{\begin{tabular}[c]{@{}l@{}} 
                        $X1=-0.553850768$ \\ 
                        $X2=-1.493074761$\\ 
                        $X3=0.6767506500$ \\ 
                        $X4=-0.602909613$ \\ 
                        $X5=-1.047292736$ \\ 
                        $X6=-0.191411525$ \\ 
                        $X7=-0.079137285$ \\ 
                        $X8=0.2588126665$ \\ 
                        $X9=-1.444664397$ \\ 
                        $X10=-0.92061842$ \\ 
                        $X11=0.424461785$ \\ 
                        $X12=-0.38351937$ \\ 
                        $X13=-0.15875219$ \end{tabular} } 
        & \multirow{13}{*}{\begin{tabular}[c]{@{}l@{}} 
                          $X1=-4.9999e-09$ \\ 
                          $X2=-5.0000e-09$ \\ 
                          $X3=-5e-09$ \\ 
                          $X4=-5e-09$ \\ 
                          $X5=-5e-09$ \\ 
                          $X6=-5e-09$ \\ 
                          $X7=-5.000003e-09$ \\ 
                          $X8=-4.307553e-09$ \\ 
                          $X9=-5.0000006e-09$ \\ 
                          $X10=-5e-09$ \\ 
                          $X11=-5.000723e-09$ \\ 
                          $X12=-5.392374e-09$ \\ 
                          $X13=-5.00000000053859e-09$ \end{tabular}} 
          & \multirow{13}{*}{$ 3.22640e-16  $ } &  \\* 
\cline{3-3}
 &  
   & \begin{tabular}[t]{@{}l@{}} 
     $ \text{Iter} =50 $\\
     $\alpha=0.1$\\
     $\gamma=0.99$    
     \end{tabular} 
     &  &  &  &  \\ 
     &&&&&& \\
     &&&&&& \\ 
     &&&&&& \\ 
     &&&&&& \\
     &&&&&& \\
     &&&&&& \\
     &&&&&& \\
     &&&&&& \\
     &&&&&& \\


     \hline
    \end{longtable}
\end{landscape}
\end{document}

主文本:

%%\documentclass[notitlepage]{article}
\documentclass[times]{iapress}
\usepackage{moreverb}
\usepackage[dvips,colorlinks,bookmarksopen,bookmarksnumbered,citecolor=red,urlcolor=red]{hyperref}

%%
\usepackage{amsmath, amssymb}
\usepackage{pdflscape}

%%
\def\volumeyear{202x}
\def\volumenumber{x}
\def\volumemonth{Month}
\setcounter{page}{00}
\renewcommand{\baselinestretch}{1.01}
%%

\usepackage{colortbl}
\usepackage[margin=1cm]{caption}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{float}
\usepackage{graphicx}
\graphicspath{{figures/}}

\usepackage{longtable}

%\usepackage{algorithm}

\usepackage{algorithmic}

\usepackage{pdfpages}
\usepackage[ ruled,vlined]{algorithm2e}
\usepackage{ifoddpage}
\usepackage{blindtext}
\usepackage{authblk} 
\usepackage{listings}
\usepackage{xcolor}
%% attention here ! 
\renewcommand{\topfraction}{0.9}

\lstset{
basicstyle=\scriptsize\tt,
}
%%
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}

\lstdefinestyle{mystyle}{
    backgroundcolor=\color{backcolour},   
    commentstyle=\color{codegreen},
    keywordstyle=\color{magenta},
    numberstyle=\tiny\color{codegray},
    stringstyle=\color{codepurple},
    basicstyle=\ttfamily\footnotesize,
    breakatwhitespace=false,         
    breaklines=true,                 
    captionpos=b,                    
    keepspaces=true,                 
    numbers=left,                    
    numbersep=5pt,                  
    showspaces=false,                
    showstringspaces=false,
    showtabs=false,                  
    tabsize=2
}
\begin{document}

\includepdf[pages={1-4}, pagecommand={}]{../figures/result.pdf}

\end{document}

当我编译 main.tex 文件时,表格粘在左边:

在此处输入图片描述

使用的 iapress 类文件可以在这里找到:

https://drive.google.com/file/d/1M3ZEjdt6PSXOuzN9d2Ex4CYdOjtBAGNI/view?usp=sharing

非常感谢您的帮助!

相关内容