I have a long document which includes quite a lot of \textbf{...}
and \textit{...}
even just in the middle of sentences. I would like to put something in the preamble in order to make every text that is bold or italic, a sans serif text. I need it to be reversible (that's why I don't want to change each of the hundreds of occurrences adding \sffamily{...}
).
I already tried to use
\let\oldtextbf\textbf
\renewcommand{\textbf}{\sffamily\oldtextbf}
\let\oldtextit\textit
\renewcommand{\textit}{\sffamily\oldtextit}
but this only produces sans serif from the first occurrence until the end of the document. What should I use to get back to normal font every time a bold or italic text ends?