summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tikz-imagelabels
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-01-29 22:13:18 +0000
committerKarl Berry <karl@freefriends.org>2019-01-29 22:13:18 +0000
commit86d244860ecefedd67e32cab48bef5d1ba4b593a (patch)
tree7f4060edb3b9622175009121360b60d17d60321f /Master/texmf-dist/tex/latex/tikz-imagelabels
parent640a2c1396e10c77057ea4565bd6cdd4056073c8 (diff)
tikz-imagelabels (29jan19)
git-svn-id: svn://tug.org/texlive/trunk@49864 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tikz-imagelabels')
-rw-r--r--Master/texmf-dist/tex/latex/tikz-imagelabels/tikz-imagelabels.sty171
1 files changed, 171 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/tikz-imagelabels/tikz-imagelabels.sty b/Master/texmf-dist/tex/latex/tikz-imagelabels/tikz-imagelabels.sty
new file mode 100644
index 00000000000..8f5e8d46298
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/tikz-imagelabels/tikz-imagelabels.sty
@@ -0,0 +1,171 @@
+%%
+%% This is file `tikz-imagelabels.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% tikz-imagelabels.dtx (with options: `package')
+%%
+%% This is a generated file.
+%%
+%% Copyright (C) 2019 by Tobias Plüss <tpluess@ieee.org>
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+\NeedsTeXFormat{LaTeX2e}[2011/06/27]
+\ProvidesPackage{tikz-imagelabels}
+ [2019/01/29 v0.1 put labels on images using TikZ]
+\RequirePackage{tikz}
+\RequirePackage{xifthen}
+\usetikzlibrary{
+ arrows.meta,
+ calc,
+ positioning,
+ decorations,
+ decorations.markings,
+ math,
+}
+\pgfkeys{
+ /imagelabels/.is family,
+ /imagelabels/.search also={/tikz},
+}
+
+\def\imagelabelset{\pgfqkeys{/imagelabels}}
+\imagelabelset{
+ coarse grid color/.store in = \maingridcolor,
+ fine grid color/.store in = \finegridcolor,
+}
+
+\imagelabelset{
+ image label font/.store in = \imagelabelfont,
+ image label distance/.store in = \imagelabelsep,
+ image label back/.store in = \imagelabelback,
+ image label text/.store in = \imagelabeltext,
+}
+
+\imagelabelset{
+ annotation font/.store in = \annotationfont,
+ arrow distance/.store in = \arrowdistance,
+ arrow thickness/.store in = \arrowthickness,
+ tip size/.store in = \tipsize,
+ border thickness/.store in = \borderthickness,
+ outer dist/.store in = \labeloutersep,
+}
+\imagelabelset{
+ coarse grid color = red,
+ fine grid color = gray,
+ image label font = \sffamily\bfseries\small,
+ image label distance = 2mm,
+ image label back = black,
+ image label text = white,
+ annotation font = \normalfont\small,
+ arrow distance = 1.5mm,
+ border thickness = 0.6pt,
+ arrow thickness = 0.4pt,
+ tip size = 1.2mm,
+ outer dist = 0.5cm,
+}
+\newenvironment{annotationimage}[3][]{
+\let\tikzset\imagelabelset
+ \begin{tikzpicture}
+ \node[anchor=south west, inner sep=0]
+ (image) at (0,0) {\includegraphics[#2]{#3}};
+ \begin{scope}[x={(image.south east)},y={(image.north west)}]
+ \ifthenelse{\equal{#1}{grid}}{%
+ \draw[very thin, draw=\finegridcolor, step=0.02]
+ (0,0) grid (1,1);
+ \draw[thin, draw=\maingridcolor, xstep=0.1, ystep=0.1]
+ (0,0) grid (1,1);
+ \foreach \x in {0,1,...,9} {
+ \node [anchor=north] at (\x/10,0) {\tiny 0.\x};
+ }
+ \node [anchor=north] at (1,0) {\tiny 1};
+
+ \foreach \y in {0,1,...,9} {
+ \node [anchor=east] at (0,\y/10) {\tiny 0.\y};
+ }
+ \node [anchor=east] at (0,1) {\tiny 1};
+ }{}
+}
+{
+ \end{scope}
+ \end{tikzpicture}}
+\imagelabelset{
+ annotation arrow/.style =
+ {
+ preaction =
+ {
+ draw,
+ -{Circle[fill=white, length=\tipsize+2*\borderthickness,
+ width=\tipsize+2*\borderthickness]},
+ line width = 2*\borderthickness + \arrowthickness,
+ white,
+ shorten >= \arrowdistance,
+ },
+ draw,
+ -{Circle[fill=black, length=\tipsize, width=\tipsize]},
+ black,
+ line width = \arrowthickness,
+ shorten >= \borderthickness + \arrowdistance,
+ },
+ annotation node/.style =
+ {
+ font=\annotationfont,
+ inner sep = 0.5ex,
+ },
+ annotation below/.style args = {#1 at #2}{
+ annotation arrow,
+ insert path = {
+ (#2,0) ++ (0,-\labeloutersep)
+ node[anchor = north, annotation node] {#1\strut}
+ }
+ },
+ annotation above/.style args = {#1 at #2}{
+ annotation arrow,
+ insert path = {
+ (#2,1.0) ++ (0,\labeloutersep)
+ node[anchor = south, annotation node] {#1\strut}
+ }
+ },
+ annotation left/.style args = {#1 at #2}{
+ annotation arrow,
+ insert path = {
+ (0,#2) ++ (-\labeloutersep,0)
+ node[anchor = east, annotation node] {#1}
+ }
+ },
+ annotation right/.style args = {#1 at #2}{
+ annotation arrow,
+ insert path = {
+ (1.0,#2) ++ (\labeloutersep,0)
+ node[anchor = west, annotation node] {#1}
+ }
+ },
+}
+\imagelabelset{
+ image label style/.style = {
+ rectangle,
+ minimum width = 5mm,
+ minimum height = 5mm,
+ fill = \imagelabelback,
+ text = \imagelabeltext,
+ font = \imagelabelfont,
+ },
+ image label/.style args = {#1 at #2}{
+ insert path = {
+ (image.#2) node[outer sep = \imagelabelsep,
+ anchor=#2, image label style] {#1}
+ }
+ },
+}
+\endinput
+%%
+%% End of file `tikz-imagelabels.sty'.