Font package in lualatex gives the cm style figure
You should load newtxsf
before FiraSans
and pass no-math
to fontspec
.
\RequirePackage{luatex85}
\documentclass[tikz,12pt]{standalone}
\usepackage{amsmath,amsthm}
\usepackage[cmintegrals]{newtxsf}
\PassOptionsToPackage{no-math}{fontspec}
\usepackage[sfdefault,scaled=.85]{FiraSans}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
test $a^2+b^2=c^2$
\end{document}
You don't need \PassOptionsToPackage{no-math}{fontspec}
if you add the option as a global one:
\documentclass[tikz,12pt,no-math]{standalone}
This answer solves the problem with the font warnings and the text uses font FiraSans instead of Computer Modern. However, it does not solve the problem with the wrong font for the figures in math style.
Font encoding T1
is intended for fonts with at most 256 slots, therefore package fontspec
uses a different font encoding. Package FiraSans
uses fontspec
if it detects a TeX compiler capable of using OpenType fonts (LuaTeX, XeTeX).
As solution, \usepackage[T1]{fontenc}
can be wrapped in:
\usepackage{ifluatex, ifxetex}
\newif\ifWithOpenTypeFonts
\ifluatex
\WithOpenTypeFontstrue
\else
\ifxetex
\WithOpenTypeFontstrue
\fi
\fi
\ifWithOpenTypeFonts
% \usepackage{fontspec}
\else
\usepackage[T1]{fontenc}
\fi
Then the document can be compiled with the different TeX compilers.