我在 latex 文档中使用 Optima 字体。我想更改刻度标签的字体。
我尝试使用新的字体系列并设置 tikz 的全局选项,但它不起作用。
分数维:
\documentclass[oneside]{scrbook}
\usepackage{fontspec}
\usepackage[frenchmath]{newtxsf}
\setmainfont[Ligatures=TeX]{Optima}
\setmathrm{Optima}
\setmathsf{Optima}
\setmathtt{Optima}
\setboldmathrm[BoldFont={Optima ExtraBlack}]{Optima Bold}
\newfontfamily\Optima{Optima}
\usepackage[french]{babel}
%TIKZ PGF
\usepackage{tikz,tikzpagenodes,tkz-tab}
\usepackage{tikzsymbols}
\usetikzlibrary{backgrounds,shadows,matrix,arrows,arrows.meta,decorations.pathmorphing,shapes,plotmarks,shapes.geometric,decorations.markings,positioning,calc,shapes.misc,automata,cd,fit,datavisualization,datavisualization.formats.functions,patterns,ipe,decorations.shapes}
\usepackage{pgfornament}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\usepgfplotslibrary{groupplots}
\pgfplotsset{compat=1.11,every axis/.append style={
axis x line=middle, % put the x axis in the middle
axis y line=middle, % put the y axis in the middle
axis line style={<->}, % arrows on the axis
xlabel={$x$}, % default put x on x-axis
ylabel={$y$}, % default put y on y-axis
label style={font=\Optima},
tick label style={font=\Optima}
}}
%%%
\begin{document}
TEST
\begin{tikzpicture}
\begin{axis}[
axis lines = middle,
xlabel = $x$,
ylabel = {$f(x)$},
xscale = 1,
yscale = 0.5,
grid = major,
xticklabel=\tick,
yticklabel=\tick
]
\addplot [
domain = -5:5,
samples= 100,
color = red,
]
{exp(-abs(x))};
%\addlegendentry{$f$}
\end{axis}
\end{tikzpicture}
\end{document}