summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-07-27 21:26:08 +0000
committerKarl Berry <karl@freefriends.org>2017-07-27 21:26:08 +0000
commit654d2d2ad9ef4fc4de9cfd3b3d6038ef14ad4161 (patch)
tree6b9c27c2711e7103946c29f046dffafcfb7cb020 /Master
parent1eaf921900a3d76fd3daf0e53dc8cf23de15cb72 (diff)
callouts (27jul17)
git-svn-id: svn://tug.org/texlive/trunk@44899 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/callouts/README.md2
-rw-r--r--Master/texmf-dist/doc/latex/callouts/callouts.pdfbin211828 -> 212254 bytes
-rw-r--r--Master/texmf-dist/doc/latex/callouts/callouts.tex21
-rw-r--r--Master/texmf-dist/tex/latex/callouts/callouts.sty80
4 files changed, 62 insertions, 41 deletions
diff --git a/Master/texmf-dist/doc/latex/callouts/README.md b/Master/texmf-dist/doc/latex/callouts/README.md
index 05d28006332..11921754a63 100644
--- a/Master/texmf-dist/doc/latex/callouts/README.md
+++ b/Master/texmf-dist/doc/latex/callouts/README.md
@@ -15,4 +15,4 @@ I'd be happy to receive feedback, suggestions, or complaints at <markus.stuetz@g
Best regards,
_Markus Stuetz_
-Graz, Austria on March 17, 2017
+Graz, Austria on July 27, 2017
diff --git a/Master/texmf-dist/doc/latex/callouts/callouts.pdf b/Master/texmf-dist/doc/latex/callouts/callouts.pdf
index 216728af8e0..ab81f1f7dd7 100644
--- a/Master/texmf-dist/doc/latex/callouts/callouts.pdf
+++ b/Master/texmf-dist/doc/latex/callouts/callouts.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/callouts/callouts.tex b/Master/texmf-dist/doc/latex/callouts/callouts.tex
index 2b43fc637ad..19cfe1f6ed8 100644
--- a/Master/texmf-dist/doc/latex/callouts/callouts.tex
+++ b/Master/texmf-dist/doc/latex/callouts/callouts.tex
@@ -26,10 +26,10 @@ In some reports or documents it may be necessary to annotate, draw arrows or put
\section{Using the package}
-The package is included in the preamble as follows, with currently four color options, listed in table \ref{tab:colors}. If no or a wrong option is specified, the package will use \texttt{plain}.
+The package is included in the preamble as follows, with currently four pre-defined color options, listed in table \ref{tab:colors}. If no or a wrong option is specified, the package will use the default color scheme.
\begin{lstlisting}
- \includepackage{callouts}[option]
+ \usepackage[option]{callouts}
\end{lstlisting}
\begin{table}[htb]
@@ -39,7 +39,7 @@ The package is included in the preamble as follows, with currently four color op
\toprule
option & text & background & arrow \\
\midrule
- \texttt{plain}& black & black & none \\
+ -& black & none & black \\
\texttt{bwr} & black & white & red \\
\texttt{wby} & white & black & yellow \\
\texttt{bww} & black & white & white\\
@@ -47,10 +47,17 @@ The package is included in the preamble as follows, with currently four color op
\end{tabular}
\end{table}
-The environment itself is called \texttt{annotate} and may be put inside a \texttt{figure}-float. The environment requires two variables: The image path including a width option and the annotation scale. Make sure to put the same number in the \texttt{width}-option and the coordinate scale. If you decide to change the scale later on, change both numbers equally, then the relative position of the annotations will remain.
+Moreover, the colors for text, background, and arrow can be set directly by using the respective option keys, for instance:
+
+\begin{lstlisting}
+ \usepackage[background=gray,arrow=red]{callouts}
+\end{lstlisting}
+
+The environment itself is called \texttt{annotate} and may be put inside a \texttt{figure}-float. The environment requires two variables: The image path including a size option and the annotation scale. Make sure to put the same number in the size (e.g. \texttt{width}) option and the coordinate scale. If you decide to change the scale later on, change both numbers equally, then the relative position of the annotations will remain.
+
\begin{lstlisting}
\begin{annotate}
- {\includegraphics[0.5\textwidth]{<picture file name>} {0.5}
+ {\includegraphics[width=0.5\textwidth]{<file path>}}{0.5}
\end{annotate}
\end{lstlisting}
@@ -58,7 +65,7 @@ The environment itself is called \texttt{annotate} and may be put inside a \text
There are currently four commands included which may follow the first two variables of the package.
\subsection{Helpgrid}
-First of all, you may want to use a help grid to place your annotations. With \texttt{\textbackslash helpgrid}, a grid is drawn. The grid's coodinate origin is indicated by the large dot in the center. The grid lines display integers, coordinates are given in positive and negative decimal numbers.
+First of all, you may want to use a help grid to place your annotations. With \texttt{\textbackslash helpgrid}, a grid is drawn. The grid's coordinate origin is indicated by the dot in the center. The grid lines represent integers, coordinates are given in positive and negative decimal numbers. The default color is the background color, you may alter the color of the help grid by adding an option like so: \texttt{\textbackslash helpgrid[gray]}
\subsection{Callouts, notes, arrows }
A callout is a note, indicating to a point with an arrow. The syntax for this object is
@@ -91,7 +98,7 @@ The following source code results in figure \ref{fig:Airbus}. The color option u
\begin{figure}[htb]
\centering
\begin{annotate}{\includegraphics[width=0.7\textwidth]{A319neo.jpg}}{0.7}
- % \helpgrid
+% \helpgrid
\callout{5,-3}{Engine}{1.6,-2}
\arrow{-3,-2.4}{-4.5,-3}
\arrow{-4.7,-3.2}{-5.5,-2.4}
diff --git a/Master/texmf-dist/tex/latex/callouts/callouts.sty b/Master/texmf-dist/tex/latex/callouts/callouts.sty
index 878c9940511..27575c60531 100644
--- a/Master/texmf-dist/tex/latex/callouts/callouts.sty
+++ b/Master/texmf-dist/tex/latex/callouts/callouts.sty
@@ -8,48 +8,50 @@
% version 1 of the License, or any later version.
% ==================================================================
-\ProvidesPackage{callouts}[2017/03/16 Callouts]
+\ProvidesPackage{callouts}[2017/07/27 Callouts]
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{tikz}
-% \RequirePackage{kvoptions}
-%
-% \tikzset{every picture/.style={font issue=\footnotesize},
-% font issue/.style={execute at begin picture={#1\selectfont}}
-% }
-% \DeclareStringOption[red]{color}[black]{
-% \@arrowcolor
-% }
+\usetikzlibrary{calc}
+\RequirePackage{xifthen}
-\DeclareOption{plain}{%
-\newcommand{\focol}{black}
-\newcommand{\bgcol}{none}
-\newcommand{\arcol}{black}
-}
+\newcommand*{\focol}{black}
+\newcommand*{\bgcol}{none}
+\newcommand*{\arcol}{black}
-\DeclareOption{bwr}{%
-\newcommand{\focol}{black}
-\newcommand{\bgcol}{white}
-\newcommand{\arcol}{red}
-}
+\RequirePackage{kvoptions}
+\SetupKeyvalOptions {family = callouts,prefix = callouts@}%
-\DeclareOption{wby}{%
-\newcommand{\focol}{white}
-\newcommand{\bgcol}{black}
-\newcommand{\arcol}{yellow}
+\DeclareDefaultOption{\ClassWarning{callouts}{Unknown color option '\CurrentOptionKey=\CurrentOptionValue'}}%
+
+\DeclareVoidOption{bwr}{%
+\renewcommand*{\bgcol}{white}%
+\renewcommand*{\arcol}{red}%
}
-\DeclareOption{bww}{%
-\newcommand{\focol}{black}
-\newcommand{\bgcol}{white}
-\newcommand{\arcol}{white}
+\DeclareVoidOption{wby}{%
+\renewcommand*{\focol}{white}%
+\renewcommand*{\bgcol}{black}%
+\renewcommand*{\arcol}{yellow}%
}
-\DeclareOption*{\ClassWarning{annotations}{Unknown color option '\CurrentOption'}\ExecuteOptions{none}}
+\DeclareVoidOption{bww}{%
+\renewcommand*{\focol}{black}%
+\renewcommand*{\bgcol}{white}%
+\renewcommand*{\arcol}{white}%
+}
-\newcommand{\hecol}{black}
+\define@key{callouts}{text}{%
+\renewcommand*{\focol}{#1}%
+}
+\define@key{callouts}{background}{%
+\renewcommand*{\bgcol}{#1}%
+}
+\define@key{callouts}{arrow}{%
+\renewcommand*{\arcol}{#1}%
+}
-\ProcessOptions\relax % terminate option processing
+\ProcessKeyvalOptions* % terminate option processing
% ==================================================================
@@ -57,13 +59,25 @@
{ \begin{tikzpicture}[scale=#2]% }%
% Annotate
\node (pic) at (0,0) {#1};%
+\newdimen\xtic
+\newdimen\ytic
+\pgfextractx\xtic{\pgfpointanchor{pic}{east}}
+\pgfmathparse{int(\xtic/1cm)}
+\pgfmathsetmacro\xtic{\pgfmathresult}
+\pgfextracty\ytic{\pgfpointanchor{pic}{north}}
+\pgfmathparse{int(\ytic/1cm)}
+\pgfmathsetmacro\ytic{\pgfmathresult}
}%
{ \end{tikzpicture} }
% ==================================================================
-\newcommand{\helpgrid}{%
-\draw[help lines, \hecol] (pic.south west) grid (pic.north east); \fill[\hecol] (0,0) circle (5pt);%
+\newcommand{\helpgrid}[1][\bgcol]{%
+\draw[help lines, color=#1] (pic.south west) grid (pic.north east); \fill[#1] (0,0) circle (3pt);%
+ \foreach \i in {-\xtic,...,\xtic} {%
+ \node at (\i+0.2,0.2) {\color{#1} \tiny \i};}
+ \foreach \i in {-\ytic,...,\ytic} {%
+ \node at (0.2,\i+0.2) {\color{#1} \tiny \i};}
}
\newcommand{\callout}[3]{%
\node [fill=\bgcol] (text) at (#1) {\scriptsize\color{\focol} #2};
@@ -76,4 +90,4 @@
\draw [\arcol,thick,->] (#1) -- (#2);
}
-\endinput % === EOF ================================================ \ No newline at end of file
+\endinput % === EOF ================================================