3

I have been using hf-tikz for a while, both in presentations and in posters. The way I've been using it, so far, was mainly inspired by the package manual (e.g. the syntax shown in 2.2 An advanced example), since in most cases I would highlight something and put an annotation to it. However, I've always found the need of fiddling around with values a bit frustrating.

Therefore, I was quite happy when I discovered the option markings, which would simplify a lot the linking between the highlighted portions and correspondent annotations.

I managed to get something working to create the following example

enter image description here

with the following code:

\documentclass{beamer}
\usepackage{pgfplots}
\usepackage{tikz}                       %inline graphics
\usetikzlibrary{calc}

\usepackage[customcolors,markings,shade]{hf-tikz}

\tikzset{nodeStyleGreen/.style={
    draw=green!40!black,
    fill=green!50!lime!30,
    align=left,
    very thick,
    rounded corners
}}

\tikzset{nodeStyleRed/.style={
    draw=red!40!black,
    fill=red!50!lime!30,
    align=left,
    very thick,
    rounded corners
}}

\tikzset{nodeStyleBlue/.style={
    draw=blue!40!black,
    fill=blue!50!lime!30,
    align=left,
    very thick,
    rounded corners
}}

\tikzset{lineStyleRed/.style={
    color=red!40!black,opacity=0.75,line width=2pt,
}}

\tikzset{lineStyleGreen/.style={
    color=green!40!black,opacity=0.75,line width=2pt,
}}

\tikzset{lineStyleBlue/.style={
    color=blue!40!black,opacity=0.75,line width=2pt,
}}

\begin{document}
    \begin{frame}
   %
    \begin{align*}
        \tikzmarkin[nodeStyleRed,mark at=0.5]{firsteq} a &= b \tikzmarkend{firsteq}\\ 
        %
        \tikz[remember picture,overlay]{
            \node[nodeStyleRed] (firsteq-aa) at ($(firsteq)+(-4.0cm,-1.0cm)$) {
                \begin{minipage}{3cm}
                    My content:\\[-0.5cm]
                    \begin{itemize}
                        \item item 1 of a
                        \item item 2 of a
                    \end{itemize}
                \end{minipage}
                };
                \path [lineStyleRed,use marker id=1] (firsteq-aa.east) edge[out=0,in=185,-stealth] (0,0);
        }
        \tikzmarkin[nodeStyleGreen,mark at=0]{secondeq} b &= c \tikzmarkend{secondeq}\\
        %
        \tikz[remember picture,overlay]{
            \node[nodeStyleGreen] (secondeq-aa) at ($(secondeq)+(4.0,1.0)$) {
                \begin{minipage}{4cm}My other content:\\[-0.5cm]
                    \begin{itemize}
                        \itemsep-0.25em
                        \item item 1
                        \item item 2
                        \item item 3
                    \end{itemize}
                \end{minipage}
            };
            \path [lineStyleGreen,use marker id=1] (secondeq-aa.west) edge[out=180,in=0,-stealth] (0,0);
        }
        %
        \tikzmarkin[nodeStyleBlue,mark at=0.0]{thirdeq} c &= d \tikzmarkend{thirdeq}
        %
        \tikz[remember picture,overlay]{
            \node[nodeStyleBlue] (thirdeq-aa) at ($(thirdeq)+(4.0,-3.0)$) {
                \begin{minipage}{3cm}My final content:\\[-0.5cm]
                    \begin{itemize}
                        \itemsep-0.25em
                        \item item 1
                        \item item 2
                        \item item 3
                    \end{itemize}
                \end{minipage}
            };
            \path [lineStyleBlue,use marker id=1] (thirdeq-aa.west) edge[out=180,in=0,-stealth] (0,0);
        }
    \end{align*}
    %
    \end{frame}
\end{document}

So, my problems are the following:

  • I would like to define only my align environment first, and call all the annotation nodes afterward (outside the align environment); so far, I've been doing like that (again, following example 2.2), but with markings, it doesn't seem to be possible, because if one defines 2 or more \tikzmarkin commands, each with a mark at= option, only the latest one can be accessed. In other words, is there a way to use the markers relative to a specific, labeled, content of a \tikzmarkin command?

  • I've copy-pasted the exact code within the frame above in a poster template (which can be found here) and it doesn't work. The code compiles once, but then it yields the error ! Dimension too large. I've read on some other thread here on the forum that such error might be due to something being either too small or too large and I managed to get rid of the error by simply including a scale factor in the \path commands, e.g.

        \path [lineStyleGreen,use marker id,scale=10] (secondeq-aa.west) edge[out=180,in=0,-stealth] (0,0);
    

    but I would like to be able to find out a better way to solve the problem that doesn't involve including some, seemingly random, scaling factors :)

Sorry for the long post :)

gbernardi
  • 845
  • Where you have a=b, etc, there should be equations there? And in the boxes, how much content do you expect? Make sure you clarify all these details, so we know what final result you expect to have. – Alenanno Aug 26 '16 at 08:20
  • Hi @Alenanno. Yeah, the dummy equations I used would be replaced by more complicated ones, but that shouldn't necessarily be a problem. I saw that there are some workaround to assure a proper boxing even of big equations here https://tex.stackexchange.com/questions/98540/hf-tikz-doesnt-box-around-equation – gbernardi Aug 26 '16 at 10:40
  • Yes, but it's important to know anyways. :P I'll try to post a solution later. – Alenanno Aug 26 '16 at 11:08
  • Actually, it's more important than I thought. I tried to use the different solutions provided from the other link and they don't work very well, because the equations are within an align environment that screws up things. Anyway, that might call for another question... – gbernardi Aug 26 '16 at 11:57

0 Answers0