Generalformatting text within tables

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
workerbee
Posts: 43
Joined: Sat Nov 22, 2008 1:53 am

formatting text within tables

Post by workerbee »

I was wondering if there was a way to define a certain font face and size for text within tables. For instance, the main text is in Times Roman but I would like to put a sans serif font in some tables (preferably something that has the same characteristics as Arial). Is this possible?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

mas
Posts: 226
Joined: Thu Dec 04, 2008 4:39 am

Re: formatting text within tables

Post by mas »

Have you tried

{\sffamily
\begin{tabular}{....}
...
\end{tabular}
} ?

Regards.

OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

formatting text within tables

Post by localghost »

workerbee wrote:I was wondering if there was a way to define a certain font face and size for text within tables. For instance, the main text is in Times Roman but I would like to put a sans serif font in some tables (preferably something that has the same characteristics as Arial). Is this possible?
The approach of mas goes in the right direction. Usually a tabular environment appears inside a table environment.

Code: Select all

\begin{table}[!ht]
  \centering
  \sffamily
%  The table itself
  \caption{Sans serif table}\label{tab:sans-serif}
\end{table}
If you have special ideas of the fonts you want to use, try some font packages.

Code: Select all

\usepackage{mathptmx}          % set main (and math) font to Times
\usepackage[scaled]{helvet}    % set sans serif font to Helvetica (Arial like)
\usepackage{luximono}          % set mono spaced font to Luxi
The packages can be found as usual on CTAN.


Best regards
Thorsten¹
Post Reply