强制将表格或图片放在指定页面上

强制将表格或图片放在指定页面上

我想强制在页面上显示一个表格。

我试过了\startpostponing[2],但似乎不起作用并给出了一个错误:

Undefined control sequence \startpostponing

有没有其他方法可以强制我的表格出现在特定的页面上。

PS 我也尝试过\afterpage{},但是效果不太好。

编辑:我的代码:

        \documentclass[12pt,oneside, paper=a4,pagesize=pdftex, liststotoc, bibtotoc]{scrartcl}
        %Einstellungen der Seitenrnder
        \usepackage[left=3.0cm,right=3.0cm,top=3cm,bottom=3cm,includeheadfoot]{geometry}
        \usepackage{graphicx}
        %Umlaute ermglichen
        \usepackage[latin1]{inputenc}
        \usepackage{color}
        %\usepackage[printonlyused]{acronym}
        \usepackage{cite}
        \usepackage{multirow}
        \usepackage{booktabs}
        \usepackage{setspace}
        \usepackage{amssymb}
        \usepackage{wrapfig}
        \usepackage[tight,TABTOPCAP]{subfigure}
        \usepackage{float}
        \usepackage{epstopdf}
        \definecolor{orange}{rgb}{1,0.5,0}
        \usepackage[T1]{fontenc}
        \usepackage{algorithmic}
        \usepackage{amsmath}
        %------------------------------------------------------------------------- 
        % macros - newly defined by htrsek
        \newcommand{\todo}[1]{\textcolor{red}{\textbf{TODO: #1}}}
        \newcommand{\comment}[2]{\textcolor{orange}{\textbf{\textit{\textless Comment (#1): #2\textgreater}}}}
        \newcommand{\inprogress}[3]{\textcolor{blue}{\textbf{InProgress: #1}}}
        \newcommand{\translate}[4]{\textcolor{green}{\textbf{(#1)}}}
        \newcommand{\flexWARE}{\textsuperscript{flex}WARE }
        \newcommand{\thedate}{\today}
        %[BC] Using the listing package for source code embedding.
        \usepackage{listings} \lstset{numbers=left, numberstyle=\tiny, numbersep=5pt} \lstset{language=Perl} 

         %PDF Kram
        \usepackage[%
            pdftitle={something},% Titel des PDF Dokuments.
            pdfauthor={someone},%Autor des PDF Dokuments.
            pdfsubject={something},%Thema des PDF Dokuments.
            pdfcreator={MiKTeX, LaTeX, hyperref, KOMA-Script},%Erzeuger des PDF Dokuments.
            pdfkeywords={project title},% auch fr PDF 
            pdfpagemode=UseOutlines,% Inhaltsverzeichnis anzeigen beim 
            %pdfdisplaydoctitle=true,%Dokumenttitel statt Dateiname 
            pdflang=en%Sprache des Dokuments.
        ]{hyperref}

        \definecolor{LinkColor}{rgb}{0,0,0.5}
        \definecolor{hellgelb}{rgb}{1,1,0.8}
        \definecolor{colKeys}{rgb}{0,0,1}
        \definecolor{colIdentifier}{rgb}{0.4,0.4,0.4}
        \definecolor{colComments}{rgb}{0,0.5,0}
        \definecolor{colString}{rgb}{1,0,0}
        \definecolor{blue}{rgb}{0,0,1}

        \hypersetup
        {
            colorlinks=true,%        Aktivieren von farbigen Links im Dokument (keine Rahmen)
            linkcolor=LinkColor,%    Farbe festlegen.
            citecolor=LinkColor,%    Farbe festlegen.
            filecolor=LinkColor,%    Farbe festlegen.
            menucolor=LinkColor,%    Farbe festlegen.
            urlcolor=LinkColor,%     Farbe von URL's im Dokument.
            bookmarksnumbered=true%  Überschriftsnummerierung im PDF Inhalt anzeigen.
        }
        %Zeilenabstand 1.2
        \linespread{1.2}
        %Kopf- und Fusszeile
        \usepackage{fancyhdr}
        \pagestyle{fancy}
        \fancyhf{}
        %Kopfzeile links bzw. innen
        \fancyhead[L]{\textsf{someone}}
        %Kopfzeile rechts bzw. aussen
        \fancyhead[R]{\textsf{\nouppercase{\leftmark}}}
        %Linie oben
        \renewcommand{\headrulewidth}{0.5pt}
        %Fusszeile links bzw. innen
        \fancyfoot[L]{\textsf{Something}}
        %Fusszeile rechts bzw. aussen
        \fancyfoot[R]{{\textsf{\pagemark}}}
        %Linie unten
        \renewcommand{\footrulewidth}{0.5pt}
        \setlength{\parindent}{0pt}

        %Setup for listings.
        \lstset{basicstyle=\small}
        \lstset{language=C}

        \newtheorem{Def}{Definition}
        \begin{document}
        \thispagestyle{empty}

        \newpage
        \pagenumbering{arabic}

        \thispagestyle{empty}
        \mbox{}

        \newpage
        \renewcommand{\thepage}{\roman{page}}
        \section*{Affirmation}
        \newpage
        \section*{Abstract}

        \newpage

        \section*{Acknowledgements}

        \newpage



        \setcounter{tocdepth}{3}
        \tableofcontents


        \newpage

   \afterpage{
\clearpage
\begin{landscape}
\begin{table}[p!]
\begin{center}
\rowcolors{1}{thistle}{lightblue}
 \begin{tabular}{ | p{4cm} | p{5cm} | p{5cm} | p{4.5cm} |}
\hline


My table


\hline
 \end{tabular}
\end{center}
\end{table}
\end{landscape}
\clearpage

\clearpage
\begin{landscape}
\begin{table}[h]
\begin{center}
\rowcolors{1}{thistle}{lightblue}
 \begin{tabular}{ | p{4cm} | p{5cm} | p{5cm} | p{4.5cm} |}
\hline
\hiderowcolors \textbf{Examples} & \textbf{How it works} & \textbf{Technologies} & \textbf{On the market} \\ \hline \showrowcolors

Table2

 \\ \hline
 \end{tabular}
    \caption{Examples of IoT.}
\end{center}
\end{table}
\end{landscape}
\clearpage
}



        \end{document}         

答案1

boxhandler 包可以满足您的所有需求。[请注意,我在第一篇帖子发表后的第二天编辑了这篇文章,提供了一个改进的版本,除了提前定义图形应出现在哪些页面上之外,不需要用户干预。] 在下面给出的这个 MWE 中,图形将出现在第 1、3 和 4 页,如文档序言中定义的那样。

\documentclass{article}
\usepackage{ifthen}
\usepackage{boxhandler}
\holdFigures
\bxfigure{Here is my caption}
  {\fbox{Here is my figure material}}
\bxfigure{Here is my another caption}
  {\fbox{Here is some more figure material}}
\bxfigure{Here is my third caption}
  {\fbox{Here is yet more figure material}}
\newcommand\checkpage{\ifthenelse%
  {\equal{\csname figpage\roman{figure}\endcsname}{\thepage}}%
  {\nextFigure[t]}{}}
\let\parsave\par
\def\par{\parsave\checkpage}
\def\figpage{1}
\def\figpagei{3}
\def\figpageii{4}
\begin{document}
The \textsf{boxhandler} package has figure (and table) deferral options.
By using \verb|\holdFigures|, figures may be defined but are not output.
They are only output with a \verb|\nextFigure| or if you want the
backlog cleared out, with \verb|\clearFigures|.

Note that in this MWE, I first create all the figures in the
preamble using the \verb|\bxfigure| command, with
\verb|\holdFigures| active.  I have created a command
\verb|\checkpage| which is automatically invoked with every
\verb|\par|.  If the page is a predefined value, the next figure is
printed.  To predefine what pages the figures will printout, the
user need merely define the variables, using a roman suffix of
(figure$- 1$)\\

\noindent
\verb|\def\figpage{1}   % First  figure on page 1|\\
\verb|\def\figpagei{3}  % second figure on page 3|\\
\verb|\def\figpageii{4} % third  figure on page 4|\\
\verb|...|

Notice in this document that nowhere, after \verb|\begin{document}|
is a figure call invoked anywhere.  Yet the figures show at their
assigned locations.

\clearpage
Here is text

\clearpage
more text

\clearpage
still more text

\end{document}

这是第 1 页顶部的快照

在此处输入图片描述

相关内容