1

I would like to use Helvetica (regular or italics) in a tikz figure.

By specifying the {\familydefault}{\sfdefault} and using the pxfonts package, I am able to obtain kind of the same font:

\documentclass[tikz, margin=3mm]{standalone}

\renewcommand{\familydefault}{\sfdefault}
\usepackage{pxfonts}

\begin{document}
\begin{tikzpicture}
   \node(text) at (1,1) {Test test};
\end{tikzpicture}
\end{document}

However, it is not recognized by Adobe Illustrator as Helvetica but as 'NimbusSanL'.

How do I specify Helvetica as a font in Tikz?

1
  • 3
    NimbusSan is nothing but Helvetica, if you are using PDFLaTeX, LuaLaTeX or XeLaTeX, then the font name is changed as NimbusSans, if you follow LaTeX -> dvips -> Ps2PDF, then the font name was displayed as Helvetica... – MadyYuvi Mar 5 '20 at 10:46
4

EDIT 1: Thank you very much to @Marian G.

Into enviroment tikzpicture you can write into the \node the syntax

\node[font=\fontfamily{phv}\selectfont] at (1,1) {Test test}

(see the comment of the user @Marian G.) to write in URW Nimbus Sans based on Helvetica font. You can see this article into specific page of Wikipedia. A screenshot is put below together a MWE, and you can compile it in pdfLaTeX.

enter image description here

\documentclass[12pt]{article}   
\usepackage{tikz}
\usepackage{lipsum}
\usepackage[T1]{fontenc}
\begin{document}
\lipsum[1]
\begin{tikzpicture}
   \node[font=\fontfamily{phv}\selectfont] at (1,1) {Test test}; % semicolon
\end{tikzpicture}
\end{document}

ADDENDUM: Thank you very much also to the user @Zarko (see your comment).

\documentclass[12pt]{article}   
\usepackage{tikz}
\tikzset{font=\fontfamily{phv}\selectfont}%%%%%%%<----by @Zarko's comment
\usepackage{lipsum}
\usepackage[T1]{fontenc}
\begin{document}
\lipsum[1]
\begin{tikzpicture}
   \node(text) at (1,1) {Test test}; 
\end{tikzpicture}
\end{document}

enter image description here

4
  • 2
    If OP wish to use Helvetica font in all TikZ pictures, than might be sensible ad to document preamble \tikzset{font=\fontfamily{phv}\selectfont} :-). Nice answer! – Zarko Mar 5 '20 at 17:29
  • I am trying to use Amatica SC font by defining \newfontfamily\amatica[Scale=1.0]{Amatica SC}. The font selection works well with main text {\amatica This is Amatica SC}, but inside tikzpicture it is reverting to default CM font with \node [font=\fontfamily{amatica}\selectfont] at (1.5,0) {Amatica}; Though it is working with \node at (1.5,0) {\amatica Amatica}; How do I define it globally? – Damitr Apr 20 '20 at 14:44
  • @Damitr Excuse me for my delay for this answer. But for my humble opinion you should to ask a specific other question because thus it works the site :-(. My best regards. – Sebastiano Apr 22 '20 at 10:24
  • 1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.