When using the book class, pgfplots, hyperref, and section labeling according to "How to reset chapter and section counter with \part", I get the following error
! You can't use `the character -' after \the.
\value ->-
1.60942
l.51 \end{axis}
in the following MWE
\documentclass[a4paper, 12pt]{book}
\usepackage{pgfplots}
\pgfplotsset{compat=1.7} % to use more recent defaults
\usepackage{hyperref}
%section restarts at each part
%see https://tex.stackexchange.com/questions/54383/how-to-reset-chapter-and-section-counter-with-part/123777#123777
\makeatletter\@addtoreset{chapter}{part}\makeatother
\begin{document}
\begin{figure}
\centering
\pgfplotsset{
colormap/hot,
}%
\pgfmathparse{-ln(0.1)}%
\let\BEMAX=\pgfmathresult
\pgfmathparse{-ln(5)}%
\let\BEMIN=\pgfmathresult
% FIRST: define one color for every value of \be :
\pgfplotsforeachungrouped \be in {
0.1,
0.5,
0.8,
1.0,
2.0,
5.0} {
\pgfmathparse{-ln(\be)}
\let\value=\pgfmathresult
}
\begin{tikzpicture}
\begin{axis}[ylabel={$p(x)$},
legend to name={fig:mm_temp_legend}
]
\pgfplotsforeachungrouped \be/\zedd in {
0.1/12.4595,
0.5/18.3263,
0.8/29.6888,
1.0/43.0372,
2.0/403.539,
5.0/1.07923e6 } {
\addplot+ gnuplot {x};
}
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
which was adapted from Christian Feuersänger's answer to "line legend for mesh plots". I tried to make the example as small as possible. In particular, removing any of
\usepackage{hyperref}
, \makeatletter\@addtoreset{chapter}{part}\makeatother
, \let\value=\pgfmathresult
or legend to name={fig:mm_temp_legend}
makes it compile.