I'm trying to make an environment that uses sans-serif math by default inside the environment, but not outside of it. To do this I'm using the sansmath
package.
The problem is that, when used with \usepackage[libertine]{newtxmath}
Here's an example:
\documentclass[10pt]{article}
\usepackage[tt=false, type1=true]{libertine}
\usepackage[libertine]{newtxmath} %works if I remove this
\usepackage{sansmath}
\begin{document}
$(0 + 1) + 2$
\begin{sansmath}
$(3 + 4) + 5$
\end{sansmath}
\end{document}
The non-sans part displays fine, but the brackets in the sans section don't show up at all. They do if I remove the newtxmath
package.
Is there something I can do to get sansmath and libertine working together?
nextxmath
andsansmath
but not tolibertine
itself. (And loadingsansmath
beforenewtxmath
, while restoring the missing parentheses and plus signs, of course fails to use sans serif fonts inside thesansmath
environment.sansmath
package is not compatible with the libertine font when used with thenewtxmath
package. You could use thesansmathaccent
package, which provides a way to use the libertine math font with thesansmath
package: