
Intento llegar a la misma fuente en todos los lugares posibles dentro del gráfico pgf. Después de muchas horas en este foro y pruebas de soluciones escritas, no tengo idea.
Muchas gracias por la ayuda de antemano.
Saludos, Th.
\documentclass{scrartcl}
\usepackage{fontspec}
\setmainfont{Arial}
\usepackage{etoolbox}
% change fonts to sans serif then `tikzpicture' environment is started
\BeforeBeginEnvironment{tikzpicture}{
\begingroup
\changeFonts
}
% end scope (for font change)
\AfterEndEnvironment{tikzpicture}{
\endgroup
}
\usepackage{sansmath}
% create a command to switch fonts in `tikzpicture' environments to a
% sans serif font
\newcommand*\changeFonts{
\sffamily\sansmath
}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
10 <> $\mathsf 10$!
\begin{figure}[htbp]
\centering
\begin{tikzpicture}
\begin{axis}[xlabel={Abscissa, $x_\mathsf{10}$}, ylabel={Ordinate, $y$}]
\addplot {x^2};
\end{axis}
\end{tikzpicture}
\caption{A figure with a \texttt{pgfplots} axis.}
\end{figure}
\end{document}
Respuesta1
Puede cambiar todas las fuentes de las etiquetas de ticks a sansserif con
\pgfplotsset{my style/.append style={xticklabel={$\mathsf{\pgfmathprintnumber{\tick}}$},
yticklabel={$\mathsf{\pgfmathprintnumber{\tick}}$} } }
Y luego agregando my style
a las opciones del eje:
begin{axis}[my style, xlabel={Abscissa, $x_\mathsf{10}$}, ylabel={Ordinate, $y$}]