Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am using pgfplots in combination with the clickable library. Here's an example

\documentclass{article}
\usepackage[latin1]{inputenc}

% important packages
\usepackage{pgfplots}
\usepgfplotslibrary{clickable}

\begin{document}
\begin{tikzpicture}
\begin{axis}
    [% options
    xlabel=$x$,
    ylabel={$x$},
    clickable coords = {exact coords: <br/> (xy)}, % activates a snap-to-nearest feature
    annot/snap dist=10,
    clickable coords size = {10,5}, % size in characters for the snapping pop ups
    annot/popup size generic = {20,10}, % size in characters  for the rest
    ]
\addplot
    [% options
    only marks, % do not connect data points
    ] 
    coordinates 
    {
    (0,0)
    (2,2)
    (5,5)
    };
\end{axis}
\end{tikzpicture}
\end{document}

The result can be seen here

https://dl.dropbox.com/u/1833443/clickable-Problem/my_LaTeX_File.pdf

If you click near the data points then you will get a message like this:

exact coords:
(x,y)

If you click anywhere else you just get:

(x,y)

Here's a screenshot of the first case: Screenshot

In the pgfplots documentation in chapter 5.1.3 there is also mentioned that you can use the sprintf syntax to customize the formatting. Example:

/pgfplots/annot/point format={sprintf-format} (initially (%.1f,%.1f))

documentation

But I do not understand how I can use the

%

and

\n

within the normal LaTeX code.

Does anyone have an example how to use the line break symbol (\n) and the variable placeholder symbol (%) in the context of the clickable library?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

The clickable lib has extra support for the control sequences or chars ", \#, |, \", \n, \r, \t, \\, \%.

It should work out-of-the-box if you place these special escapes into the argument.

And it used to work, at least together with pdflatex.

Note that the manual appears to be incorrect: the initial values of these keys are

annot/point format/.initial={(\%.1f, \%.1f)},
annot/point format 3d/.initial={(\%.1f, \%.1f, \%.1f)},
share|improve this answer
    
Thanks - I'll try it again. Very cool that the author himself answers me here. –  Manuel Kuehner Oct 18 '12 at 19:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.