我可以在 LaTeX 中标记图形吗?

我可以在 LaTeX 中标记图形吗?

我通过谷歌搜索找到了上述问题的答案。但我所说的“标签”是指标记图形,而不是用于引用的标签。让我解释一下。

假设我正在为高中演示文稿制作一个图形,其中展示了 PC 的各个部分:CPU、显示器、键盘、鼠标等。我可以使用 MS Paint 等软件插入标签。但使用 MS Paint 等软件插入方程式、带下标的字母、上标非常困难。

出于同样的目的,我想使用 LaTeX。有办法吗?

想要使用 Latex 的另一个原因是 Latex 可能会以矢量的形式创建文本,即文本在放大时很可能不会像素化。

答案1

以下是卡拉姆迪尔的精彩回答使用 TikZ 在图像上绘图

\documentclass{article}
\usepackage{graphicx}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[
every pin edge/.style={thick,blue!50},pin distance=15mm,
cir/.style = {align=center,circle,fill=blue!50,minimum size=6pt,inner sep=0pt}
]

\node[anchor=south west,inner sep=0] (image) at (0,0) 
  {\includegraphics[width=0.45\textwidth]{ctanlion}};
\begin{scope}[x={(image.south east)},y={(image.north west)}]
  \node [cir,pin=110:{The \TeX book}] at (0.16,0.45) {};
  \node [cir,pin=60:\parbox{4cm}{CTAN lion \\ by Duane Bibby}] at (0.76,0.65) {};
\end{scope}
\end{tikzpicture}

\end{document}

在此处输入图片描述

相关内容