最小工作示例

最小工作示例

问题

无法让表格和文本框共享同一页面。

该文件跨越两页,而不是一页

最小工作示例

\documentclass{article}
\usepackage{amsmath, amssymb}
\usepackage[paperheight=11in, paperwidth=17in, margin = 0.25cm]{geometry}
\usepackage{float}
\usepackage{graphicx}
\usepackage[dvipsnames]{xcolor}
\usepackage[absolute,overlay]{textpos}

\definecolor{patriarch}{rgb}{0.5, 0.0, 0.5}

\def\isize{0.80in}
\def\cpath{../graphics/zeros/checkers/}

\begin{document}
%
\def\arraystretch{7.3}
\begin{table}[ht]
    \begin{center}
        \begin{tabular}{ccccc ccccc ccccc ccc}
                %
            &&&&&&&& 
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} \\
                %
            &&&&&&& 
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} \\
                %
            &&&&&& 
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} \\
                %
            &&&&& 
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} \\
                %
            &&&& 
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} \\
                %
            &&& 
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} \\
                %
            &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} \\
                %
            & 
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} \\
                %
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} &&
            \includegraphics[ width = \isize ]{\cpath "n08-m02-re"} \\
                %
        \end{tabular}
    \end{center}
\end{table}
%
\begin{textblock*}{5in}(0.0in, 0.35in) % {block width} (x, y coords) 
    \begin{center}
        \huge{\color{patriarch}{\bf{My Table}}}
    \end{center}
\end{textblock*}
%
\begin{textblock*}{5in}(11.7in, 0.5in) 
    \Large{$a+b=c$}
\end{textblock*}
%
\end{document}

咨询的问题

强制表格*停留在当前页面

在同一页上显示带有标题和标签的表格和图形

强制在文本中放置图形

如何强制图形和表格在 LaTeX 中停留在同一页面上?

答案1

X

解决方案是使用xcoffins包而不是textpos

简而言之,它将材料(文本、表格、图形、tikzfigures 等)放在特殊的盒子里。(称为棺材,名字选得不好)

它有几个优点:

(1) 它允许以各种方式连接这些框,并带有偏移。我使用一个零尺寸的框作为框架, 以适当的水平和垂直偏移\Framex连接 ( \Join...) 其他两个框

(2)框不是浮动的,而是在当前插入点处排版。这样,您可以将框放置在物理页面上的任何位置,包括难以到达的位置,例如角落。

在这个特殊案例中,有四个步骤:

(1)用 赋值\NewCoffin

(2) 填写\SetHorizontalCoffin

(3)将盒子连接到\Framex具有偏移 X,Y 的物体上。

(4)在表格后面排版带有 的框架\TypesetCoffin。由于它是一个零尺寸框,因此它保留在同一页面上。在这种情况下,偏移量是从页面右下角(靠近)测量的,因此 X 为负(向左移动),Y 为正(向上移动)

\documentclass{article}
\usepackage{amsmath, amssymb}
\usepackage[paperheight=11in, paperwidth=17in, margin = 0.25cm]{geometry}
\usepackage{float}
\usepackage{graphicx}
\usepackage[dvipsnames]{xcolor}
\usepackage[absolute,overlay]{textpos}

\definecolor{patriarch}{rgb}{0.5, 0.0, 0.5}

\def\isize{0.80in}
\def\cpath{../graphics/zeros/checkers/}

\usepackage{xcoffins}
\NewCoffin\MT
\NewCoffin\EQ
\NewCoffin\Framex

\begin{document}
    \SetHorizontalCoffin\MT{\color{patriarch}\bfseries \huge My Table}
    \SetHorizontalCoffin\EQ{\Large $a+b=c$}
    
    \JoinCoffins*\Framex[l,t]\MT[l,t](-1150pt,350pt) % (xoffset, yoffset)
    \JoinCoffins*\Framex[l,t]\EQ[l,t](-150pt,350pt)
    %
    \def\arraystretch{7.3}
    \begin{table}[ht]
            \centering
            \begin{tabular}{ccccc ccccc ccccc ccc}
                %
                &&&&&&&& 
                \includegraphics[ width = \isize ]{example-grid-100x100pt} \\
                %
                &&&&&&& 
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} \\
                %
                &&&&&& 
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} \\
                %
                &&&&& 
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} \\
                %
                &&&& 
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} \\
                %
                &&& 
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} \\
                %
                &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} \\
                %
                & 
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} \\
                %
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} &&
                \includegraphics[ width = \isize ]{example-grid-100x100pt} \\
                %
            \end{tabular}
    \TypesetCoffin\Framex
    \end{table}

    %   \begin{textblock*}{5in}(0.0in, 0.35in) % {block width} (x, y coords) 
    %       \begin{center}
    %           \huge{\color{patriarch}{\bf{My Table}}}
    %       \end{center}
    %   \end{textblock*}
    %   %
    %   \begin{textblock*}{5in}(11.7in, 0.5in) 
    %       \Large{$a+b=c$}
    %   \end{textblock*}
    %   %
\end{document}

其他例子

我需要一个相当复杂的学术版布局,但不知道从哪里开始

如何将一组表格合并到一个页面上?

如何创建单词/方程式/图表拼贴画

相关内容