diff options
author | Karl Berry <karl@freefriends.org> | 2019-06-27 20:58:38 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-06-27 20:58:38 +0000 |
commit | 3b67ea9ad4e326adb5ceefd4b1043d545dde8058 (patch) | |
tree | 9c712dc6e638cd65dcbf77d85a9f45a8e44c925b /Master/texmf-dist/source/latex/tikz-imagelabels | |
parent | e79ccbb041045e467e9bae3ba9e4b6490c1b9110 (diff) |
tikz-imagelabels (27jun19)
git-svn-id: svn://tug.org/texlive/trunk@51490 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/tikz-imagelabels')
-rw-r--r-- | Master/texmf-dist/source/latex/tikz-imagelabels/tikz-imagelabels.dtx | 66 |
1 files changed, 65 insertions, 1 deletions
diff --git a/Master/texmf-dist/source/latex/tikz-imagelabels/tikz-imagelabels.dtx b/Master/texmf-dist/source/latex/tikz-imagelabels/tikz-imagelabels.dtx index c492420de14..239221f2781 100644 --- a/Master/texmf-dist/source/latex/tikz-imagelabels/tikz-imagelabels.dtx +++ b/Master/texmf-dist/source/latex/tikz-imagelabels/tikz-imagelabels.dtx @@ -17,7 +17,7 @@ % \iffalse %<package>\NeedsTeXFormat{LaTeX2e}[2011/06/27] %<package>\ProvidesPackage{tikz-imagelabels} -%<package> [2019/01/29 v0.1 put labels on images using TikZ] +%<package> [2019/06/27 v0.2 put labels on images using TikZ] % %<*driver> \documentclass[a4paper]{ltxdoc} @@ -223,6 +223,41 @@ % % |\draw[image label = {M45 at south east}];| % +% \changes{v0.2}{2019/06/27}{add coordinate labels} +% Another kind of label is the so-called ``coordinate label''. In contrast to +% the image label, it may be positioned at arbitrary coordinates. The syntax is +% similar to the |image label|: +% +% |\draw[coordinate label = {|\meta{text}| at (|\meta{coordinate}|)}];| +% +% An example of some coordinate labels is shown in \autoref{fig:coord-labels}. +% +% \begin{figure} +% \centering +% \begin{annotationimage}{width=6cm}{pleiades.jpg} +% \draw[coordinate label = {1 at (0.1,0.3)}]; +% \draw[coordinate label = {2 at (0.4,0.6)}]; +% \draw[coordinate label = {3 at (0.65,0.25)}]; +% \draw[coordinate label = {4 at (0.9,0.4)}]; +% \draw[coordinate label = {5 at (0.62,0.62)}]; +% \draw[coordinate label = {6 at (0.83,0.8)}]; +% \draw[image label = {M45 at south east}]; +% \end{annotationimage} +% \caption{Example of using coordinate labels} +% \label{fig:coord-labels} +% \end{figure} +% +% \autoref{fig:coord-labels} was created using the following code: +% \begin{verbatim} +% \draw[coordinate label = {1 at (0.1,0.3)}]; +% \draw[coordinate label = {2 at (0.4,0.6)}]; +% \draw[coordinate label = {3 at (0.65,0.25)}]; +% \draw[coordinate label = {4 at (0.9,0.4)}]; +% \draw[coordinate label = {5 at (0.62,0.62)}]; +% \draw[coordinate label = {6 at (0.83,0.8)}]; +% \draw[image label = {M45 at south east}]; +% \end{verbatim} +% % \subsection{Adding annotations} % % An annotation is added with the aid of the \tkz{} macro |\draw|. The syntax is @@ -278,6 +313,10 @@ % image label distance = 2mm, % image label back = black, % image label text = white, +% coordinate label font = \sffamily\bfseries\scriptsize, +% coordinate label distance = 2mm, +% coordinate label back = black, +% coordinate label text = white, % annotation font = \normalfont\small, % arrow distance = 1.5mm, % border thickness = 0.6pt, @@ -438,6 +477,13 @@ } \imagelabelset{ + coordinate label font/.store in = \coordinatelabelfont, + coordinate label distance/.store in = \coordinatelabelsep, + coordinate label back/.store in = \coordinatelabelback, + coordinate label text/.store in = \coordinatelabeltext, +} + +\imagelabelset{ annotation font/.store in = \annotationfont, arrow distance/.store in = \arrowdistance, arrow thickness/.store in = \arrowthickness, @@ -459,6 +505,10 @@ image label distance = 2mm, image label back = black, image label text = white, + coordinate label font = \sffamily\bfseries\scriptsize, + coordinate label distance = 2mm, + coordinate label back = black, + coordinate label text = white, annotation font = \normalfont\small, arrow distance = 1.5mm, border thickness = 0.6pt, @@ -633,6 +683,14 @@ text = \imagelabeltext, font = \imagelabelfont, }, + coordinate label style/.style = { + rectangle, + minimum width = 3mm, + minimum height = 3mm, + fill = \coordinatelabelback, + text = \coordinatelabeltext, + font = \coordinatelabelfont, + }, % \end{macrocode} % On the other hand, the |image label| style defines the actual image labels. % \begin{macrocode} @@ -642,6 +700,12 @@ anchor=#2, image label style] {#1} } }, + coordinate label/.style args = {#1 at (#2)}{ + insert path = { + node[outer sep = \coordinatelabelsep, + anchor=center, coordinate label style] at (#2) {#1} + } + }, } % \end{macrocode} % |