diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/pdfcomment/example_xelatex.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/pdfcomment/example_xelatex.tex | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/pdfcomment/example_xelatex.tex b/Master/texmf-dist/doc/latex/pdfcomment/example_xelatex.tex index 11f3d391f2f..1fc4e3ac124 100644 --- a/Master/texmf-dist/doc/latex/pdfcomment/example_xelatex.tex +++ b/Master/texmf-dist/doc/latex/pdfcomment/example_xelatex.tex @@ -13,6 +13,7 @@ \usepackage{lipsum} \usepackage[svgnames,rgb]{xcolor} \usepackage{tikz} +\usetikzlibrary{calc} \usepackage{amsmath,array,bm} \usepackage[absolute]{textpos} \usepackage[subject={Top1},author={Ã…nsgar Lund},version=1]{pdfcomment} @@ -132,4 +133,66 @@ eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum.}{T \end{array} \] +\begin{tikzpicture} + \draw [<->,thick] (0,2) node (yaxis) [above] {$y$} + |- (3,0) node (xaxis) [right] {$x$}; + \draw (0,0) coordinate (a_1) -- (2,1.8) coordinate (a_2); + \draw (0,1.5) coordinate (b_1) -- (2.5,0) coordinate (b_2); + \coordinate (c) at (intersection of a_1--a_2 and b_1--b_2); + \draw[dashed] (yaxis |- c) node[left] {$y'$} + -| (xaxis -| c) node[below] {$x'$}; + % + \fill[red] (0,0) circle (2pt); + \draw (0,0) node {\pdftooltip{\rule{0pt}{0.5cm}\rule{0.5cm}{0pt}}{Origin}}; + % + \draw[red] (1.5,2) node {\pdftooltip{\textbullet}{1.5,2.0}}; + % + \fill[red] (c) circle (2pt) + let + \p1 = (current path bounding box.south west), + \p2 = (current path bounding box.north east) + in + node at (current path bounding box) + {\pdftooltip{\rule{\dimexpr\x2-\x1\relax}{0pt}\rule{0pt}{\dimexpr\y2-\y1\relax}}% + {This is the intersection point\textCR of the two lines!}}; +\end{tikzpicture} +\hspace{1cm} +\begin{tikzpicture} + \draw (1.5,0) node[below] {countries}; + \draw (0,1) node[left] {\pdftooltip{SCI}{Sausage Consumption Index}}; + \fill[blue] (0.5,0) rectangle (1,1.2) + let + \p1 = (current path bounding box.south west), + \p2 = (current path bounding box.north east) + in + node at (current path bounding box) + % these calculations are based on scale factor 1 otherwise use: + % \dimexpr(scale factor)\dimexpr\x2-\x1\relax\relax + {\pdftooltip{\rule{\dimexpr\x2-\x1\relax}{0pt}\rule{0pt}{\dimexpr\y2-\y1\relax}}% + {USA: 120}}; + \fill[red] (1.5,0) rectangle (2,1.8) + let + \p1 = (current path bounding box.south west), + \p2 = (current path bounding box.north east) + in + node at (current path bounding box) + {\pdftooltip{\rule{\dimexpr\x2-\x1\relax}{0pt}\rule{0pt}{\dimexpr\y2-\y1\relax}}% + {Germany: 180}}; + \fill[green] (2.5,0) rectangle (3,0.65) + let + \p1 = (current path bounding box.south west), + \p2 = (current path bounding box.north east) + in + node at (current path bounding box) + {\pdftooltip{\rule{\dimexpr\x2-\x1\relax}{0pt}\rule{0pt}{\dimexpr\y2-\y1\relax}}% + {South Africa: 65}}; + \draw [<->,thick] (0,2) node (yaxis) [above] {$y$} + |- (3.5,0) node (xaxis) [right] {$x$}; +\end{tikzpicture} + +\bigskip\bigskip +You can use tooltips with simple \pdftooltip{\textcolor{red}{words}}{This is a tooltip!} or chemical notation like: $\pdftooltip{H_{2}SO_{4}}{Sulfuric acid}$ + +\bigskip\bigskip +It also works in equations: \[\pdftooltip[mathstyle=\displaystyle]{\sum_{i=1}^{n}i=\frac{1}{2}n\cdot(n+1)}{little Gauß}\] \end{document} |