anriseth / baposter

Automatically exported from code.google.com/p/baposter
GNU General Public License v3.0
14 stars 2 forks source link

Problem with \label - \ref functionality referencing curves in tikzpicture environments #30

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This issue occurs if you insert plots which use the tikzpicture environment, 
for instance follwing plot:

\begin{tikzpicture}
    \begin{axis}[
        domain=-0:5,samples=100,
        xlabel={$x$},
        ylabel={$f(x)$}]
    \addplot {x^2}; \label{tikz:someCurve}
    \end{axis}
\end{tikzpicture}

If you want to use \ref{tikz:someCurve} in the text later, then the \ref{...} 
command does not work as expected.

----

Using PFGplots/Tikz it is sometime very convenient to use \label{...} after an 
\addplot command to reference through \ref{} to a curve later in the document.

Here it doesn't work, since the reference command checks, whether the \ref{...} 
command is in a tikzpicture-environment or not. And it fails. 

It seems to be a bug of the \ref command, thus is not a bug of baposter. 
According to 
http://tex.stackexchange.com/questions/36917/using-ref-in-a-ylabel-of-a-pgfplot 
this may be fixed in the future. 

---

But until then define

\def\fixcheck{%
    \def\tikzifinpicture##1##2{##2}%
}%

and use in a headerbox:

"The curve ({\fixcheck\ref{tikz:someCurve}}) shows ..."

instead of 

"The curve (\ref{tikz:someCurve}) shows ..."

Original issue reported on code.google.com by Wosrediinanatour on 9 Feb 2012 at 8:24

GoogleCodeExporter commented 8 years ago
Thank you for reporting this. I will add it to the FAQ.

Original comment by brian.amberg@gmail.com on 9 Feb 2012 at 9:35

GoogleCodeExporter commented 8 years ago
Added to the FAQ

Original comment by brian.amberg@gmail.com on 9 Feb 2012 at 9:38

GoogleCodeExporter commented 8 years ago
I define the box as block. My problem is that the header of the block is too 
wide. How can I define a fit header of a box?

Original comment by qz1...@gmail.com on 11 Jan 2015 at 12:19