# Helvetica not showing up due to Sweave

I'm just trying to switch my font to Helvetica, but it's not doing it. I'm using

\usepackage{helvet}
\renewcommand\familydefault{\sfdefault}


By all accounts, that should work, but I'm getting this:

I'm using pdflatex and RStudio on a Mac if that's relevant at all. Sorry if this is an obvious fix or something that's been answered already, but I can't seem to find anything else online.

FIXED: The problem was Sweave being loaded and messing with the fonts somehow. I worked around it by doing the following:

\documentclass{article}
\AtBeginDocument{\usepackage{helvet}\renewcommand\familydefault{\sfdefault}} % Fixes main body text
\begin{document}
\SweaveOpts{concordance=TRUE}
\fontfamily{phv}\selectfont % Fixes text in tables
aGR --- By all accounts, this should and does work.
\end{document}


Thanks to Mico for the help and example.

• Well you are probably changing the font later to some other font. Show a complete example. – Ulrike Fischer Jun 7 '18 at 20:08
• The package gives me Nimbus Sans L. It looks like you may have computer modern. – John Jun 7 '18 at 20:12
• Hint: If you get a helpful answer to your question you can honor it by upvoting it. This is considered an appropriate gesture here. – Dr. Manuel Kuehner Jun 7 '18 at 21:47
• If you have \usepackage{Sweave}, add the noae option: \usepackage[noae]{Sweave}. – egreg Jun 7 '18 at 22:36

(too long for a comment, hence posted as an answer)

Do check your preamble for the presence of other font-switching commands. Do also check the log file -- maybe the helvet package isn't being loaded properly.

\documentclass{article}
\usepackage{helvet} % a Helvetica clone
\renewcommand\familydefault{\sfdefault}
\begin{document}
aGR --- By all accounts, this should and does work.
\end{document}

• I tried copying and pasting that directly into a new file and I'm still getting the same thing. I also checked the log and looked up the helvet.sty file on my computer and it exists and is getting loaded (At least as far as I can tell from this line. I'm relatively new to this stuff). (/usr/local/texlive/2018/texmf-dist/tex/latex/psnfss/helvet.sty Package: helvet 2005/04/12 PSNFSS-v9.2a (WaS) – JayC Jun 7 '18 at 20:45
• @JayC Show the log-file of your compilation of Mico's example. – Ulrike Fischer Jun 7 '18 at 20:46
• @Ulrike Fischer Posted it as an answer – JayC Jun 7 '18 at 20:49