乳胶 - 是否可以在图像上方放置文字?

ano*_*ous 10 latex image pdflatex

我想使用Latex创建类似传单/杂志的东西.是否可以将文本放在图像上并自由设置文本样式?

有关此类示例的任何链接?

mid*_*iby 17

我经常这样做

\usepackage{tikz}
...
\begin{tikzpicture}
    \draw (0, 0) node[inner sep=0] {\includegraphics[width=4cm]{imagefile.png}};
    \draw (1, 1) node {Hello world};
\end{tikzpicture}
Run Code Online (Sandbox Code Playgroud)

  • tqjustc:您提到的问题可以通过向节点添加选项"text width = 20em"来解决. (2认同)
  • '''inner sep=0''' 是为了避免图像周围出现(白色)边框。 (2认同)

dan*_*jar 7

您还可以在图像之后定义文本,然后使用负垂直空间对其进行偏移。因为它跟随在 LaTeX 源中的图像之后,所以它将绘制在图像的顶部而不是图像的下面。

\includegraphics[...]{...}
\vspace*{-20ex}  % Tune this to the image height.
\begin{center}
Text
\end{center}
\vspace*{20ex}  % The spacing above but without the minus.
Run Code Online (Sandbox Code Playgroud)


ton*_*nio 5

pgf/TikZ pdf doc是处理图像的一个非常好的工具集。

请参阅\pgfimage示例。它允许自由混合文本和图像。有很多方法可以做到这一点。其中之一是要使用layerspgfmanual第220 )。该pgf手册包含许多简单的示例,并且非常精确。

另一个解决方案是使用该lpic程序包:主页包含一些示例。

您可以在这里这里找到pfg和TikZ的其他示例,其中包含许多令人印象深刻的示例。