1

I have a table. Latex code is given below. I want to set the font of this table arial - only this table not the entire document. How do I set this?

\begin{sidewaystable}
\small
\begin{tabular}{p{5cm}p{5cm}p{5cm}p{5cm}}
\toprule
    {\centering\tabhead{Col1}}&
    {\centering\tabhead{Col2}}&
    {\centering\tabhead{Col3}}&
    {\centering\tabhead{Col4}}\\

\midrule

wwww & xxxx & yyyy & zzzz \\

wwww & xxxx & yyyy & zzzz \\

\bottomrule
\end{tabular}
\caption{Caption}
\label{tab:my_table}
\end{sidewaystable}
Ignasi
  • 136,588
Pubs
  • 163

1 Answers1

1

If you want to do that with pdflatex, you first have to install the winfonts package yourself in your local TeXMF tree, since, as far as I know, it is not part of MiKTeX nor TeX Live. Don't forget to run updmap at the end. Then modify the beginning of your table as:

\begin{sidewaystable}
\fontfamily{arial}\selectfont\small

If you want to compile with XeLaTeX and Arial is installed on your system, it is simpler: add to your preamble (if not already done):

\usepackage{fontspec}

and modify the beginning of your table as:

\begin{sidewaystable}
\fontspec{Arial}\small
Bernard
  • 271,350