![强制将图像放置在桌面环境中](https://linux22.com/image/376462/%E5%BC%BA%E5%88%B6%E5%B0%86%E5%9B%BE%E5%83%8F%E6%94%BE%E7%BD%AE%E5%9C%A8%E6%A1%8C%E9%9D%A2%E7%8E%AF%E5%A2%83%E4%B8%AD.png)
我有一张紧凑的汇总表,其中包含 3 个表格,两个短表和一个长表。如下所示:
\begin{document}
\begin{table}
\footnotesize
%Short table 1
\begin{tabular}[t]{|lll|}
\end{tabular}
\hfill
%Short table 2
\begin{tabular}[t]{|lll|}
\end{tabular}
\hfill
%Long table 3
\begin{tabular}[t]{|lll|}
\end{tabular}
\end{table}
\end{document}
我想在长桌子左边的两个短桌子下面放置一张图片,如下所示:
3 个表格为灰色,页眉和页脚为粉红色,所需图像位置为蓝色。我已经尝试使用 tikzpicture:
\begin{tikzpicture}
\node [shift={(0.7 cm,0.7cm)}] at (current page.south west){\includegraphics[width=0.6\textwidth]{pic.png}};
\end{tikzpicture}
并为班次插入各种数字,但它总是完全跳过该页面(包含表格)。
谢谢您的帮助!
答案1
有多种方法可以做到这一点。在这里,我将所有图片和表格放在一个主表格中。请注意,我设置了图片的宽度和高度以匹配表格所需的空间。
\documentclass{article}
\usepackage{graphicx}
\newlength\tempdima
\begin{document}
\begin{table}
\footnotesize
% store tabulars in saveboxes
\sbox0{\begin{tabular}[t]{|lll|}
a & b & c
\end{tabular}}%
\sbox1{\begin{tabular}[t]{|lll|}
d & e & f
\end{tabular}}%
\sbox2{\begin{tabular}[t]{|lll|}
g & h & i\\
j & k & l\\
m & n & o\\
p & q & r\\
s & t & u\\
v & w & x
\end{tabular}}%
% compute excess needed space for long table
\ifdim\dp0>\dp1 \tempdima=\dp0
\else \tempdima=\dp1
\fi
\tempdima=\dimexpr \dp2-\tempdima\relax
% master tabular
\centering
\begin{tabular}{ccc}
\multicolumn{3}{c}{\includegraphics[width={\dimexpr \wd0+\wd1+\wd2+4\tabcolsep},height=1cm]{example-image}}\\
\usebox0 & \usebox1 & \smash{\usebox2}\\
\multicolumn{2}{c}{\includegraphics[width={\dimexpr \wd0+\wd1+2\tabcolsep},height=\tempdima]{example-image}} \\
\multicolumn{3}{c}{\includegraphics[width={\dimexpr \wd0+\wd1+\wd2+4\tabcolsep},height=1cm]{example-image}}
\end{tabular}
\end{table}
\end{document}