40

I want to use arial font, but it doesn't generate any document. I'm using Texpad software. I tried with helvet package, but it doesn't work. Here's my code, maybe I'm not right. Can you help me?

\documentclass[10pt, a4paper]{article}

\usepackage{fontspec}
\setmainfont{Arial}
\usepackage{lipsum}
\usepackage[ampersand]{easylist}

\begin{document}

\tableofcontents
\newpage
\section{TITLE}
\section{TITLE}
\subsection{Subtitle}
\subsection{Subtitle}
\section{TITLE}
\lipsum
\subsection{Subtitle}
\subsection{Subtitle}
\subsubsection{Title}
\begin{easylist}
& Title
& Title
&& Subtitle
&&& Title
& Title
\end{easylist}
\subsubsection{Title}
\subsection{Subtitle}
\section{TITLE}
\subsection{Subtitle}
\subsubsection{Title}

\end{document}
5
  • 3
    Your document works fine for me with xelatex You can not use pdflatex or latex as that can not use system fonts and the fontspec package. Jun 25 '13 at 19:21
  • It works fine for me compiled with xelatex. Do you have Arial installed? Jun 25 '13 at 19:22
  • @DavidCarlisle You're right, but I have errors in my code when I use xeLatex, such as size of fonts, bolding text and another. Can I bold and resize text?
    – Isai
    Jun 25 '13 at 19:29
  • The headings in your example are already large and bold, to get bold in general text all normal latex commands work eg aaaa \textbf{bbb} ccc makes bbb bold. Jun 25 '13 at 19:31
  • Can you add in the question the errors you get? Jun 25 '13 at 19:38
55

Your code works perfectly for me but it must be compiled by XeTeX, not with pdflatex. Note also that you must have that True Type Font (.ttf) available in your system.

To obtain the default sans serif font with pdflatex, basically you only need add this line to the preamble, without any package:

\renewcommand*\familydefault{\sfdefault} 

To use the helvetica font as the default font with pdflatex you can add these lines:

\usepackage[scaled]{helvet}
\renewcommand\familydefault{\sfdefault} 
\usepackage[T1]{fontenc}

Please note that you cannot use \usepackage{fontspec} with pdflatex.

Tip: Go to http://www.tug.dk/FontCatalogue/sansseriffonts.html for many other options.

2
  • How can I use Helvetica Neue? Using \usepackage[neue]{helvet} does not work
    – Ooker
    Dec 10 '17 at 19:11
  • @Ooker I suppose that you're trying to use a TTF font? As explained above, these fonts should be compiled with xelatex or lualatex, not with pdflatex, and using a different preamble (not the showed in my answers, but that form question of Isai, except that you must change "Arial" with the name of your font).
    – Fran
    Dec 13 '17 at 21:46

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.